* src/EventEdit.py: Hide warning message for new events and for

existing events with the default role; Only commit new Event when
OK clicked in the editor.
* src/RelLib.py: Add assertions for external witness methods.
* src/gramps.glade:


svn: r4835
This commit is contained in:
Alex Roitman 2005-06-16 15:39:19 +00:00
parent fdf7867589
commit d1136c731c
4 changed files with 99 additions and 68 deletions

View File

@ -1,6 +1,12 @@
2005-06-16 Alex Roitman <shura@gramps-project.org> 2005-06-16 Alex Roitman <shura@gramps-project.org>
* src/EventEdit.py: Remove unused variable. * src/EventEdit.py: Remove unused variable.
* src/EventEdit.py: Hide warning message for new events and for
existing events with the default role; Only commit new Event when
OK clicked in the editor.
* src/RelLib.py: Add assertions for external witness methods.
* src/gramps.glade:
2005-06-15 Don Allingham <don@gramps-project.org> 2005-06-15 Don Allingham <don@gramps-project.org>
* src/DisplayModels.py: fixed event type display * src/DisplayModels.py: fixed event type display
* src/ReadXML.py: build child/family relationships properly on * src/ReadXML.py: build child/family relationships properly on

View File

@ -455,6 +455,7 @@ class EventRefEditor:
self.preform = self.top.get_widget("eer_ev_preform") self.preform = self.top.get_widget("eer_ev_preform")
self.ok = self.top.get_widget('ok') self.ok = self.top.get_widget('ok')
self.expander = self.top.get_widget("eer_expander") self.expander = self.top.get_widget("eer_expander")
self.warning = self.top.get_widget("eer_warning")
add_src = self.top.get_widget('eer_add_src') add_src = self.top.get_widget('eer_add_src')
del_src = self.top.get_widget('eer_del_src') del_src = self.top.get_widget('eer_del_src')
@ -496,16 +497,24 @@ class EventRefEditor:
RelLib.Event.CUSTOM,default_type) RelLib.Event.CUSTOM,default_type)
if self.event: if self.event:
self.event_added = False
self.date = Date.Date(self.event.get_date_object()) self.date = Date.Date(self.event.get_date_object())
self.expander.set_expanded(False) if self.event_ref:
if self.event_ref.get_role()[0] == default_role:
self.expander.set_expanded(True)
self.warning.hide()
else:
self.expander.set_expanded(False)
self.warning.show_all()
else: else:
trans = self.db.transaction_begin()
self.event = RelLib.Event() self.event = RelLib.Event()
self.event.set_type((default_type,ev_dict[default_type])) self.event.set_type((default_type,ev_dict[default_type]))
self.db.add_event(self.event,trans) self.event.set_handle(self.db.create_id())
self.db.transaction_commit(trans,_("Add Event")) self.event.set_gramps_id(self.db.find_next_event_gramps_id())
self.event_added = True
self.date = Date.Date(None) self.date = Date.Date(None)
self.expander.set_expanded(True) self.expander.set_expanded(True)
self.warning.hide()
if not self.event_ref: if not self.event_ref:
self.event_ref = RelLib.EventRef() self.event_ref = RelLib.EventRef()
@ -615,6 +624,9 @@ class EventRefEditor:
if self.parent.lists_changed: if self.parent.lists_changed:
trans = self.db.transaction_begin() trans = self.db.transaction_begin()
self.db.commit_event(self.event,trans) self.db.commit_event(self.event,trans)
if self.event_added:
self.db.transaction_commit(trans,_("Add Event"))
else:
self.db.transaction_commit(trans,_("Modify Event")) self.db.transaction_commit(trans,_("Modify Event"))
# then, set properties of the event_ref # then, set properties of the event_ref
@ -625,7 +637,6 @@ class EventRefEditor:
stop = buf.get_end_iter() stop = buf.get_end_iter()
note = unicode(buf.get_text(start,stop,False)) note = unicode(buf.get_text(start,stop,False))
self.event_ref.set_note(note) self.event_ref.set_note(note)
#self.referent.add_event_ref(self.event_ref)
self.close(None) self.close(None)
if self.update: if self.update:

View File

@ -2424,9 +2424,11 @@ class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase,PlaceBase):
return self.description return self.description
def add_ext_witness(self,witness): def add_ext_witness(self,witness):
assert type(witness) == tuple
self.ext_witness_list.append(witness) self.ext_witness_list.append(witness)
def remove_ext_witness(self,witness): def remove_ext_witness(self,witness):
assert type(witness) == tuple
if witness in self.ext_witness_list: if witness in self.ext_witness_list:
self.ext_witness_list.remove(witness) self.ext_witness_list.remove(witness)
return True return True

View File

@ -37421,7 +37421,7 @@ Family name Given name
<property name="border_width">12</property> <property name="border_width">12</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">6</property> <property name="n_rows">6</property>
<property name="n_columns">4</property> <property name="n_columns">3</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
@ -37592,6 +37592,28 @@ Family name Given name
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="eer_ref_priv">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Private record</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">2</property>
<property name="right_attach">3</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child> <child>
<widget class="GtkExpander" id="eer_expander"> <widget class="GtkExpander" id="eer_expander">
<property name="border_width">6</property> <property name="border_width">6</property>
@ -37916,32 +37938,11 @@ Family name Given name
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label521"> <widget class="GtkHBox" id="eer_warning">
<property name="border_width">6</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; Any changes in the shared event information will be reflected in the event itself, for all participants in the event.</property> <property name="homogeneous">False</property>
<property name="use_underline">True</property> <property name="spacing">12</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_FILL</property>
<property name="wrap">True</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">3</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child> <child>
<widget class="GtkImage" id="image2651"> <widget class="GtkImage" id="image2651">
@ -37953,13 +37954,46 @@ Family name Given name
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label521">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; Any changes in the shared event information will be reflected in the event itself, for all participants in the event.</property>
<property name="use_underline">True</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</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">3</property>
<property name="mnemonic_widget">eer_ev_priv</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="right_attach">1</property> <property name="right_attach">3</property>
<property name="top_attach">6</property> <property name="top_attach">6</property>
<property name="bottom_attach">7</property> <property name="bottom_attach">7</property>
<property name="x_options">fill</property> <property name="x_options">expand|shrink|fill</property>
<property name="y_options">fill</property> <property name="y_options">expand|shrink|fill</property>
</packing> </packing>
</child> </child>
</widget> </widget>
@ -38918,36 +38952,14 @@ Family name Given name
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">5</property> <property name="top_attach">5</property>
<property name="bottom_attach">6</property> <property name="bottom_attach">6</property>
<property name="x_options">fill</property> <property name="x_options">expand|shrink|fill</property>
<property name="y_options">expand|shrink|fill</property> <property name="y_options">expand|shrink|fill</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="eer_ref_priv">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Private record</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">2</property>
<property name="right_attach">4</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>