* src/gramps.glade: remove button border for date editor button

* src/DateDisplay.py: fix quality prefix display


svn: r3557
This commit is contained in:
Don Allingham 2004-09-19 23:05:25 +00:00
parent 894619e016
commit 030aa36011
3 changed files with 103 additions and 76 deletions

View File

@ -1,3 +1,7 @@
2004-09-19 Don Allingham <dallingham@users.sourceforge.net>
* src/gramps.glade: remove button border for date editor button
* src/DateDisplay.py: fix quality prefix display
2004-09-19 Alex Roitman <shura@alex.neuro.umn.edu>
* src/DateEdit.py: Take date object as an argument and work with it.
* src/AddrEdit.py: Use date object instead of text.

View File

@ -46,9 +46,9 @@ class DateDisplay:
" (Persian)"," (Islamic)"
)
_mod_str = (
"","before ","after ","about ","estimated ","calculated ",""
)
_mod_str = ("","before ","after ","about ","","","")
_qual_str = ("","estimated ","calculated ")
# determine the code set returned by nl_langinfo
_codeset = locale.nl_langinfo(locale.CODESET)
@ -175,20 +175,24 @@ class DateDisplay:
"""
mod = date.get_modifier()
cal = date.get_calendar()
qual = date.get_quality()
start = date.get_start_date()
qual_str = self._qual_str[qual]
if start == Date.EMPTY:
return u""
if mod == Date.MOD_SPAN:
d1 = self.display_cal[cal](start)
d2 = self.display_cal[cal](date.get_stop_date())
return "from %s to %s%s" % (d1,d2,self.calendar[cal])
return "%sfrom %s to %s%s" % (qual_str,d1,d2,self.calendar[cal])
elif mod == Date.MOD_RANGE:
d1 = self.display_cal[cal](start)
d2 = self.display_cal[cal](date.get_stop_date())
return "between %s and %s%s" % (d1,d2,self.calendar[cal])
return "%sbetween %s and %s%s" % (qual_str,d1,d2,self.calendar[cal])
else:
text = self.display_cal[date.get_calendar()](start)
return "%s%s%s" % (self._mod_str[mod],text,self.calendar[cal])
return "%s%s%s%s" % (qual_str,self._mod_str[mod],text,self.calendar[cal])
def _slash_year(self,val,slash):
if slash:

View File

@ -8184,9 +8184,6 @@ Other</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">birthDate</property>
<accessibility>
<atkrelation target="birthDate" type="label-for"/>
</accessibility>
</widget>
<packing>
<property name="left_attach">1</property>
@ -8198,27 +8195,6 @@ Other</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="birthDate">
<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>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button99">
<property name="border_width">1</property>
@ -8763,27 +8739,6 @@ Other</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="deathDate">
<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>
<packing>
<property name="left_attach">8</property>
<property name="right_attach">9</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button126">
<property name="border_width">1</property>
@ -8969,59 +8924,123 @@ Other</property>
</child>
<child>
<widget class="GtkButton" id="birth_stat">
<widget class="GtkHBox" id="hbox97">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Invoke date editor</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="birth_stat_child">
<widget class="GtkEntry" id="birthDate">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="birth_stat">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Invoke date editor</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
<child>
<widget class="GtkImage" id="birth_stat_child">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="left_attach">2</property>
<property name="right_attach">4</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="death_stat">
<widget class="GtkHBox" id="hbox98">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Invoke date editor</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_edit_date_death_clicked" last_modification_time="Sat, 18 Sep 2004 02:30:11 GMT"/>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="death_stat_child">
<widget class="GtkEntry" id="deathDate">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="death_stat">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Invoke date editor</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_edit_date_death_clicked" last_modification_time="Sat, 18 Sep 2004 02:30:11 GMT"/>
<child>
<widget class="GtkImage" id="death_stat_child">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">9</property>
<property name="left_attach">8</property>
<property name="right_attach">10</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>