* src/gramps_main.py: Enable context menus with back and forward
portions of history upon right-clicking on Back and Forward buttons. * src/gramps.glade: Add handlers for the context menus. svn: r2021
This commit is contained in:
parent
f3670c4163
commit
8aa632c51a
@ -1,6 +1,9 @@
|
|||||||
2003-08-18 Alex Roitman <shura@alex.neuro.umn.edu>
|
2003-08-18 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/preferences.glade: Provide hotkeys for the new default view
|
* src/preferences.glade: Provide hotkeys for the new default view
|
||||||
options.
|
options.
|
||||||
|
* src/gramps_main.py: Enable context menus with back and forward
|
||||||
|
portions of history upon right-clicking on Back and Forward buttons.
|
||||||
|
* src/gramps.glade: Add handlers for the context menus.
|
||||||
|
|
||||||
2003-08-17 Alex Roitman <shura@alex.neuro.umn.edu>
|
2003-08-17 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/gramps_main.py: Better behavior for the history menu.
|
* src/gramps_main.py: Better behavior for the history menu.
|
||||||
|
@ -758,6 +758,7 @@
|
|||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="new_group">True</property>
|
<property name="new_group">True</property>
|
||||||
<signal name="clicked" handler="on_back_clicked" last_modification_time="Thu, 14 Aug 2003 02:19:55 GMT"/>
|
<signal name="clicked" handler="on_back_clicked" last_modification_time="Thu, 14 Aug 2003 02:19:55 GMT"/>
|
||||||
|
<signal name="button_press_event" handler="on_back_pressed" last_modification_time="Tue, 19 Aug 2003 00:07:23 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="new_group">True</property>
|
<property name="new_group">True</property>
|
||||||
@ -770,6 +771,7 @@
|
|||||||
<property name="label">gtk-go-forward</property>
|
<property name="label">gtk-go-forward</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
<signal name="clicked" handler="on_fwd_clicked" last_modification_time="Thu, 14 Aug 2003 02:20:17 GMT"/>
|
<signal name="clicked" handler="on_fwd_clicked" last_modification_time="Thu, 14 Aug 2003 02:20:17 GMT"/>
|
||||||
|
<signal name="button_press_event" handler="on_fwd_pressed" last_modification_time="Tue, 19 Aug 2003 00:27:51 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
@ -384,7 +384,9 @@ class Gramps:
|
|||||||
|
|
||||||
self.gtop.signal_autoconnect({
|
self.gtop.signal_autoconnect({
|
||||||
"on_back_clicked" : self.back_clicked,
|
"on_back_clicked" : self.back_clicked,
|
||||||
|
"on_back_pressed" : self.back_pressed,
|
||||||
"on_fwd_clicked" : self.fwd_clicked,
|
"on_fwd_clicked" : self.fwd_clicked,
|
||||||
|
"on_fwd_pressed" : self.fwd_pressed,
|
||||||
"on_editbtn_clicked" : self.edit_button_clicked,
|
"on_editbtn_clicked" : self.edit_button_clicked,
|
||||||
"on_addbtn_clicked" : self.add_button_clicked,
|
"on_addbtn_clicked" : self.add_button_clicked,
|
||||||
"on_removebtn_clicked" : self.remove_button_clicked,
|
"on_removebtn_clicked" : self.remove_button_clicked,
|
||||||
@ -490,10 +492,53 @@ class Gramps:
|
|||||||
else:
|
else:
|
||||||
self.hist_gomenuitem.set_sensitive(0)
|
self.hist_gomenuitem.set_sensitive(0)
|
||||||
|
|
||||||
def back_clicked(self,obj):
|
def build_backhistmenu(self):
|
||||||
|
"""Builds and displays the menu with the back portion of the history"""
|
||||||
|
if self.hindex > 0:
|
||||||
|
backhistmenu = gtk.Menu()
|
||||||
|
backhistmenu.set_title(_('Back Menu'))
|
||||||
|
pids = self.history[:self.hindex]
|
||||||
|
pids.reverse()
|
||||||
|
num = 1
|
||||||
|
for pid in pids:
|
||||||
|
person = self.db.getPerson(pid)
|
||||||
|
item = gtk.MenuItem("%s [%s]" %
|
||||||
|
(person.getPrimaryName().getName(),pid))
|
||||||
|
item.connect("activate",self.back_clicked,num)
|
||||||
|
item.show()
|
||||||
|
backhistmenu.append(item)
|
||||||
|
num = num + 1
|
||||||
|
backhistmenu.popup(None,None,None,0,0)
|
||||||
|
|
||||||
|
def back_pressed(self,obj,event):
|
||||||
|
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||||
|
self.build_backhistmenu()
|
||||||
|
|
||||||
|
def build_fwdhistmenu(self):
|
||||||
|
"""Builds and displays the menu with the forward portion of the history"""
|
||||||
|
if self.hindex < len(self.history)-1:
|
||||||
|
fwdhistmenu = gtk.Menu()
|
||||||
|
fwdhistmenu.set_title(_('Forward Menu'))
|
||||||
|
pids = self.history[self.hindex+1:]
|
||||||
|
num = 1
|
||||||
|
for pid in pids:
|
||||||
|
person = self.db.getPerson(pid)
|
||||||
|
item = gtk.MenuItem("%s [%s]" %
|
||||||
|
(person.getPrimaryName().getName(),pid))
|
||||||
|
item.connect("activate",self.fwd_clicked,num)
|
||||||
|
item.show()
|
||||||
|
fwdhistmenu.append(item)
|
||||||
|
num = num + 1
|
||||||
|
fwdhistmenu.popup(None,None,None,0,0)
|
||||||
|
|
||||||
|
def fwd_pressed(self,obj,event):
|
||||||
|
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||||
|
self.build_fwdhistmenu()
|
||||||
|
|
||||||
|
def back_clicked(self,obj,step=1):
|
||||||
if self.hindex > 0:
|
if self.hindex > 0:
|
||||||
try:
|
try:
|
||||||
self.hindex -= 1
|
self.hindex -= step
|
||||||
self.active_person = self.db.getPerson(self.history[self.hindex])
|
self.active_person = self.db.getPerson(self.history[self.hindex])
|
||||||
self.modify_statusbar()
|
self.modify_statusbar()
|
||||||
self.update_display(0)
|
self.update_display(0)
|
||||||
@ -516,10 +561,10 @@ class Gramps:
|
|||||||
self.fwdbtn.set_sensitive(1)
|
self.fwdbtn.set_sensitive(1)
|
||||||
self.forward.set_sensitive(1)
|
self.forward.set_sensitive(1)
|
||||||
|
|
||||||
def fwd_clicked(self,obj):
|
def fwd_clicked(self,obj,step=1):
|
||||||
if self.hindex+1 < len(self.history):
|
if self.hindex+1 < len(self.history):
|
||||||
try:
|
try:
|
||||||
self.hindex += 1
|
self.hindex += step
|
||||||
self.active_person = self.db.getPerson(self.history[self.hindex])
|
self.active_person = self.db.getPerson(self.history[self.hindex])
|
||||||
self.modify_statusbar()
|
self.modify_statusbar()
|
||||||
self.update_display(0)
|
self.update_display(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user