deskbar-applet r1880 - in trunk: . data deskbar deskbar/core deskbar/interfaces deskbar/ui deskbar/ui/cuemiac deskbar/ui/preferences po



Author: sebp
Date: Fri Jan 25 23:14:27 2008
New Revision: 1880
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=1880&view=rev

Log:
Merged work from the button-ui branch.
This introduces the old Button UI.
(work partly by Andreas KÃhntopf)

Added:
   trunk/deskbar/ui/CuemiacAlignedView.py
   trunk/deskbar/ui/cuemiac/CuemiacAlignedWindow.py
Modified:
   trunk/ChangeLog
   trunk/data/deskbar-applet.schemas.in
   trunk/data/prefs-dialog.glade
   trunk/deskbar/__init__.py
   trunk/deskbar/core/CoreImpl.py
   trunk/deskbar/core/DeskbarHistory.py
   trunk/deskbar/core/GconfStore.py
   trunk/deskbar/interfaces/Core.py
   trunk/deskbar/ui/CuemiacWindowController.py
   trunk/deskbar/ui/CuemiacWindowView.py
   trunk/deskbar/ui/DeskbarTray.py
   trunk/deskbar/ui/Makefile.am
   trunk/deskbar/ui/cuemiac/CuemiacActionsTreeView.py
   trunk/deskbar/ui/cuemiac/CuemiacModel.py
   trunk/deskbar/ui/cuemiac/LingeringSelectionWindow.py
   trunk/deskbar/ui/cuemiac/Makefile.am
   trunk/deskbar/ui/preferences/DeskbarPreferences.py
   trunk/po/POTFILES.in

Modified: trunk/data/deskbar-applet.schemas.in
==============================================================================
--- trunk/data/deskbar-applet.schemas.in	(original)
+++ trunk/data/deskbar-applet.schemas.in	Fri Jan 25 23:14:27 2008
@@ -160,5 +160,16 @@
 				<long>Whether to show only the preferred search engine, rather than all available engines.  This only affects Mozilla-based web browsers such as Firefox.</long>
 			</locale>
 		</schema>
+		
+		<schema>
+			<key>/schemas/apps/deskbar/ui_name</key>
+			<applyto>/apps/deskbar/ui_name</applyto>
+			<owner>deskbar</owner>
+			<type>string</type>
+			<default>Window</default>
+			<locale name="C">
+				<short>Selects the user interface to use, one of "Window" or "Button"</short>
+			</locale>
+		</schema>
 	</schemalist>
 </gconfschemafile>

Modified: trunk/data/prefs-dialog.glade
==============================================================================
--- trunk/data/prefs-dialog.glade	(original)
+++ trunk/data/prefs-dialog.glade	Fri Jan 25 23:14:27 2008
@@ -12,7 +12,6 @@
   <property name="default_height">450</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">True</property>
-  <property name="icon_name"></property>
   <property name="decorated">True</property>
   <property name="skip_taskbar_hint">False</property>
   <property name="skip_pager_hint">False</property>
@@ -21,7 +20,7 @@
   <property name="focus_on_map">True</property>
   <property name="urgency_hint">False</property>
   <property name="has_separator">False</property>
-  <signal name="response" handler="prefs_dialog_response_cb" last_modification_time="Sat, 10 May 2003 09:37:44 GMT"/>
+  <signal name="response" handler="prefs_dialog_response_cb"/>
 
   <child internal-child="vbox">
     <widget class="GtkVBox" id="dialog-vbox2">
@@ -381,14 +380,14 @@
 			      </child>
 
 			      <child>
-				<widget class="GtkButton" id="update">
+				<widget class="GtkButton" id="check">
 				  <property name="visible">True</property>
 				  <property name="can_focus">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
 				  <property name="focus_on_click">True</property>
 
 				  <child>
-				    <widget class="GtkAlignment" id="alignment21">
+				    <widget class="GtkAlignment" id="alignment22">
 				      <property name="visible">True</property>
 				      <property name="xalign">0.5</property>
 				      <property name="yalign">0.5</property>
@@ -400,15 +399,15 @@
 				      <property name="right_padding">0</property>
 
 				      <child>
-					<widget class="GtkHBox" id="hbox189">
+					<widget class="GtkHBox" id="hbox190">
 					  <property name="visible">True</property>
 					  <property name="homogeneous">False</property>
 					  <property name="spacing">2</property>
 
 					  <child>
-					    <widget class="GtkImage" id="image1">
+					    <widget class="GtkImage" id="image2">
 					      <property name="visible">True</property>
-					      <property name="stock">gtk-refresh</property>
+					      <property name="stock">gtk-network</property>
 					      <property name="icon_size">4</property>
 					      <property name="xalign">0.5</property>
 					      <property name="yalign">0.5</property>
@@ -423,9 +422,9 @@
 					  </child>
 
 					  <child>
-					    <widget class="GtkLabel" id="label1320">
+					    <widget class="GtkLabel" id="label1321">
 					      <property name="visible">True</property>
-					      <property name="label" translatable="yes">_Update</property>
+					      <property name="label" translatable="yes">_Check For Updates</property>
 					      <property name="use_underline">True</property>
 					      <property name="use_markup">False</property>
 					      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -460,14 +459,14 @@
 			      </child>
 
 			      <child>
-				<widget class="GtkButton" id="check">
+				<widget class="GtkButton" id="update">
 				  <property name="visible">True</property>
 				  <property name="can_focus">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
 				  <property name="focus_on_click">True</property>
 
 				  <child>
-				    <widget class="GtkAlignment" id="alignment22">
+				    <widget class="GtkAlignment" id="alignment21">
 				      <property name="visible">True</property>
 				      <property name="xalign">0.5</property>
 				      <property name="yalign">0.5</property>
@@ -479,15 +478,15 @@
 				      <property name="right_padding">0</property>
 
 				      <child>
-					<widget class="GtkHBox" id="hbox190">
+					<widget class="GtkHBox" id="hbox189">
 					  <property name="visible">True</property>
 					  <property name="homogeneous">False</property>
 					  <property name="spacing">2</property>
 
 					  <child>
