From a4d54b93832bde039e3b7d4813a20711bac3a104 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 29 Apr 2011 20:55:31 +0000 Subject: [PATCH] Hide navigation the plugin selector when only the default plugin is loaded svn: r17340 --- src/gui/navigator.py | 28 +++++++++++++++++----------- src/gui/viewmanager.py | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/gui/navigator.py b/src/gui/navigator.py index bbd2f4f75..9fe9fba04 100644 --- a/src/gui/navigator.py +++ b/src/gui/navigator.py @@ -54,38 +54,42 @@ class Navigator(object): frame = gtk.Frame() hbox = gtk.HBox() + hbox.show() frame.add(hbox) + frame.show() - select_button = gtk.ToggleButton() - select_button.set_relief(gtk.RELIEF_NONE) + self.select_button = gtk.ToggleButton() + self.select_button.set_relief(gtk.RELIEF_NONE) select_hbox = gtk.HBox() - #self.title_label = gtk.Label('') + self.title_label = gtk.Label('') arrow = gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_NONE) - #select_hbox.pack_start(self.title_label, False) + select_hbox.pack_start(self.title_label, False) select_hbox.pack_end(arrow, False) - select_button.add(select_hbox) + self.select_button.add(select_hbox) - select_button.connect('button_press_event', self.__menu_button_pressed) + self.select_button.connect('button_press_event', + self.__menu_button_pressed) #close_button = gtk.Button() #img = gtk.image_new_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU) #close_button.set_image(img) #close_button.set_relief(gtk.RELIEF_NONE) #close_button.connect('clicked', self.cb_close_clicked) - hbox.pack_start(select_button, False) + hbox.pack_start(self.select_button, False) #hbox.pack_end(close_button, False) self.top.pack_end(frame, False) self.menu = gtk.Menu() self.menu.show() - self.menu.connect('deactivate', cb_menu_deactivate, select_button) + self.menu.connect('deactivate', cb_menu_deactivate, self.select_button) self.notebook = gtk.Notebook() self.notebook.show() self.notebook.set_show_tabs(False) self.notebook.set_show_border(False) self.notebook.connect('switch_page', self.cb_switch_page) + self.top.show() self.top.pack_start(self.notebook, True) def get_top(self): @@ -110,6 +114,9 @@ class Navigator(object): menu_item.connect('activate', self.cb_menu_activate, index) menu_item.show() + if self.notebook.get_n_pages() == 2: + self.select_button.show_all() + def view_changed(self, cat_num, view_num): """ Called when a Gramps view is changed. @@ -138,9 +145,8 @@ class Navigator(object): """ Called when the user has switched to a new sidebar plugin page. """ - pass - #if self.pages: - #self.title_label.set_text(self.pages[index][0]) + if self.pages: + self.title_label.set_text(self.pages[index][0]) def cb_close_clicked(self, button): """ diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index 8149f8ec2..4f64bce7f 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -590,7 +590,7 @@ class ViewManager(CLIManager): self.navigator = Navigator(self) self.ebox.add(self.navigator.get_top()) hpane.add1(self.ebox) - hpane.show_all() + hpane.show() self.notebook = gtk.Notebook() self.notebook.set_scrollable(True)