Changeset 867:0db1c4089615 for src/mlx
- Timestamp:
- 06/18/17 18:15:40 (7 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flightlist.py
r859 r867 287 287 self._flightList = FlightList(columnDescriptors = 288 288 PendingFlightsFrame.columnDescriptors, 289 widthRequest = 500, multiSelection = True) 289 widthRequest = 500, multiSelection = True, 290 popupMenuProducer = 291 self._producePopupMenu) 290 292 self._flightList.connect("selection-changed", self._selectionChanged) 291 293 … … 298 300 "view") + "_" + which)) 299 301 self._editButton.set_sensitive(False) 302 self._editButton.set_use_underline(True) 300 303 self._editButton.connect("clicked", self._editClicked) 301 304 buttonBox.pack_start(self._editButton, False, False, 2) … … 303 306 self._reflyButton = gtk.Button(xstr("pendflt_refly_" + which)) 304 307 self._reflyButton.set_sensitive(False) 308 self._reflyButton.set_use_underline(True) 305 309 self._reflyButton.connect("clicked", self._reflyClicked) 306 310 buttonBox.pack_start(self._reflyButton, False, False, 2) … … 308 312 self._deleteButton = gtk.Button(xstr("pendflt_delete_" + which)) 309 313 self._deleteButton.set_sensitive(False) 314 self._deleteButton.set_use_underline(True) 310 315 self._deleteButton.connect("clicked", self._deleteClicked) 311 316 buttonBox.pack_start(self._deleteButton, False, False, 2) … … 339 344 def _editClicked(self, button): 340 345 """Called when the Edit button is clicked.""" 346 self._editSelected() 347 348 def _editSelected(self): 349 """Edit or view the selected flight.""" 341 350 gui = self._wizard.gui 342 351 gui.beginBusy(xstr("pendflt_pirep_busy")) … … 368 377 def _reflyClicked(self, button): 369 378 """Called when the Refly button is clicked.""" 379 self._reflySelected() 380 381 def _reflySelected(self): 382 """Mark the selected flight(s) to refly.""" 370 383 if askYesNo(xstr("pendflt_refly_question"), parent = self._window): 371 384 gui = self._wizard.gui … … 407 420 def _deleteClicked(self, button): 408 421 """Called when the Delete button is clicked.""" 422 self._deleteSelected() 423 424 def _deleteSelected(self): 425 """Delete the selected flight.""" 409 426 if askYesNo(xstr("flight_delete_question"), parent = self._window): 410 427 gui = self._wizard.gui … … 443 460 else: 444 461 communicationErrorDialog() 462 463 def _producePopupMenu(self): 464 """Create the popup menu for the flights.""" 465 menu = gtk.Menu() 466 467 menuItem = gtk.MenuItem() 468 menuItem.set_label(xstr("pendflt_" + 469 ("edit" if self._pirepEditable else "view") + 470 "_" + self._which)) 471 menuItem.set_use_underline(True) 472 menuItem.connect("activate", self._popupEdit) 473 menuItem.show() 474 475 menu.append(menuItem) 476 477 menuItem = gtk.MenuItem() 478 menuItem.set_label(xstr("pendflt_refly_" + self._which)) 479 menuItem.set_use_underline(True) 480 menuItem.connect("activate", self._popupRefly) 481 menuItem.show() 482 483 menu.append(menuItem) 484 485 menuItem = gtk.MenuItem() 486 menuItem.set_label(xstr("pendflt_delete_" + self._which)) 487 menuItem.set_use_underline(True) 488 menuItem.connect("activate", self._popupDelete) 489 menuItem.show() 490 491 menu.append(menuItem) 492 493 return menu 494 495 def _popupEdit(self, menuitem): 496 """Called when the Edit or View menu item is selected from the popup 497 menu.""" 498 self._editSelected() 499 500 def _popupRefly(self, menuitem): 501 """Called when the Refly menu item is selected from the popup menu.""" 502 self._reflySelected() 503 504 def _popupDelete(self, menuitem): 505 """Called when the Delete menu item is selected from the popup menu.""" 506 self._deleteSelected() 445 507 446 508 #-----------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.