-					    <widget class="GtkImage" id="image2">
+					    <widget class="GtkImage" id="image1">
 					      <property name="visible">True</property>
-					      <property name="stock">gtk-network</property>
+					      <property name="stock">gtk-refresh</property>
 					      <property name="icon_size">4</property>
 					      <property name="xalign">0.5</property>
 					      <property name="yalign">0.5</property>
@@ -502,9 +501,9 @@
 					  </child>
 
 					  <child>
-					    <widget class="GtkLabel" id="label1321">
+					    <widget class="GtkLabel" id="label1320">
 					      <property name="visible">True</property>
-					      <property name="label" translatable="yes">_Check For Updates</property>
+					      <property name="label" translatable="yes">_Update</property>
 					      <property name="use_underline">True</property>
 					      <property name="use_markup">False</property>
 					      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -817,14 +816,14 @@
 			      <property name="spacing">6</property>
 
 			      <child>
-				<widget class="GtkButton" id="install">
+				<widget class="GtkButton" id="check_new_extensions">
 				  <property name="visible">True</property>
 				  <property name="can_focus">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
 				  <property name="focus_on_click">True</property>
 
 				  <child>
-				    <widget class="GtkAlignment" id="alignment26">
+				    <widget class="GtkAlignment" id="alignment28">
 				      <property name="visible">True</property>
 				      <property name="xalign">0.5</property>
 				      <property name="yalign">0.5</property>
@@ -836,15 +835,15 @@
 				      <property name="right_padding">0</property>
 
 				      <child>
-					<widget class="GtkHBox" id="hbox195">
+					<widget class="GtkHBox" id="hbox197">
 					  <property name="visible">True</property>
 					  <property name="homogeneous">False</property>
 					  <property name="spacing">2</property>
 
 					  <child>
-					    <widget class="GtkImage" id="image5">
+					    <widget class="GtkImage" id="image7">
 					      <property name="visible">True</property>
-					      <property name="stock">gtk-save</property>
+					      <property name="stock">gtk-network</property>
 					      <property name="icon_size">4</property>
 					      <property name="xalign">0.5</property>
 					      <property name="yalign">0.5</property>
@@ -859,9 +858,9 @@
 					  </child>
 
 					  <child>
-					    <widget class="GtkLabel" id="label1327">
+					    <widget class="GtkLabel" id="label1329">
 					      <property name="visible">True</property>
-					      <property name="label" translatable="yes">_Install</property>
+					      <property name="label" translatable="yes">_Check for new extensions</property>
 					      <property name="use_underline">True</property>
 					      <property name="use_markup">False</property>
 					      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -891,19 +890,18 @@
 				  <property name="padding">0</property>
 				  <property name="expand">False</property>
 				  <property name="fill">True</property>
-				  <property name="pack_type">GTK_PACK_END</property>
 				</packing>
 			      </child>
 
 			      <child>
-				<widget class="GtkButton" id="check_new_extensions">
+				<widget class="GtkButton" id="install">
 				  <property name="visible">True</property>
 				  <property name="can_focus">True</property>
 				  <property name="relief">GTK_RELIEF_NORMAL</property>
 				  <property name="focus_on_click">True</property>
 
 				  <child>
-				    <widget class="GtkAlignment" id="alignment28">
+				    <widget class="GtkAlignment" id="alignment26">
 				      <property name="visible">True</property>
 				      <property name="xalign">0.5</property>
 				      <property name="yalign">0.5</property>
@@ -915,15 +913,15 @@
 				      <property name="right_padding">0</property>
 
 				      <child>
-					<widget class="GtkHBox" id="hbox197">
+					<widget class="GtkHBox" id="hbox195">
 					  <property name="visible">True</property>
 					  <property name="homogeneous">False</property>
 					  <property name="spacing">2</property>
 
 					  <child>
-					    <widget class="GtkImage" id="image7">
+					    <widget class="GtkImage" id="image5">
 					      <property name="visible">True</property>
-					      <property name="stock">gtk-network</property>
+					      <property name="stock">gtk-save</property>
 					      <property name="icon_size">4</property>
 					      <property name="xalign">0.5</property>
 					      <property name="yalign">0.5</property>
@@ -938,9 +936,9 @@
 					  </child>
 
 					  <child>
-					    <widget class="GtkLabel" id="label1329">
+					    <widget class="GtkLabel" id="label1327">
 					      <property name="visible">True</property>
-					      <property name="label" translatable="yes">_Check for new extensions</property>
+					      <property name="label" translatable="yes">_Install</property>
 					      <property name="use_underline">True</property>
 					      <property name="use_markup">False</property>
 					      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -970,6 +968,7 @@
 				  <property name="padding">0</property>
 				  <property name="expand">False</property>
 				  <property name="fill">True</property>
+				  <property name="pack_type">GTK_PACK_END</property>
 				</packing>
 			      </child>
 			    </widget>
@@ -1033,6 +1032,71 @@
 	      <property name="spacing">18</property>
 
 	      <child>
+		<widget class="GtkFrame" id="frame4">
+		  <property name="visible">True</property>
+		  <property name="label_xalign">0</property>
+		  <property name="label_yalign">0.5</property>
+		  <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+		  <child>
+		    <widget class="GtkAlignment" id="alignment31">
+		      <property name="visible">True</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xscale">1</property>
+		      <property name="yscale">1</property>
+		      <property name="top_padding">0</property>
+		      <property name="bottom_padding">0</property>
+		      <property name="left_padding">12</property>
+		      <property name="right_padding">0</property>
+
+		      <child>
+			<widget class="GtkCheckButton" id="sticktopanel_checkbox">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Stick to panel</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label1333">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;Window Behavior&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</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="type">label_item</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
 		<widget class="GtkVBox" id="frame3">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>

Modified: trunk/deskbar/__init__.py
==============================================================================
--- trunk/deskbar/__init__.py	(original)
+++ trunk/deskbar/__init__.py	Fri Jan 25 23:14:27 2008
@@ -72,3 +72,6 @@
 
 # Global overrides for command line mode
 UI_OVERRIDE = None
