dbstate.active fixes

svn: r6255
This commit is contained in:
Don Allingham 2006-04-02 04:15:11 +00:00
parent 51b81e9bb3
commit 447f9ea7f8
10 changed files with 27 additions and 53 deletions

View File

@ -1,3 +1,14 @@
2006-04-01 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: dbstate.active fixes
* src/GrampsDb/_GrampsDbBase.py: dbstate.active fixes
* src/Exporter.py: dbstate.active fixes
* src/RelLib/_DateBase.py: remove unused stuff
* src/DisplayState.py: Remove managed window
* src/PluginUtils/_ReportUtils.py: fix check
* src/PageView.py: dbstate.active fixes
* src/ManagedWindow.py: add assertions
* autogen.sh: require automake 1.9
2006-04-01 Brian Matherly <pez4brian@users.sourceforge.net>
* src/PluginUtils/_ReportUtils.py: remove use of deprecated functions
* src/plugins/NavWebPage.py: various fixes - should work now

View File

@ -18,4 +18,4 @@ which gnome-autogen.sh || {
echo "You need to install gnome-common package."
exit 1
}
REQUIRED_AUTOMAKE_VERSION=1.6 USE_GNOME2_MACROS=1 . gnome-autogen.sh
REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh

View File

@ -301,8 +301,9 @@ class DisplayState(GrampsDb.GrampsDBCallback):
self.status.push(self.status_id,"")
else:
if Config.get_statusbar() <= 1:
pname = NameDisplay.displayer.display(self.dbstate.active)
name = "[%s] %s" % (self.dbstate.active.get_gramps_id(),pname)
person = self.dbstate.get_active_person()
pname = NameDisplay.displayer.display(person)
name = "[%s] %s" % (person.get_gramps_id(),pname)
else:
name = "" #self.display_relationship()
self.status.push(self.status_id,name)

View File

@ -85,7 +85,7 @@ class Exporter:
self.uistate = uistate
self.callback = self.uistate.pulse_progressbar
if self.dbstate.active:
self.person = self.dbstate.active
self.person = self.dbstate.get_active_person()
else:
self.person = self.dbstate.db.find_initial_person()

View File

@ -2048,6 +2048,7 @@ class DbState(GrampsDBCallback):
self.change_active_person(self.db.get_person_from_handle(handle))
def get_active_person(self):
self.active = self.db.get_person_from_handle(self.active.handle)
return self.active
def change_database(self,db):

View File

@ -278,7 +278,6 @@ class ManagedWindow:
...
"""
window_key = self.build_window_key(obj)
menu_label,submenu_label = self.build_menu_names(obj)
@ -312,6 +311,9 @@ class ManagedWindow:
# On the top level: we use gramps top window
self.parent_window = self.uistate.window
def set_window(self, window):
self.window = window
def build_menu_names(self,obj):
return ('Undefined Menu','Undefined Submenu')
@ -319,6 +321,7 @@ class ManagedWindow:
return id(self)
def show(self):
assert(self.window)
self.window.set_transient_for(self.parent_window)
self.window.show()
@ -334,4 +337,5 @@ class ManagedWindow:
"""
Present window (unroll/unminimize/bring to top).
"""
assert(self.window)
self.window.present()

View File

@ -279,9 +279,8 @@ class PersonNavView(PageView):
if not hobj.at_end():
try:
handle = hobj.forward()
self.dbstate.active = self.dbstate.db.get_person_from_handle(handle)
self.uistate.modify_statusbar()
self.dbstate.change_active_handle(handle)
self.uistate.modify_statusbar()
hobj.mhistory.append(hobj.history[hobj.index])
#self.redraw_histmenu()
self.fwd_action.set_sensitive(not hobj.at_end())

View File

@ -1320,8 +1320,8 @@ def get_birth_death_strings(database,person,empty_date="",empty_place=""):
birth_ref = person.get_birth_ref()
if birth_ref and birth_ref.ref:
if birth_ref:
birth = database.get_event_from_handle(birth_ref.ref)
birth = database.get_event_from_handle(birth_ref.ref)
if birth:
bdate = DateHandler.get_date(birth)
bplace_handle = birth.get_place_handle()
if bplace_handle:

View File

@ -66,48 +66,6 @@ class DateBase:
else:
self.date = Date().unserialize(data)
# def set_date(self, date) :
# """
# Sets the date of the DateBase instance.
# The date is parsed into a L{Date} instance.
# @param date: String representation of a date. The locale specific
# L{DateParser} is used to parse the string into a GRAMPS L{Date}
# object.
# @type date: str
# """
# self.date = DateHandler.parser.parse(date)
# def get_date(self) :
# """
# Returns a string representation of the date of the DateBase instance.
# This representation is based off the default date display format
# determined by the locale's L{DateDisplay} instance.
# @return: Returns a string representing the DateBase date
# @rtype: str
# """
# if self.date:
# return DateHandler.displayer.display(self.date)
# return u""
# def get_quote_date(self) :
# """
# Returns a string representation of the date of the DateBase instance.
# This representation is based off the default date display format
# determined by the locale's L{DateDisplay} instance. The date is
# enclosed in quotes if the L{Date} is not a valid date.
# @return: Returns a string representing the DateBase date
# @rtype: str
# """
# if self.date:
# return DateHandler.displayer.quote_display(self.date)
# return u""
def get_date_object(self):
"""
Returns the L{Date} object associated with the DateBase.

View File

@ -1113,11 +1113,11 @@ def add_gedcom_filter(chooser):
chooser.add_filter(mime_filter)
def make_report_callback(lst,dbstate):
return lambda x: Report.report(dbstate.db,dbstate.active,
return lambda x: Report.report(dbstate.db,dbstate.get_active_person(),
lst[0],lst[1],lst[2],lst[3],lst[4])
def make_tool_callback(lst,dbstate):
return lambda x: Tool.gui_tool(dbstate.db,dbstate.active,
return lambda x: Tool.gui_tool(dbstate.db,dbstate.get_active_person(),
lst[0],lst[1],lst[2],lst[3],lst[4],
dbstate.db.request_rebuild,None)