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