+
+WINDOW_UI_NAME = "Window"
+BUTTON_UI_NAME = "Button"

Modified: trunk/deskbar/core/CoreImpl.py
==============================================================================
--- trunk/deskbar/core/CoreImpl.py	(original)
+++ trunk/deskbar/core/CoreImpl.py	Fri Jan 25 23:14:27 2008
@@ -123,7 +123,7 @@
     
     def get_use_selection(self):
         return self._gconf.get_use_selection()
-    
+
     def get_clear_entry(self):
         return self._gconf.get_clear_entry()
     
@@ -157,6 +157,9 @@
     def get_max_history_items(self):
         return self._gconf.get_max_history_items()
     
+    def get_ui_name(self):
+        return self._gconf.get_ui_name()
+    
     def set_keybinding(self, binding):
         """
         Store keybinding and actually bind it
@@ -175,7 +178,7 @@
     
     def set_use_selection(self, val):
         self._gconf.set_use_selection(val)
-    
+
     def set_clear_entry(self, val):
         self._gconf.set_clear_entry(val)
     
@@ -208,6 +211,9 @@
     
     def set_max_history_items(self, amount):
         self._gconf.set_max_history_items(amount)
+        
+    def set_ui_name(self, name):
+        self._gconf.set_ui_name(name)
     
     def get_history(self):
         """

Modified: trunk/deskbar/core/DeskbarHistory.py
==============================================================================
--- trunk/deskbar/core/DeskbarHistory.py	(original)
+++ trunk/deskbar/core/DeskbarHistory.py	Fri Jan 25 23:14:27 2008
@@ -53,7 +53,7 @@
         """
         gtk.ListStore.__init__ (self, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT) # timestamp, query, match
         
-        self.set_sort_column_id (self.COL_TIME, gtk.SORT_DESCENDING)
+        self.set_sort_order (gtk.SORT_DESCENDING)
         self.set_sort_func (self.COL_TIME, self.__sort_actions)
         
         self._index = 0 # We don't want to show ChooseFromHistoryAction
@@ -61,6 +61,17 @@
         
         self.append(0, "", ChooseFromHistoryAction())
     
+    def set_sort_order(self, order):
+        """
+        @param order Either C{gtk.SORT_DESCENDING} or C{gtk.SORT_ASCENDING}
+        """
+        self.set_sort_column_id(self.COL_TIME, order)
+        if order == gtk.SORT_DESCENDING:
+            # Alternatively gtk.TreeStore.prepend for bottom panel layout
+            self.append_method = gtk.ListStore.append
+        else:
+            self.append_method = gtk.ListStore.prepend
+    
     @staticmethod
     def get_instance(max_history_items=25):
         """
@@ -152,7 +163,7 @@
         """
         *Do not* use this method. Always use L{add}.
         """
-        gtk.ListStore.append (self, (timestamp, text, action))
+        self.append_method (self, (timestamp, text, action))
     
     def prepend (self, timestamp, text, action):
         """

Modified: trunk/deskbar/core/GconfStore.py
==============================================================================
--- trunk/deskbar/core/GconfStore.py	(original)
+++ trunk/deskbar/core/GconfStore.py	Fri Jan 25 23:14:27 2008
@@ -41,13 +41,16 @@
     
     GCONF_MAX_HISTORY_ITEMS = GCONF_DIR + "/max_history_items"
     
-    GCONF_DEFAULT_BROWSER = "/desktop/gnome/url-handlers/http/command"
+    GCONF_UI_NAME = GCONF_DIR + "/ui_name" 
 
+    GCONF_DEFAULT_BROWSER = "/desktop/gnome/url-handlers/http/command"
+    
     __gsignals__ = {
         "keybinding-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]),
         "min-chars-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_INT]),
         "type-delay-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_INT]),
         "use-selection-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_BOOLEAN]),
+        "use-newstyleui-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_BOOLEAN]),
         "clear-entry-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_BOOLEAN]),
         "use-http-proxy-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_BOOLEAN]),
         "proxy-host-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]),
@@ -57,6 +60,7 @@
         "hide-after-action-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_BOOLEAN]),
         "max-history-items-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_INT]),
         "default-browser-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]),
+        "ui-name-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]),
     }
 
     __instance = None
@@ -90,6 +94,7 @@
         self._client.notify_add(self.GCONF_HIDE_AFTER_ACTION, lambda x, y, z, a: self.emit("hide-after-action-changed", z.value.get_bool()))
         self._client.notify_add(self.GCONF_TYPINGDELAY, lambda x, y, z, a: self.emit("max-history-items-changed", z.value.get_int()))
         self._client.notify_add(self.GCONF_DEFAULT_BROWSER, lambda x, y, z, a: self.emit("default-browser-changed", z.value.get_string()))
+        self._client.notify_add(self.GCONF_UI_NAME, lambda x, y, z, a: self.emit("ui-name-changed", z.value.get_string()))
     
     def get_client(self):
         return self._client
@@ -114,6 +119,12 @@
         if select == None:
             select = True
         return select
+
+    def get_use_newstyleui(self):
+        select = self._client.get_bool(self.GCONF_USE_NEWSTYLEUI)
+        if select == None:
+            select = True
+        return select
     
     def get_clear_entry(self):
         clear = self._client.get_bool(self.GCONF_CLEAR_ENTRY)
@@ -159,7 +170,10 @@
            
     def get_default_browser(self):      
         return self._client.get_string(self.GCONF_DEFAULT_BROWSER)
-    
+        
+    def get_ui_name(self):
+        return self._client.get_string(self.GCONF_UI_NAME)
+
     def set_keybinding(self, binding):
         self._client.set_string(self.GCONF_KEYBINDING, binding)
     
@@ -207,3 +221,6 @@
         
     def set_max_history_items(self, amount):
         self._client.set_int(self.GCONF_MAX_HISTORY_ITEMS, int(amount))
+        
+    def set_ui_name(self, name):
+        self._client.set_string(self.GCONF_UI_NAME, name)

Modified: trunk/deskbar/interfaces/Core.py
==============================================================================
--- trunk/deskbar/interfaces/Core.py	(original)
+++ trunk/deskbar/interfaces/Core.py	Fri Jan 25 23:14:27 2008
@@ -89,6 +89,9 @@
     def get_max_history_items(self):
         raise NotImplementedError
     
+    def get_ui_name(self):
+        raise NotImplementedError
+    
     def set_keybinding(self, binding):
         raise NotImplementedError
     
@@ -134,6 +137,9 @@
     def set_max_history_items(self, amount):
         raise NotImplementedError
     
+    def set_ui_name(self, name):
+        raise NotImplementedError
+    
     def get_history(self):
         """
         Returns History object

