* src/Editors/_EditPlace.py: consistent menu and title names

* src/Editors/_EditSource.py: consistent menu and title names
	* src/Editors/_EditPerson.py: consistent menu and title names
	* src/Editors/_EditMedia.py: consistent menu and title names
	* src/Editors/_EditRepository.py: consistent menu and title names
	* src/Editors/_EditFamily.py: consistent menu and title names
	* src/Editors/_EditEvent.py: consistent menu and title names


svn: r7709
This commit is contained in:
Don Allingham 2006-11-26 21:18:30 +00:00
parent 331c282d03
commit d47ca2efc3
8 changed files with 86 additions and 72 deletions

View File

@ -4,6 +4,13 @@
* NEWS: Typo.
2006-11-26 Don Allingham <don@gramps-project.org>
* src/Editors/_EditPlace.py: consistent menu and title names
* src/Editors/_EditSource.py: consistent menu and title names
* src/Editors/_EditPerson.py: consistent menu and title names
* src/Editors/_EditMedia.py: consistent menu and title names
* src/Editors/_EditRepository.py: consistent menu and title names
* src/Editors/_EditFamily.py: consistent menu and title names
* src/Editors/_EditEvent.py: consistent menu and title names
* src/docgen/ODFDoc.py: fix registration
2006-11-25 Don Allingham <don@gramps-project.org>

View File

@ -75,20 +75,23 @@ class EditEvent(EditPrimary):
def empty_object(self):
return RelLib.Event()
def get_menu_title(self):
if self.obj.get_handle():
event_name = self.obj.get_description()
if not event_name:
event_name = str(self.obj.get_type())
dialog_title = _('Event: %s') % event_name
else:
dialog_title = _('New Event')
return dialog_title
def get_custom_events(self):
return self.dbstate.db.get_person_event_types() + \
self.dbstate.db.get_family_event_types()
def _local_init(self):
self.top = gtk.glade.XML(const.gladeFile, "event_edit","gramps")
title = self.obj.get_description()
if title:
title = _('Event') + ": " + title
else:
title = _('Event')
self.set_window(self.top.get_widget("event_edit"), None, title)
self.set_window(self.top.get_widget("event_edit"), None, self.get_menu_title())
self.place = self.top.get_widget('place')
self.share_btn = self.top.get_widget('select_place')
@ -197,12 +200,7 @@ class EditEvent(EditPrimary):
Config.sync()
def build_menu_names(self,event):
if event:
event_name = str(event.get_type())
submenu_label = _('Event: %s') % event_name
else:
submenu_label = _('New Event')
return (_('Event Editor'),submenu_label)
return (_('Edit Event'), self.get_menu_title())
def help_clicked(self,obj):
"""Display the relevant portion of GRAMPS manual"""

View File

@ -428,18 +428,22 @@ class EditFamily(EditPrimary):
self.update_mother(mhandle)
self.child_list.rebuild()
def get_menu_title(self):
if self.obj.get_handle():
dialog_title = Utils.family_name(self.obj, self.db, _("New Family"))
dialog_title = _("Family") + ': ' + dialog_title
else:
dialog_title = _("New Family")
return dialog_title
def build_menu_names(self,family):
win_menu_label = Utils.family_name(family,self.db,_("New Family"))
if not win_menu_label.strip():
win_menu_label = _("New Family")
return (_('Edit Family'), win_menu_label)
return (_('Edit Family'), self.get_menu_title())
def build_interface(self):
self.top = gtk.glade.XML(const.gladeFile,"family_editor","gramps")
self.set_window(self.top.get_widget("family_editor"),
None,_('Family Editor'))
self.set_window(self.top.get_widget("family_editor"), None, self.get_menu_title())
# restore window size
width = Config.get(Config.FAMILY_WIDTH)

View File

