Ignore:
Timestamp:
06/19/12 14:52:44 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented option to control whether to quit or hide when the window close button is pressed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r197 r249  
    121121        self._language = ""
    122122        self._hideMinimizedWindow = True
     123        self._quitOnClose = False
    123124        self._onlineGateSystem = True
    124125        self._onlineACARS = True
     
    211212        if hideMinimizedWindow!=self._hideMinimizedWindow:
    212213            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
    213228            self._modified = True
    214229   
     
    482497
    483498        self._language = self._get(config, "general", "language", "")
     499
    484500        self._hideMinimizedWindow = self._getBoolean(config, "general",
    485501                                                     "hideMinimizedWindow",
    486502                                                     True)
     503        self._quitOnClose = self._getBoolean(config, "general",
     504                                             "quitOnClose", False)
     505       
    487506        self._onlineGateSystem = self._getBoolean(config, "general",
    488507                                                  "onlineGateSystem",
     
    557576        config.set("general", "hideMinimizedWindow",
    558577                   "yes" if self._hideMinimizedWindow else "no")
     578        config.set("general", "quitOnClose",
     579                   "yes" if self._quitOnClose else "no")
    559580        config.set("general", "onlineGateSystem",
    560581                   "yes" if self._onlineGateSystem else "no")
Note: See TracChangeset for help on using the changeset viewer.