python3
Line | |
---|
1 |
|
---|
2 | from .common import *
|
---|
3 |
|
---|
4 | from mlx.i18n import xstr
|
---|
5 | import mlx.const as const
|
---|
6 |
|
---|
7 | from . import cef
|
---|
8 |
|
---|
9 | #------------------------------------------------------------------------------
|
---|
10 |
|
---|
11 | ## @package mlx.gui.acars
|
---|
12 | #
|
---|
13 | # The ACARS tab.
|
---|
14 | #
|
---|
15 | # This module implements to \ref ACARS class, which displays the MAVA ACARS in a
|
---|
16 | # browser window using CEF
|
---|
17 |
|
---|
18 | #------------------------------------------------------------------------------
|
---|
19 |
|
---|
20 | class ACARS(Gtk.VBox):
|
---|
21 | """The flight info tab."""
|
---|
22 | # The URL of the ACARS map
|
---|
23 | URL = MAVA_BASE_URL + "/acars2/show.html"
|
---|
24 |
|
---|
25 | def __init__(self, gui):
|
---|
26 | """Construct the flight info tab."""
|
---|
27 | super(ACARS, self).__init__()
|
---|
28 | self._gui = gui
|
---|
29 | self._browser = None
|
---|
30 |
|
---|
31 | def start(self):
|
---|
32 | """Start the browser."""
|
---|
33 | container = cef.getContainer()
|
---|
34 |
|
---|
35 | self.pack_start(container, True, True, 0)
|
---|
36 |
|
---|
37 | self._browser = cef.startInContainer(container, ACARS.URL)
|
---|
38 |
|
---|
39 | def stop(self):
|
---|
40 | """Close the browser."""
|
---|
41 | if self._browser is not None:
|
---|
42 | self._browser.CloseBrowser(False)
|
---|
43 | self._browser = None
|
---|
Note:
See
TracBrowser
for help on using the repository browser.