@ -65,18 +65,22 @@ class EditMedia(EditPrimary):
def empty_object(self):
return RelLib.MediaObject()
def get_menu_title(self):
if self.obj.get_handle():
event_name = self.obj.get_description()
if not event_name:
event_name = str(self.obj.get_type())
dialog_title = _('Media: %s') % event_name
else:
dialog_title = _('New Media')
return dialog_title
def _local_init(self):
assert(self.obj)
self.glade = gtk.glade.XML(const.gladeFile,
"change_global","gramps")
title = self.obj.get_description()
if title:
title = _('Media') + ": " + title
else:
title = _('Media')
self.set_window(self.glade.get_widget('change_global'), None, title)
self.set_window(self.glade.get_widget('change_global'), None, self.get_menu_title())
width = Config.get(Config.MEDIA_WIDTH)
height = Config.get(Config.MEDIA_HEIGHT)
self.window.resize(width, height)
@ -169,8 +173,7 @@ class EditMedia(EditPrimary):
self.glade.get_widget('vbox').pack_start(notebook,True)
def build_menu_names(self,person):
win_menu_label = _("Media Properties")
return (_('Edit Media Object'),win_menu_label)
return (_('Edit Media Object'), self.get_menu_title())
def select_file(self,obj):
f = gtk.FileChooserDialog(

View File

@ -105,6 +105,14 @@ class EditPerson(EditPrimary):
"""
return RelLib.Person()
def get_menu_title(self):
pname = self.obj.get_primary_name()
if pname.is_empty():
title = _('New Person')
else:
name = NameDisplay.displayer.display_name(self.pname)
title = _('Person') + ': %s' % name
def _local_init(self):
"""
Local initialization function. Performs basic initialization,
@ -119,13 +127,7 @@ class EditPerson(EditPrimary):
self.load_obj = None
self.top = gtk.glade.XML(const.person_glade, "edit_person", "gramps")
if self.pname.is_empty():
title = _('Person')
else:
name = NameDisplay.displayer.display_name(self.pname)
title = _('Person') + ': %s' % name
self.set_window(self.top.get_widget("edit_person"), None, title)
self.set_window(self.top.get_widget("edit_person"), None, self.get_menu_title())
width = Config.get(Config.PERSON_WIDTH)
height = Config.get(Config.PERSON_HEIGHT)
self.window.set_default_size(width, height)
@ -354,10 +356,7 @@ class EditPerson(EditPrimary):
Provides the information need by the base class to define the
window management menu entries.
"""
win_menu_label = self.nd.display(person)
if not win_menu_label.strip():
win_menu_label = _("New Person")
return (_('Edit Person'), win_menu_label)
return (_('Edit Person'), self.get_menu_title())
def _image_callback(self, ref, obj):
"""

View File

@ -67,18 +67,20 @@ class EditPlace(EditPrimary):
def _local_init(self):
self.top = gtk.glade.XML(const.gladeFile,"place_editor","gramps")
title = self.obj.get_title()
if title:
title = _('Place') + ": " + title
else:
title = _('Place')
self.set_window(self.top.get_widget("place_editor"), None, title)
self.set_window(self.top.get_widget("place_editor"), None, self.get_menu_title())
width = Config.get(Config.PLACE_WIDTH)
height = Config.get(Config.PLACE_HEIGHT)
self.window.resize(width, height)
self.window.show()
def get_menu_title(self):
if self.obj.get_handle():
title = self.obj.get_title()
dialog_title = _('Place: %s') % title
else:
dialog_title = _('New Place')
return dialog_title
def _connect_signals(self):
self.define_ok_button(self.top.get_widget('ok'),self.save)
self.define_cancel_button(self.top.get_widget('cancel'))
@ -144,10 +146,7 @@ class EditPlace(EditPrimary):
self.db.readonly)
def build_menu_names(self,place):
win_menu_label = place.get_title()
if not win_menu_label.strip():
win_menu_label = _("New Place")
return (win_menu_label, _('Edit Place'))
return (_('Edit Place'), self.get_menu_title())
def _create_tabbed_pages(self):
"""

View File

@ -57,23 +57,30 @@ class EditRepository(EditPrimary):
def empty_object(self):
return RelLib.Repository()
def get_menu_title(self):
if self.obj.get_handle():
title = self.obj.get_name()
if title:
title = _('Repository') + ": " + title
else:
title = _('Repository')
else:
title = _('New Repository')
return title
def _local_init(self):
self.glade = gtk.glade.XML(const.gladeFile,"repository_editor","gramps")
title = self.obj.get_name()
print title
if title:
title = _('Repository') + ": " + title
else:
title = _('Repository')
self.set_window(self.glade.get_widget("repository_editor"), None, title)
self.set_window(self.glade.get_widget("repository_editor"), None, self.get_menu_title())
width = Config.get(Config.REPO_WIDTH)
height = Config.get(Config.REPO_HEIGHT)
self.window.resize(width, height)
self.window.show()
def build_menu_names(self,source):
return (_('Edit Repository'), self.get_menu_title())
def _setup_fields(self):
self.name = MonitoredEntry(

View File

@ -66,19 +66,20 @@ class EditSource(EditPrimary):
def empty_object(self):
return RelLib.Source()
def get_menu_title(self):
title = self.obj.get_title()
if title:
title = _('Source') + ": " + title
else:
title = _('New Source')
return title
def _local_init(self):
assert(self.obj)
self.glade = gtk.glade.XML(const.gladeFile,"source_editor","gramps")
title = self.obj.get_title()
if title:
title = _('Source') + ": " + title
else:
title = _('Source')
self.set_window(self.glade.get_widget("source_editor"),
None, title)
self.set_window(self.glade.get_widget("source_editor"), None, self.get_menu_title())
width = Config.get(Config.SOURCE_WIDTH)
height = Config.get(Config.SOURCE_HEIGHT)
self.window.resize(width, height)
@ -156,11 +157,7 @@ class EditSource(EditPrimary):
self.glade.get_widget('vbox').pack_start(notebook,True)
def build_menu_names(self,source):
if source:
label = "Edit Source"
else:
label = "New Source"
return (label, _('Source Editor'))
return (_('Edit Source'), self.get_menu_title())
def save(self,*obj):
if self.object_is_empty():