* 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 724d66ee19
commit 3795edd1d4
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> 2003-09-07 Don Allingham <dallingham@users.sourceforge.net>
* src/gramps_main.py: re-present the open dialog box on * src/gramps_main.py: re-present the open dialog box on
a failure to open a file. a failure to open a file.

View File

@ -51,14 +51,16 @@ except:
class DbPrompter: class DbPrompter:
"""Make sure a database is opened""" """Make sure a database is opened"""
def __init__(self,db,want_new): def __init__(self,db,want_new,parent=None):
self.db = db self.db = db
self.want_new = want_new self.want_new = want_new
self.parent = parent
self.show() self.show()
def show(self): def show(self):
opendb = gtk.glade.XML(const.gladeFile, "opendb","gramps") opendb = gtk.glade.XML(const.gladeFile, "opendb","gramps")
top = opendb.get_widget('opendb') top = opendb.get_widget('opendb')
top.set_transient_for(self.parent)
title = opendb.get_widget('title') title = opendb.get_widget('title')
Utils.set_titles(top,title,_('Open a database')) Utils.set_titles(top,title,_('Open a database'))

View File

@ -6381,7 +6381,7 @@
<property name="title" translatable="yes"></property> <property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</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_width">300</property>
<property name="default_height">200</property> <property name="default_height">200</property>
<property name="resizable">True</property> <property name="resizable">True</property>

View File

@ -967,7 +967,7 @@ class Gramps:
def new_database_response(self): def new_database_response(self):
import DbPrompter import DbPrompter
DbPrompter.DbPrompter(self,1) DbPrompter.DbPrompter(self,1,self.topWindow)
def clear_person_tabs(self): def clear_person_tabs(self):
@ -1173,7 +1173,7 @@ class Gramps:
filename = os.path.dirname(filename) filename = os.path.dirname(filename)
elif not os.path.isdir(filename): elif not os.path.isdir(filename):
import DbPrompter import DbPrompter
DbPrompter.DbPrompter(self,0) DbPrompter.DbPrompter(self,0,self.topWindow)
self.displayError(_("Database could not be opened"), self.displayError(_("Database could not be opened"),
_("%s is not a directory.") % filename + ' ' + \ _("%s is not a directory.") % filename + ' ' + \
_("You should select a directory that contains a " _("You should select a directory that contains a "
@ -1451,7 +1451,7 @@ class Gramps:
if os.path.exists(filename): if os.path.exists(filename):
if not os.path.isdir(filename): if not os.path.isdir(filename):
import DbPrompter import DbPrompter
DbPrompter.DbPrompter(self,0) DbPrompter.DbPrompter(self,0,self.topWindow)
self.displayError(_("Database could not be opened"), self.displayError(_("Database could not be opened"),
_("%s is not a directory.") % filename + ' ' + \ _("%s is not a directory.") % filename + ' ' + \
_("You should select a directory that contains a " _("You should select a directory that contains a "