Changeset 821:158bfb360027 for src/mlx/gui
- Timestamp:
- 09/25/16 06:42:50 (8 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r819 r821 541 541 self._flightList.addFlight(flight) 542 542 543 def _reflyFlight(self, flight): 544 """Refly the given flight.""" 545 self._addFlight(flight) 546 self._setupHelp() 547 self._updatePendingButton() 548 543 549 def _pendingClicked(self, button): 544 550 """Called when the Pending flights button is clicked.""" … … 5080 5086 self._loginPage = LoginPage(self) 5081 5087 self._pages.append(self._loginPage) 5082 self._pages.append(FlightSelectionPage(self)) 5088 self._flightSelectionPage = FlightSelectionPage(self) 5089 self._pages.append(self._flightSelectionPage) 5083 5090 self._pages.append(GateSelectionPage(self)) 5084 5091 self._pages.append(RegisterPage(self)) … … 5481 5488 self.login(callback, None, None) 5482 5489 5490 def reflyFlight(self, bookedFlight): 5491 """Add the given booked flight to the flight selection page.""" 5492 self._removePendingFlight(bookedFlight) 5493 self._flightSelectionPage._reflyFlight(bookedFlight) 5494 5483 5495 def cancelFlight(self, reloadCallback): 5484 5496 """Cancel the flight. … … 5526 5538 if page is not originator: 5527 5539 page.changeMETAR(metar) 5540 5541 def _removePendingFlight(self, flight): 5542 """Remove the given pending flight from the login result.""" 5543 for flights in [self._loginResult.reportedFlights, 5544 self._loginResult.rejectedFlights]: 5545 for f in flights: 5546 if f.id==flight.id: 5547 flights.remove(f) 5548 return 5528 5549 5529 5550 def _loginResultCallback(self, returned, result): -
src/mlx/gui/flightlist.py
r819 r821 251 251 self._reflyButton = gtk.Button(xstr("pendflt_refly_" + which)) 252 252 self._reflyButton.set_sensitive(False) 253 self._reflyButton.connect("clicked", self._reflyClicked) 253 254 buttonBox.pack_start(self._reflyButton, False, False, 2) 254 255 … … 284 285 self._deleteButton.set_sensitive(sensitive) 285 286 287 def _reflyClicked(self, button): 288 """Called when the Refly button is clicked.""" 289 gui = self._wizard.gui 290 gui.beginBusy(xstr("pendflt_refly_busy")) 291 self.set_sensitive(False) 292 293 flight = self._flights[self._flightList.selectedIndex] 294 gui.webHandler.reflyFlights(self._reflyResultCallback, [flight.id]) 295 296 def _reflyResultCallback(self, returned, result): 297 """Called when the refly result is available.""" 298 gobject.idle_add(self._handleReflyResult, returned, result) 299 300 def _handleReflyResult(self, returned, result): 301 """Handle the refly result.""" 302 303 self.set_sensitive(True) 304 gui = self._wizard.gui 305 gui.endBusy() 306 307 print "PendingFlightsFrame._handleReflyResult", returned, result 308 309 if returned: 310 index = self._flightList.selectedIndex 311 312 flight = self._flights[index] 313 314 self._flightList.removeFlight(index) 315 del self._flights[index] 316 317 self._wizard.reflyFlight(flight) 318 319 286 320 #----------------------------------------------------------------------------- 287 321
Note:
See TracChangeset
for help on using the changeset viewer.