deskbar-applet r2044 - in trunk: . deskbar/core deskbar/ui/preferences



Author: sebp
Date: Fri Mar 28 16:56:17 2008
New Revision: 2044
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2044&view=rev

Log:
Sort new extension according to their name.
Don't insert tags more than once when the "Search for new extensions" button has been pressed more then once

Modified:
   trunk/ChangeLog
   trunk/deskbar/core/ModuleList.py
   trunk/deskbar/ui/preferences/DeskbarPreferences.py

Modified: trunk/deskbar/core/ModuleList.py
==============================================================================
--- trunk/deskbar/core/ModuleList.py	(original)
+++ trunk/deskbar/core/ModuleList.py	Fri Mar 28 16:56:17 2008
@@ -238,8 +238,8 @@
      MODULE_DESCRIPTION) = range (3)
     
     def __init__ (self):
-        # First element is a tuple containing module id, name and description
         gtk.ListStore.__init__ (self, str, str, str)
+        self.set_sort_column_id (self.MODULE_NAME, gtk.SORT_ASCENDING)
         
     def __contains__ (self, mod_id):
         for mod in self:

Modified: trunk/deskbar/ui/preferences/DeskbarPreferences.py
==============================================================================
--- trunk/deskbar/ui/preferences/DeskbarPreferences.py	(original)
+++ trunk/deskbar/ui/preferences/DeskbarPreferences.py	Fri Mar 28 16:56:17 2008
@@ -152,11 +152,11 @@
             
             self.web_module_list = WebModuleList()
             
-            ROW_SEPERATOR_STRING = "<-->"
+            self.ROW_SEPERATOR_STRING = "<-->"
             self.ALL_EXTENSIONS_TEXT = _("All Extensions")
             
             self.combobox_tags = self.glade.get_widget("combobox_tags")
-            self.combobox_tags.set_row_separator_func( lambda model, iter: model[iter][0] == ROW_SEPERATOR_STRING )  
+            self.combobox_tags.set_row_separator_func( lambda model, iter: model[iter][0] == self.ROW_SEPERATOR_STRING )  
             
             tag_cell = gtk.CellRendererText ()
             self.combobox_tags.pack_start (tag_cell)
@@ -166,10 +166,7 @@
             self.tags_list.set_sort_column_id (0, gtk.SORT_ASCENDING)
             self.tags_list.set_sort_func (0, self._tags_sort_func)
             
-            self.tags_list.append ([self.ALL_EXTENSIONS_TEXT])
-            self.tags_list.append ([ROW_SEPERATOR_STRING])
             self.combobox_tags.set_model (self.tags_list)
-            self.combobox_tags.set_active (0) # Set to all
             self.combobox_tags.connect ("changed", self.on_combobox_tags_changed)
             
             container = self.glade.get_widget("newhandlers")
@@ -471,6 +468,10 @@
                     self.__capuchin = None
      
     def _get_tags (self):
+        self.tags_list.clear()
+        self.tags_list.append ([self.ALL_EXTENSIONS_TEXT])
+        self.tags_list.append ([self.ROW_SEPERATOR_STRING])
+            
         try:
             for tag in self._get_capuchin_instance().get_tags ():
                 self.tags_list.append ( [tag] )
@@ -478,6 +479,8 @@
             self._show_error_dialog(e)
             self.__capuchin.close()
             self.__capuchin = None
+            
+        self.combobox_tags.set_active (0) # Set to all
     
     def _get_new_modules (self):
         """



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