Commits

Arne Babenhauserheide  committed df5983b

Make it work again (no longer blind coded :) ).

  • Participants
  • Parent commits afd3bd1

Comments (0)

Files changed (1)

 from PyKDE4.kdeui import KApplication, KIconLoader
 # Commandline arguments 
 from sys import argv
+# and exiting
+from sys import exit as exit_
 # For circles
 from math import sin, cos, pi
 # And for starting programs
 #: The items the menu should show in top-level (via folders this contains the whole of the wheel menu). 
 ITEMS = [(CENTER_ICON, None), # the center item
                  ("kate","kate"), ("kmail","kmail"), ("kmix","kmix"), ("wesnoth","wesnoth"), # normal items
-                 ("krita","[(None, '" + CENTER_ICON + "')('gimp','gimp')]") # a folder with the center icon and only one real item
+                 ("krita","[('" + CENTER_ICON + "', None), ('gimp','gimp')]") # a folder with the center icon and only one real item
                  ]
 
 
 	
 	# Move below the cursor
         self.move_to_cursor()
-        self.setWindowTitle(programName)
+        self.setWindowTitle(appName)
 
 	# Make sure we get focus events
         self.setFocusPolicy(Qt.StrongFocus)
                 
         for i in self.circle[:]: 
 	    if self.isInside(pos, i):
-                if i.action[0] == "[":
+                if i.action is not None and i.action[0] == "[":
                     # then it's a folder!
                     # get its contents
                     items = eval(i.action)
                     # and store the current items in the new center.
                     # as long as the user didn't click the center
                     if not i == self.circle[0]: 
-                        items[0] = ( CENTER_ICON , str(self.circle) )
+                        items[0] = ( CENTER_ICON , str([(i.icon, i.action) for i in self.circle]) )
                     self.arrange_in_circle(items)
                     # We don't do anything else in that case. 
                     return None
 	"""Arrange all icons in a circle, with the zeroth in the middle."""
         # First remove the previous items
         for label in self.circle[:]:
+            label.hide()
             label.destroy()
 
         # Then create the circle list
 	    x += x_displacement
 	    y += y_displacement
 	    i.move(x, y)
+
+        # Finally show the new circle
+        for i in self.circle: 
+            i.show()
 	            
 
 
     app = KApplication()
     rad = Rad()
     rad.show()
-    sys.exit(app.exec_())
+    exit_(app.exec_())