Added: trunk/deskbar/ui/CuemiacAlignedView.py
==============================================================================
--- (empty file)
+++ trunk/deskbar/ui/CuemiacAlignedView.py	Fri Jan 25 23:14:27 2008
@@ -0,0 +1,312 @@
+import gtk
+import gtk.gdk
+import gobject
+import gnomeapplet
+from gettext import gettext as _
+import deskbar.interfaces.View
+import deskbar.core.Utils
+from deskbar.ui.cuemiac.CuemiacEntry import CuemiacEntry
+from deskbar.ui.cuemiac.CuemiacHeader import CuemiacHeader
+from deskbar.ui.cuemiac.CuemiacModel import CuemiacModel
+from deskbar.ui.cuemiac.CuemiacTreeView import CuemiacTreeView
+from deskbar.ui.cuemiac.CuemiacItems import CuemiacCategory
+from deskbar.ui.cuemiac.CuemiacHistory import CuemiacHistoryView
+from deskbar.ui.cuemiac.CuemiacActionsTreeView import CuemiacActionsTreeView, CuemiacActionsModel
+from deskbar.ui.cuemiac.LingeringSelectionWindow import LingeringSelectionWindow
+from deskbar.ui.cuemiac.CuemiacAlignedWindow import CuemiacAlignedWindow
+
+class CuemiacAlignedView(deskbar.interfaces.View, CuemiacAlignedWindow):
+    """
+    This class is responsible for setting up the GUI.
+    It displays the older version of deskbar's GUI, where the
+    results window is aligned to the gnome panel.
+    """
+    
+    def __init__(self, controller, model, widget, applet):
+        deskbar.interfaces.View.__init__(self, controller, model)
+        CuemiacAlignedWindow.__init__(self, widget, applet)
+        self._controller.register_view(self)
+        self._do_clear = True
+        self.applet = applet
+        
+        self.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_MENU)
+        self.set_keep_above(True)
+        self.applet.set_applet_flags(gnomeapplet.EXPAND_MINOR)
+        self.applet.set_flags(gtk.CAN_FOCUS)
+        
+        self._screen_height = self.get_screen().get_height ()
+        self._screen_width = self.get_screen().get_width ()
+        self._max_window_height = int (0.8 * self._screen_height)
+        self._max_window_width = int (0.6 * self._screen_width)
+        
+        self.connect("delete-event", self._controller.on_quit)
+        self.connect("destroy-event", self._controller.on_quit)
+        self.connect("key-press-event", self.__on_window_key_press_event)
+       
+        self.set_title("Deskbar Applet")
+        self.set_default_size( self._model.get_window_width(), -1 )
+        self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_MENU)
+
+        self.set_role("deskbar-search-window")
+        self.set_property("skip-taskbar-hint", True)
+
+        self._model.connect("query-ready", lambda s,m: gobject.idle_add(self.append_matches, s, m))
+        
+        # VBox 
+        self.vbox_main = gtk.VBox(spacing=12)
+        self.vbox_main.set_border_width(6)
+        self.add(self.vbox_main)
+        self.vbox_main.show()
+        
+#        self.completion = gtk.EntryCompletion()
+#        self.completion.set_model(self._model.get_history())
+#        self.completion.set_inline_completion(True)
+#        self.completion.set_popup_completion(False)
+#        self.completion.set_text_column(1)
+        
+         # Search entry
+        self.default_entry_pixbuf = deskbar.core.Utils.load_icon("deskbar-applet-panel-h.png", width=23, height=14)
+        self.entry = CuemiacEntry (self.default_entry_pixbuf)
+        self.entry.connect("changed", self._controller.on_query_entry_changed)
+        # Connect this before "go-next/previous" to parse history
+        self.entry.connect("key-press-event", self._controller.on_query_entry_key_press_event)
+        self.entry.connect("activate", self._controller.on_query_entry_activate)
+        self.entry.connect("go-next", lambda e: self.__focus_matches_if_visible("top"))
+        self.entry.connect("go-previous", lambda e: self.__focus_matches_if_visible("bottom"))
+#        self.entry.get_entry().set_completion(self.completion)
+        self.entry.show()
+        
+        self.header = CuemiacHeader ( self.entry )
+        self.header.show()
+        
+        # History TreeView
+        self.history_box = gtk.HBox(spacing=6)
+        self.history_box.show()
+        
+        hlabel = gtk.Label()
+        # translators: _H is a mnemonic, i.e. pressing Alt+h will focus the widget
+        hlabel.set_markup_with_mnemonic("<b>%s:</b>" % _("_History"))
+        hlabel.show()
+        self.history_box.pack_start(hlabel, False)
+        
+        self.hview = CuemiacHistoryView(self._model.get_history())
+        self.hview.connect("match-selected", self._controller.on_history_match_selected)
+        self.hview.show()
+        self.history_box.pack_start(self.hview)
+        hlabel.set_mnemonic_widget(self.hview)
+        
+        empty_button = gtk.Button()
+        empty_button.set_image( gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_MENU) )
+        empty_button.connect("clicked", self._controller.on_clear_history)
+        empty_button.show()
+        self.history_box.pack_start(empty_button, False)
+        
+        # Results TreeView
+        self.treeview_model = CuemiacModel ()
+        self.treeview_model.connect("category-added", self._controller.on_category_added)
+        
+        self.cview = CuemiacTreeView (self.treeview_model)
+        #self.cview.connect ("key-press-event", self._on_cview_key_press)
+        self.cview.connect ("match-selected", self._controller.on_match_selected)
+        self.cview.connect ("do-default-action", self._controller.on_do_default_action)
+        self.cview.connect ("pressed-up-at-top", lambda s: self.entry.grab_focus())
+        self.cview.connect ("pressed-down-at-bottom", lambda s: self.entry.grab_focus())
+        self.cview.connect_after ("cursor-changed", self._controller.on_treeview_cursor_changed)
+        self.cview.connect ("row-expanded", self._controller.on_category_expanded, self.treeview_model)
+        self.cview.connect ("row-collapsed", self._controller.on_category_collapsed, self.treeview_model)
+        self.cview.show()
+        
+        LingeringSelectionWindow (self.cview)
+        
+        self.scrolled_results = gtk.ScrolledWindow ()
+        self.scrolled_results.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+        self.scrolled_results.set_shadow_type(gtk.SHADOW_IN)
+        self.scrolled_results.add(self.cview)
+        self.scrolled_results.show()
+        
+        # Actions TreeView
+        self.actions_box = gtk.VBox(spacing=3)
+        
+        self.actions_model = CuemiacActionsModel()
+        self.aview = CuemiacActionsTreeView(self.actions_model)
+        self.aview.connect ("action-selected", self._controller.on_action_selected)
+        self.aview.connect ("go-back", self.__on_go_back)
+        self.aview.show()
+        
+        LingeringSelectionWindow (self.aview)
+        
+        self.scrolled_actions = gtk.ScrolledWindow()
+        self.scrolled_actions.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+        self.scrolled_actions.set_shadow_type(gtk.SHADOW_IN)
+        self.scrolled_actions.add(self.aview)
+        self.scrolled_actions.show()
+        self.actions_box.pack_start(self.scrolled_actions)
+        
+        buttonbox = gtk.HButtonBox()
+        buttonbox.set_layout(gtk.BUTTONBOX_START)
+        buttonbox.show()
+        self.actions_box.pack_start(buttonbox, False)
+        
+        back_button = gtk.Button(_("Back to Matches"))
+        back_button.set_image( gtk.image_new_from_stock(gtk.STOCK_GO_BACK, gtk.ICON_SIZE_MENU) )
+        back_button.set_relief(gtk.RELIEF_NONE)
+        back_button.connect("clicked", self.__on_go_back)
+        back_button.show()
+        buttonbox.pack_start(back_button, False, False, 0)
+       
+        # Results
+        self.results_box = gtk.HBox()
+        self.results_box.pack_start(self.scrolled_results)
+        self.results_box.pack_start(self.actions_box)
+        
+        self.__set_layout_by_orientation(self.applet.get_orient())
+        self.resize( *self.size_request() )
+   
+    def clear_all(self):
+        deskbar.interfaces.View.clear_all(self)
+        self.applet.set_state(gtk.STATE_NORMAL)
+        self.results_box.hide()
+        self.__adjust_popup_size()
+    
+    def clear_results(self):
+        self.treeview_model.clear()
+        
+    def clear_actions(self):
+        self.actions_model.clear()
+        
+    def clear_query(self):
+        self.entry.set_text("")
+        self.entry.set_icon( self.default_entry_pixbuf )
+    
+    def get_toplevel(self):
+        return self
+    
+    def get_entry(self):
+        return self.entry
+    
+    def set_clear(self):
+        """
+        Set a flag to clear the list of matches and actions
+        as soon as the first result arrives
+        """
+        self._do_clear = True
+    
+    def receive_focus(self, time):
+        self.applet.set_state(gtk.STATE_SELECTED)
+        self.update_position()
+        self.entry.grab_focus()
+        self.present_with_time (time)
+    
+    def __show_matches(self):
+        self.scrolled_results.show()
+        self.actions_box.hide()
+        
+    def __show_actions(self):
+        self.scrolled_results.hide()
+        self.actions_box.show()
+    
+    def show_results(self):
+        self.results_box.show()
+        self.__show_matches()
+    
+    def display_actions(self, actions, qstring):
+        self.actions_model.clear()
+        self.__show_actions()
+        self.actions_model.add_actions(actions, qstring)
+        self.aview.grab_focus()
+
+    def append_matches (self, sender, matches):
+        """
+        We suppose that the results belong to the text
+        that is currently in the entry
+        """
+        if self._do_clear:
+            self._do_clear = False
+            self.clear_results()
+            self.clear_actions()
+            # Display default icon in entry
+            self.update_entry_icon()
+        self.treeview_model.append (matches, self.entry.get_text())
+        self.__adjust_popup_size ()
+        
+    def set_sensitive (self, active):
+        """
+        Called when the UI should be in/active because modules are loading
+        """
+        self.vbox_main.set_sensitive(active)
+        if active:
+            self.entry.grab_focus()
+   
+    def update_entry_icon (self, icon=None):
+        if icon == None:
+            icon = self.default_entry_pixbuf
+            if not (self.cview.get_toplevel().flags() & gtk.MAPPED):
+                # The view is hidden, just show default icon
+                self.entry.set_icon (icon)
+                return
+                
+            path, column = self.cview.get_cursor ()
+        
+            if path != None and self.entry.get_text() != "":
+                match = self.treeview_model[self.treeview_model.get_iter(path)][self.treeview_model.MATCHES]
+                if not isinstance(match, CuemiacCategory):
+                    icon = match.get_icon()
+                
+        self.entry.set_icon (icon)
+        
+    def __on_go_back(self, widget):
+        self.__show_matches()
+        self.cview.grab_focus()
+        return False
+    
+    def __on_window_key_press_event(self, window, event):
+        if event.keyval == gtk.keysyms.Escape:
+            self.emit("destroy-event", event)
+                
+        return False
+    
+    def __focus_matches_if_visible(self, mode):
+        if (self.results_box.get_property("visible")):
+            if mode == "top":
+                self.cview.select_first_item()
+            elif mode == "bottom":
+                self.cview.select_last_item()
+            self.cview.grab_focus()
+            return True
+        else:
+            return False
+        
+    def __adjust_popup_size (self):
+        """adjust window size to the size of the children"""
+        # FIXME: Should we handle width intelligently also?
+        w, h = self.cview.size_request ()
+        h = h + self.header.allocation.height + 2 # To ensure we don't always show scrollbars
+        h = min (h, self._max_window_height)
+        w = min (w, self._max_window_width)
+        if w > 0 and h > 0:
+            self.resize (w, h)
+    
+    def __set_layout_by_orientation (self, orient):
+        """
+        Adjust the various widgets managed to layout with repect to the given
+        orientation.
+        
+        @param orient: The orientation to switch to. 
+                    Must be one of C{gnomeapplet.ORIENT_UP}, C{gnomeapplet.ORIENT_DOWN},
+                    C{gnomeapplet.ORIENT_LEFT}, C{gnomeapplet.ORIENT_RIGHT}.
+        """
+        if orient in [gnomeapplet.ORIENT_LEFT, gnomeapplet.ORIENT_RIGHT, gnomeapplet.ORIENT_DOWN]:
+            self.treeview_model.set_sort_order (gtk.SORT_ASCENDING)
+            self.actions_model.set_sort_order (gtk.SORT_ASCENDING)
+            self._model.get_history().set_sort_order (gtk.SORT_DESCENDING)
+            self.vbox_main.pack_start(self.header, False)
+            self.vbox_main.pack_start(self.history_box, False)
+            self.vbox_main.pack_start(self.results_box)
+        else:
+            # We are at a bottom panel. Put entry on bottom, and prepend matches (instead of append).
+            self.treeview_model.set_sort_order (gtk.SORT_DESCENDING)
+            self.actions_model.set_sort_order (gtk.SORT_DESCENDING)
+            self._model.get_history().set_sort_order (gtk.SORT_ASCENDING)
+            self.vbox_main.pack_start(self.results_box)
+            self.vbox_main.pack_start(self.history_box, False)
+            self.vbox_main.pack_start(self.header, False)

