[Bugs] #875 NORM: reordering the journal pulldown menu

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Thu May 21 10:17:10 EDT 2009


#875: reordering the journal pulldown menu
----------------------------+-----------------------------------------------
    Reporter:  walter       |          Owner:  tomeu      
        Type:  enhancement  |         Status:  new        
    Priority:  Normal       |      Milestone:  0.86       
   Component:  journal      |        Version:  0.84.x     
    Severity:  Minor        |     Resolution:             
    Keywords:               |   Distribution:  Unspecified
Status_field:  New          |  
----------------------------+-----------------------------------------------

Comment(by walter):

 proposed patch:

 --- journaltoolbox.py   2009-04-24 08:03:49.000000000 -0400
 +++ journaltoolbox.py   2009-05-21 09:52:50.000000000 -0400
 @@ -272,13 +272,25 @@ class SearchToolbar(gtk.Toolbar):

              registry = bundleregistry.get_registry()
              appended_separator = False
 +
 +            types = mime.get_all_generic_types()
 +            for generic_type in types :
 +                if not appended_separator:
 +                    self._what_search_combo.append_separator()
 +                    appended_separator = True
 +                self._what_search_combo.append_item(
 +                    generic_type.type_id, generic_type.name,
 generic_type.icon)
 +                if generic_type.type_id == current_value:
 +                    current_value_index = \
 +                            len(self._what_search_combo.get_model()) - 1
 +
 +                self._what_search_combo.set_active(current_value_index)
 +
 +            self._what_search_combo.append_separator()
 +
              for service_name in model.get_unique_values('activity'):
                  activity_info = registry.get_bundle(service_name)
                  if not activity_info is None:
 -                    if not appended_separator:
 -                        self._what_search_combo.append_separator()
 -                        appended_separator = True
 -
                      if os.path.exists(activity_info.get_icon()):
                          self._what_search_combo.append_item(service_name,
                                  activity_info.get_name(),
 @@ -291,18 +303,6 @@ class SearchToolbar(gtk.Toolbar):
                      if service_name == current_value:
                          current_value_index = \
                                  len(self._what_search_combo.get_model())
 - 1
 -
 -            self._what_search_combo.append_separator()
 -
 -            types = mime.get_all_generic_types()
 -            for generic_type in types :
 -                self._what_search_combo.append_item(
 -                    generic_type.type_id, generic_type.name,
 generic_type.icon)
 -                if generic_type.type_id == current_value:
 -                    current_value_index = \
 -                            len(self._what_search_combo.get_model()) - 1
 -
 -                self._what_search_combo.set_active(current_value_index)
          finally:
              self._what_search_combo.handler_unblock(
                      self._what_combo_changed_sid)

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/875#comment:3>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list