Changeset 249:d055e454a7ea for src/mlx
- Timestamp:
- 06/19/12 14:52:44 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/config.py
r197 r249 121 121 self._language = "" 122 122 self._hideMinimizedWindow = True 123 self._quitOnClose = False 123 124 self._onlineGateSystem = True 124 125 self._onlineACARS = True … … 211 212 if hideMinimizedWindow!=self._hideMinimizedWindow: 212 213 self._hideMinimizedWindow = hideMinimizedWindow 214 self._modified = True 215 216 @property 217 def quitOnClose(self): 218 """Get whether the application should quit when the close button is 219 clicked.""" 220 return self._quitOnClose 221 222 @quitOnClose.setter 223 def quitOnClose(self, quitOnClose): 224 """Set whether the application should quit when the close button is 225 clicked.""" 226 if quitOnClose!=self._quitOnClose: 227 self._quitOnClose = quitOnClose 213 228 self._modified = True 214 229 … … 482 497 483 498 self._language = self._get(config, "general", "language", "") 499 484 500 self._hideMinimizedWindow = self._getBoolean(config, "general", 485 501 "hideMinimizedWindow", 486 502 True) 503 self._quitOnClose = self._getBoolean(config, "general", 504 "quitOnClose", False) 505 487 506 self._onlineGateSystem = self._getBoolean(config, "general", 488 507 "onlineGateSystem", … … 557 576 config.set("general", "hideMinimizedWindow", 558 577 "yes" if self._hideMinimizedWindow else "no") 578 config.set("general", "quitOnClose", 579 "yes" if self._quitOnClose else "no") 559 580 config.set("general", "onlineGateSystem", 560 581 "yes" if self._onlineGateSystem else "no") -
src/mlx/gui/gui.py
r246 r249 83 83 window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico")) 84 84 window.set_resizable(False) 85 window.connect("delete-event", 86 lambda a, b: self.hideMainWindow()) 85 window.connect("delete-event", self.deleteMainWindow) 87 86 window.connect("window-state-event", self._handleMainWindowState) 88 87 accelGroup = gtk.AccelGroup() … … 568 567 self.showMainWindow() 569 568 self._mainWindow.present() 569 570 def deleteMainWindow(self, window, event): 571 """Handle the delete event for the main window.""" 572 if self.config.quitOnClose: 573 self._quit() 574 else: 575 self.hideMainWindow() 576 return True 570 577 571 578 def hideMainWindow(self, savePosition = True): -
src/mlx/gui/prefs.py
r233 r249 225 225 self._setLanguage(config.language) 226 226 self._hideMinimizedWindow.set_active(config.hideMinimizedWindow) 227 self._quitOnClose.set_active(config.quitOnClose) 227 228 self._onlineGateSystem.set_active(config.onlineGateSystem) 228 229 self._onlineACARS.set_active(config.onlineACARS) … … 270 271 config.language = self._getLanguage() 271 272 config.hideMinimizedWindow = self._hideMinimizedWindow.get_active() 273 config.quitOnClose = self._quitOnClose.get_active() 272 274 config.onlineGateSystem = self._onlineGateSystem.get_active() 273 275 config.onlineACARS = self._onlineACARS.get_active() … … 347 349 self._hideMinimizedWindow.set_tooltip_text(xstr("prefs_hideMinimizedWindow_tooltip")) 348 350 guiBox.pack_start(self._hideMinimizedWindow, False, False, 4) 351 352 self._quitOnClose = gtk.CheckButton(xstr("prefs_quitOnClose")) 353 self._quitOnClose.set_use_underline(True) 354 self._quitOnClose.set_tooltip_text(xstr("prefs_quitOnClose_tooltip")) 355 guiBox.pack_start(self._quitOnClose, False, False, 4) 349 356 350 357 onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online")) -
src/mlx/i18n.py
r241 r249 702 702 "when minimized. You can still make it appear by " 703 703 "clicking on the status icon or using its popup menu.") 704 self.add("prefs_quitOnClose", 705 "_Quit when the window close button is clicked") 706 self.add("prefs_quitOnClose_tooltip", 707 "If checked, the application will quit when the window close " 708 "button is clicked. Before quitting, the confirmation " 709 "will be asked. If not checked, the window will be hidden " 710 "to the tray.") 704 711 self.add("prefs_onlineGateSystem", 705 712 "_Use the Online Gate System") … … 1572 1579 "ha minimalizálod. A státuszikonra kattintással vagy annak " 1573 1580 "menüje segítségével újra meg tudod jeleníteni.") 1581 self.add("prefs_quitOnClose", 1582 "_Kilépés az ablakzáró gomb megnyomásakor") 1583 self.add("prefs_quitOnClose_tooltip", 1584 "Ha ezt kijelölöd, a program az ablakzáró gomb megnyomására " 1585 "kilép, ha ebbéli szándékát megerősíted. Ha nem jelölöd " 1586 "ki, a főablak eltűnik, de a tálcaikon a helyén marad.") 1574 1587 self.add("prefs_onlineGateSystem", 1575 1588 "Az Online _Gate System használata")
Note:
See TracChangeset
for help on using the changeset viewer.