better reaction on tab switch

This commit is contained in:
guinux 2013-04-22 19:06:31 +02:00
parent 916ca6a8e3
commit d1d7e7b525
3 changed files with 21 additions and 6 deletions

View File

@ -420,6 +420,7 @@
<object class="GtkNotebook" id="notebook1"> <object class="GtkNotebook" id="notebook1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<signal name="switch-page" handler="on_notebook1_switch_page" swapped="no"/>
<child> <child>
<object class="GtkBox" id="box2"> <object class="GtkBox" id="box2">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -98,12 +98,12 @@ if common.pid_file_exists():
response = main.ErrorDialog.run() response = main.ErrorDialog.run()
if response: if response:
main.ErrorDialog.hide() main.ErrorDialog.hide()
#~ elif updates: elif updates:
#~ main.ErrorDialog.format_secondary_text(_('Some updates are available.\nPlease update your system first')) main.ErrorDialog.format_secondary_text(_('Some updates are available.\nPlease update your system first'))
#~ response = main.ErrorDialog.run() response = main.ErrorDialog.run()
#~ if response: if response:
#~ main.ErrorDialog.hide() main.ErrorDialog.hide()
#~ transaction.StopDaemon() transaction.StopDaemon()
else: else:
common.write_pid_file() common.write_pid_file()
pkgs_to_install = argv[1:] pkgs_to_install = argv[1:]

View File

@ -1008,6 +1008,20 @@ class Handler:
else: else:
handle_reply('') handle_reply('')
def on_notebook1_switch_page(self, notebook, page, page_num):
if page_num == 0:
liste, line = search_selection.get_selected()
if line:
self.on_search_treeview_selection_changed(self)
elif search_entry.get_text():
self.on_search_entry_activate(self)
elif page_num == 1:
self.on_groups_treeview_selection_changed(self)
elif page_num == 2:
self.on_state_treeview_selection_changed(self)
elif page_num == 3:
self.on_repos_treeview_selection_changed(self)
#Updater Handlers #Updater Handlers
def on_UpdaterWindow_delete_event(self, *arg): def on_UpdaterWindow_delete_event(self, *arg):
transaction.StopDaemon() transaction.StopDaemon()