* 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
This commit is contained in:
Don Allingham 2004-08-05 04:14:21 +00:00
parent ef4ed776c0
commit e2122c9d67
6 changed files with 79 additions and 365 deletions

View File

@ -1,3 +1,10 @@
2004-08-04 Don Allingham <dallingham@users.sourceforge.net>
* 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 <dallingham@users.sourceforge.net>
* src/WriteXML.py: always write the default location for a place
* src/EditPerson.py: don't for write of multimedia objects if

View File

@ -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())

View File

@ -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()

View File

@ -27256,10 +27256,6 @@ Other</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">attr_type</property>
<accessibility>
<atkrelation target="attr_menu" type="label-for"/>
</accessibility>
</widget>
<packing>
<property name="left_attach">0</property>
@ -27321,68 +27317,6 @@ Other</property>
</packing>
</child>
<child>
<widget class="GtkCombo" id="attr_menu">
<property name="visible">True</property>
<property name="value_in_list">False</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="attr_type">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget13">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget14">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget15">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="attr_value">
<property name="visible">True</property>
@ -27403,6 +27337,20 @@ Other</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="attr_menu">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
@ -29578,10 +29526,6 @@ Other</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">alt_last</property>
<accessibility>
<atkrelation target="alt_surname_list" type="label-for"/>
</accessibility>
</widget>
<packing>
<property name="left_attach">0</property>
@ -29634,10 +29578,6 @@ Other</property>
<property name="yalign">0</property>
<property name="xpad">1</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">combo-entry2</property>
<accessibility>
<atkrelation target="name_type" type="label-for"/>
</accessibility>
</widget>
<packing>
<property name="left_attach">0</property>
@ -29749,67 +29689,6 @@ Other</property>
</packing>
</child>
<child>
<widget class="GtkCombo" id="alt_surname_list">
<property name="visible">True</property>
<property name="value_in_list">False</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="alt_last">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget29">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget30">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget31">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="alt_prefix">
<property name="visible">True</property>
@ -29874,107 +29753,30 @@ Other</property>
</child>
<child>
<widget class="GtkCombo" id="name_type">
<widget class="GtkComboBoxEntry" id="alt_surname_list">
<property name="visible">True</property>
<property name="value_in_list">True</property>
<property name="allow_empty">False</property>
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="combo-entry2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget32">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget33">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget34">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkListItem" id="convertwidget35">
<widget class="GtkComboBoxEntry" id="name_type">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget36">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget37">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget38">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="y_options"></property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>

View File

@ -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)

View File

@ -124,128 +124,6 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<widget class="GtkCombo" id="original">
<property name="visible">True</property>
<property name="value_in_list">True</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">True</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="original_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget1">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget2">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget3">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCombo" id="new">
<property name="visible">True</property>
<property name="value_in_list">False</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">True</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="new_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget4">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget5">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget6">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
@ -259,7 +137,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">original_text</property>
</widget>
<packing>
<property name="left_attach">0</property>
@ -284,7 +161,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">new_text</property>
</widget>
<packing>
<property name="left_attach">0</property>
@ -295,6 +171,33 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="new">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="original">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>