Changeset 698:19c20bbcd6a7 for src/mlx


Ignore:
Timestamp:
10/25/15 06:24:33 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
cef
Phase:
public
Message:

The SimBrief browser is created only on the first activation, later on it is reused (re #279).

File:
1 edited

Legend:

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

    r692 r698  
    18611861                                       xscale = 1.0, yscale = 1.0)
    18621862
     1863        self._container = cef.getContainer()
     1864        self._alignment.add(self._container)
     1865
    18631866        self.setMainWidget(self._alignment)
     1867
     1868        self._browser = None
    18641869
    18651870        self.addCancelFlightButton()
     
    18741879    def activate(self):
    18751880        """Activate the SimBrief flight plan page"""
    1876         container = cef.getContainer()
    1877         self._alignment.add(container)
    1878 
    1879         self._browser = \
    1880           cef.startInContainer(container,
    1881                                "file://" + SimBriefSetupPage.getHTMLFilePath())
     1881        if self._browser is None:
     1882            url = "file://" + SimBriefSetupPage.getHTMLFilePath()
     1883            self._browser = cef.startInContainer(self._container, url)
     1884        else:
     1885            self._browser.Reload()
    18821886
    18831887    def _backClicked(self, button):
Note: See TracChangeset for help on using the changeset viewer.