From dcbc150d76a450a2a9f6c624b9b4ed3cc116213a Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 5 Aug 2004 04:14:21 +0000 Subject: [PATCH] * src/AttrEdit.py: use ComboBox * src/NameEdit.py: use ComboBox * src/gramps.glade: use ComboBox * src/plugins/ChangeTypes.py: use ComboBox * src/plugins/changetype.glade: use ComboBox svn: r3333 --- gramps2/ChangeLog | 7 + gramps2/src/AttrEdit.py | 4 +- gramps2/src/NameEdit.py | 11 +- gramps2/src/gramps.glade | 258 ++++----------------------- gramps2/src/plugins/ChangeTypes.py | 13 +- gramps2/src/plugins/changetype.glade | 151 +++------------- 6 files changed, 79 insertions(+), 365 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2586c8301..99ed6cab1 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2004-08-04 Don Allingham + * src/AttrEdit.py: use ComboBox + * src/NameEdit.py: use ComboBox + * src/gramps.glade: use ComboBox + * src/plugins/ChangeTypes.py: use ComboBox + * src/plugins/changetype.glade: use ComboBox + 2004-08-03 Don Allingham * src/WriteXML.py: always write the default location for a place * src/EditPerson.py: don't for write of multimedia objects if diff --git a/gramps2/src/AttrEdit.py b/gramps2/src/AttrEdit.py index 861f0a7c9..046161c6f 100644 --- a/gramps2/src/AttrEdit.py +++ b/gramps2/src/AttrEdit.py @@ -85,11 +85,11 @@ class AttributeEditor: self.alist = list self.top = gtk.glade.XML(const.dialogFile, "attr_edit","gramps") - self.type_field = self.top.get_widget("attr_type") self.slist = self.top.get_widget("slist") self.value_field = self.top.get_widget("attr_value") self.note_field = self.top.get_widget("attr_note") self.attrib_menu = self.top.get_widget("attr_menu") + self.type_field = self.attrib_menu.child self.source_field = self.top.get_widget("attr_source") self.priv = self.top.get_widget("priv") self.sources_label = self.top.get_widget("sourcesAttr") @@ -117,7 +117,7 @@ class AttributeEditor: l = self.top.get_widget("title") Utils.set_titles(self.window,l,title,_('Attribute Editor')) - AutoComp.AutoCombo(self.attrib_menu,list) + AutoComp.fill_combo(self.attrib_menu,list) if attrib != None: self.type_field.set_text(attrib.get_type()) diff --git a/gramps2/src/NameEdit.py b/gramps2/src/NameEdit.py index 1083daf79..d35aa94a3 100644 --- a/gramps2/src/NameEdit.py +++ b/gramps2/src/NameEdit.py @@ -66,13 +66,15 @@ class NameEditor: self.window = self.top.get_widget("name_edit") self.given_field = self.top.get_widget("alt_given") self.title_field = self.top.get_widget("alt_title") - self.surname_field = self.top.get_widget("alt_last") self.suffix_field = self.top.get_widget("alt_suffix") + self.combo = self.top.get_widget("alt_surname_list") + self.surname_field = self.top.get_widget("alt_last") + + AutoComp.fill_combo(self.combo,self.parent.db.get_surnames()) + self.type_field = self.top.get_widget("name_type") self.note_field = self.top.get_widget("alt_note") self.slist = self.top.get_widget('slist') - slist = self.top.get_widget("alt_surname_list") - self.combo = AutoComp.AutoCombo(slist,self.parent.db.get_surnames()) self.priv = self.top.get_widget("priv") self.sources_label = self.top.get_widget("sourcesName") self.notes_label = self.top.get_widget("noteName") @@ -81,8 +83,7 @@ class NameEditor: types = const.NameTypesMap.get_values() types.sort() - self.type_field.set_popdown_strings(types) - self.typecomp = AutoComp.AutoEntry(self.type_field.entry,types) + AutoComp.fill_combo(self.type_field,types) if self.name: self.srcreflist = self.name.get_source_references() diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 7615d63a7..170611b30 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -27256,10 +27256,6 @@ Other 0.5 0 0 - attr_type - - - 0 @@ -27321,68 +27317,6 @@ Other - - - True - False - True - False - True - False - - - - True - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 0 - 1 - - - - True @@ -27403,6 +27337,20 @@ Other + + + + True + + + 1 + 2 + 0 + 1 + fill + fill + + False @@ -29578,10 +29526,6 @@ Other 0.5 0 0 - alt_last - - - 0 @@ -29634,10 +29578,6 @@ Other 0 1 0 - combo-entry2 - - - 0 @@ -29749,67 +29689,6 @@ Other - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 1 - 2 - - - - True @@ -29874,107 +29753,30 @@ Other - + True - True - False - False - True - False + + + 1 + 2 + 1 + 2 + fill + fill + + - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - + + + True 1 2 5 6 - + fill + fill diff --git a/gramps2/src/plugins/ChangeTypes.py b/gramps2/src/plugins/ChangeTypes.py index 1e282691c..4dffb8694 100644 --- a/gramps2/src/plugins/ChangeTypes.py +++ b/gramps2/src/plugins/ChangeTypes.py @@ -59,10 +59,11 @@ class ChangeTypes: glade_file = "%s/%s" % (base,"changetype.glade") self.glade = gtk.glade.XML(glade_file,"top","gramps") - self.auto1 = AutoComp.AutoCombo(self.glade.get_widget("original"), - const.personalEvents) - self.auto2 = AutoComp.AutoCombo(self.glade.get_widget("new"), - const.personalEvents) + self.auto1 = self.glade.get_widget("original") + self.auto2 = self.glade.get_widget("new") + + AutoComp.fill_combo(self.auto1,const.personalEvents) + AutoComp.fill_combo(self.auto2,const.personalEvents) Utils.set_titles(self.glade.get_widget('top'), self.glade.get_widget('title'), @@ -75,8 +76,8 @@ class ChangeTypes: def on_apply_clicked(self,obj): modified = 0 - original = unicode(self.glade.get_widget("original_text").get_text()) - new = unicode(self.glade.get_widget("new_text").get_text()) + original = unicode(self.auto1.child.get_text()) + new = unicode(self.auto2.child..get_text()) for person_handle in self.db.get_person_keys(): person = self.db.try_to_find_person_from_handle(person_handle) diff --git a/gramps2/src/plugins/changetype.glade b/gramps2/src/plugins/changetype.glade index deebb5984..b16e2f687 100644 --- a/gramps2/src/plugins/changetype.glade +++ b/gramps2/src/plugins/changetype.glade @@ -124,128 +124,6 @@ 6 12 - - - True - True - True - True - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 0 - 1 - - - - - - - True - False - True - True - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 1 - 2 - - - - True @@ -259,7 +137,6 @@ 0.5 0 0 - original_text 0 @@ -284,7 +161,6 @@ 0.5 0 0 - new_text 0 @@ -295,6 +171,33 @@ + + + + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + + + 1 + 2 + 0 + 1 + fill + + 0