2007-03-29 Don Allingham <don@gramps-project.org>

* src/ViewManager.py: load previous db if requested
	* src/gramps_main.py: load previous db if requested
	* src/ArgHandler.py: load previous db if requested



svn: r8340
This commit is contained in:
Don Allingham 2007-03-30 04:23:46 +00:00
parent 698c28f230
commit 2002d9a1ba
4 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2007-03-29 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: load previous db if requested
* src/gramps_main.py: load previous db if requested
* src/ArgHandler.py: load previous db if requested
2007-03-29 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_ReportOptions.py
* src/ReportBase/_Report.py

View File

@ -444,9 +444,13 @@ class ArgHandler:
elif Config.get(Config.RECENT_FILE) and Config.get(Config.AUTOLOAD):
rf = Config.get(Config.RECENT_FILE)
if os.path.isfile(rf):
filetype = Mime.get_type(rf)
self.vm.read_recent_file(rf,filetype)
self.vm.read_recent_file(rf, filetype)
elif os.path.isdir(rf):
if os.path.isfile(os.path.join(rf, "name.txt")):
self.vm.read_recent_file(rf, 'x-directory/normal')
#-------------------------------------------------------------------------
#

View File

@ -999,7 +999,17 @@ class ViewManager:
def read_recent_file(self, filename, filetype):
if self.db_loader.read_file(filename, filetype):
self.post_load_newdb(filename, filetype)
# Attempt to figure out the database title
path = os.path.join(filename, "name.txt")
try:
f = open(path)
title = f.readline().strip()
f.close()
except:
title = filename
self.post_load_newdb(filename, filetype, title)
def post_load(self):
# This method is for the common UI post_load, both new files
@ -1060,7 +1070,8 @@ class ViewManager:
self.state.db.enable_signals()
self.state.signal_change()
#Config.set(Config.RECENT_FILE, filename)
print filename
Config.set(Config.RECENT_FILE, filename)
self.relationship = self.RelClass(self.state.db)

View File

@ -238,8 +238,8 @@ class Gramps:
# we may need to change the order of operation
ah = ArgHandler.ArgHandler(state,self.vm,args)
if ah.need_gui():
self.vm.post_init_interface()
ah.handle_args()
self.vm.post_init_interface()
else:
ah.handle_args()
self.vm.post_init_interface()