* src/Editors/_EditEvent.py: start of SelectPlace integration

* src/glade/gramps.glade: start of SelectPlace integration
	* src/GrampsWidgets.py: start of SelectPlace integration


svn: r6686
This commit is contained in:
Don Allingham 2006-05-17 04:35:03 +00:00
parent 7f4abf4392
commit a0c320d2fc
5 changed files with 249 additions and 172 deletions

View File

@ -1,4 +1,7 @@
2006-05-16 Don Allingham <don@gramps-project.org>
* src/Editors/_EditEvent.py: start of SelectPlace integration
* src/glade/gramps.glade: start of SelectPlace integration
* src/GrampsWidgets.py: start of SelectPlace integration
* src/DisplayTabs/_WebEmbedList.py: icon fixes
* src/images/stock_insert-url.png: added
* src/images/person.png: added

View File

@ -93,6 +93,10 @@ class EditEvent(EditPrimary):
self.top.get_widget('title'),
_('Event Editor'))
self.place = self.top.get_widget('place')
self.share_btn = self.top.get_widget('select_place')
self.add_del_btn = self.top.get_widget('add_del_place')
def _connect_signals(self):
self.top.get_widget('button111').connect('clicked',self.close)
self.top.get_widget('button126').connect('clicked',self.help_clicked)
@ -106,11 +110,16 @@ class EditEvent(EditPrimary):
self.dbstate.db.get_family_event_types()
def _setup_fields(self):
# place, select_place, add_del_place
self.place_field = PlaceEntry(
self.top.get_widget("eventPlace"),
self.obj.get_place_handle(),
self.dbstate.get_place_completion(),
self.db.readonly)
self.db,
self.top.get_widget("place"),
self.obj.set_place_handle,
self.obj.get_place_handle,
self.add_del_btn,
self.share_btn)
self.cause_monitor = MonitoredEntry(
self.top.get_widget("eventCause"),

View File

@ -471,41 +471,47 @@ class MonitoredDate:
class PlaceEntry:
def __init__(self, obj, handle, place_map, read_only=False):
def __init__(self, db, obj, set_val, get_val, add_del, share):
self.obj = obj
self.handle = handle
self.places = place_map
self.add_del = add_del
self.share = share
self.db = db
self.get_val = get_val
self.set_val = set_val
if handle:
name = place_map[handle]
if get_val():
self.set_button(True)
p = self.db.get_place_from_handle(self.get_val())
name = "%s [%s]" % (p.get_title(),p.gramps_id)
else:
name = u""
self.set_button(False)
if read_only:
self.obj.set_editable(False)
if db.readonly:
self.add_del.set_sensitive(False)
self.share.set_sensitive(False)
else:
self.obj.set_editable(True)
self.add_del.set_sensitive(True)
self.share.set_sensitive(True)
store = gtk.ListStore(str)
foo = [ (locale.strxfrm(self.places[v]), v) \
for v in self.places.keys()]
foo.sort()
for val in foo:
store.append(row=[self.places[val[1]]])
completion = gtk.EntryCompletion()
completion.set_text_column(0)
completion.set_model(store)
obj.set_completion(completion)
obj.set_text(name)
def get_place_info(self):
text = unicode(self.obj.get_text().strip())
if text:
for key in self.places.keys():
if text == self.places[key]:
return (False, key)
return (True, text)
def set_button(self, use_add):
for i in self.add_del.get_children():
self.add_del.remove(i)
image = gtk.Image()
if use_add:
image.set_from_stock(gtk.STOCK_REMOVE,gtk.ICON_SIZE_BUTTON)
self.share.hide()
else:
return (False, u"")
image.set_from_stock(gtk.STOCK_ADD,gtk.ICON_SIZE_BUTTON)
self.share.show()
image.show()
self.add_del.add(image)

View File

@ -8461,7 +8461,7 @@ Text Beside Icons</property>
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">4</property>
<property name="n_columns">6</property>
<property name="n_columns">5</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
@ -8494,35 +8494,6 @@ Text Beside Icons</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label157">
<property name="visible">True</property>
<property name="label" translatable="yes">_Place:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</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">3</property>
<property name="mnemonic_widget">eventPlace</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">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="causelabel">
<property name="visible">True</property>
@ -8545,34 +8516,13 @@ Text Beside Icons</property>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="eventCause">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="personal_events">
<property name="visible">True</property>
@ -8582,7 +8532,7 @@ Text Beside Icons</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</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>
@ -8610,8 +8560,8 @@ Text Beside Icons</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
@ -8619,27 +8569,6 @@ Text Beside Icons</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="eventDate">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">4</property>
<property name="right_attach">5</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="date_stat">
<property name="visible">True</property>
@ -8658,8 +8587,8 @@ Text Beside Icons</property>
</child>
</widget>
<packing>
<property name="left_attach">5</property>
<property name="right_attach">6</property>
<property name="left_attach">4</property>
<property name="right_attach">5</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
@ -8696,48 +8625,6 @@ Text Beside Icons</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="event_description">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">6</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="eventPlace">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">6</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkToggleButton" id="private">
<property name="visible">True</property>
@ -8760,10 +8647,10 @@ Text Beside Icons</property>
</child>
</widget>
<packing>
<property name="left_attach">5</property>
<property name="right_attach">6</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="left_attach">4</property>
<property name="right_attach">5</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -8787,12 +8674,33 @@ Text Beside Icons</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="eventDate">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
@ -8809,14 +8717,178 @@ Text Beside Icons</property>
<property name="invisible_char">●</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="eventCause">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="event_description">
<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">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">4</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="label157">
<property name="visible">True</property>
<property name="label" translatable="yes">_Place:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</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">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">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="add_del_place">
<property name="visible">True</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="image2699">
<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="left_attach">4</property>
<property name="right_attach">5</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox130">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="place">
<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>
<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">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="select_place">
<property name="visible">True</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="image2700">
<property name="visible">True</property>
<property name="icon_size">4</property>
<property name="icon_name">gtk-index</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">1</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>

View File

@ -194,16 +194,6 @@ class Gramps:
self.statusbar_key_update)
Config.client.notify_add("/apps/gramps/interface/toolbar",
self.toolbar_key_update)
# Config.client.notify_add("/apps/gramps/interface/toolbar-on",
# self.toolbar_on_key_update)
# Config.client.notify_add("/apps/gramps/interface/filter",
# self.filter_key_update)
# Config.client.notify_add("/apps/gramps/interface/view",
# self.sidebar_key_update)
# Config.client.notify_add("/apps/gramps/preferences/name-format",
# self.familyview_key_update)
# Config.client.notify_add("/apps/gramps/preferences/date-format",
# self.date_format_key_update)
if Config.get(Config.USE_TIPS):
TipOfDay.TipOfDay(self.vm.uistate)
@ -254,6 +244,3 @@ class Gramps:
else:
self.vm.toolbar.set_style(the_style)
# def toolbar_on_key_update(self,client,cnxn_id,entry,data):
# is_on = COnfig.get_toolbar_on()
# self.enable_toolbar(is_on)