Modified: trunk/deskbar/ui/CuemiacWindowController.py
==============================================================================
--- trunk/deskbar/ui/CuemiacWindowController.py	(original)
+++ trunk/deskbar/ui/CuemiacWindowController.py	Fri Jan 25 23:14:27 2008
@@ -167,4 +167,4 @@
         
     def on_category_added (self, widget, cat, path):
         if cat.get_id() not in self._model.get_collapsed_cat():
-            self._view.cview.expand_row (path, False)
\ No newline at end of file
+            self._view.cview.expand_row (path, False)

Modified: trunk/deskbar/ui/CuemiacWindowView.py
==============================================================================
--- trunk/deskbar/ui/CuemiacWindowView.py	(original)
+++ trunk/deskbar/ui/CuemiacWindowView.py	Fri Jan 25 23:14:27 2008
@@ -150,9 +150,6 @@
         self.results_box.pack_start(self.actions_box)
         self.vbox_main.pack_start(self.results_box)
    
-    def __on_row_act(self, view, path, column):
-        print "======================"
-    
     def clear_all(self):
         deskbar.interfaces.View.clear_all(self)
         width, height = self.get_size()
@@ -284,4 +281,4 @@
         """
         Save window height before results_box disappears
         """
-        self._model.set_window_height( self.get_size()[1] )
\ No newline at end of file
+        self._model.set_window_height( self.get_size()[1] )

