From 727cbff2da7973fa616dbca7ae45de347b7d0076 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 8 Sep 2003 04:12:43 +0000 Subject: [PATCH] * src/gramps_main.py (new_database_response,read_file,save_file): Pass parent window to DbPrompter. * src/DbPrompter.py (__init__): Accept optional parent argument; (show): Make the window the transient for the main window. * src/gramps.glade: Make Opendb dialog modal. svn: r2103 --- ChangeLog | 7 +++++++ src/DbPrompter.py | 4 +++- src/gramps.glade | 2 +- src/gramps_main.py | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 166193473..a0636a295 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-09-07 Alex Roitman + * src/gramps_main.py (new_database_response,read_file,save_file): + Pass parent window to DbPrompter. + * src/DbPrompter.py (__init__): Accept optional parent argument; + (show): Make the window the transient for the main window. + * src/gramps.glade: Make Opendb dialog modal. + 2003-09-07 Don Allingham * src/gramps_main.py: re-present the open dialog box on a failure to open a file. diff --git a/src/DbPrompter.py b/src/DbPrompter.py index a5c5717b6..7a5355a0c 100644 --- a/src/DbPrompter.py +++ b/src/DbPrompter.py @@ -51,14 +51,16 @@ except: class DbPrompter: """Make sure a database is opened""" - def __init__(self,db,want_new): + def __init__(self,db,want_new,parent=None): self.db = db self.want_new = want_new + self.parent = parent self.show() def show(self): opendb = gtk.glade.XML(const.gladeFile, "opendb","gramps") top = opendb.get_widget('opendb') + top.set_transient_for(self.parent) title = opendb.get_widget('title') Utils.set_titles(top,title,_('Open a database')) diff --git a/src/gramps.glade b/src/gramps.glade index d34c46c01..d306ba860 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -6381,7 +6381,7 @@ GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - False + True 300 200 True diff --git a/src/gramps_main.py b/src/gramps_main.py index 976dd5003..cf4a163cb 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -967,7 +967,7 @@ class Gramps: def new_database_response(self): import DbPrompter - DbPrompter.DbPrompter(self,1) + DbPrompter.DbPrompter(self,1,self.topWindow) def clear_person_tabs(self): @@ -1173,7 +1173,7 @@ class Gramps: filename = os.path.dirname(filename) elif not os.path.isdir(filename): import DbPrompter - DbPrompter.DbPrompter(self,0) + DbPrompter.DbPrompter(self,0,self.topWindow) self.displayError(_("Database could not be opened"), _("%s is not a directory.") % filename + ' ' + \ _("You should select a directory that contains a " @@ -1451,7 +1451,7 @@ class Gramps: if os.path.exists(filename): if not os.path.isdir(filename): import DbPrompter - DbPrompter.DbPrompter(self,0) + DbPrompter.DbPrompter(self,0,self.topWindow) self.displayError(_("Database could not be opened"), _("%s is not a directory.") % filename + ' ' + \ _("You should select a directory that contains a "