The control panel modules are currently read into a dict, which tosses
them out in arbitrary order.  This patch cleans things up, with two
main goals:

1) Always place the "About me" and "About my XO" modules first, as
they are the most general
2) Arrange the remaining modules alphabetically, so their order has has meaning

It's possible that it would be better to order them by installation
date, such that old modules retain their positions in the grid even as
new ones appear, but that's arguable, and alphabetical sorting is at
least a logical ordering that can be made sense of.

- Eben
diff --git a/src/controlpanel/gui.py b/src/controlpanel/gui.py
index b07687f..79fa3b3 100644
--- a/src/controlpanel/gui.py
+++ b/src/controlpanel/gui.py
@@ -115,8 +115,11 @@ class ControlPanel(gtk.Window):
 
     def _setup_options(self):
         row = 0
-        column = 0
-        for option in self._options:
+        column = 2
+        options = self._options.keys()
+        options.sort()
+
+        for option in options:
             sectionicon = _SectionIcon(icon_name=self._options[option]['icon'],
                                        title=self._options[option]['title'],
                                        xo_color=self._options[option]['color'],
@@ -125,13 +128,18 @@ class ControlPanel(gtk.Window):
                                self.__select_option_cb, option)
             sectionicon.show()
             
-            self._table.attach(sectionicon, column, column + 1, row, row + 1) 
-            self._options[option]['button'] = sectionicon
+            if self._options[option]['title'].lower() == 'about me':
+                self._table.attach(sectionicon, 0, 1, 0, 1)
+            elif self._options[option]['title'].lower() == 'about my xo':
+                self._table.attach(sectionicon, 1, 2, 0, 1)
+            else:
+                self._table.attach(sectionicon, column, column + 1, row, row + 1) 
+                column += 1
+                if column == _MAX_COLUMNS:
+                    column = 0
+                    row += 1
 
-            column += 1
-            if column == _MAX_COLUMNS:
-                column = 0
-                row += 1        
+            self._options[option]['button'] = sectionicon
 
     def _show_main_view(self):
         self._set_toolbar(self._main_toolbar)
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar

Reply via email to