* src/DisplayTabs.py: pychecker fixes
* src/EditMedia.py: Handle Note types properly * src/EditPerson.py: minor cleanup * src/EventEdit.py: pychecker fixes * src/MediaView.py: Don't call NoteEditor, use EditMedia instead * src/PageView.py: pychecker fixes * src/PersonView.py: typo * src/gramps.glade: Handle note types in media editor svn: r5901
This commit is contained in:
parent
200b8cc17d
commit
47091ad736
@ -1,3 +1,13 @@
|
||||
2006-02-08 Don Allingham <don@gramps-project.org>
|
||||
* src/DisplayTabs.py: pychecker fixes
|
||||
* src/EditMedia.py: Handle Note types properly
|
||||
* src/EditPerson.py: minor cleanup
|
||||
* src/EventEdit.py: pychecker fixes
|
||||
* src/MediaView.py: Don't call NoteEditor, use EditMedia instead
|
||||
* src/PageView.py: pychecker fixes
|
||||
* src/PersonView.py: typo
|
||||
* src/gramps.glade: Handle note types in media editor
|
||||
|
||||
2006-02-08 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||
* src/ObjectSelector/_FamilyPreviewFrame.py: use new baseclass
|
||||
* src/ObjectSelector/_FamilyTreeFrame.py: use new baseclass
|
||||
@ -9,7 +19,6 @@
|
||||
* src/ObjectSelector/_TreeFrameBase.py: added
|
||||
* src/ObjectSelector/__init__.py: added some documentation
|
||||
|
||||
|
||||
2006-02-08 Don Allingham <don@gramps-project.org>
|
||||
* src/DisplayTabs.py: reordering items in a Gallery
|
||||
|
||||
|
@ -41,6 +41,7 @@ try:
|
||||
set()
|
||||
except:
|
||||
from sets import Set as set
|
||||
print "set not used"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -51,8 +52,6 @@ import DateHandler
|
||||
import NameDisplay
|
||||
import RelLib
|
||||
import Utils
|
||||
import GrampsMime
|
||||
import const
|
||||
import ImgManip
|
||||
import Spell
|
||||
|
||||
@ -64,7 +63,7 @@ from GrampsWidgets import SimpleButton
|
||||
# constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
|
||||
dnddata = None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -942,7 +941,7 @@ class LocationEmbedList(EmbeddedList):
|
||||
if loc:
|
||||
import LocEdit
|
||||
LocEdit.LocationEditor(self.dbstate, self.uistate, self.track,
|
||||
addr, self.edit_callback)
|
||||
loc, self.edit_callback)
|
||||
|
||||
def edit_callback(self,name):
|
||||
self.rebuild()
|
||||
@ -1171,7 +1170,7 @@ class SourceEmbedList(EmbeddedList):
|
||||
self.add_callback)
|
||||
|
||||
def add_callback(self,obj):
|
||||
self.get_data().append(name)
|
||||
self.get_data().append(obj)
|
||||
self.changed = True
|
||||
self.rebuild()
|
||||
|
||||
@ -1226,7 +1225,7 @@ class RepoEmbedList(EmbeddedList):
|
||||
self.dbstate, self.uistate, self.track, ref, self.add_callback)
|
||||
|
||||
def add_callback(self,obj):
|
||||
self.get_data().append(name)
|
||||
self.get_data().append(obj)
|
||||
self.changed = True
|
||||
self.rebuild()
|
||||
|
||||
@ -1262,7 +1261,7 @@ class ChildModel(gtk.ListStore):
|
||||
self.append(row=[index,
|
||||
child.get_gramps_id(),
|
||||
NameDisplay.displayer.display(child),
|
||||
_GENDER[child.get_gender()],
|
||||
Utils.gender[child.get_gender()],
|
||||
self.column_father_rel(child),
|
||||
self.column_mother_rel(child),
|
||||
self.column_birth_day(child),
|
||||
|
@ -108,8 +108,6 @@ class EditMedia(DisplayState.ManagedWindow):
|
||||
title = _('Media Properties Editor')
|
||||
|
||||
self.window = self.change_dialog.get_widget('change_global')
|
||||
self.select = self.change_dialog.get_widget('file_select')
|
||||
self.select.connect('clicked', self.select_file)
|
||||
|
||||
self.date_entry = self.change_dialog.get_widget('date')
|
||||
self.date_entry.set_editable(mode)
|
||||
@ -141,12 +139,13 @@ class EditMedia(DisplayState.ManagedWindow):
|
||||
if descr:
|
||||
self.change_dialog.get_widget("type").set_text(descr)
|
||||
else:
|
||||
pb = GrampsMime.find_mime_type_pixbuf('text/plain')
|
||||
self.pixmap.set_from_pixbuf(pb)
|
||||
self.change_dialog.get_widget("type").set_text(_('Note'))
|
||||
self.pixmap.hide()
|
||||
|
||||
self.change_dialog.get_widget("gid").set_text(self.obj.get_gramps_id())
|
||||
|
||||
self.update_info()
|
||||
self.setup_filepath()
|
||||
|
||||
self.gladeif.connect('change_global','delete_event',
|
||||
self.on_delete_event)
|
||||
@ -154,6 +153,11 @@ class EditMedia(DisplayState.ManagedWindow):
|
||||
self.gladeif.connect('ok','clicked',self.on_ok_clicked)
|
||||
self.gladeif.connect('button102','clicked',self.on_help_clicked)
|
||||
|
||||
self._create_tabbed_windows()
|
||||
|
||||
self.show()
|
||||
|
||||
def _create_tabbed_windows(self):
|
||||
self.vbox = self.change_dialog.get_widget('vbox')
|
||||
self.notebook = gtk.Notebook()
|
||||
self.notebook.show()
|
||||
@ -166,15 +170,18 @@ class EditMedia(DisplayState.ManagedWindow):
|
||||
self.src_list = SourceEmbedList(self.state,self.uistate,
|
||||
self.track,self.obj.source_list)
|
||||
|
||||
if self.obj.get_mime_type():
|
||||
self.notebook.insert_page(self.src_list)
|
||||
self.notebook.set_tab_label(self.src_list,self.src_list.get_tab_widget())
|
||||
|
||||
self.notebook.insert_page(self.attr_list)
|
||||
self.notebook.set_tab_label(self.attr_list,self.attr_list.get_tab_widget())
|
||||
|
||||
self.notebook.insert_page(self.note_tab)
|
||||
else:
|
||||
self.notebook.insert_page(self.note_tab)
|
||||
self.notebook.insert_page(self.src_list)
|
||||
self.notebook.insert_page(self.attr_list)
|
||||
|
||||
self.notebook.set_tab_label(self.src_list,self.src_list.get_tab_widget())
|
||||
self.notebook.set_tab_label(self.note_tab,self.note_tab.get_tab_widget())
|
||||
self.show()
|
||||
self.notebook.set_tab_label(self.attr_list,self.attr_list.get_tab_widget())
|
||||
|
||||
def build_menu_names(self,person):
|
||||
win_menu_label = _("Media Properties")
|
||||
@ -213,10 +220,18 @@ class EditMedia(DisplayState.ManagedWindow):
|
||||
gobject.source_remove(self.idle)
|
||||
self.close()
|
||||
|
||||
def update_info(self):
|
||||
fname = self.obj.get_path()
|
||||
def setup_filepath(self):
|
||||
self.select = self.change_dialog.get_widget('file_select')
|
||||
self.file_path = self.change_dialog.get_widget("path")
|
||||
|
||||
if self.obj.get_mime_type():
|
||||
fname = self.obj.get_path()
|
||||
self.file_path.set_text(fname)
|
||||
self.select.connect('clicked', self.select_file)
|
||||
else:
|
||||
self.change_dialog.get_widget('path_label').hide()
|
||||
self.file_path.hide()
|
||||
self.select.hide()
|
||||
|
||||
def on_apply_clicked(self, obj):
|
||||
desc = unicode(self.descr_window.get_text())
|
||||
|
@ -111,7 +111,6 @@ class EditPerson(DisplayState.ManagedWindow):
|
||||
self.orig_surname = self.person.get_primary_name().get_group_name()
|
||||
self.db = self.dbstate.db
|
||||
self.callback = callback
|
||||
# self.lds_not_loaded = True
|
||||
self.pdmap = {}
|
||||
self.add_places = []
|
||||
self.should_guess_gender = (not person.get_gramps_id() and
|
||||
@ -472,7 +471,7 @@ class EditPerson(DisplayState.ManagedWindow):
|
||||
changed = True
|
||||
if self.pname.get_note() != name.get_note():
|
||||
changed = True
|
||||
# if not self.lds_not_loaded and self.check_lds():
|
||||
# if self.check_lds():
|
||||
# changed = True
|
||||
|
||||
(female,male,unknown) = _select_gender[self.gender.get_active()]
|
||||
@ -483,10 +482,7 @@ class EditPerson(DisplayState.ManagedWindow):
|
||||
changed = True
|
||||
elif unknown and self.person.get_gender() != RelLib.Person.UNKNOWN:
|
||||
changed = True
|
||||
if text != self.person.get_note():
|
||||
changed = True
|
||||
|
||||
# if not self.lds_not_loaded:
|
||||
# if not self.lds_baptism.are_equal(self.person.get_lds_baptism()):
|
||||
# changed= True
|
||||
|
||||
|
@ -191,7 +191,7 @@ class EventEditor(DisplayState.ManagedWindow):
|
||||
date_stat,
|
||||
self.window)
|
||||
|
||||
self.gladeif.connect('button111','clicked',self.close)
|
||||
self.gladeif.connect('button111','clicked',self.close_window)
|
||||
self.gladeif.connect('ok','clicked',self.on_event_edit_ok_clicked)
|
||||
self.gladeif.connect('button126','clicked',self.on_help_clicked)
|
||||
|
||||
@ -241,15 +241,17 @@ class EventEditor(DisplayState.ManagedWindow):
|
||||
|
||||
def build_window_key(self,obj):
|
||||
if obj:
|
||||
win_key = obj.get_handle()
|
||||
return obj.get_handle()
|
||||
else:
|
||||
win_key = id(self)
|
||||
return id(self)
|
||||
|
||||
def on_delete_event(self,obj,b):
|
||||
self.gladeif.close()
|
||||
self.close()
|
||||
|
||||
def close(self,obj):
|
||||
def close_window(self,obj):
|
||||
self.gladeif.close()
|
||||
self.close()
|
||||
self.window.destroy()
|
||||
|
||||
def on_help_clicked(self,obj):
|
||||
@ -298,7 +300,7 @@ class EventEditor(DisplayState.ManagedWindow):
|
||||
self.db.commit_event(event,trans)
|
||||
|
||||
def get_event_names(self):
|
||||
data = sets.Set(self.db.get_family_event_types())
|
||||
data = set(self.db.get_family_event_types())
|
||||
data.union(self.db.get_person_event_types())
|
||||
return list(data)
|
||||
|
||||
|
@ -32,7 +32,6 @@ import gtk.gdk
|
||||
# gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import RelLib
|
||||
import PageView
|
||||
import DisplayModels
|
||||
import ImgManip
|
||||
@ -171,13 +170,8 @@ class MediaView(PageView.ListView):
|
||||
return
|
||||
|
||||
obj = self.dbstate.db.get_object_from_handle(handle)
|
||||
if obj.get_mime_type():
|
||||
import EditMedia
|
||||
EditMedia.EditMedia(self.dbstate,self.uistate, [], obj)
|
||||
else:
|
||||
import NoteEdit
|
||||
NoteEdit.NoteEditor(obj,self.parent,self.topWindow,
|
||||
self.note_callback)
|
||||
|
||||
class DeleteMediaQuery:
|
||||
|
||||
|
@ -20,8 +20,26 @@
|
||||
|
||||
# $Id$
|
||||
|
||||
#----------------------------------------------------------------
|
||||
#
|
||||
# python
|
||||
#
|
||||
#----------------------------------------------------------------
|
||||
from gettext import gettext as _
|
||||
|
||||
#----------------------------------------------------------------
|
||||
#
|
||||
# gtk
|
||||
#
|
||||
#----------------------------------------------------------------
|
||||
import gtk
|
||||
import pango
|
||||
|
||||
#----------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS
|
||||
#
|
||||
#----------------------------------------------------------------
|
||||
import TreeTips
|
||||
import GenericFilter
|
||||
|
||||
@ -386,7 +404,7 @@ class ListView(PageView):
|
||||
order = gtk.SORT_ASCENDING
|
||||
else:
|
||||
if (self.columns[data].get_sort_order() == gtk.SORT_DESCENDING
|
||||
or self.columns[data].get_sort_indicator() == False):
|
||||
or not self.columns[data].get_sort_indicator()):
|
||||
order = gtk.SORT_ASCENDING
|
||||
else:
|
||||
order = gtk.SORT_DESCENDING
|
||||
|
@ -28,6 +28,7 @@
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
from gettext import gettext as _
|
||||
import cPickle as pickle
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -8738,7 +8738,7 @@ Very High</property>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label180">
|
||||
<widget class="GtkLabel" id="path_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Path:</property>
|
||||
<property name="use_underline">False</property>
|
||||
|
Loading…
Reference in New Issue
Block a user