diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index d4458e810..042aaee97 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2003-10-05 Alex Roitman + * src/PeopleView.py: Correct references to history in gramps_main. + * src/gramps_main.py: Switch away from separate history submenu. + * src/gramps.glade: Likewise. + 2003-10-04 Don Allingham * src/PeopleView.py: broken out of gramps_main.py, fixed add/delete diff --git a/gramps2/src/PeopleView.py b/gramps2/src/PeopleView.py index d7eebae40..8321e40f7 100644 --- a/gramps2/src/PeopleView.py +++ b/gramps2/src/PeopleView.py @@ -344,22 +344,22 @@ class PeopleView: """Builds the menu with navigation and editing operations on the people's list""" - back_sensitivity = self.hindex > 0 - fwd_sensitivity = self.hindex + 1 < len(self.history) + back_sensitivity = self.parent.hindex > 0 + fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) mlist = self.person_tree.get_selected_objects() if mlist: sel_sensitivity = 1 else: sel_sensitivity = 0 entries = [ - (gtk.STOCK_GO_BACK,self.back_clicked,back_sensitivity), - (gtk.STOCK_GO_FORWARD,self.fwd_clicked,fwd_sensitivity), - (gtk.STOCK_HOME,self.on_home_clicked,1), - (_("Add Bookmark"),self.on_add_bookmark_activate,sel_sensitivity), + (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity), + (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity), + (gtk.STOCK_HOME,self.parent.on_home_clicked,1), + (_("Add Bookmark"),self.parent.on_add_bookmark_activate,sel_sensitivity), (None,None,0), - (gtk.STOCK_ADD, self.add_button_clicked,1), - (gtk.STOCK_REMOVE, self.remove_button_clicked,sel_sensitivity), - (_("Edit"), self.edit_button_clicked,sel_sensitivity), + (gtk.STOCK_ADD, self.parent.add_button_clicked,1), + (gtk.STOCK_REMOVE, self.parent.remove_button_clicked,sel_sensitivity), + (_("Edit"), self.parent.edit_button_clicked,sel_sensitivity), ] menu = gtk.Menu() @@ -375,5 +375,3 @@ class PeopleView: def redisplay_person_list(self,person): self.add_to_person_list(person,1) - - diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 737816abe..4592c7418 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -51,7 +51,7 @@ - + True gtk-new 1 @@ -73,7 +73,7 @@ - + True gtk-open 1 @@ -95,7 +95,7 @@ - + True gtk-save 1 @@ -116,7 +116,7 @@ - + True gtk-save-as 1 @@ -150,7 +150,7 @@ True - + True gtk-convert 1 @@ -171,7 +171,7 @@ - + True gtk-revert-to-saved 1 @@ -192,7 +192,7 @@ - + True gtk-refresh 1 @@ -220,7 +220,7 @@ - + True gtk-quit 1 @@ -255,7 +255,7 @@ - + True gtk-find 1 @@ -276,7 +276,7 @@ - + True gtk-convert 1 @@ -331,99 +331,6 @@ True _Go True - - - - - - - True - Go back in history - _Back - True - - - - - - True - gtk-go-back - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Go forward in history - _Forward - True - - - - - - True - gtk-go-forward - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - _Home - True - - - - - - True - gtk-home - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - _History - True - - - - @@ -445,7 +352,7 @@ - + True gtk-index 1 @@ -467,7 +374,7 @@ - + True gnome-stock-book-open 1 @@ -531,7 +438,7 @@ - + True gtk-preferences 1 @@ -552,7 +459,7 @@ - + True gtk-home 1 @@ -587,7 +494,7 @@ - + True gtk-help 1 @@ -614,7 +521,7 @@ - + True gtk-jump-to 1 @@ -635,7 +542,7 @@ - + True gnome-stock-mail 1 @@ -689,7 +596,7 @@ - + True gnome-stock-about 1 diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 081e1c487..280b39af1 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -43,6 +43,7 @@ import gtk import gnome import gnome.ui import gtk.glade +import gtk.gdk #------------------------------------------------------------------------- # @@ -251,10 +252,7 @@ class Gramps: self.add_button = self.gtop.get_widget('addbtn') self.backbtn = self.gtop.get_widget('back_btn') self.fwdbtn = self.gtop.get_widget('fwd_btn') - self.back = self.gtop.get_widget('back') - self.forward = self.gtop.get_widget('forward') - self.hist_gomenuitem = self.gtop.get_widget("history1") - self.histmenu = None + self.gomenuitem = self.gtop.get_widget("go1") self.gtop.signal_autoconnect({ "on_back_clicked" : self.back_clicked, @@ -341,9 +339,36 @@ class Gramps: def redraw_histmenu(self): """Create the history submenu of the Go menu""" - self.hist_gomenuitem.remove_submenu() + + # Start a brand new menu and create static items: + # back, forward, separator, home. + gomenu = gtk.Menu() + + self.back = gtk.ImageMenuItem(gtk.STOCK_GO_BACK) + self.back.connect("activate",self.back_clicked) + self.back.show() + gomenu.append(self.back) + + self.forward = gtk.ImageMenuItem(gtk.STOCK_GO_FORWARD) + self.forward.connect("activate",self.fwd_clicked) + self.forward.show() + gomenu.append(self.forward) + + item = gtk.MenuItem() + item.show() + gomenu.append(item) + + item = gtk.ImageMenuItem(gtk.STOCK_HOME) + item.connect("activate",self.on_home_clicked) + item.show() + gomenu.append(item) + if len(self.history) > 0: - self.histmenu = gtk.Menu() + # Draw separator + item = gtk.MenuItem() + item.show() + gomenu.append(item) + pids = self.mhistory[:] pids.reverse() num = 0 @@ -358,12 +383,14 @@ class Gramps: (num,person.getPrimaryName().getName(),pid)) item.connect("activate",self.bookmark_callback,person) item.show() - self.histmenu.append(item) - self.hist_gomenuitem.set_submenu(self.histmenu) - self.hist_gomenuitem.set_sensitive(1) + gomenu.append(item) num = num + 1 else: - self.hist_gomenuitem.set_sensitive(0) + self.back.set_sensitive(0) + self.forward.set_sensitive(0) + + self.gomenuitem.remove_submenu() + self.gomenuitem.set_submenu(gomenu) def build_backhistmenu(self): """Builds and displays the menu with the back portion of the history""" @@ -778,6 +805,7 @@ class Gramps: self.history = [] self.mhistory = [] self.hindex = -1 + self.redraw_histmenu() self.people_view.clear_person_tabs()