Modified: trunk/deskbar/ui/DeskbarTray.py
==============================================================================
--- trunk/deskbar/ui/DeskbarTray.py	(original)
+++ trunk/deskbar/ui/DeskbarTray.py	Fri Jan 25 23:14:27 2008
@@ -6,7 +6,9 @@
 from os.path import join
 from deskbar.core.CoreImpl import CoreImpl
 from deskbar.ui.CuemiacWindowView import CuemiacWindowView
+from deskbar.ui.CuemiacAlignedView import CuemiacAlignedView
 from deskbar.ui.CuemiacWindowController import CuemiacWindowController
+from deskbar.core.GconfStore import GconfStore
         
 class DeskbarTray (gtk.EventBox):
     """
@@ -67,11 +69,32 @@
         self.__core.connect("loaded", self.__on_loaded)
         
         self.__controller = CuemiacWindowController(self.__core)
-        self.__view = CuemiacWindowView(self.__controller, self.__core)
+
+        # Select the view based on user choice. CuemiacWindowView is
+        # the new style UI,
+        # CuemiacAlignedView is the older UI as seen in the
+        # Deskbar gnome-2-18 branch.
+        if self.__core.get_ui_name() == deskbar.WINDOW_UI_NAME:
+            self.__create_window_ui()
+        else:
+            # We need to use an AlignedWindow, which needs a Widget (self.image
+            # in this case) and the applet (self.applet)
+            self.__create_button_ui()
+
         self.__view.set_sensitive(False)
         
+        GconfStore.get_instance().connect("ui-name-changed", self.__on_ui_name_changed)
+        
         self.__core.run()
         
+    def __create_button_ui(self):
+        self.__view = CuemiacAlignedView(self.__controller, self.__core, self.image, self.applet)
+        self._active_view = deskbar.BUTTON_UI_NAME
+        
+    def __create_window_ui(self):
+        self.__view = CuemiacWindowView(self.__controller, self.__core)
+        self._active_view = deskbar.WINDOW_UI_NAME
+        
     def __setup_applet_menu(self):
         self.applet.setup_menu_from_file (
             deskbar.SHARED_DATA_DIR, "Deskbar_Applet.xml",
@@ -100,6 +123,15 @@
           
     def __show_toggle(self, widget, time):
         self.__controller.on_keybinding_activated(widget, time, False)
+        
+    def __on_ui_name_changed(self, gconfstore, name):
+        if name != self._active_view:
+            self.__view.destroy()
+            if name == deskbar.WINDOW_UI_NAME:
+                self.__create_window_ui()
+            else:
+                self.__create_button_ui()
+            self._active_view = name
     
     def set_button_image_from_file (self, filename, size):
         # We use an intermediate pixbuf to scale the image

Modified: trunk/deskbar/ui/Makefile.am
==============================================================================
--- trunk/deskbar/ui/Makefile.am	(original)
+++ trunk/deskbar/ui/Makefile.am	Fri Jan 25 23:14:27 2008
@@ -6,4 +6,5 @@
 	About.py \
 	CuemiacWindowController.py \
 	CuemiacWindowView.py \
-	DeskbarTray.py
\ No newline at end of file
+	CuemiacAlignedView.py \
+	DeskbarTray.py

Modified: trunk/deskbar/ui/cuemiac/CuemiacActionsTreeView.py
==============================================================================
--- trunk/deskbar/ui/cuemiac/CuemiacActionsTreeView.py	(original)
+++ trunk/deskbar/ui/cuemiac/CuemiacActionsTreeView.py	Fri Jan 25 23:14:27 2008
@@ -9,11 +9,23 @@
     
     def __init__(self):
         gtk.ListStore.__init__(self, gtk.gdk.Pixbuf, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
+        self.set_sort_order(gtk.SORT_ASCENDING)
         
     def add_actions(self, actions, qstring):
         for action in actions:
             text = action.get_verb() % action.get_escaped_name(qstring)
-            self.append([action.get_pixbuf(), text, qstring, action])
+            self.append_method(self, [action.get_pixbuf(), text, qstring, action])
+  
+    def set_sort_order(self, order):
+        """
+        @param order Either C{gtk.SORT_DESCENDING} or C{gtk.SORT_ASSCENDING}
+        """
+        if order == gtk.SORT_DESCENDING:
+            # Alternatively gtk.TreeStore.prepend for bottom panel layout
+            self.append_method = gtk.ListStore.prepend
+        else:
+            self.append_method = gtk.ListStore.append
+    
         
 class CuemiacActionsTreeView(gtk.TreeView):
    

Added: trunk/deskbar/ui/cuemiac/CuemiacAlignedWindow.py
==============================================================================
--- (empty file)
+++ trunk/deskbar/ui/cuemiac/CuemiacAlignedWindow.py	Fri Jan 25 23:14:27 2008
@@ -0,0 +1,136 @@
+import gtk
+import gnomeapplet
+import gobject
+import logging
+
+LOGGER = logging.getLogger(__name__)
+
+class CuemiacAlignedWindow (gtk.Window):
+    """
+    Borderless window aligning itself to a given widget.
+    Use CuemiacWindow.update_position() to align it.
+    """
+    def __init__(self, widgetToAlignWith, applet, window_type=gtk.WINDOW_TOPLEVEL):
+        """
+        alignment should be one of
+            gnomeapplet.ORIENT_{DOWN,UP,LEFT,RIGHT}
+        
+        Call CuemiacWindow.update_position () to position the window.
+        """
+        gtk.Window.__init__(self, window_type)
+        self.set_decorated (False)
+
+        # Skip the taskbar, and the pager, stick and stay on top
+        self.stick()
+        self.set_keep_above(True)
+        self.set_skip_pager_hint(True)
+        self.set_skip_taskbar_hint(True)
+        self.set_border_width (1)
+                
+        self.widgetToAlignWith = widgetToAlignWith
+        self.applet = applet
+        self.alignment = applet.get_orient ()
+
+        self.realize_status = None
+        self.connect ("realize", lambda win : self.__register_realize ())
+        self.connect ("delete-event", self.on_delete_event)
+        self.connect ("size-allocate", self.__resize_event)
+    
+    def on_delete_event(self, window, event):
+        # Since all users of this class expect it to remain open and alive
+        # We must catch deletion events (for example alt-f4) and just hide the window
+        self.hide()
+        return True
+        
+    def __resize_event (self, widget, allocation):
+        # Update position, cause the size might have changed for the window
+        self.update_position ()
+    
+    def update_position (self):
+        """
+        Calculates the position and moves the window to it.
+        IMPORATNT: widgetToAlignWith should be realized!
+        """
+        if self.realize_status == None:
+            self.realize_status = False
+            self.realize ()
+            return
+        
+        if self.realize_status == False:
+            return
+        
+        if not (self.widgetToAlignWith.flags() & gtk.REALIZED):
+            LOGGER.warning("CuemiacAlignedWindow.update_position() widgetToAlignWith is not realized.")
+            return
+            
+        # Get our own dimensions & position
+        (wx, wy) = self.window.get_origin ()
+        (ax, ay) = self.widgetToAlignWith.window.get_origin ()
+
+        (ww, wh) = self.window.get_size ()
+        (aw, ah) = self.widgetToAlignWith.window.get_size ()
+
+        screen = self.get_screen()
+        monitor = screen.get_monitor_geometry (screen.get_monitor_at_window (self.applet.window))
+        
+        if self.alignment == gnomeapplet.ORIENT_LEFT:
+            x = ax - ww
+            y = ay
+            
+            if (y + wh > monitor.y + monitor.height):
+                y = monitor.y + monitor.height - wh
+            
+            if (y < 0):
+                y = 0
+            
+            if (y + wh > monitor.height / 2):
+                gravity = gtk.gdk.GRAVITY_SOUTH_WEST    
+            else:
+                gravity = gtk.gdk.GRAVITY_NORTH_WEST
+                    
+        elif self.alignment == gnomeapplet.ORIENT_RIGHT:
+            x = ax + aw
+            y = ay
+            
+            if (y + wh > monitor.y + monitor.height):
+                y = monitor.y + monitor.height - wh
+            
+            if (y < 0):
+                y = 0
+            
+            if (y + wh > monitor.height / 2):
+                gravity = gtk.gdk.GRAVITY_SOUTH_EAST
+            else:
+                gravity = gtk.gdk.GRAVITY_NORTH_EAST
+
+        elif self.alignment == gnomeapplet.ORIENT_DOWN:
+            x = ax
+            y = ay + ah
+            
+            if (x + ww > monitor.x + monitor.width):
+                x = monitor.x + monitor.width - ww
+            
+            if (x < 0):
+                x = 0
+            
+            gravity = gtk.gdk.GRAVITY_NORTH_WEST
+        elif self.alignment == gnomeapplet.ORIENT_UP:
+            x = ax
+            y = ay - wh
+            
+            if (x + ww > monitor.x + monitor.width):
+                x = monitor.x + monitor.width - ww
+            
+            if (x < 0):
+                x = 0
+            
+            gravity = gtk.gdk.GRAVITY_SOUTH_WEST
+        
+        self.move(x, y)
+        self.set_gravity(gravity)
+    
+    def __register_realize (self):
+        self.realize_status = True
+        self.update_position()
+        
+gobject.type_register (CuemiacAlignedWindow)

Modified: trunk/deskbar/ui/cuemiac/CuemiacModel.py
==============================================================================
--- trunk/deskbar/ui/cuemiac/CuemiacModel.py	(original)
+++ trunk/deskbar/ui/cuemiac/CuemiacModel.py	Fri Jan 25 23:14:27 2008
@@ -40,12 +40,19 @@
         gtk.TreeStore.__init__ (self, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_STRING)
         self.__categories = {}
         self.__match_hashes = {}
-        self.append_method = gtk.TreeStore.append # Alternatively gtk.TreeStore.prepend for bottom panel layout
         self.set_sort_func(SORT_BY_CATEGORY, self.__on_sort_categories)
         self.set_sort_order(gtk.SORT_ASCENDING)
     
     def set_sort_order(self, order):
+        """
+        @param order Either C{gtk.SORT_DESCENDING} or C{gtk.SORT_ASCENDING}
+        """
         self.set_sort_column_id(SORT_BY_CATEGORY, order)
+        if order == gtk.SORT_DESCENDING:
+            # Alternatively gtk.TreeStore.prepend for bottom panel layout
+            self.append_method = gtk.TreeStore.prepend
+        else:
+            self.append_method = gtk.TreeStore.append
     
     def __compare_priorities(self, item1, item2):
         """
