* src/gramps_main.py (back_pressed, fwd_pressed): Pass event to the
build_menu functions; (build_backhistmenu, build_fwdhistmenu): Use event for popping the menu. * NEWS, TODO: catch up with the current CVS state. * src/Utils.py (history_broken, clearHistory_broken, wasHistory_broken): Add functions. * src/plugins/ReorderIds.py(__init__): Call Utils.history_broken upon reordering. * src/gramps_main.py (clear_history): Add function; (redraw_histmenu, fwd_clicked, back_clicked): Clear history if catching an exception (should be actually handled by reorder plugin, leaving here svn: r2320
This commit is contained in:
parent
9b5aafc260
commit
ab6f7ac74f
@ -1,3 +1,21 @@
|
||||
2003-11-06 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||
* src/gramps_main.py (back_pressed, fwd_pressed): Pass event to the
|
||||
build_menu functions; (build_backhistmenu, build_fwdhistmenu): Use
|
||||
event for popping the menu.
|
||||
|
||||
* NEWS, TODO: catch up with the current CVS state.
|
||||
|
||||
* src/Utils.py (history_broken, clearHistory_broken, wasHistory_broken):
|
||||
Add functions.
|
||||
* src/plugins/ReorderIds.py(__init__): Call Utils.history_broken upon
|
||||
reordering.
|
||||
* src/gramps_main.py (clear_history): Add function;
|
||||
(redraw_histmenu, fwd_clicked, back_clicked): Clear history if catching
|
||||
an exception (should be actually handled by reorder plugin, leaving here
|
||||
just in case);
|
||||
(bookmark_callback): Display warning if catching an exception. Should
|
||||
never be reached if reorder properly handles broken history.
|
||||
|
||||
2003-11-05 Tim Waugh <twaugh@redhat.com>
|
||||
|
||||
* src/PlaceView.py (PlaceView.goto): Scroll to found item.
|
||||
|
@ -8,8 +8,15 @@ Version 0.98.0
|
||||
* When choosing parents, select the spouse of the first selected person to
|
||||
make picking a family quicker.
|
||||
* Instant preferences.
|
||||
* FreeBSD compatibility.
|
||||
* People and Relationships can now have sources not associated with any
|
||||
event
|
||||
* Report options (paper size, orientation, style, and filter) are kept
|
||||
within the session.
|
||||
* Substantial speedups in updating display in tree views.
|
||||
* Children are enumerated in Family View.
|
||||
* ZODB backend is removed. Reald database backend is being worked on and will
|
||||
appear in post-1.0 releases.
|
||||
* Bugfixes.
|
||||
|
||||
Version 0.9.5 -- the "Fix me up" release
|
||||
|
@ -12,7 +12,6 @@
|
||||
* Startup tips.
|
||||
* Date calculator.
|
||||
See http://sourceforge.net/mailarchive/forum.php?thread_id=3252078&forum_id=1993
|
||||
* Save report options settings.
|
||||
* Add sequence number to childlist in family view
|
||||
* Add string substitutions for web page generation (name, report name,
|
||||
date, etc).
|
||||
|
@ -18,6 +18,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Standard python modules
|
||||
@ -56,6 +58,7 @@ from gettext import gettext as _
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_modifiedFlag = 0
|
||||
_history_brokenFlag = 0
|
||||
_autotime_val = 1
|
||||
_autosave_fun = None
|
||||
_autosave_tim = None
|
||||
@ -94,6 +97,10 @@ def clear_timer():
|
||||
gtk.timeout_remove(_autosave_tim)
|
||||
_autosave_tim = None
|
||||
|
||||
def history_broken():
|
||||
global _history_brokenFlag
|
||||
_history_brokenFlag = 1
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# force_unicode
|
||||
@ -116,6 +123,10 @@ def clearModified():
|
||||
global _modifiedFlag
|
||||
_modifiedFlag = 0
|
||||
|
||||
def clearHistory_broken():
|
||||
global _history_brokenFlag
|
||||
_history_brokenFlag = 0
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Returns the modified flag
|
||||
@ -124,6 +135,9 @@ def clearModified():
|
||||
def wasModified():
|
||||
return _modifiedFlag
|
||||
|
||||
def wasHistory_broken():
|
||||
return _history_brokenFlag
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Short hand function to return either the person's name, or an empty
|
||||
|
@ -350,6 +350,16 @@ class Gramps:
|
||||
self.topWindow.show()
|
||||
self.enable_toolbar(self.use_toolbar)
|
||||
|
||||
def clear_history(self):
|
||||
self.history = []
|
||||
self.mhistory = []
|
||||
self.hindex = -1
|
||||
self.back.set_sensitive(0)
|
||||
self.forward.set_sensitive(0)
|
||||
self.backbtn.set_sensitive(0)
|
||||
self.fwdbtn.set_sensitive(0)
|
||||
self.redraw_histmenu()
|
||||
|
||||
def redraw_histmenu(self):
|
||||
"""Create the history submenu of the Go menu"""
|
||||
|
||||
@ -415,14 +425,12 @@ class Gramps:
|
||||
self.back.set_sensitive(0)
|
||||
self.forward.set_sensitive(0)
|
||||
except:
|
||||
self.history = []
|
||||
self.back.set_sensitive(0)
|
||||
self.forward.set_sensitive(0)
|
||||
self.clear_history
|
||||
|
||||
self.gomenuitem.remove_submenu()
|
||||
self.gomenuitem.set_submenu(gomenu)
|
||||
|
||||
def build_backhistmenu(self):
|
||||
def build_backhistmenu(self,event):
|
||||
"""Builds and displays the menu with the back portion of the history"""
|
||||
if self.hindex > 0:
|
||||
backhistmenu = gtk.Menu()
|
||||
@ -445,13 +453,13 @@ class Gramps:
|
||||
item.show()
|
||||
backhistmenu.append(item)
|
||||
num = num + 1
|
||||
backhistmenu.popup(None,None,None,0,0)
|
||||
backhistmenu.popup(None,None,None,event.button,event.time)
|
||||
|
||||
def back_pressed(self,obj,event):
|
||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||
self.build_backhistmenu()
|
||||
self.build_backhistmenu(event)
|
||||
|
||||
def build_fwdhistmenu(self):
|
||||
def build_fwdhistmenu(self,event):
|
||||
"""Builds and displays the menu with the forward portion of the history"""
|
||||
if self.hindex < len(self.history)-1:
|
||||
fwdhistmenu = gtk.Menu()
|
||||
@ -473,11 +481,11 @@ class Gramps:
|
||||
item.show()
|
||||
fwdhistmenu.append(item)
|
||||
num = num + 1
|
||||
fwdhistmenu.popup(None,None,None,0,0)
|
||||
fwdhistmenu.popup(None,None,None,event.button,event.time)
|
||||
|
||||
def fwd_pressed(self,obj,event):
|
||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||
self.build_fwdhistmenu()
|
||||
self.build_fwdhistmenu(event)
|
||||
|
||||
def set_buttons(self,val):
|
||||
self.report_menu.set_sensitive(val)
|
||||
@ -509,7 +517,7 @@ class Gramps:
|
||||
self.fwdbtn.set_sensitive(1)
|
||||
self.forward.set_sensitive(1)
|
||||
except:
|
||||
self.set_buttons(0)
|
||||
self.clear_history
|
||||
else:
|
||||
self.backbtn.set_sensitive(0)
|
||||
self.back.set_sensitive(0)
|
||||
@ -535,9 +543,7 @@ class Gramps:
|
||||
self.backbtn.set_sensitive(1)
|
||||
self.back.set_sensitive(1)
|
||||
except:
|
||||
self.backbtn.set_sensitive(1)
|
||||
self.back.set_sensitive(1)
|
||||
self.set_buttons(0)
|
||||
self.clear_history
|
||||
else:
|
||||
self.fwdbtn.set_sensitive(0)
|
||||
self.forward.set_sensitive(0)
|
||||
@ -893,6 +899,9 @@ class Gramps:
|
||||
def import_tool_callback(self):
|
||||
Utils.modified()
|
||||
self.people_view.clear_person_tabs()
|
||||
if Utils.wasHistory_broken():
|
||||
self.clear_history()
|
||||
Utils.clearHistory_broken()
|
||||
if not self.active_person:
|
||||
self.change_active_person(self.find_initial_person())
|
||||
self.goto_active_person()
|
||||
@ -1743,8 +1752,16 @@ class Gramps:
|
||||
self.bookmarks.edit()
|
||||
|
||||
def bookmark_callback(self,obj,person):
|
||||
old_person = self.active_person
|
||||
try:
|
||||
self.change_active_person(person)
|
||||
self.update_display(0)
|
||||
except TypeError:
|
||||
WarningDialog(_("Could Not Go to a Person"),
|
||||
_("Either stale bookmark or broken history caused by IDs reorder."))
|
||||
self.clear_history()
|
||||
self.change_active_person(old_person)
|
||||
self.update_display(0)
|
||||
|
||||
def on_default_person_activate(self,obj):
|
||||
if self.active_person:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000 Donald N. Allingham
|
||||
# Copyright (C) 2000-2003 Donald N. Allingham
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -18,6 +18,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Change id IDs of all the elements in the database to conform to the
|
||||
scheme specified in the database's prefix ids
|
||||
@ -49,6 +51,7 @@ class ReorderIds:
|
||||
self.reorder(db.getSourceMap(),db.sprefix,db.buildSourceDisplay)
|
||||
self.reorder(db.getPlaceMap(),db.pprefix,db.buildPlaceDisplay)
|
||||
Utils.modified()
|
||||
Utils.history_broken()
|
||||
callback(1)
|
||||
|
||||
def reorder(self,data_map,prefix,update):
|
||||
|
Loading…
Reference in New Issue
Block a user