* src/gramps_main.py (build_backhistmenu,build_fwdhistmenu):

Limit of 20 for the Back/Forward history menus.
Add hotkeys for these menus.


svn: r2025
This commit is contained in:
Alex Roitman 2003-08-19 12:39:05 +00:00
parent 2da2a88cd4
commit 7be1292441
2 changed files with 36 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2003-08-19 Alex Roitman <shura@alex.neuro.umn.edu>
* src/gramps_main.py (build_backhistmenu,build_fwdhistmenu):
Limit of 20 for the Back/Forward history menus.
Add hotkeys for these menus.
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.

View File

@ -478,18 +478,19 @@ class Gramps:
num = 0 num = 0
haveit = [] haveit = []
for pid in pids: for pid in pids:
if num < 10: if num >= 10:
if pid not in haveit: break
haveit.append(pid) if pid not in haveit:
person = self.db.getPerson(pid) haveit.append(pid)
item = gtk.MenuItem("_%d. %s [%s]" % person = self.db.getPerson(pid)
(num,person.getPrimaryName().getName(),pid)) item = gtk.MenuItem("_%d. %s [%s]" %
item.connect("activate",self.bookmark_callback,person) (num,person.getPrimaryName().getName(),pid))
item.show() item.connect("activate",self.bookmark_callback,person)
self.histmenu.append(item) item.show()
self.hist_gomenuitem.set_submenu(self.histmenu) self.histmenu.append(item)
self.hist_gomenuitem.set_sensitive(1) self.hist_gomenuitem.set_submenu(self.histmenu)
num = num + 1 self.hist_gomenuitem.set_sensitive(1)
num = num + 1
else: else:
self.hist_gomenuitem.set_sensitive(0) self.hist_gomenuitem.set_sensitive(0)
@ -502,9 +503,16 @@ class Gramps:
pids.reverse() pids.reverse()
num = 1 num = 1
for pid in pids: for pid in pids:
if num <= 10:
f,r = divmod(num,10)
hotkey = "_%d" % r
elif num <= 20:
hotkey = "_%s" % chr(ord('a')+num-11)
elif num >= 21:
break
person = self.db.getPerson(pid) person = self.db.getPerson(pid)
item = gtk.MenuItem("%s [%s]" % item = gtk.MenuItem("%s. %s [%s]" %
(person.getPrimaryName().getName(),pid)) (hotkey,person.getPrimaryName().getName(),pid))
item.connect("activate",self.back_clicked,num) item.connect("activate",self.back_clicked,num)
item.show() item.show()
backhistmenu.append(item) backhistmenu.append(item)
@ -523,9 +531,16 @@ class Gramps:
pids = self.history[self.hindex+1:] pids = self.history[self.hindex+1:]
num = 1 num = 1
for pid in pids: for pid in pids:
if num <= 10:
f,r = divmod(num,10)
hotkey = "_%d" % r
elif num <= 20:
hotkey = "_%s" % chr(ord('a')+num-11)
elif num >= 21:
break
person = self.db.getPerson(pid) person = self.db.getPerson(pid)
item = gtk.MenuItem("%s [%s]" % item = gtk.MenuItem("%s. %s [%s]" %
(person.getPrimaryName().getName(),pid)) (hotkey,person.getPrimaryName().getName(),pid))
item.connect("activate",self.fwd_clicked,num) item.connect("activate",self.fwd_clicked,num)
item.show() item.show()
fwdhistmenu.append(item) fwdhistmenu.append(item)