* 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:
parent
215c831fef
commit
a5d499fe20
@ -81,6 +81,9 @@ class AddMediaObject:
|
||||
self.file_text = self.glade.get_widget("fname")
|
||||
self.update = update
|
||||
self.temp_name = ""
|
||||
|
||||
Utils.set_titles(self.window,self.glade.get_widget('title'),
|
||||
_('Select a media object'))
|
||||
|
||||
self.glade.signal_autoconnect({
|
||||
"on_savephoto_clicked" : self.on_savephoto_clicked,
|
||||
|
@ -118,7 +118,11 @@ class DbPrompter:
|
||||
|
||||
self.dbname = wFs.get_widget("dbname")
|
||||
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)
|
||||
|
||||
def cancel_button_clicked(self,obj):
|
||||
|
@ -733,6 +733,11 @@ class FamilyView:
|
||||
id = self.child_model.get_value(iter,2)
|
||||
self.parent.change_active_person(self.parent.db.getPerson(id))
|
||||
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):
|
||||
if not person:
|
||||
|
@ -57,7 +57,7 @@ _IMAGEX = 140
|
||||
_IMAGEY = 150
|
||||
_PAD = 5
|
||||
|
||||
|
||||
_last_path = ""
|
||||
_iconlist_refs = []
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -67,8 +67,6 @@ _iconlist_refs = []
|
||||
#-------------------------------------------------------------------------
|
||||
class ImageSelect:
|
||||
|
||||
last_path = ""
|
||||
|
||||
def __init__(self, path, db, parent):
|
||||
"""Creates an edit window. Associates a person with the window."""
|
||||
self.path = path;
|
||||
@ -101,6 +99,7 @@ class ImageSelect:
|
||||
self.image = self.glade.get_widget("image")
|
||||
self.description = self.glade.get_widget("photoDescription")
|
||||
self.external = self.glade.get_widget("private")
|
||||
self.photosel = self.glade.get_widget("photosel")
|
||||
self.temp_name = ""
|
||||
|
||||
Utils.set_titles(window,self.glade.get_widget('title'),
|
||||
@ -112,8 +111,10 @@ class ImageSelect:
|
||||
"destroy_passed_object" : Utils.destroy_passed_object
|
||||
})
|
||||
|
||||
if ImageSelect.last_path != "":
|
||||
self.glade.get_widget("photosel").set_default_path(ImageSelect.last_path)
|
||||
if os.path.isdir(_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()
|
||||
|
||||
def on_name_changed(self, obj):
|
||||
@ -139,8 +140,10 @@ class ImageSelect:
|
||||
|
||||
def on_savephoto_clicked(self, obj):
|
||||
"""Save the photo in the dataobj object. (Required function)"""
|
||||
filename = self.glade.get_widget("photosel").get_full_path(0)
|
||||
ImageSelect.last_path = os.path.dirname(filename)
|
||||
global _last_path
|
||||
|
||||
filename = self.photosel.get_full_path(0)
|
||||
_last_path = os.path.dirname(filename)
|
||||
|
||||
description = self.description.get_text()
|
||||
|
||||
|
@ -293,15 +293,23 @@ class PedigreeView:
|
||||
# Build and display the menu attached to the left pointing arrow
|
||||
# button. The menu consists of the children of the current root
|
||||
# person of the tree. Attach a child to each menu item.
|
||||
myMenu = gtk.Menu()
|
||||
|
||||
childlist = []
|
||||
for family in self.active_person.getFamilyList():
|
||||
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))
|
||||
myMenu.append(menuitem)
|
||||
menuitem.set_data(_PERSON,child)
|
||||
menuitem.connect("activate",self.on_childmenu_changed)
|
||||
menuitem.show()
|
||||
myMenu.popup(None,None,None,0,0)
|
||||
myMenu.popup(None,None,None,0,0)
|
||||
return 1
|
||||
|
||||
def on_childmenu_changed(self,obj):
|
||||
|
@ -939,8 +939,10 @@ class ReportDialog(BareReportDialog):
|
||||
self.col += 1
|
||||
|
||||
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):
|
||||
"""Set up the format frame of the dialog. This function
|
||||
|
@ -1494,6 +1494,9 @@ class Gramps:
|
||||
getoldrev = wFs.get_widget("getoldrev")
|
||||
fileSelector.set_data("dbname",dbname)
|
||||
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)
|
||||
getoldrev.set_sensitive(GrampsCfg.usevc)
|
||||
fileSelector.show()
|
||||
|
@ -10,7 +10,7 @@
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</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="destroy_with_parent">False</property>
|
||||
<property name="icon">gramps.png</property>
|
||||
@ -735,8 +735,6 @@
|
||||
<property name="show_border">True</property>
|
||||
<property name="tab_pos">GTK_POS_TOP</property>
|
||||
<property name="scrollable">False</property>
|
||||
<property name="tab_hborder">2</property>
|
||||
<property name="tab_vborder">2</property>
|
||||
<property name="enable_popup">False</property>
|
||||
|
||||
<child>
|
||||
@ -1410,8 +1408,6 @@
|
||||
<property name="show_border">True</property>
|
||||
<property name="tab_pos">GTK_POS_TOP</property>
|
||||
<property name="scrollable">False</property>
|
||||
<property name="tab_hborder">2</property>
|
||||
<property name="tab_vborder">2</property>
|
||||
<property name="enable_popup">False</property>
|
||||
<signal name="switch_page" handler="on_notebook_switch_page"/>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user