diff --git a/gramps/src/Config.py b/gramps/src/Config.py index e9ba922e5..5ae848562 100644 --- a/gramps/src/Config.py +++ b/gramps/src/Config.py @@ -105,6 +105,7 @@ nameof = utils.normal_name display_attr = 0 attr_name = "" status_bar = 0 +toolbar = 2 calendar = 0 paper_preference = None output_preference = None @@ -184,6 +185,7 @@ def loadConfig(call): global web_dir global db_dir global status_bar + global toolbar global mediaref global globalprop global localprop @@ -203,6 +205,11 @@ def loadConfig(call): index_visible = get_bool("/gramps/config/IndexVisible") show_detail = get_bool("/gramps/config/ShowDetail") status_bar = get_int("/gramps/config/StatusBar") + t = get_int("/gramps/config/ToolBar") + if t == 0: + toolbar = 2 + else: + toolbar = t-1 display_attr = get_bool("/gramps/config/DisplayAttr") attr_name = get_string("/gramps/config/DisplayAttrName") @@ -311,6 +318,8 @@ def loadConfig(call): show_detail = 0 if status_bar == None: status_bar = 0 + if toolbar == None: + toolbar = 2 if hide_altnames == None: hide_altnames = 0 if dateFormat == None: @@ -422,6 +431,7 @@ def on_propertybox_apply(obj,page): global id_edit global index_visible global status_bar + global toolbar global display_attr global attr_name global hide_altnames @@ -461,6 +471,13 @@ def on_propertybox_apply(obj,page): else: status_bar = 2 + if prefsTop.get_widget("tool1").get_active(): + toolbar = 0 + elif prefsTop.get_widget("tool2").get_active(): + toolbar = 1 + else: + toolbar = 2 + iprefix = prefsTop.get_widget("iprefix").get_text() if iprefix == "": iprefix = "I" @@ -505,6 +522,7 @@ def on_propertybox_apply(obj,page): set_bool("/gramps/config/IndexVisible",index_visible) set_bool("/gramps/config/ShowDetail",show_detail) set_int("/gramps/config/StatusBar",status_bar) + set_int("/gramps/config/ToolBar",toolbar+1) set_bool("/gramps/config/DisplayAttr",display_attr) set_string("/gramps/config/DisplayAttrName",attr_name) set_string("/gramps/config/paperPreference",paper_preference) @@ -700,6 +718,13 @@ def display_preferences_box(db): else: prefsTop.get_widget("stat3").set_active(1) + if toolbar == 0: + prefsTop.get_widget("tool1").set_active(1) + elif toolbar == 1: + prefsTop.get_widget("tool2").set_active(1) + else: + prefsTop.get_widget("tool3").set_active(1) + display_attr_obj.set_active(display_attr) prefsTop.get_widget("attr_name").set_text(attr_name) diff --git a/gramps/src/Find.py b/gramps/src/Find.py index b779d8059..cfc247a6e 100644 --- a/gramps/src/Find.py +++ b/gramps/src/Find.py @@ -32,7 +32,7 @@ import gtk class Find: """Opens find person dialog for gramps""" - def __init__(self,clist,task): + def __init__(self,clist,task,plist): """Opens a dialog box instance that allows users to search for a person. @@ -45,10 +45,19 @@ class Find: self.xml.signal_autoconnect({ "destroy_passed_object" : utils.destroy_passed_object, "on_next_clicked" : self.on_next_clicked, + "on_combo_insert_text" : utils.combo_insert_text, "on_prev_clicked" : self.on_prev_clicked, }) self.top = self.xml.get_widget("find") self.entry = self.xml.get_widget("entry1") + self.combo = self.xml.get_widget("combo") + self.combo.disable_activate() + self.next = self.xml.get_widget("next") + nlist = [""] + for n in plist: + nlist.append(n.getPrimaryName().getName()) + nlist.sort() + self.combo.set_popdown_strings(nlist) self.top.editable_enters(self.entry) def find_next(self): @@ -65,10 +74,12 @@ class Find: gtk.gdk_beep() return + orow = row + row = row + 1 last = self.clist.rows person = None - while row < last: + while row != orow: person,alt = self.clist.get_row_data(row) if alt == 0: name = person.getPrimaryName().getName() @@ -76,6 +87,9 @@ class Find: self.task(person) return row = row + 1 + if row == last: + row = 0 + gtk.gdk_beep() def find_prev(self): @@ -92,9 +106,11 @@ class Find: gtk.gdk_beep() return + orow = row row = row - 1 + last = self.clist.rows person = None - while row >= 0: + while row != orow: person,alt = self.clist.get_row_data(row) if alt == 0: name = person.getPrimaryName().getName() @@ -102,6 +118,8 @@ class Find: self.task(person) return row = row - 1 + if row < 0: + row = last gtk.gdk_beep() diff --git a/gramps/src/config.glade b/gramps/src/config.glade index a49db0fd2..a77103162 100644 --- a/gramps/src/config.glade +++ b/gramps/src/config.glade @@ -429,7 +429,7 @@ GtkTable table21 - 2 + 3 2 False 0 @@ -444,8 +444,8 @@ 1 2 - 1 - 2 + 2 + 3 5 5 False @@ -646,7 +646,7 @@ 0 1 0 - 2 + 3 5 5 True @@ -971,6 +971,99 @@ + + + GtkFrame + frame17 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkVBox + vbox35 + False + 0 + + + GtkRadioButton + tool1 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:01 GMT + + + True + True + toolbar + + 0 + False + False + + + + + GtkRadioButton + tool2 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:16 GMT + + + False + True + toolbar + + 0 + False + False + + + + + GtkRadioButton + tool3 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:29 GMT + + + False + True + toolbar + + 0 + False + False + + + + diff --git a/gramps/src/find.glade b/gramps/src/find.glade index 1c1c5e9ba..32560f3fd 100644 --- a/gramps/src/find.glade +++ b/gramps/src/find.glade @@ -17,7 +17,7 @@ GnomeDialog find - Gramps - Find person + Gramps - Find Person GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False @@ -116,7 +116,7 @@ GtkLabel label238 - + GTK_JUSTIFY_CENTER False 0.5 @@ -156,20 +156,37 @@ - GtkEntry - entry1 - 250 - True - True - True - True - 0 - + GtkCombo + combo + False + True + False + True + False + 10 True True + + + GtkEntry + GtkCombo:entry + entry1 + True + True + + insert_text + on_combo_insert_text + combo + Wed, 12 Dec 2001 01:27:32 GMT + + True + True + 0 + + diff --git a/gramps/src/gramps.glade b/gramps/src/gramps.glade index fe46d942f..d821f90af 100644 --- a/gramps/src/gramps.glade +++ b/gramps/src/gramps.glade @@ -199,12 +199,19 @@ GtkPixmapMenuItem find + + GDK_CONTROL_MASK + GDK_f + activate + activate on_find_activate Wed, 05 Sep 2001 02:48:31 GMT - GNOMEUIINFO_MENU_FIND_ITEM + + False + GNOME_STOCK_MENU_SEARCH @@ -591,6 +598,7 @@ GtkButton Toolbar:button button111 + Display the list of places clicked on_places_activate @@ -604,6 +612,7 @@ GtkButton Toolbar:button button145 + Display the list of media objects clicked on_media_activate diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index b72e9fa83..23c80b8be 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -96,6 +96,7 @@ pedigree_view = None place_view = None media_view = None source_view = None +toolbar = None bookmarks = None topWindow = None @@ -141,7 +142,11 @@ FILTERNAME = "filter_list" #------------------------------------------------------------------------- def on_find_activate(obj): """Display the find box""" - Find.Find(person_list,find_goto_to) + Find.Find(person_list,find_goto_to,database.getPersonMap().values()) + +def on_findname_activate(obj): + """Display the find box""" + pass def find_goto_to(person): """Find callback to jump to the selected person""" @@ -436,6 +441,7 @@ def full_update(): place_view.load_places() pedigree_view.load_canvas(active_person) media_view.load_media() + toolbar.set_style(Config.toolbar) def update_display(changed): """Incremental display update, update only the displayed page""" @@ -1876,7 +1882,7 @@ def main(arg): global person_list global topWindow, preview, merge_button global nameArrow, dateArrow, deathArrow, idArrow, genderArrow - global cNameArrow, cDateArrow + global cNameArrow, cDateArrow, toolbar global sort_column, sort_direct gtk.rc_parse(const.gtkrcFile) @@ -1889,13 +1895,12 @@ def main(arg): (sort_column,sort_direct) = Config.get_sort_cols("person",sort_column,sort_direct) - gtop = libglade.GladeXML(const.gladeFile, "gramps") + Config.loadConfig(full_update) + + gtop = libglade.GladeXML(const.gladeFile, "gramps") + toolbar = gtop.get_widget("toolbar1") + toolbar.set_style(Config.toolbar) - Plugins.build_report_menu(gtop.get_widget("reports_menu"),menu_report) - Plugins.build_tools_menu(gtop.get_widget("tools_menu"),menu_tools) - Plugins.build_export_menu(gtop.get_widget("export1"),export_callback) - Plugins.build_import_menu(gtop.get_widget("import1"),import_callback) - statusbar = gtop.get_widget("statusbar") topWindow = gtop.get_widget("gramps") person_list = gtop.get_widget("person_list") @@ -1908,6 +1913,11 @@ def main(arg): deathArrow = gtop.get_widget("deathSort") merge_button= gtop.get_widget("merge") + Plugins.build_report_menu(gtop.get_widget("reports_menu"),menu_report) + Plugins.build_tools_menu(gtop.get_widget("tools_menu"),menu_tools) + Plugins.build_export_menu(gtop.get_widget("export1"),export_callback) + Plugins.build_import_menu(gtop.get_widget("import1"),import_callback) + canvas = gtop.get_widget("canvas1") pedigree_view = PedigreeView(canvas,modify_statusbar,\ statusbar,change_active_person,\ @@ -1932,7 +1942,6 @@ def main(arg): person_list.column_titles_active() set_sort_arrow(sort_column,sort_direct) - Config.loadConfig(full_update) gtop.signal_autoconnect({ "delete_event" : delete_event, @@ -1975,6 +1984,7 @@ def main(arg): "on_family1_activate" : on_family1_activate, "on_father_next_clicked" : on_father_next_clicked, "on_find_activate" : on_find_activate, + "on_findname_activate" : on_findname_activate, "on_fv_prev_clicked" : on_fv_prev_clicked, "on_home_clicked" : on_home_clicked, "on_mother_next_clicked" : on_mother_next_clicked,