* src/DataViews/PersonView.py: don't crash on click, 1794

* src/PageView.py: don't crash on click, #1794

2008-02-28  Benny Malengier <benny.malengier@gramps-project.org>


svn: r10139
This commit is contained in:
Benny Malengier 2008-02-28 23:13:07 +00:00
parent b1561e5f78
commit 979ea11f3d
3 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2008-02-28 Benny Malengier <benny.malengier@gramps-project.org>
* src/DataViews/PersonView.py: don't crash on click, 1794
* src/PageView.py: don't crash on click, #1794
2008-02-28 Benny Malengier <benny.malengier@gramps-project.org> 2008-02-28 Benny Malengier <benny.malengier@gramps-project.org>
* src/ViewManager.py: allow for info dialog after import * src/ViewManager.py: allow for info dialog after import
* src/gen/db/base.py: find returns if new object or not * src/gen/db/base.py: find returns if new object or not

View File

@ -820,6 +820,8 @@ class PersonView(PageView.PersonNavView):
self.selection.select_path(path) self.selection.select_path(path)
def _button_press(self, obj, event): def _button_press(self, obj, event):
if not self.dbstate.open:
return False
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
handle = self.first_selected() handle = self.first_selected()
person = self.dbstate.db.get_person_from_handle(handle) person = self.dbstate.db.get_person_from_handle(handle)
@ -865,6 +867,8 @@ class PersonView(PageView.PersonNavView):
return False return False
def _key_press(self, obj, event): def _key_press(self, obj, event):
if not self.dbstate.open:
return False
if not event.state or event.state in (gtk.gdk.MOD2_MASK, ): if not event.state or event.state in (gtk.gdk.MOD2_MASK, ):
if event.keyval in (gtk.keysyms.Return, gtk.keysyms.KP_Enter): if event.keyval in (gtk.keysyms.Return, gtk.keysyms.KP_Enter):
if self.dbstate.active: if self.dbstate.active:

View File

@ -950,6 +950,8 @@ class ListView(BookMarkView):
raise NotImplemented raise NotImplemented
def _button_press(self, obj, event): def _button_press(self, obj, event):
if not self.dbstate.open:
return False
from QuickReports import create_quickreport_menu from QuickReports import create_quickreport_menu
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
self.edit(obj) self.edit(obj)
@ -983,6 +985,8 @@ class ListView(BookMarkView):
return False return False
def _key_press(self, obj, event): def _key_press(self, obj, event):
if not self.dbstate.open:
return False
if not event.state or event.state in (gtk.gdk.MOD2_MASK, ): if not event.state or event.state in (gtk.gdk.MOD2_MASK, ):
if event.keyval in (gtk.keysyms.Return, gtk.keysyms.KP_Enter): if event.keyval in (gtk.keysyms.Return, gtk.keysyms.KP_Enter):
self.edit(obj) self.edit(obj)