Changeset 92:1ca250ec2aa0 for src


Ignore:
Timestamp:
04/19/12 15:10:20 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Further work on the reset

Location:
src/mlx/gui
Files:
2 edited

Legend:

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

    r91 r92  
    209209        self._loginButton.set_sensitive(False)
    210210        self._loginButton.connect("clicked", self._loginClicked)
    211         self._loginButton.set_tooltip_text("Click to log in.")
    212        
     211        self._loginButton.set_tooltip_text("Click to log in.")       
     212
     213    def activate(self):
     214        """Activate the page."""
    213215        config = self._wizard.gui.config
    214216        self._pilotID.set_text(config.pilotID)
     
    747749        self._cargoWeight.set_sensitive(True)
    748750        self._mailWeight.set_text(str(bookedFlight.mailWeight))
     751        self._simulatorZFW.set_text("-")
     752        self._simulatorZFWValue = None
    749753        self._zfwButton.set_sensitive(True)
    750754        self._updateCalculatedZFW()
     
    873877        self._departure.set_text(str(bookedFlight.departureTime.time()))
    874878        self._arrival.set_text(str(bookedFlight.arrivalTime.time()))
     879        self._simulatorTime.set_text("-")
    875880
    876881    def finalize(self):
     
    950955        self._cruiseLevel.set_increments(step = 10, page = 100)
    951956        self._cruiseLevel.set_range(min = 50, max = 500)
    952         self._cruiseLevel.set_value(240)
    953957        self._cruiseLevel.set_tooltip_text("The cruise flight level.")
    954958        self._cruiseLevel.set_numeric(True)
     
    10091013        """Setup the route from the booked flight."""
    10101014        self._route.set_sensitive(True)
     1015        self._cruiseLevel.set_value(240)
    10111016        self._cruiseLevel.set_sensitive(True)
    10121017        self._route.get_buffer().set_text(self._wizard._bookedFlight.route)
     
    11881193        if notams is None:
    11891194            buffer.set_text("Could not download NOTAMs")
     1195        elif not notams:
     1196            buffer.set_text("Could not download NOTAM for this airport")
    11901197        else:
    11911198            s = ""
  • src/mlx/gui/gui.py

    r91 r92  
    6060        window.add(mainVBox)
    6161
    62         notebook = gtk.Notebook()
    63         mainVBox.add(notebook)
     62        self._notebook = gtk.Notebook()
     63        mainVBox.add(self._notebook)
    6464
    6565        self._wizard = Wizard(self)
     
    6767        label.set_use_underline(True)
    6868        label.set_tooltip_text("Flight wizard")
    69         notebook.append_page(self._wizard, label)
     69        self._notebook.append_page(self._wizard, label)
    7070
    7171        self._flightInfo = FlightInfo(self)
     
    7373        label.set_use_underline(True)
    7474        label.set_tooltip_text("Flight information")
    75         notebook.append_page(self._flightInfo, label)
     75        self._notebook.append_page(self._flightInfo, label)
    7676
    7777        logVBox = gtk.VBox()
     
    7979        label.set_use_underline(True)
    8080        label.set_tooltip_text("Flight log")
    81         notebook.append_page(logVBox, label)
     81        self._notebook.append_page(logVBox, label)
    8282       
    8383        logFrame = self._buildLogFrame()
     
    9090        mainVBox.pack_start(self._statusbar, False, False, 0)
    9191
    92         notebook.connect("switch-page", self._notebookPageSwitch)
     92        self._notebook.connect("switch-page", self._notebookPageSwitch)
    9393
    9494        self._monitorWindow = MonitorWindow(self, iconDirectory)
     
    240240        """Reset the GUI."""
    241241        self._disconnect()
    242         self._wizard.reset()
     242
    243243        self._flightInfo.reset()
    244244        self.resetFlightStatus()
    245245
     246        self._wizard.reset()
     247        self._notebook.set_current_page(0)
     248
     249        self._logView.get_buffer().set_text("")
     250
    246251    def _disconnect(self):
    247252        """Disconnect from the simulator if connected."""
     253        self.stopMonitoring()
     254
    248255        if self._connected:
    249             self.stopMonitoring()
    250256            self._flight.simulator.disconnect()
    251257            self._connected = False
Note: See TracChangeset for help on using the changeset viewer.