* src/ArgHandler.py: start fixing.
* src/gramps_main.py: Run ArgHandler with new arguments. svn: r5061
This commit is contained in:
parent
6356e91983
commit
4e4f558c6e
@ -1,3 +1,7 @@
|
|||||||
|
2005-08-12 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/ArgHandler.py: start fixing.
|
||||||
|
* src/gramps_main.py: Run ArgHandler with new arguments.
|
||||||
|
|
||||||
2005-08-12 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
2005-08-12 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||||
* src/MapView.py: Corrected coordinate handling; Show all location in map;
|
* src/MapView.py: Corrected coordinate handling; Show all location in map;
|
||||||
fetch locations from xearth config file
|
fetch locations from xearth config file
|
||||||
|
@ -85,8 +85,9 @@ class ArgHandler:
|
|||||||
interactive session will not be launched.
|
interactive session will not be launched.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self,parent,args):
|
def __init__(self,state,vm,args):
|
||||||
self.parent = parent
|
self.state = state
|
||||||
|
self.vm = vm
|
||||||
self.args = args
|
self.args = args
|
||||||
|
|
||||||
self.open_gui = None
|
self.open_gui = None
|
||||||
@ -221,24 +222,13 @@ class ArgHandler:
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
def auto_save_load(self,filename):
|
def auto_save_load(self,filename):
|
||||||
self.parent.active_person = None
|
|
||||||
filename = os.path.normpath(os.path.abspath(filename))
|
filename = os.path.normpath(os.path.abspath(filename))
|
||||||
filetype = GrampsMime.get_type(filename)
|
filetype = GrampsMime.get_type(filename)
|
||||||
if filetype == const.app_gramps:
|
if filetype in (const.app_gramps,
|
||||||
import GrampsBSDDB
|
const.app_gramps_xml,
|
||||||
self.parent.db.close()
|
const.app_gedcom):
|
||||||
self.parent.db = GrampsBSDDB.GrampsBSDDB()
|
print "Here"
|
||||||
return self.parent.read_file(filename)
|
return self.vm.open_native(filename,filetype)
|
||||||
elif filetype == const.app_gramps_xml:
|
|
||||||
import GrampsXMLDB
|
|
||||||
self.parent.db.close()
|
|
||||||
self.parent.db = GrampsXMLDB.GrampsXMLDB()
|
|
||||||
return self.parent.read_file(filename)
|
|
||||||
elif filetype == const.app_gedcom:
|
|
||||||
import GrampsGEDDB
|
|
||||||
self.parent.db.close()
|
|
||||||
self.parent.db = GrampsGEDDB.GrampsGEDDB()
|
|
||||||
return self.parent.read_file(filename)
|
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -20,7 +20,19 @@
|
|||||||
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# GTK+/GNOME modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
import gtk
|
import gtk
|
||||||
|
import gnome
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# GRAMPS modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
import ViewManager
|
import ViewManager
|
||||||
import PersonView
|
import PersonView
|
||||||
import RepositoryView
|
import RepositoryView
|
||||||
@ -42,8 +54,6 @@ import GrampsDbBase
|
|||||||
from GrampsMime import mime_type_is_defined
|
from GrampsMime import mime_type_is_defined
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
|
||||||
import gnome
|
|
||||||
|
|
||||||
|
|
||||||
iconpaths = [".",const.rootDir]
|
iconpaths = [".",const.rootDir]
|
||||||
|
|
||||||
@ -135,7 +145,22 @@ class Gramps:
|
|||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
return
|
return
|
||||||
|
|
||||||
ArgHandler.ArgHandler(self,args)
|
|
||||||
|
register_stock_icons()
|
||||||
|
|
||||||
|
state = GrampsDbBase.DbState()
|
||||||
|
vm = ViewManager.ViewManager(state)
|
||||||
|
vm.register_view(PersonView.PersonView)
|
||||||
|
vm.register_view(PedView.PedView)
|
||||||
|
vm.register_view(EventView.EventView)
|
||||||
|
vm.register_view(SourceView.SourceView)
|
||||||
|
vm.register_view(PlaceView.PlaceView)
|
||||||
|
vm.register_view(MapView.MapView)
|
||||||
|
vm.register_view(RepositoryView.RepositoryView)
|
||||||
|
|
||||||
|
ArgHandler.ArgHandler(state,vm,args)
|
||||||
|
|
||||||
|
vm.init_interface()
|
||||||
|
|
||||||
# Don't show main window until ArgHandler is done.
|
# Don't show main window until ArgHandler is done.
|
||||||
# This prevents a window from annoyingly popping up when
|
# This prevents a window from annoyingly popping up when
|
||||||
@ -159,20 +184,6 @@ class Gramps:
|
|||||||
# GrampsKeys.client.notify_add("/apps/gramps/preferences/date-format",
|
# GrampsKeys.client.notify_add("/apps/gramps/preferences/date-format",
|
||||||
# self.date_format_key_update)
|
# self.date_format_key_update)
|
||||||
|
|
||||||
register_stock_icons()
|
|
||||||
|
|
||||||
state = GrampsDbBase.DbState()
|
|
||||||
|
|
||||||
a = ViewManager.ViewManager(state)
|
|
||||||
a.register_view(PersonView.PersonView)
|
|
||||||
a.register_view(PedView.PedView)
|
|
||||||
a.register_view(EventView.EventView)
|
|
||||||
a.register_view(SourceView.SourceView)
|
|
||||||
a.register_view(PlaceView.PlaceView)
|
|
||||||
a.register_view(MapView.MapView)
|
|
||||||
a.register_view(RepositoryView.RepositoryView)
|
|
||||||
a.init_interface()
|
|
||||||
|
|
||||||
if GrampsKeys.get_usetips():
|
if GrampsKeys.get_usetips():
|
||||||
TipOfDay.TipOfDay(self)
|
TipOfDay.TipOfDay(self)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user