Changeset 650:751fe5133670 for src/mlx


Ignore:
Timestamp:
06/28/15 12:11:05 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
cef
Phase:
public
Message:

CEF and the new ACARS widget are supported (re #272)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/gui.py

    r620 r650  
    1515from mlx.gui.pirep import PIREPViewer
    1616from mlx.gui.bugreport import BugReportDialog
     17from mlx.gui.acars import ACARS
     18import cef
    1719
    1820import mlx.const as const
     
    102104        window.connect("delete-event", self.deleteMainWindow)
    103105        window.connect("window-state-event", self._handleMainWindowState)
     106        if os.name=="nt":
     107            window.connect("leave-notify-event", self._handleLeaveNotify)
    104108        accelGroup = gtk.AccelGroup()
    105109        window.add_accel_group(accelGroup)
     110        window.realize()
    106111
    107112        mainVBox = gtk.VBox()
     
    151156        self._notebook.append_page(self._fleetGateStatus, label)
    152157
     158        self._acars = ACARS(self)
     159        label = gtk.Label("ACARS")
     160        label.set_use_underline(True)
     161        self._notebook.append_page(self._acars, label)
     162
    153163        (self._debugLogWidget, self._debugLogView) = self._buildLogWidget()
    154164        self._debugLogWidget.show_all()
     
    170180
    171181        window.show_all()
     182        if os.name=="nt":
     183            window.get_window().focus()
    172184
    173185        self._wizard.grabDefault()
     
    431443            self._updater.start()
    432444
     445        cef.initialize()
     446        self._acars.start()
     447
    433448        singleton.raiseCallback = self.raiseCallback
    434449        gtk.main()
    435450        singleton.raiseCallback = None
     451
     452        cef.finalize()
    436453
    437454        self._disconnect()
     
    687704             (event.new_window_state&WINDOW_STATE_ICONIFIED)==0:
    688705            self._mainWindow.present()
     706
     707    def _handleLeaveNotify(self, widget, event):
     708        """Handle the leave-notify event.
     709
     710        Here we reset the focus to the main window as CEF might have acquired
     711        it earlier."""
     712        self._mainWindow.get_window().focus()
    689713
    690714    def raiseCallback(self):
Note: See TracChangeset for help on using the changeset viewer.