From 2a23820fb75eee964654c3eb8f46f04cd248b500 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 12 Dec 2001 03:53:15 +0000 Subject: [PATCH] Autocompletion is now optional svn: r612 --- src/Config.py | 13 + src/Find.py | 7 +- src/config.glade | 1229 ++++++++++++++++++++++++---------------------- 3 files changed, 647 insertions(+), 602 deletions(-) diff --git a/src/Config.py b/src/Config.py index 5ae848562..10d8d4684 100644 --- a/src/Config.py +++ b/src/Config.py @@ -95,6 +95,7 @@ pprefix = "P" fprefix = "F" autoload = 0 usetabs = 0 +autocomp = 1 usevc = 0 vc_comment = 0 uncompress = 0 @@ -162,6 +163,7 @@ def loadConfig(call): global autoload global owner global usetabs + global autocomp global calendar global usevc global iprefix, fprefix, pprefix, oprefix, sprefix @@ -193,6 +195,7 @@ def loadConfig(call): _callback = call lastfile = get_string("/gramps/data/LastFile") usetabs = get_bool("/gramps/config/UseTabs") + ac = get_bool("/gramps/config/DisableAutoComplete") mediaref = get_bool("/gramps/config/MakeReference") globalprop = get_bool("/gramps/config/DisplayGlobal") localprop = get_bool("/gramps/config/DisplayLocal") @@ -300,6 +303,11 @@ def loadConfig(call): localprop =1 if usetabs == None: usetabs = 0 + if ac == None: + autocomp = 1 + else: + autocomp = not ac + if calendar == None: calendar = 0 if usevc == None: @@ -415,6 +423,7 @@ def on_propertybox_apply(obj,page): global nameof global owner global usetabs + global autocomp global mediaref global globalprop global localprop @@ -450,6 +459,7 @@ def on_propertybox_apply(obj,page): display_attr = prefsTop.get_widget("attr_display").get_active() attr_name = string.strip(prefsTop.get_widget("attr_name").get_text()) usetabs = prefsTop.get_widget("usetabs").get_active() + autocomp = prefsTop.get_widget("autocomp").get_active() mediaref = prefsTop.get_widget("mediaref").get_active() localprop = prefsTop.get_widget("localprop").get_active() globalprop = prefsTop.get_widget("globalprop").get_active() @@ -510,6 +520,7 @@ def on_propertybox_apply(obj,page): output_preference = output_obj.get_data(DATA) set_bool("/gramps/config/UseTabs",usetabs) + set_bool("/gramps/config/DisableAutoComplete",not autocomp) set_bool("/gramps/config/MakeReference",mediaref) set_bool("/gramps/config/DisplayGlobal",globalprop) set_bool("/gramps/config/DisplayLocal",localprop) @@ -677,6 +688,7 @@ def display_preferences_box(db): idedit = prefsTop.get_widget("gid_edit") index_vis = prefsTop.get_widget("show_child_id") tabs = prefsTop.get_widget("usetabs") + ac = prefsTop.get_widget("autocomp") mr = prefsTop.get_widget("mediaref") mc = prefsTop.get_widget("mediacopy") dg = prefsTop.get_widget("globalprop") @@ -691,6 +703,7 @@ def display_preferences_box(db): auto.set_active(autoload) detail.set_active(show_detail) tabs.set_active(usetabs) + ac.set_active(autocomp) if mediaref: mr.set_active(1) else: diff --git a/src/Find.py b/src/Find.py index cfc247a6e..1274aac40 100644 --- a/src/Find.py +++ b/src/Find.py @@ -24,6 +24,7 @@ __author__ = 'Don Allingham' import libglade +import Config import const import utils import string @@ -45,13 +46,15 @@ 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() + if Config.autocomp: + self.entry.connect_object("insert-text",utils.combo_insert_text,self.combo) + self.combo.disable_activate() self.next = self.xml.get_widget("next") nlist = [""] for n in plist: diff --git a/src/config.glade b/src/config.glade index a77103162..c4e539a6d 100644 --- a/src/config.glade +++ b/src/config.glade @@ -214,9 +214,38 @@ GtkFrame - frame12 + frame18 5 - + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkCheckButton + autocomp + True + + toggled + on_object_toggled + propertybox + Wed, 12 Dec 2001 03:34:00 GMT + + + True + True + + + + + GtkFrame + frame17 + 5 + 0 GTK_SHADOW_ETCHED_IN @@ -227,82 +256,71 @@ GtkVBox - vbox31 + vbox35 False 0 - GtkCheckButton - usetabs - 3 + GtkRadioButton + tool1 True toggled on_object_toggled propertybox - Thu, 15 Feb 2001 21:32:23 GMT + Wed, 30 May 2001 02:18:01 GMT - - False + + True True + toolbar - 5 + 0 False False - GtkHBox - hbox1 - False - 0 + GtkRadioButton + tool2 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:16 GMT + + + False + True + toolbar 0 - True - True + False + False + - - GtkCheckButton - attr_display - True - - toggled - on_object_toggled - propertybox - Thu, 24 May 2001 21:14:10 GMT - - - False - True - - 3 - False - False - - - - - GtkEntry - attr_name - True - - changed - on_object_toggled - propertybox - Thu, 24 May 2001 21:14:30 GMT - - True - True - 0 - - - 5 - True - True - - + + GtkRadioButton + tool3 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:29 GMT + + + False + True + toolbar + + 0 + False + False + @@ -974,9 +992,9 @@ GtkFrame - frame17 + frame12 5 - + 0 GTK_SHADOW_ETCHED_IN @@ -996,71 +1014,82 @@ GtkVBox - vbox35 + vbox31 False 0 - GtkRadioButton - tool1 + GtkCheckButton + usetabs + 3 True toggled on_object_toggled propertybox - Wed, 30 May 2001 02:18:01 GMT + Thu, 15 Feb 2001 21:32:23 GMT - - True + + False True - toolbar - 0 + 5 False False - GtkRadioButton - tool2 - True - - toggled - on_object_toggled - propertybox - Wed, 30 May 2001 02:18:16 GMT - - - False - True - toolbar + GtkHBox + hbox1 + False + 0 0 - False - False + True + True - - - GtkRadioButton - tool3 - True - - toggled - on_object_toggled - propertybox - Wed, 30 May 2001 02:18:29 GMT - - - False - True - toolbar - - 0 - False - False - + + GtkCheckButton + attr_display + True + + toggled + on_object_toggled + propertybox + Thu, 24 May 2001 21:14:10 GMT + + + False + True + + 3 + False + False + + + + + GtkEntry + attr_name + True + + changed + on_object_toggled + propertybox + Thu, 24 May 2001 21:14:30 GMT + + True + True + 0 + + + 5 + True + True + + @@ -1344,246 +1373,6 @@ 0 0 - - GtkEntry - resname - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:33:49 GMT - - True - True - 0 - - - 1 - 2 - 0 - 1 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - resaddr - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:34:37 GMT - - True - True - 0 - - - 1 - 2 - 1 - 2 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - rescity - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:35:00 GMT - - True - True - 0 - - - 1 - 2 - 2 - 3 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - resstate - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:35:18 GMT - - True - True - 0 - - - 1 - 2 - 3 - 4 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - rescountry - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:35:38 GMT - - True - True - 0 - - - 1 - 2 - 4 - 5 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - respostal - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:35:53 GMT - - True - True - 0 - - - 1 - 2 - 5 - 6 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - resphone - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:36:08 GMT - - True - True - 0 - - - 1 - 2 - 6 - 7 - 3 - 3 - True - False - False - False - True - False - - - - - GtkEntry - resemail - True - - changed - on_object_toggled - propertybox - Thu, 14 Jun 2001 14:36:27 GMT - - True - True - 0 - - - 1 - 2 - 7 - 8 - 3 - 3 - True - False - False - False - True - False - - - GtkLabel label143 @@ -1791,6 +1580,246 @@ False + + + GtkEntry + resaddr + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:34:37 GMT + + True + True + 0 + + + 1 + 2 + 1 + 2 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + resname + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:33:49 GMT + + True + True + 0 + + + 1 + 2 + 0 + 1 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + rescity + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:35:00 GMT + + True + True + 0 + + + 1 + 2 + 2 + 3 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + resstate + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:35:18 GMT + + True + True + 0 + + + 1 + 2 + 3 + 4 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + rescountry + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:35:38 GMT + + True + True + 0 + + + 1 + 2 + 4 + 5 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + respostal + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:35:53 GMT + + True + True + 0 + + + 1 + 2 + 5 + 6 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + resphone + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:36:08 GMT + + True + True + 0 + + + 1 + 2 + 6 + 7 + 5 + 3 + True + False + False + False + True + False + + + + + GtkEntry + resemail + True + + changed + on_object_toggled + propertybox + Thu, 14 Jun 2001 14:36:27 GMT + + True + True + 0 + + + 1 + 2 + 7 + 8 + 5 + 3 + True + False + False + False + True + False + + @@ -1810,7 +1839,7 @@ GtkTable table25 4 - 2 + 3 False 0 0 @@ -1867,140 +1896,6 @@ - - GtkOptionMenu - paper_size - True - Letter -A4 - - 0 - - 1 - 2 - 1 - 2 - 5 - 5 - True - False - False - False - True - False - - - - - GtkOptionMenu - output_format - True - OpenOffice -HTML -PDF -AbiWord - - 0 - - 1 - 2 - 0 - 1 - 5 - 5 - True - False - False - False - True - False - - - - - GnomeFileEntry - repdir - repdir - 10 - Gramps - Select default report directory - True - False - - 1 - 2 - 2 - 3 - 5 - 5 - True - False - False - False - True - False - - - - GtkEntry - GnomeEntry:entry - entry1 - The default directory for the output of many report generators - True - - changed - on_object_toggled - propertybox - Thu, 28 Jun 2001 13:49:30 GMT - - True - True - 0 - - - - - - GnomeFileEntry - htmldir - repdir - 10 - Gramps - Select default report directory - True - False - - 1 - 2 - 3 - 4 - 5 - 5 - True - False - False - False - True - False - - - - GtkEntry - GnomeEntry:entry - entry2 - The default directory for the output of the Web Site report generators - True - - changed - on_object_toggled - propertybox - Thu, 28 Jun 2001 13:49:30 GMT - - True - True - 0 - - - - GtkLabel label206 @@ -2052,6 +1947,140 @@ AbiWord False + + + GnomeFileEntry + repdir + repdir + 10 + Gramps - Select default report directory + True + False + + 1 + 3 + 2 + 3 + 5 + 5 + True + False + False + False + True + False + + + + GtkEntry + GnomeEntry:entry + entry1 + The default directory for the output of many report generators + True + + changed + on_object_toggled + propertybox + Thu, 28 Jun 2001 13:49:30 GMT + + True + True + 0 + + + + + + GnomeFileEntry + htmldir + repdir + 10 + Gramps - Select default report directory + True + False + + 1 + 3 + 3 + 4 + 5 + 5 + True + False + False + False + True + False + + + + GtkEntry + GnomeEntry:entry + entry2 + The default directory for the output of the Web Site report generators + True + + changed + on_object_toggled + propertybox + Thu, 28 Jun 2001 13:49:30 GMT + + True + True + 0 + + + + + + GtkOptionMenu + output_format + True + OpenOffice +HTML +PDF +AbiWord + + 0 + + 1 + 2 + 0 + 1 + 5 + 5 + False + False + False + False + True + False + + + + + GtkOptionMenu + paper_size + True + Letter +A4 + + 0 + + 1 + 2 + 1 + 2 + 5 + 5 + False + False + False + False + True + False + + @@ -2081,7 +2110,7 @@ AbiWord 0 GTK_SHADOW_ETCHED_IN - 0 + 5 False True @@ -2269,96 +2298,6 @@ AbiWord - - GtkEntry - iprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 13:59:28 GMT - - True - True - 0 - I - - 1 - 2 - 0 - 1 - 2 - 2 - True - False - False - False - True - False - - - - - GtkEntry - fprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:00:26 GMT - - True - True - 0 - F - - 1 - 2 - 1 - 2 - 2 - 2 - True - False - False - False - True - False - - - - - GtkEntry - pprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:00:13 GMT - - True - True - 0 - P - - 1 - 2 - 2 - 3 - 2 - 2 - True - False - False - False - True - False - - - GtkLabel label211 @@ -2437,36 +2376,6 @@ AbiWord - - GtkEntry - sprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:00:46 GMT - - True - True - 0 - S - - 1 - 2 - 3 - 4 - 0 - 0 - True - False - False - False - True - False - - - GtkLabel label214 @@ -2493,6 +2402,126 @@ AbiWord + + GtkEntry + iprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 13:59:28 GMT + + True + True + 0 + I + + 1 + 2 + 0 + 1 + 5 + 5 + True + False + False + False + True + False + + + + + GtkEntry + fprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:00:26 GMT + + True + True + 0 + F + + 1 + 2 + 1 + 2 + 5 + 5 + True + False + False + False + True + False + + + + + GtkEntry + pprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:00:13 GMT + + True + True + 0 + P + + 1 + 2 + 2 + 3 + 5 + 5 + True + False + False + False + True + False + + + + + GtkEntry + sprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:00:46 GMT + + True + True + 0 + S + + 1 + 2 + 3 + 4 + 5 + 5 + True + False + False + False + True + False + + + GtkEntry oprefix @@ -2512,8 +2541,8 @@ AbiWord 2 4 5 - 0 - 0 + 5 + 5 True False False @@ -2529,7 +2558,7 @@ AbiWord GtkFrame frame13 5 - + 0 GTK_SHADOW_ETCHED_IN