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
8ca6f4ab30
commit
2713516e97
@ -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>
|
2006-04-26 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/plugins/PatchNames.py (PatchNames.on_ok_clicked): Properly
|
* src/plugins/PatchNames.py (PatchNames.on_ok_clicked): Properly
|
||||||
call update.
|
call update.
|
||||||
|
@ -161,6 +161,16 @@ uidefault = '''<ui>
|
|||||||
<separator/>
|
<separator/>
|
||||||
<placeholder name="CommonEdit"/>
|
<placeholder name="CommonEdit"/>
|
||||||
</toolbar>
|
</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>
|
</ui>
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -174,6 +184,7 @@ class ViewManager:
|
|||||||
self.active_page = None
|
self.active_page = None
|
||||||
self.views = []
|
self.views = []
|
||||||
self.pages = []
|
self.pages = []
|
||||||
|
self.keypress_function = {}
|
||||||
self.file_loaded = False
|
self.file_loaded = False
|
||||||
self._build_main_window()
|
self._build_main_window()
|
||||||
self._connect_signals()
|
self._connect_signals()
|
||||||
@ -325,7 +336,17 @@ class ViewManager:
|
|||||||
('BookMenu', None, '_Bookmarks'),
|
('BookMenu', None, '_Bookmarks'),
|
||||||
('ReportsMenu', None, '_Reports'),
|
('ReportsMenu', None, '_Reports'),
|
||||||
('ToolsMenu', None, '_Tools'),
|
('ToolsMenu', None, '_Tools'),
|
||||||
('WindowsMenu', None, '_Windows'),
|
('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 = [
|
self._file_toggle_action_list = [
|
||||||
@ -349,6 +370,14 @@ class ViewManager:
|
|||||||
PageView.NAVIGATION_PERSON: (None, None),
|
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):
|
def init_interface(self):
|
||||||
self._init_lists()
|
self._init_lists()
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import locale
|
import locale
|
||||||
|
import const
|
||||||
import signal
|
import signal
|
||||||
import gettext
|
import gettext
|
||||||
import exceptions
|
import exceptions
|
||||||
@ -144,23 +145,23 @@ def setup_logging():
|
|||||||
def run():
|
def run():
|
||||||
|
|
||||||
setup_logging()
|
setup_logging()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import gnome
|
import gnome
|
||||||
self.program = gnome.program_init('gramps',const.version,
|
program = gnome.program_init('gramps',const.version,
|
||||||
gnome.libgnome_module_info_get(),
|
gnome.libgnome_module_info_get(),
|
||||||
args, const.popt_table)
|
args, const.popt_table)
|
||||||
|
|
||||||
self.program.set_property('app-libdir',
|
program.set_property('app-libdir',
|
||||||
'%s/lib' % const.prefixdir)
|
'%s/lib' % const.prefixdir)
|
||||||
self.program.set_property('app-datadir',
|
program.set_property('app-datadir',
|
||||||
'%s/share/gramps' % const.prefixdir)
|
'%s/share/gramps' % const.prefixdir)
|
||||||
self.program.set_property('app-sysconfdir',
|
program.set_property('app-sysconfdir',
|
||||||
'%s/etc' % const.prefixdir)
|
'%s/etc' % const.prefixdir)
|
||||||
self.program.set_property('app-prefix', const.prefixdir)
|
program.set_property('app-prefix', const.prefixdir)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import StartupDialog
|
import StartupDialog
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user