* src/AddMedia.py: set title for image select dialog

* src/DbPrompter.py: set default path in database file entry box
* src/gramps_main.py: set default path in database file entry box
* src/ImageSelect.py: set default path in image select file entry box,
keep track of last directory used
* src/Report.py: set default path in report file entry box
* src/imagesel.glade: enlarge image select dialog box


svn: r1997
This commit is contained in:
Don Allingham 2003-08-13 04:28:07 +00:00
parent 880dc551ae
commit de7f76b347
8 changed files with 40 additions and 16 deletions

View File

@ -82,6 +82,9 @@ class AddMediaObject:
self.update = update self.update = update
self.temp_name = "" self.temp_name = ""
Utils.set_titles(self.window,self.glade.get_widget('title'),
_('Select a media object'))
self.glade.signal_autoconnect({ self.glade.signal_autoconnect({
"on_savephoto_clicked" : self.on_savephoto_clicked, "on_savephoto_clicked" : self.on_savephoto_clicked,
"on_name_changed" : self.on_name_changed, "on_name_changed" : self.on_name_changed,

View File

@ -118,7 +118,11 @@ class DbPrompter:
self.dbname = wFs.get_widget("dbname") self.dbname = wFs.get_widget("dbname")
self.getoldrev = wFs.get_widget("getoldrev") self.getoldrev = wFs.get_widget("getoldrev")
self.dbname.set_default_path(GrampsCfg.db_dir) if GrampsCfg.db_dir:
self.dbname.set_default_path(GrampsCfg.db_dir)
self.dbname.set_filename(GrampsCfg.db_dir)
self.photosel.gtk_entry().set_position(len(GrampsCfg.db_dir))
self.getoldrev.set_sensitive(GrampsCfg.usevc) self.getoldrev.set_sensitive(GrampsCfg.usevc)
def cancel_button_clicked(self,obj): def cancel_button_clicked(self,obj):

View File

@ -733,6 +733,11 @@ class FamilyView:
id = self.child_model.get_value(iter,2) id = self.child_model.get_value(iter,2)
self.parent.change_active_person(self.parent.db.getPerson(id)) self.parent.change_active_person(self.parent.db.getPerson(id))
self.load_family() self.load_family()
else:
list = self.family.getChildList()
if len(list) == 1:
self.parent.change_active_person(list[0])
self.load_family()
def parent_editor(self,person,selection): def parent_editor(self,person,selection):
if not person: if not person:

View File

@ -57,7 +57,7 @@ _IMAGEX = 140
_IMAGEY = 150 _IMAGEY = 150
_PAD = 5 _PAD = 5
_last_path = ""
_iconlist_refs = [] _iconlist_refs = []
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -67,8 +67,6 @@ _iconlist_refs = []
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class ImageSelect: class ImageSelect:
last_path = ""
def __init__(self, path, db, parent): def __init__(self, path, db, parent):
"""Creates an edit window. Associates a person with the window.""" """Creates an edit window. Associates a person with the window."""
self.path = path; self.path = path;
@ -101,6 +99,7 @@ class ImageSelect:
self.image = self.glade.get_widget("image") self.image = self.glade.get_widget("image")
self.description = self.glade.get_widget("photoDescription") self.description = self.glade.get_widget("photoDescription")
self.external = self.glade.get_widget("private") self.external = self.glade.get_widget("private")
self.photosel = self.glade.get_widget("photosel")
self.temp_name = "" self.temp_name = ""
Utils.set_titles(window,self.glade.get_widget('title'), Utils.set_titles(window,self.glade.get_widget('title'),
@ -112,8 +111,10 @@ class ImageSelect:
"destroy_passed_object" : Utils.destroy_passed_object "destroy_passed_object" : Utils.destroy_passed_object
}) })
if ImageSelect.last_path != "": if os.path.isdir(_last_path):
self.glade.get_widget("photosel").set_default_path(ImageSelect.last_path) self.photosel.set_default_path(_last_path)
self.photosel.set_filename(_last_path)
self.photosel.gtk_entry().set_position(len(_last_path))
window.show() window.show()
def on_name_changed(self, obj): def on_name_changed(self, obj):
@ -139,8 +140,10 @@ class ImageSelect:
def on_savephoto_clicked(self, obj): def on_savephoto_clicked(self, obj):
"""Save the photo in the dataobj object. (Required function)""" """Save the photo in the dataobj object. (Required function)"""
filename = self.glade.get_widget("photosel").get_full_path(0) global _last_path
ImageSelect.last_path = os.path.dirname(filename)
filename = self.photosel.get_full_path(0)
_last_path = os.path.dirname(filename)
description = self.description.get_text() description = self.description.get_text()

View File

@ -293,15 +293,23 @@ class PedigreeView:
# Build and display the menu attached to the left pointing arrow # Build and display the menu attached to the left pointing arrow
# button. The menu consists of the children of the current root # button. The menu consists of the children of the current root
# person of the tree. Attach a child to each menu item. # person of the tree. Attach a child to each menu item.
myMenu = gtk.Menu()
childlist = []
for family in self.active_person.getFamilyList(): for family in self.active_person.getFamilyList():
for child in family.getChildList(): for child in family.getChildList():
childlist.append(child)
if len(childlist) == 1:
self.load_canvas(childlist[0])
elif len(childlist) > 1:
myMenu = gtk.Menu()
for child in childlist:
menuitem = gtk.MenuItem(GrampsCfg.nameof(child)) menuitem = gtk.MenuItem(GrampsCfg.nameof(child))
myMenu.append(menuitem) myMenu.append(menuitem)
menuitem.set_data(_PERSON,child) menuitem.set_data(_PERSON,child)
menuitem.connect("activate",self.on_childmenu_changed) menuitem.connect("activate",self.on_childmenu_changed)
menuitem.show() menuitem.show()
myMenu.popup(None,None,None,0,0) myMenu.popup(None,None,None,0,0)
return 1 return 1
def on_childmenu_changed(self,obj): def on_childmenu_changed(self,obj):

View File

@ -939,8 +939,10 @@ class ReportDialog(BareReportDialog):
self.col += 1 self.col += 1
spath = self.get_default_directory() spath = self.get_default_directory()
self.target_fileentry.set_default_path(spath)
self.target_fileentry.set_default_path(spath)
self.target_fileentry.set_filename(spath)
self.target_fileentry.gtk_entry().set_position(len(spath))
def setup_format_frame(self): def setup_format_frame(self):
"""Set up the format frame of the dialog. This function """Set up the format frame of the dialog. This function

View File

@ -1494,6 +1494,9 @@ class Gramps:
getoldrev = wFs.get_widget("getoldrev") getoldrev = wFs.get_widget("getoldrev")
fileSelector.set_data("dbname",dbname) fileSelector.set_data("dbname",dbname)
dbname.set_default_path(GrampsCfg.db_dir) dbname.set_default_path(GrampsCfg.db_dir)
dbname.set_filename(GrampsCfg.db_dir)
dbname.gtk_entry().set_position(len(GrampsCfg.db_dir))
fileSelector.set_data("getoldrev",getoldrev) fileSelector.set_data("getoldrev",getoldrev)
getoldrev.set_sensitive(GrampsCfg.usevc) getoldrev.set_sensitive(GrampsCfg.usevc)
fileSelector.show() fileSelector.show()

View File

@ -10,7 +10,7 @@
<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">False</property>
<property name="default_width">400</property> <property name="default_width">500</property>
<property name="resizable">True</property> <property name="resizable">True</property>
<property name="destroy_with_parent">False</property> <property name="destroy_with_parent">False</property>
<property name="icon">gramps.png</property> <property name="icon">gramps.png</property>
@ -735,8 +735,6 @@
<property name="show_border">True</property> <property name="show_border">True</property>
<property name="tab_pos">GTK_POS_TOP</property> <property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property> <property name="scrollable">False</property>
<property name="tab_hborder">2</property>
<property name="tab_vborder">2</property>
<property name="enable_popup">False</property> <property name="enable_popup">False</property>
<child> <child>
@ -1410,8 +1408,6 @@
<property name="show_border">True</property> <property name="show_border">True</property>
<property name="tab_pos">GTK_POS_TOP</property> <property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property> <property name="scrollable">False</property>
<property name="tab_hborder">2</property>
<property name="tab_vborder">2</property>
<property name="enable_popup">False</property> <property name="enable_popup">False</property>
<signal name="switch_page" handler="on_notebook_switch_page"/> <signal name="switch_page" handler="on_notebook_switch_page"/>