Don't try to set the global hide_window keybinding if it's disabled. Closes LP#1101155

This commit is contained in:
Chris Jones 2013-01-30 13:37:14 +00:00
parent 30e3665005
commit ed5a4040bc
1 changed files with 12 additions and 11 deletions

View File

@ -117,18 +117,19 @@ class Window(Container, gtk.Window):
# Attempt to grab a global hotkey for hiding the window. # Attempt to grab a global hotkey for hiding the window.
# If we fail, we'll never hide the window, iconifying instead. # If we fail, we'll never hide the window, iconifying instead.
try: if self.config['keybindings']['hide_window'] != None:
self.hidebound = keybinder.bind( try:
self.config['keybindings']['hide_window'], self.hidebound = keybinder.bind(
self.on_hide_window) self.config['keybindings']['hide_window'],
except (KeyError, NameError): self.on_hide_window)
pass except (KeyError, NameError):
pass
if not self.hidebound: if not self.hidebound:
err('Unable to bind hide_window key, another instance/window has it.') err('Unable to bind hide_window key, another instance/window has it.')
self.hidefunc = self.iconify self.hidefunc = self.iconify
else: else:
self.hidefunc = self.hide self.hidefunc = self.hide
def apply_config(self): def apply_config(self):
"""Apply various configuration options""" """Apply various configuration options"""