Changeset 147:7a297d30a0ce for src


Ignore:
Timestamp:
05/02/12 17:43:02 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added option to hide the window when minimized

Location:
src/mlx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r139 r147  
    3737
    3838        self._language = ""
     39        self._hideMinimizedWindow = True
    3940        self._onlineGateSystem = True
    4041        self._onlineACARS = True
     
    9697            self._modified = True
    9798
     99    @property
     100    def hideMinimizedWindow(self):
     101        """Get whether a minimized window should be hidden."""
     102        return self._hideMinimizedWindow
     103
     104    @hideMinimizedWindow.setter
     105    def hideMinimizedWindow(self, hideMinimizedWindow):
     106        """Set whether a minimized window should be hidden."""
     107        if hideMinimizedWindow!=self._hideMinimizedWindow:
     108            self._hideMinimizedWindow = hideMinimizedWindow
     109            self._modified = True
     110   
    98111    @property
    99112    def onlineGateSystem(self):
     
    189202
    190203        self._language = self._get(config, "general", "language", "")
     204        self._hideMinimizedWindow = self._getBoolean(config, "general",
     205                                                     "hideMinimizedWindow",
     206                                                     True)
    191207        self._onlineGateSystem = self._getBoolean(config, "general",
    192208                                                  "onlineGateSystem",
     
    225241        if self._language:
    226242            config.set("general", "language", self._language)
     243        config.set("general", "hideMinimizedWindow",
     244                   "yes" if self._hideMinimizedWindow else "no")
    227245        config.set("general", "onlineGateSystem",
    228246                   "yes" if self._onlineGateSystem else "no")
  • src/mlx/gui/gui.py

    r142 r147  
    476476        iconified = gdk.WindowState.ICONIFIED if pygobject \
    477477                    else gdk.WINDOW_STATE_ICONIFIED
    478         if (event.changed_mask&iconified)!=0 and (event.new_window_state&iconified)!=0:
     478        if self.config.hideMinimizedWindow and \
     479           (event.changed_mask&iconified)!=0 and \
     480           (event.new_window_state&iconified)!=0:
    479481            self.hideMainWindow(savePosition = False)
    480482
  • src/mlx/gui/prefs.py

    r139 r147  
    6767        """Setup the dialog from the given configuration."""
    6868        self._setLanguage(config.language)
     69        self._hideMinimizedWindow.set_active(config.hideMinimizedWindow)
    6970        self._onlineGateSystem.set_active(config.onlineGateSystem)
    7071        self._onlineACARS.set_active(config.onlineACARS)
     
    9192        """Setup the given config from the settings in the dialog."""
    9293        config.language = self._getLanguage()
     94        config.hideMinimizedWindow = self._hideMinimizedWindow.get_active()
    9395        config.onlineGateSystem = self._onlineGateSystem.get_active()
    9496        config.onlineACARS = self._onlineACARS.get_active()
     
    145147        self._changingLanguage = False
    146148        self._warnedRestartNeeded = False
     149
     150        self._hideMinimizedWindow = gtk.CheckButton(xstr("prefs_hideMinimizedWindow"))
     151        self._hideMinimizedWindow.set_use_underline(True)
     152        self._hideMinimizedWindow.set_tooltip_text(xstr("prefs_hideMinimizedWindow_tooltip"))
     153        mainBox.pack_start(self._hideMinimizedWindow, False, False, 4)
    147154
    148155        self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem"))
  • src/mlx/i18n.py

    r145 r147  
    595595        self.add("prefs_lang_en_GB", "English")
    596596        self.add("prefs_lang_hu_HU", "Hungarian")
     597        self.add("prefs_hideMinimizedWindow",
     598                 "_Hide the main window when minimized")
     599        self.add("prefs_hideMinimizedWindow_tooltip",
     600                 "If checked, the main window will be hidden completely "
     601                 "when minimized. You can still make it appear by "
     602                 "clicking on the status icon or using its popup menu.")
    597603        self.add("prefs_onlineGateSystem",
    598604                 "_Use the Online Gate System")
     
    11371143        self.add("prefs_lang_en_GB", "angol")
    11381144        self.add("prefs_lang_hu_HU", "magyar")
     1145        self.add("prefs_hideMinimizedWindow",
     1146                 "A főablak _eltüntetése minimalizáláskor")
     1147        self.add("prefs_hideMinimizedWindow_tooltip",
     1148                 "Ha ezt kijelölöd, a főablak teljesen eltűnik, "
     1149                 "ha minimalizálod. A státuszikonra kattintással vagy annak "
     1150                 "menüje segítségével újra meg tudod jeleníteni.")
    11391151        self.add("prefs_onlineGateSystem",
    11401152                 "Az Online _Gate System használata")
Note: See TracChangeset for help on using the changeset viewer.