[Deskbar] [PATCH] Cuemiac optimization
- From: Mikkel Kamstrup Erlandsen <kamstrup daimi au dk>
- To: deskbar-applet-list gnome org
- Subject: [Deskbar] [PATCH] Cuemiac optimization
- Date: Tue, 24 Jan 2006 00:27:34 +0100
WARNING: The attached patch contains the "Enable cuemiac via pref
dialog"-fix from my last patch.
I did a small optimization in the C, that might also be good on the
CompletionUI. It removes the "flicker" when you type and look at the
live results.
Basically I set an invalid-flag when a new query is started, but *don't*
clear the model. Then in append_matches() I check for the invalid flag
and clear the model and revalidate if it's set - before I append matches
to (the now empty) model.
Cheers
Mikkel
? cuemiac-gconf-enable-1.patch
? cuemiac-optimize-1.patch
? deskbar/evolution/.deps
? deskbar/evolution/.libs
? deskbar/evolution/_evolution.la
? deskbar/gnomedesktop/.deps
? deskbar/gnomedesktop/.libs
? deskbar/gnomedesktop/_gnomedesktop.la
? deskbar/gnomedesktop/_gnomedesktop.lo
? deskbar/gnomedesktop/_gnomedesktopmodule.lo
? deskbar/iconentry/.deps
? deskbar/iconentry/.libs
? deskbar/iconentry/_iconentry.la
? deskbar/iconentry/_iconentry.lo
? deskbar/iconentry/_iconentrymodule.lo
? deskbar/iconentry/ephy-icon-entry.lo
? deskbar/keybinder/.deps
? deskbar/keybinder/.libs
? deskbar/keybinder/_keybinder.la
? po/.intltool-merge-cache
Index: deskbar/DeskbarApplet.py
===================================================================
RCS file: /cvs/gnome/deskbar-applet/deskbar/DeskbarApplet.py,v
retrieving revision 1.15
diff -u -r1.15 DeskbarApplet.py
--- deskbar/DeskbarApplet.py 23 Jan 2006 18:44:59 -0000 1.15
+++ deskbar/DeskbarApplet.py 23 Jan 2006 23:20:28 -0000
@@ -38,6 +38,7 @@
self.loader.connect ("module-stopped", self.module_list.module_toggled_cb)
self.loader.connect ("module-initialized", self._connect_if_async)
+ # Set and retrieve the UI to be used
ui_name = deskbar.GCONF_CLIENT.get_string(self.prefs.GCONF_UI_NAME)
if ui_name == None:
ui_name = deskbar.COMPLETION_UI_NAME
@@ -47,12 +48,13 @@
elif ui_name == deskbar.CUEMIAC_UI_NAME:
self.ui = CuemiacUI (applet)
+ # Set up the chosen UI
self.set_up_ui_signals ()
self.ui.set_sensitive (False)
self.applet.add(self.ui.get_view ())
self.applet.show_all()
- deskbar.GCONF_CLIENT.notify_add (deskbar.GCONF_UI_NAME, lambda x, y, z, a: self.on_ui_changed (z.value))
+ deskbar.GCONF_CLIENT.notify_add (self.prefs.GCONF_UI_NAME, lambda x, y, z, a: self.on_ui_changed (z.value))
# Set and retreive enabled handler list from gconf
deskbar.GCONF_CLIENT.notify_add(deskbar.GCONF_ENABLED_HANDLERS, lambda x, y, z, a: self.on_config_handlers(z.value))
@@ -251,3 +253,4 @@
self.applet.add (self.ui.get_view())
self.applet.show_all ()
self.ui.set_sensitive(True)
+ print "Changing UI to:", value.get_string ()
Index: deskbar/ui/DeskbarPreferencesUI.py
===================================================================
RCS file: /cvs/gnome/deskbar-applet/deskbar/ui/DeskbarPreferencesUI.py,v
retrieving revision 1.2
diff -u -r1.2 DeskbarPreferencesUI.py
--- deskbar/ui/DeskbarPreferencesUI.py 23 Jan 2006 00:54:40 -0000 1.2
+++ deskbar/ui/DeskbarPreferencesUI.py 23 Jan 2006 23:20:28 -0000
@@ -188,7 +188,6 @@
deskbar.GCONF_CLIENT.set_string(applet.prefs.GCONF_UI_NAME, COMPLETION_UI_NAME)
elif self.cuemiac_ui_radio.get_active ():
deskbar.GCONF_CLIENT.set_string(applet.prefs.GCONF_UI_NAME, CUEMIAC_UI_NAME)
- print "UI"
def on_config_ui (self, value):
if value != None and value.type == gconf.VALUE_STRING:
Index: deskbar/ui/cuemiac/Cuemiac.py
===================================================================
RCS file: /cvs/gnome/deskbar-applet/deskbar/ui/cuemiac/Cuemiac.py,v
retrieving revision 1.7
diff -u -r1.7 Cuemiac.py
--- deskbar/ui/cuemiac/Cuemiac.py 23 Jan 2006 00:54:41 -0000 1.7
+++ deskbar/ui/cuemiac/Cuemiac.py 23 Jan 2006 23:20:28 -0000
@@ -681,6 +681,8 @@
except Exception, msg:
print 'Could not set background widget, no transparency:', msg
+ self.invalid = True
+
def show_entry (self):
if self.deskbar_button.get_active_main ():
self.popup.update_position ()
@@ -694,9 +696,9 @@
def show_history (self):
if self.deskbar_button.get_active_arrow ():
- self.emit ("request-history-show", self.deskbar_button.button_arrow, self.applet.get_orient())
+ print "FIXME show history"
else:
- self.emit ("request-history-hide")
+ print "FIXME hide history"
def get_view (self):
return self.deskbar_button
@@ -710,8 +712,11 @@
self.set_layout_by_orientation (applet.get_orient())
def append_matches (self, matches):
- self.popup.show_all ()
+ if self.invalid :
+ self.invalid = False
+ self.model.clear()
self.model.append (matches)
+ self.popup.show_all ()
def recieve_focus (self):
self.deskbar_button.set_active_main (True)
@@ -735,7 +740,7 @@
self.box.pack_start (self.entry, False)
self.box.pack_start (self.scroll_win)
self.cview.append_method = gtk.TreeStore.append
- if orientation == gnomeapplet.ORIENT_DOWN:
+ if orient == gnomeapplet.ORIENT_DOWN:
self.deskbar_button.set_button_image_from_file (join(deskbar.ART_DATA_DIR, "deskbar-horiz.svg"))
else:
self.deskbar_button.set_button_image_from_file (join(deskbar.ART_DATA_DIR, "deskbar-vert.svg"))
@@ -760,13 +765,13 @@
def on_entry_changed (self, entry):
qstring = self.entry.get_text().strip()
- self.model.clear()
self.cview.set_query_string (qstring)
-
if qstring == "":
+ self.model.clear()
self.scroll_win.hide ()
return
self.emit ("start-query", qstring, 100)
+ self.invalid = True
self.popup.show ()
def hide_if_entry_empty (self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]