2007-11-27 Benny Malengier <benny.malengier@gramps-project.org>
* src/glade/gramps.glade: remove internal from addmedia * src/AddMedia.py: remove internal * src/Editors/_EditMedia.py: remove internal note code Note: no upgrade code for this. Old internal notes will be connected to a media object with type 'Note' and have as type 'Media Note', up to the case a user deletes these media and changes note type to eg report or changes the path to a real media object. svn: r9418
This commit is contained in:
parent
cbffb044c5
commit
4fb394530e
@ -1,3 +1,12 @@
|
||||
2007-11-27 Benny Malengier <benny.malengier@gramps-project.org>
|
||||
* src/glade/gramps.glade: remove internal from addmedia
|
||||
* src/AddMedia.py: remove internal
|
||||
* src/Editors/_EditMedia.py: remove internal note code
|
||||
Note: no upgrade code for this. Old internal notes will be connected to
|
||||
a media object with type 'Note' and have as type 'Media Note',
|
||||
up to the case a user deletes these media and changes note type to eg
|
||||
report or changes the path to a real media object.
|
||||
|
||||
2007-11-27 Jerome Rapinat <romjerome@yahoo.fr>
|
||||
* src/TipOfDay.py: remove uneeded sax escape, issue #1368
|
||||
|
||||
|
@ -102,8 +102,6 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
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')
|
||||
self.relpath.set_active(_relative_path)
|
||||
self.temp_name = ""
|
||||
@ -119,12 +117,6 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
return(_('Select media object'), None)
|
||||
|
||||
def internal_toggled(self, obj):
|
||||
"""
|
||||
Toggles the file_text icon.
|
||||
"""
|
||||
self.file_text.set_sensitive(not obj.get_active())
|
||||
|
||||
def on_help_imagesel_clicked(self, obj):
|
||||
"""Display the relevant portion of GRAMPS manual"""
|
||||
GrampsDisplay.help('gramps-edit-quick')
|
||||
@ -140,12 +132,6 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
|
||||
|
||||
description = unicode(self.description.get_text())
|
||||
|
||||
if self.internal.get_active():
|
||||
mobj = gen.lib.MediaObject()
|
||||
mobj.set_description(description)
|
||||
mobj.set_handle(Utils.create_id())
|
||||
mobj.set_mime_type(None)
|
||||
else:
|
||||
if self.file_text.get_filename() is None:
|
||||
msgstr = _("Import failed")
|
||||
msgstr2 = _("The filename supplied could not be found.")
|
||||
|
@ -124,12 +124,13 @@ class EditMedia(EditPrimary):
|
||||
|
||||
pixmap = self.glade.get_widget("pixmap")
|
||||
ebox = self.glade.get_widget('eventbox')
|
||||
ebox.connect('button-press-event', self.button_press_event)
|
||||
|
||||
mtype = self.obj.get_mime_type()
|
||||
if mtype:
|
||||
pb = ThumbNails.get_thumbnail_image(Utils.find_file(self.obj.get_path()),mtype)
|
||||
pb = ThumbNails.get_thumbnail_image(
|
||||
Utils.find_file(self.obj.get_path()),mtype)
|
||||
pixmap.set_from_pixbuf(pb)
|
||||
ebox.connect('button-press-event', self.button_press_event)
|
||||
descr = Mime.get_description(mtype)
|
||||
if descr:
|
||||
self.glade.get_widget("type").set_text(descr)
|
||||
@ -143,7 +144,6 @@ class EditMedia(EditPrimary):
|
||||
def _create_tabbed_pages(self):
|
||||
notebook = gtk.Notebook()
|
||||
|
||||
if self.obj.get_mime_type():
|
||||
self.src_list = self._add_tab(
|
||||
notebook,
|
||||
SourceEmbedList(self.dbstate,self.uistate,self.track,self.obj))
|
||||
@ -158,21 +158,6 @@ class EditMedia(EditPrimary):
|
||||
NoteTab(self.dbstate, self.uistate, self.track,
|
||||
self.obj.get_note_list(),
|
||||
notetype=gen.lib.NoteType.MEDIA))
|
||||
else:
|
||||
self.note_tab = self._add_tab(
|
||||
notebook,
|
||||
NoteTab(self.dbstate, self.uistate, self.track,
|
||||
self.obj.get_note_list(),
|
||||
notetype=gen.lib.NoteType.MEDIA))
|
||||
|
||||
self.src_list = self._add_tab(
|
||||
notebook,
|
||||
SourceEmbedList(self.dbstate,self.uistate,self.track,self.obj))
|
||||
|
||||
self.attr_list = self._add_tab(
|
||||
notebook,
|
||||
AttrEmbedList(self.dbstate, self.uistate, self.track,
|
||||
self.obj.get_attribute_list()))
|
||||
|
||||
self.backref_list = self._add_tab(
|
||||
notebook,
|
||||
@ -222,14 +207,9 @@ class EditMedia(EditPrimary):
|
||||
self.select = self.glade.get_widget('file_select')
|
||||
self.file_path = self.glade.get_widget("path")
|
||||
|
||||
if self.obj.get_mime_type():
|
||||
fname = Utils.get_unicode_path(self.obj.get_path())
|
||||
fname = self.obj.get_path()
|
||||
self.file_path.set_text(fname)
|
||||
self.select.connect('clicked', self.select_file)
|
||||
else:
|
||||
self.glade.get_widget('path_label').hide()
|
||||
self.file_path.hide()
|
||||
self.select.hide()
|
||||
|
||||
def save(self, *obj):
|
||||
path = self.glade.get_widget('path').get_text()
|
||||
@ -238,7 +218,6 @@ class EditMedia(EditPrimary):
|
||||
mime = Mime.get_type(Utils.find_file(os.path.abspath(path)))
|
||||
self.obj.set_mime_type(mime)
|
||||
|
||||
if self.obj.get_mime_type():
|
||||
self.obj.set_path(Utils.get_unicode_path(path))
|
||||
|
||||
trans = self.db.transaction_begin()
|
||||
|
@ -4396,7 +4396,7 @@
|
||||
<widget class="GtkTable" id="table51">
|
||||
<property name="border_width">6</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">6</property>
|
||||
@ -4452,28 +4452,6 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="internal">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Internal note</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="relpath">
|
||||
<property name="visible">True</property>
|
||||
|
Loading…
Reference in New Issue
Block a user