Commits

Anonymous committed 292018a

Added as of yet untested save functionality.

  • Participants
  • Parent commits fc1f6b8

Comments (0)

Files changed (1)

     
     def save_config(self): 
 	"""Save the current wheel layout to the config file."""
-	pass
-	            
+	# First we create a temporary copy of the current circle
+	items_tmp = [(i.icon, i.action) for i in self.circle]
+	# Now we roll back the circle to the top level
+	while self.circle[0] is not None: 
+	    self.labelClicked(self.circle[0])
+	# And turn the circle into items. 
+	items = [(i.icon, i.action) for i in self.circle]
+	# Now we copy the previous circle back into the current circle. 
+	self.circle = circle_tmp
+	# Finally we prepare the config data
+	config = "# v0.1 keep this line!\n"
+	config += str(items)
+	# And save it
+	f = open(join(home, CONFIG_FILE_NAME), "w")
+	f.write(config)
+	f.close()
+