* 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:
parent
e8138f46b0
commit
f77ca9b479
@ -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.
|
||||||
|
@ -478,7 +478,8 @@ class Gramps:
|
|||||||
num = 0
|
num = 0
|
||||||
haveit = []
|
haveit = []
|
||||||
for pid in pids:
|
for pid in pids:
|
||||||
if num < 10:
|
if num >= 10:
|
||||||
|
break
|
||||||
if pid not in haveit:
|
if pid not in haveit:
|
||||||
haveit.append(pid)
|
haveit.append(pid)
|
||||||
person = self.db.getPerson(pid)
|
person = self.db.getPerson(pid)
|
||||||
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user