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:
@@ -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>
|
2007-03-29 Brian Matherly <brian@gramps-project.org>
|
||||||
* src/ReportBase/_ReportOptions.py
|
* src/ReportBase/_ReportOptions.py
|
||||||
* src/ReportBase/_Report.py
|
* src/ReportBase/_Report.py
|
||||||
|
@@ -444,9 +444,13 @@ class ArgHandler:
|
|||||||
|
|
||||||
elif Config.get(Config.RECENT_FILE) and Config.get(Config.AUTOLOAD):
|
elif Config.get(Config.RECENT_FILE) and Config.get(Config.AUTOLOAD):
|
||||||
rf = Config.get(Config.RECENT_FILE)
|
rf = Config.get(Config.RECENT_FILE)
|
||||||
|
|
||||||
if os.path.isfile(rf):
|
if os.path.isfile(rf):
|
||||||
filetype = Mime.get_type(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')
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@@ -999,7 +999,17 @@ class ViewManager:
|
|||||||
|
|
||||||
def read_recent_file(self, filename, filetype):
|
def read_recent_file(self, filename, filetype):
|
||||||
if self.db_loader.read_file(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):
|
def post_load(self):
|
||||||
# This method is for the common UI post_load, both new files
|
# 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.db.enable_signals()
|
||||||
self.state.signal_change()
|
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)
|
self.relationship = self.RelClass(self.state.db)
|
||||||
|
|
||||||
|
@@ -238,8 +238,8 @@ class Gramps:
|
|||||||
# we may need to change the order of operation
|
# we may need to change the order of operation
|
||||||
ah = ArgHandler.ArgHandler(state,self.vm,args)
|
ah = ArgHandler.ArgHandler(state,self.vm,args)
|
||||||
if ah.need_gui():
|
if ah.need_gui():
|
||||||
self.vm.post_init_interface()
|
|
||||||
ah.handle_args()
|
ah.handle_args()
|
||||||
|
self.vm.post_init_interface()
|
||||||
else:
|
else:
|
||||||
ah.handle_args()
|
ah.handle_args()
|
||||||
self.vm.post_init_interface()
|
self.vm.post_init_interface()
|
||||||
|
Reference in New Issue
Block a user