diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index bb720d304..c80369db3 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,7 @@ 2006-05-17 Don Allingham + * src/GrampsDb/_GrampsDbBase.py: remove place name storage + * src/Editors/_EditLdsOrd.py: new SelectPlace interface + * src/glade/gramps.glade: new select place interface changes * src/Editors/_EditPlace.py: new SelectPlace interface * src/Editors/_EditEventRef.py: new SelectPlace interface, remove old code diff --git a/gramps2/src/Editors/_EditLdsOrd.py b/gramps2/src/Editors/_EditLdsOrd.py index afeaf169c..a29e8fcce 100644 --- a/gramps2/src/Editors/_EditLdsOrd.py +++ b/gramps2/src/Editors/_EditLdsOrd.py @@ -124,6 +124,8 @@ class EditLdsOrd(EditSecondary): self.set_window(self.top.get_widget("lds_person_edit"), self.top.get_widget('title'), _('LDS Ordinance Editor')) + self.share_btn = self.top.get_widget('share_place') + self.add_del_btn = self.top.get_widget('add_del_place') def _connect_signals(self): self.parents_select.connect('clicked',self.select_parents_clicked) @@ -150,10 +152,14 @@ class EditLdsOrd(EditSecondary): self.db.readonly) self.place_field = PlaceEntry( + self.dbstate, + self.uistate, + self.track, self.top.get_widget("place"), - self.obj.get_place_handle(), - self.dbstate.get_place_completion(), - self.db.readonly) + self.obj.set_place_handle, + self.obj.get_place_handle, + self.add_del_btn, + self.share_btn) self.type_menu = MonitoredMenu( self.top.get_widget('type'), @@ -266,18 +272,6 @@ class EditLdsOrd(EditSecondary): Called when the OK button is pressed. Gets data from the form and updates the LdsOrd data structure. """ - - (need_new, handle) = self.place_field.get_place_info() - if need_new: - place_obj = RelLib.Place() - place_obj.set_title(handle) - trans = self.db.transaction_begin() - self.db.add_place(place_obj,trans) - self.db.transaction_commit(trans,_("Add Place")) - self.obj.set_place_handle(place_obj.get_handle()) - else: - self.obj.set_place_handle(handle) - if self.callback: self.callback(self.obj) self.close() @@ -308,6 +302,8 @@ class EditFamilyLdsOrd(EditSecondary): self.set_window(self.top.get_widget("lds_person_edit"), self.top.get_widget('title'), _('LDS Ordinance Editor')) + self.share_btn = self.top.get_widget('share_place') + self.add_del_btn = self.top.get_widget('add_del_place') def _connect_signals(self): self.define_cancel_button(self.top.get_widget('cancel')) @@ -333,10 +329,14 @@ class EditFamilyLdsOrd(EditSecondary): self.db.readonly) self.place_field = PlaceEntry( + self.dbstate, + self.uistate, + self.track, self.top.get_widget("place"), - self.obj.get_place_handle(), - self.dbstate.get_place_completion(), - self.db.readonly) + self.obj.set_place_handle, + self.obj.get_place_handle, + self.add_del_btn, + self.share_btn) self.type_menu = MonitoredMenu( self.top.get_widget('type'), @@ -396,18 +396,6 @@ class EditFamilyLdsOrd(EditSecondary): Called when the OK button is pressed. Gets data from the form and updates the LdsOrd data structure. """ - - (need_new, handle) = self.place_field.get_place_info() - if need_new: - place_obj = RelLib.Place() - place_obj.set_title(handle) - trans = self.db.transaction_begin() - self.db.add_place(place_obj,trans) - self.db.transaction_commit(trans,_("Add Place")) - self.obj.set_place_handle(place_obj.get_handle()) - else: - self.obj.set_place_handle(handle) - if self.callback: self.callback(self.obj) self.close() diff --git a/gramps2/src/GrampsDb/_GrampsDbBase.py b/gramps2/src/GrampsDb/_GrampsDbBase.py index d65fbbff0..3f6c193e8 100644 --- a/gramps2/src/GrampsDb/_GrampsDbBase.py +++ b/gramps2/src/GrampsDb/_GrampsDbBase.py @@ -2115,31 +2115,6 @@ class DbState(GrampsDBCallback): self.db = GrampsDbBase() self.open = False self.active = None - self.places = {} - - def _place_rebuild(self): - self.places.clear() - cursor = self.db.get_place_cursor() - data = cursor.next() - while data: - if data[1][2]: - self.places[data[0]] = data[1][2] - data = cursor.next() - cursor.close() - - def _place_add(self, handle_list): - for handle in handle_list: - place = self.db.get_place_from_handle(handle) - self.places[handle] = place.get_title() - - def _place_update(self, handle_list): - for handle in handle_list: - place = self.db.get_place_from_handle(handle) - self.places[handle] = place.get_title() - - def _place_delete(self, handle_list): - for handle in handle_list: - del self.places[handle] def change_active_person(self, person): self.active = person @@ -2160,10 +2135,6 @@ class DbState(GrampsDBCallback): def change_database(self, database): self.db.close() self.db = database - self.db.connect('place-add', self._place_add) - self.db.connect('place-update', self._place_update) - self.db.connect('place-delete', self._place_delete) - self.db.connect('place-rebuild', self._place_rebuild) self.active = None self.open = True @@ -2177,5 +2148,3 @@ class DbState(GrampsDBCallback): self.open = False self.emit('no-database') - def get_place_completion(self): - return self.places diff --git a/gramps2/src/glade/gramps.glade b/gramps2/src/glade/gramps.glade index 9a43779dd..9dc0a3b7d 100644 --- a/gramps2/src/glade/gramps.glade +++ b/gramps2/src/glade/gramps.glade @@ -9674,556 +9674,6 @@ Text Beside Icons - - True - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 600 - 450 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - - True - Accept changes and close window - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - - False - True - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 10 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 12 - True - 5 - 7 - False - 6 - 12 - - - - True - _Date: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - address_start - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Add_ress: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - street - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - _City/County: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - city - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 3 - 2 - 3 - - - - - - - True - _State/Province: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - state - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 4 - 5 - 2 - 3 - fill - - - - - - - True - _ZIP/Postal code: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - postal - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 3 - 3 - 4 - - - - - - - True - Cou_ntry: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - country - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 4 - 5 - 3 - 4 - fill - - - - - - - True - P_hone: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - phone - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 3 - 4 - 5 - - - - - - - True - True - True - True - True - 0 - - True - * - False - - - 1 - 6 - 0 - 1 - - - - - - - True - True - True - True - 0 - - True - * - False - - - 5 - 7 - 2 - 3 - - - - - - - True - True - True - True - 0 - - True - * - False - - - 5 - 7 - 3 - 4 - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 6 - 1 - 2 - - - - - - - True - True - GTK_RELIEF_NONE - True - False - False - - - - True - 1 - gtk-dialog-authentication - 0.5 - 0.5 - 0 - 0 - - - - - 6 - 7 - 1 - 2 - - - - - - - - True - True - GTK_RELIEF_NONE - True - - - - True - 0.5 - 0.5 - 0 - 0 - - - - - 6 - 7 - 0 - 1 - - fill - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - True @@ -15693,7 +15143,7 @@ You should select parents before adding any new information. If you select paren - + 12 True 6 @@ -15782,58 +15232,6 @@ You should select parents before adding any new information. If you select paren - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 4 - 5 - - - - - - - True - True - GTK_RELIEF_NONE - True - False - False - - - - True - 1 - gtk-dialog-authentication - 0.5 - 0.5 - 0 - 0 - - - - - 2 - 3 - 4 - 5 - - - - - True @@ -16080,6 +15478,129 @@ You should select parents before adding any new information. If you select paren fill + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NONE + True + + + + True + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 4 + 5 + fill + fill + + + + + + True + True + GTK_RELIEF_NONE + True + False + False + + + + True + 1 + gtk-dialog-authentication + 0.5 + 0.5 + 0 + 0 + + + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + True + GTK_RELIEF_NONE + True + + + + True + 0.5 + 0.5 + 0 + 0 + + + + + 2 + 3 + 4 + 5 + fill + + + 0