Added initial hooks for the preferences window

This commit is contained in:
José Carlos Cuevas 2014-07-11 19:04:37 +02:00
parent 81fb8d1397
commit 6dba2d7936
2 changed files with 32 additions and 2 deletions

View file

@ -131,6 +131,7 @@
<object class="GtkWindow" id="PreferencesWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Preferences</property>
<signal name="delete-event" handler="on_PreferencesWindow_delete_event" swapped="no"/>
<child>
<object class="GtkBox" id="PrefsBox">
<property name="visible">True</property>
@ -305,6 +306,7 @@
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_PrefsCloseButton_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>

View file

@ -143,6 +143,31 @@ class MainWindow(Gtk.Application):
"""
pass
def on_PreferencesWindow_delete_event(self, obj, event = None):
"""
The Preferences window has been closed by clicking the close window
button from the window manager
obj --
event --
"""
preferences_window = self.builder.get_object('PreferencesWindow')
preferences_window.hide()
# TODO: Save the preferences
return True
def on_PrefsCloseButton_clicked(self, obj, event = None):
"""
The close button at the preferences has been pressed
obj --
event --
"""
preferences_window = self.builder.get_object('PreferencesWindow')
preferences_window.hide()
# TODO: Save the preferences
### Action callbacks ###
def on_connect_action_activate(self, obj, event = None):
@ -169,8 +194,10 @@ class MainWindow(Gtk.Application):
"""
We've been asked for the preferences window
"""
# TODO
print "Not implemented: on_preferences_action_activate"
preferences_window = self.builder.get_object('PreferencesWindow')
# TODO: Set up the window to the current preferences before showing it up
preferences_window.show()
def on_refresh_action_activate(self, obj, event = None):
"""
@ -325,6 +352,7 @@ class MainWindow(Gtk.Application):
delete_container_button.set_sensitive(False)
# run main loop
def main():
main_window = MainWindow()