2006-04-27 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: support for keypress events * src/gramps.py: fix gnome init svn: r6464
This commit is contained in:
parent
ea6698be92
commit
f8a6f76900
@ -1,3 +1,7 @@
|
||||
2006-04-27 Don Allingham <don@gramps-project.org>
|
||||
* src/ViewManager.py: support for keypress events
|
||||
* src/gramps.py: fix gnome init
|
||||
|
||||
2006-04-26 Alex Roitman <shura@gramps-project.org>
|
||||
* src/plugins/PatchNames.py (PatchNames.on_ok_clicked): Properly
|
||||
call update.
|
||||
|
@ -161,6 +161,16 @@ uidefault = '''<ui>
|
||||
<separator/>
|
||||
<placeholder name="CommonEdit"/>
|
||||
</toolbar>
|
||||
<accelerator action="F2"/>
|
||||
<accelerator action="F3"/>
|
||||
<accelerator action="F4"/>
|
||||
<accelerator action="F5"/>
|
||||
<accelerator action="F6"/>
|
||||
<accelerator action="F7"/>
|
||||
<accelerator action="F8"/>
|
||||
<accelerator action="F9"/>
|
||||
<accelerator action="F11"/>
|
||||
<accelerator action="F12"/>
|
||||
</ui>
|
||||
'''
|
||||
|
||||
@ -174,6 +184,7 @@ class ViewManager:
|
||||
self.active_page = None
|
||||
self.views = []
|
||||
self.pages = []
|
||||
self.keypress_function = {}
|
||||
self.file_loaded = False
|
||||
self._build_main_window()
|
||||
self._connect_signals()
|
||||
@ -326,6 +337,16 @@ class ViewManager:
|
||||
('ReportsMenu', None, '_Reports'),
|
||||
('ToolsMenu', None, '_Tools'),
|
||||
('WindowsMenu', None, '_Windows'),
|
||||
('F2', None, None, "F2", None, self.keypress),
|
||||
('F3', None, None, "F3", None, self.keypress),
|
||||
('F4', None, None, "F4", None, self.keypress),
|
||||
('F5', None, None, "F5", None, self.keypress),
|
||||
('F6', None, None, "F6", None, self.keypress),
|
||||
('F7', None, None, "F7", None, self.keypress),
|
||||
('F8', None, None, "F8", None, self.keypress),
|
||||
('F9', None, None, "F9", None, self.keypress),
|
||||
('F11', None, None, "F11", None, self.keypress),
|
||||
('F12', None, None, "F12", None, self.keypress),
|
||||
]
|
||||
|
||||
self._file_toggle_action_list = [
|
||||
@ -349,6 +370,14 @@ class ViewManager:
|
||||
PageView.NAVIGATION_PERSON: (None, None),
|
||||
}
|
||||
|
||||
def keypress(self, action):
|
||||
name = action.get_name()
|
||||
func = self.keypress_function.get(name)
|
||||
if func:
|
||||
func()
|
||||
else:
|
||||
self.uistate.push_message(_("Key %s is not bound") % name)
|
||||
|
||||
def init_interface(self):
|
||||
self._init_lists()
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
import sys
|
||||
import os
|
||||
import locale
|
||||
import const
|
||||
import signal
|
||||
import gettext
|
||||
import exceptions
|
||||
@ -147,17 +148,17 @@ def run():
|
||||
|
||||
try:
|
||||
import gnome
|
||||
self.program = gnome.program_init('gramps',const.version,
|
||||
program = gnome.program_init('gramps',const.version,
|
||||
gnome.libgnome_module_info_get(),
|
||||
args, const.popt_table)
|
||||
|
||||
self.program.set_property('app-libdir',
|
||||
program.set_property('app-libdir',
|
||||
'%s/lib' % const.prefixdir)
|
||||
self.program.set_property('app-datadir',
|
||||
program.set_property('app-datadir',
|
||||
'%s/share/gramps' % const.prefixdir)
|
||||
self.program.set_property('app-sysconfdir',
|
||||
program.set_property('app-sysconfdir',
|
||||
'%s/etc' % const.prefixdir)
|
||||
self.program.set_property('app-prefix', const.prefixdir)
|
||||
program.set_property('app-prefix', const.prefixdir)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user