* 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
This commit is contained in:
Alex Roitman 2003-09-08 04:12:43 +00:00
parent e6a9bbbba2
commit 727cbff2da
4 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2003-09-07 Alex Roitman <shura@alex.neuro.umn.edu>
* 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 <dallingham@users.sourceforge.net>
* src/gramps_main.py: re-present the open dialog box on
a failure to open a file.

View File

@ -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'))

View File

@ -6381,7 +6381,7 @@
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="modal">True</property>
<property name="default_width">300</property>
<property name="default_height">200</property>
<property name="resizable">True</property>

View File

@ -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 "