2006-05-09 Don Allingham <don@gramps-project.org>
* src/AddMedia.py: remember last directory for images for the session svn: r6602
This commit is contained in:
parent
11d3bf9868
commit
b30fc7fb24
@ -1,3 +1,7 @@
|
||||
2006-05-09 Don Allingham <don@gramps-project.org>
|
||||
* src/AddMedia.py: remember last directory for images for
|
||||
the session
|
||||
|
||||
2006-05-09 Alex Roitman <shura@gramps-project.org>
|
||||
* src/plugins/FamilyGroup.py: Use triple quotes.
|
||||
* src/Exporter.py (Exporter.native_export): Use callback.
|
||||
|
@ -58,6 +58,8 @@ import Mime
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
|
||||
_last_directory = None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# AddMediaObject
|
||||
@ -89,6 +91,9 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
self.description = self.glade.get_widget("photoDescription")
|
||||
self.image = self.glade.get_widget("image")
|
||||
self.file_text = self.glade.get_widget("fname")
|
||||
if _last_directory and os.path.isdir(_last_directory):
|
||||
self.file_text.set_current_folder(_last_directory)
|
||||
|
||||
self.internal = self.glade.get_widget('internal')
|
||||
self.internal.connect('toggled',self.internal_toggled)
|
||||
self.relpath = self.glade.get_widget('relpath')
|
||||
@ -115,6 +120,8 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
Callback function called with the save button is pressed.
|
||||
A new media object is created, and added to the database.
|
||||
"""
|
||||
global _last_directory
|
||||
|
||||
description = unicode(self.description.get_text())
|
||||
|
||||
if self.internal.get_active():
|
||||
@ -146,6 +153,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
mobj.set_mime_type(mtype)
|
||||
name = filename
|
||||
mobj.set_path(name)
|
||||
_last_directory = os.path.dirname(filename)
|
||||
|
||||
mobj.set_handle(Utils.create_id())
|
||||
if not mobj.get_gramps_id():
|
||||
@ -155,6 +163,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
self.db.commit_media_object(mobj,trans)
|
||||
self.db.transaction_commit(trans,_("Add Media Object"))
|
||||
|
||||
|
||||
def on_name_changed(self,*obj):
|
||||
"""
|
||||
Called anytime the filename text window changes. Checks to
|
||||
|
Loading…
Reference in New Issue
Block a user