@@ -200,8 +207,5 @@
             
         return ( self.get_string_from_iter (self.get_iter(path1)) == self.get_string_from_iter (self.get_iter(path2)) )
 
-        
-
-
 if gtk.pygtk_version < (2,8,0):    
     gobject.type_register (CuemiacModel)

Modified: trunk/deskbar/ui/cuemiac/LingeringSelectionWindow.py
==============================================================================
--- trunk/deskbar/ui/cuemiac/LingeringSelectionWindow.py	(original)
+++ trunk/deskbar/ui/cuemiac/LingeringSelectionWindow.py	Fri Jan 25 23:14:27 2008
@@ -50,7 +50,7 @@
 		ox, oy = view.window.get_origin ()
 		area = view.get_background_area (path, column)
 		x, y = view.tree_to_widget_coords (area.x, area.y)
-		self.move (x + ox, y + oy)
+		self.move (x + ox, area.y + oy)
 		self.resize (area.width, area.height)
 		
 	def _linger (self):

Modified: trunk/deskbar/ui/cuemiac/Makefile.am
==============================================================================
--- trunk/deskbar/ui/cuemiac/Makefile.am	(original)
+++ trunk/deskbar/ui/cuemiac/Makefile.am	Fri Jan 25 23:14:27 2008
@@ -7,5 +7,6 @@
 	CuemiacHistory.py \
 	CuemiacItems.py \
 	CuemiacModel.py \
