Changeset 215:bff7327b2da0
- Timestamp:
- 06/01/12 17:24:26 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r211 r215 89 89 # queried from it, so the model should have a reference to the GUI as 90 90 # well and access such data via the GUI! 91 if config.onlineACARS and not flight.entranceExam:91 if config.onlineACARS and flight.loggedIn and not flight.entranceExam: 92 92 self._checkers.append(checks.ACARSSender(flight._gui)) 93 93 … … 214 214 config = flight.config 215 215 if config.onlineGateSystem and \ 216 flight.loggedIn and \ 216 217 not flight.entranceExam and \ 217 218 bookedFlight.arrivalICAO=="LHBP" and \ -
src/mlx/flight.py
r184 r215 66 66 """Get the flight stage.""" 67 67 return self._stage 68 69 @property 70 def loggedIn(self): 71 """Indicate if the user has logged in properly.""" 72 return self._gui.loggedIn 68 73 69 74 @property -
src/mlx/gui/flight.py
r214 r215 260 260 table.attach(self._entranceExam, 1, 2, 3, 4, ypadding = 12) 261 261 262 self.addButton(xstr("button_offline"), 263 clicked = self._offlineClicked, 264 tooltip = xstr("button_offline_tooltip")) 265 262 266 self._loginButton = self.addButton(xstr("button_login"), default = True) 263 267 self._loginButton.connect("clicked", self._loginClicked) … … 270 274 return self._entranceExam.get_active() and \ 271 275 self._pilotID.get_text()!="" 276 277 @property 278 def pilotID(self): 279 """Get the pilot ID, if given.""" 280 return self._pilotID.get_text() 272 281 273 282 def activate(self): … … 301 310 self._loginButton.set_sensitive(pilotID!="" and 302 311 (password!="" or entranceExam)) 312 313 def _offlineClicked(self, button): 314 """Called when the offline button was clicked.""" 315 self._wizard.nextPage() 303 316 304 317 def _loginClicked(self, button): … … 414 427 self._flights = [] 415 428 self._listStore.clear() 416 for flight in self._wizard.loginResult.flights: 417 self._addFlight(flight) 429 if self._wizard.loggedIn: 430 for flight in self._wizard.loginResult.flights: 431 self._addFlight(flight) 418 432 419 433 def _addFlight(self, flight): … … 525 539 flight = self._wizard._bookedFlight 526 540 if self._wizard.gui.config.onlineGateSystem and \ 527 not self._wizard.entranceExam:541 self._wizard.loggedIn and not self._wizard.entranceExam: 528 542 if flight.departureICAO=="LHBP": 529 543 self._wizard.getFleet(self._fleetRetrieved) … … 2221 2235 """Called when the forward button is clicked.""" 2222 2236 if self._wizard.gui.config.onlineGateSystem and \ 2223 not self._completed and \2237 self._wizard.loggedIn and not self._completed and \ 2224 2238 self._wizard.bookedFlight.arrivalICAO=="LHBP" and \ 2225 2239 not self._wizard.entranceExam: … … 2433 2447 2434 2448 self._flightType.set_active(-1) 2435 self._onlineFlight.set_active( True)2449 self._onlineFlight.set_active(self._wizard.loggedIn) 2436 2450 2437 2451 self._gatesModel.clear() 2438 2452 if self._wizard.gui.config.onlineGateSystem and \ 2453 self._wizard.loggedIn and \ 2439 2454 self._wizard.bookedFlight.arrivalICAO=="LHBP" and \ 2440 2455 not self._wizard.entranceExam: … … 2497 2512 bookedFlight = gui.bookedFlight 2498 2513 tm = time.gmtime() 2499 2500 fileName = "%s %s %02d%02d %s-%s.pirep" % \ 2501 (gui.loginResult.pilotID, 2502 str(bookedFlight.departureTime.date()), 2514 2515 pilotID = self._wizard.pilotID 2516 if pilotID: pilotID += " " 2517 fileName = "%s%s %02d%02d %s-%s.pirep" % \ 2518 (pilotID, str(bookedFlight.departureTime.date()), 2503 2519 tm.tm_hour, tm.tm_min, 2504 2520 bookedFlight.departureICAO, … … 2584 2600 self._pirepSent = returned and result.success 2585 2601 if self._wizard.gui.config.onlineGateSystem and \ 2586 not self._wizard.entranceExam and \2602 self._wizard.loggedIn and not self._wizard.entranceExam and \ 2587 2603 returned and result.success: 2588 2604 bookedFlight = self._wizard.bookedFlight … … 2660 2676 2661 2677 @property 2678 def pilotID(self): 2679 """Get the pilot ID, if given.""" 2680 return self._loginPage.pilotID 2681 2682 @property 2662 2683 def entranceExam(self): 2663 2684 """Get whether an entrance exam is about to be taken.""" 2664 2685 return self._loginPage.entranceExam 2686 2687 @property 2688 def loggedIn(self): 2689 """Indicate if there was a successful login.""" 2690 return self._loginResult is not None 2665 2691 2666 2692 @property -
src/mlx/gui/gui.py
r208 r215 186 186 """Get whether an entrance exam is about to be taken.""" 187 187 return self._wizard.entranceExam 188 189 @property 190 def loggedIn(self): 191 """Indicate if the user has logged in properly.""" 192 return self._wizard.loggedIn 188 193 189 194 @property … … 432 437 self._logView.get_buffer().set_text("") 433 438 434 self._wizard.reloadFlights(self._handleReloadResult) 439 if self.loggedIn: 440 self._wizard.reloadFlights(self._handleReloadResult) 441 else: 442 self._wizard.reset(None) 435 443 436 444 def _handleReloadResult(self, returned, result): -
src/mlx/i18n.py
r214 r215 229 229 self.add("login_entranceExam_tooltip", 230 230 "Check this to log in to take your entrance exam.") 231 self.add("button_offline", "Fl_y offline") 232 self.add("button_offline_tooltip", 233 "Click this button to fly offline, without logging in " 234 "to the MAVA website.") 231 235 self.add("button_login", "Logi_n") 232 236 self.add("login_button_tooltip", "Click to log in.")
Note:
See TracChangeset
for help on using the changeset viewer.