|
|
@ -276,17 +276,6 @@ class Interface(object): |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def quit(self, widget, user_data=None): |
|
|
|
|
|
|
|
"""Callback when the window is destroyed (e.g. when the user closes |
|
|
|
|
|
|
|
the application.""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# this is really annoying: if the threads are locked doing some IO |
|
|
|
|
|
|
|
# requests, the application will not quit. Displaying this message is |
|
|
|
|
|
|
|
# the only option we have right now. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_log.debug('quit callback invoked. exiting now...') |
|
|
|
|
|
|
|
gtk.main_quit() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def notify_reset(self, widget, event, user_data=None): |
|
|
|
def notify_reset(self, widget, event, user_data=None): |
|
|
|
if getattr(event, 'in_', False): |
|
|
|
if getattr(event, 'in_', False): |
|
|
|
self._main_window.set_urgency_hint(False) |
|
|
|
self._main_window.set_urgency_hint(False) |
|
|
@ -997,14 +986,22 @@ class Interface(object): |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _create_main_window(self): |
|
|
|
def _create_main_window(self): |
|
|
|
main_window = gtk.Window() |
|
|
|
"""Returns the object with the main window and the attached |
|
|
|
|
|
|
|
widgets.""" |
|
|
|
|
|
|
|
main_window = gtk.Window(gtk.WINDOW_TOPLEVEL) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initial_width = int(self._options[self.NAMESPACE]['width']) |
|
|
|
|
|
|
|
initial_height = int(self._options[self.NAMESPACE]['height']) |
|
|
|
|
|
|
|
_log.debug('Initial size: %d x %d', initial_width, initial_height) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initial_x = int(self._options[self.NAMESPACE]['position_x']) |
|
|
|
|
|
|
|
initial_y = int(self._options[self.NAMESPACE]['position_y']) |
|
|
|
|
|
|
|
_log.debug('Initial position: %d x %d', initial_x, initial_y) |
|
|
|
|
|
|
|
|
|
|
|
main_window.set_title('Mitter') |
|
|
|
main_window.set_title('Mitter') |
|
|
|
main_window.set_size_request(10, 10) # very small minimal size |
|
|
|
main_window.set_size_request(10, 10) # very small minimal size |
|
|
|
main_window.resize(self._options[self.NAMESPACE]['width'], |
|
|
|
main_window.resize(initial_width, initial_height) |
|
|
|
self._options[self.NAMESPACE]['height']) |
|
|
|
main_window.move(initial_x, initial_y) |
|
|
|
main_window.move(self._options[self.NAMESPACE]['position_x'], |
|
|
|
|
|
|
|
self._options[self.NAMESPACE]['position_y']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self._app_icon: |
|
|
|
if self._app_icon: |
|
|
|
main_window.set_icon_from_file(self._app_icon) |
|
|
|
main_window.set_icon_from_file(self._app_icon) |
|
|
@ -1090,7 +1087,7 @@ class Interface(object): |
|
|
|
|
|
|
|
|
|
|
|
quit_action = gtk.Action('Quit', '_Quit', |
|
|
|
quit_action = gtk.Action('Quit', '_Quit', |
|
|
|
'Exit Mitter', gtk.STOCK_QUIT) |
|
|
|
'Exit Mitter', gtk.STOCK_QUIT) |
|
|
|
quit_action.connect('activate', self.quit) |
|
|
|
quit_action.connect('activate', self.quit_app) |
|
|
|
|
|
|
|
|
|
|
|
settings_action = gtk.Action('Settings', '_Settings', |
|
|
|
settings_action = gtk.Action('Settings', '_Settings', |
|
|
|
'Settings', gtk.STOCK_PREFERENCES) |
|
|
|
'Settings', gtk.STOCK_PREFERENCES) |
|
|
@ -1295,6 +1292,17 @@ class Interface(object): |
|
|
|
def quit_app(self, widget=None, user_data=None): |
|
|
|
def quit_app(self, widget=None, user_data=None): |
|
|
|
"""Callback when the window is destroyed or the user selects |
|
|
|
"""Callback when the window is destroyed or the user selects |
|
|
|
"Quit".""" |
|
|
|
"Quit".""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(x, y) = self._main_window.get_position() |
|
|
|
|
|
|
|
_log.debug('Current position: %d x %d', x, y) |
|
|
|
|
|
|
|
self._options[self.NAMESPACE]['position_x'] = x |
|
|
|
|
|
|
|
self._options[self.NAMESPACE]['position_y'] = y |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(width, height) = self._main_window.get_size() |
|
|
|
|
|
|
|
_log.debug('Current window size: %d x %d', width, height) |
|
|
|
|
|
|
|
self._options[self.NAMESPACE]['width'] = width |
|
|
|
|
|
|
|
self._options[self.NAMESPACE]['height'] = height |
|
|
|
|
|
|
|
|
|
|
|
gtk.main_quit() |
|
|
|
gtk.main_quit() |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|