+	CuemiacAlignedWindow.py \
 	CuemiacTreeView.py \
-	LingeringSelectionWindow.py
\ No newline at end of file
+	LingeringSelectionWindow.py

Modified: trunk/deskbar/ui/preferences/DeskbarPreferences.py
==============================================================================
--- trunk/deskbar/ui/preferences/DeskbarPreferences.py	(original)
+++ trunk/deskbar/ui/preferences/DeskbarPreferences.py	Fri Jan 25 23:14:27 2008
@@ -106,6 +106,9 @@
         self.use_selection_box.connect('toggled', self.on_use_selection_toggled)
         #self.use_selection_id = deskbar.GCONF_CLIENT.notify_add(applet.prefs.GCONF_USE_SELECTION, lambda x, y, z, a: self.on_config_use_selection(z.value))
 
+        self.sticktopanel_checkbox = self.glade.get_widget("sticktopanel_checkbox")
+        self.sticktopanel_checkbox.connect("toggled", self.on_ui_changed)
+       
     def __setup_drag_and_drop(self):
         big_box = self.glade.get_widget("big_box")
         self.TARGET_URI_LIST, self.TARGET_NS_URL = range(2)
@@ -205,6 +208,8 @@
             self.keyboard_shortcut_entry.set_accelerator_name("<Alt>F3")
         
         self.use_selection_box.set_active(self.use_selection)
+         
+        self.sticktopanel_checkbox.set_active( self._model.get_ui_name() == deskbar.BUTTON_UI_NAME)
    
     def on_hide_after_action_toggled(self, toggle):
         self._model.set_hide_after_action(toggle.get_active())
@@ -222,6 +227,9 @@
 
     def on_use_selection_toggled(self, toggle):
         self._model.set_use_selection(toggle.get_active())
+
+    def on_use_newstyleui_toggled(self, toggle):
+        self._model.set_use_newstyleui(toggle.get_active())
         
     def on_more_button_clicked(self, button):
         if self.more_button_callback != None:
@@ -424,3 +432,9 @@
         self.moduleview.scroll_to_iter(iter)
         self.set_buttons(self.moduleview.get_selection())
         self.moduleview.grab_focus()
+        
+    def on_ui_changed(self, check):
+        if self.sticktopanel_checkbox.get_active():
+            self._model.set_ui_name(deskbar.BUTTON_UI_NAME)
+        else:
+            self._model.set_ui_name(deskbar.WINDOW_UI_NAME)

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Fri Jan 25 23:14:27 2008
@@ -40,6 +40,7 @@
 deskbar/ui/About.py
 deskbar/ui/cuemiac/CuemiacHeader.py
 deskbar/ui/cuemiac/CuemiacItems.py
+deskbar/ui/CuemiacAlignedView.py
 deskbar/ui/CuemiacWindowView.py
 deskbar/ui/DeskbarTray.py
 deskbar/ui/preferences/AccelEntry.py



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]