* Fix default menu configuration creation

git-svn-id: svn+ssh://svn.marcochapeau.org/laditools/trunk@105 bfe161da-02ef-4cea-8c43-ae261ea21ac6
This commit is contained in:
marco 2008-03-01 13:56:16 +00:00
parent 29b17d009d
commit 0e26d43176
2 changed files with 5 additions and 6 deletions

View File

@ -110,13 +110,12 @@ class config:
self.save()
# Use this when you want to update the xml doc with the content of the array
def set_as_array(self, app_name, param_array):
def set_as_array(self, app_name, param_array, element_name):
# Full cleanup to avoid keeping deprecated entries in the xml file
self.cleanup(app_name)
# Fill in the current list of parametters
for param, value in param_array:
param_element = self.doc.createElement(param)
text, attrib_dict = value
for text, attrib_dict in param_array:
param_element = self.doc.createElement(element_name)
if type(text) is not str:
text = str(text)
param_text = self.doc.createTextNode(text)

View File

@ -35,10 +35,10 @@ class jack_menu:
self.jack_menu_config = config()
self.menu_array = self.jack_menu_config.get_as_array('jack_menu')
# Add some defaults if we don't already have a menu
if self.menu_array == {}:
if self.menu_array == []:
for name, path in menu_default:
self.menu_array.append((path, {'name' : name}))
self.jack_menu_config.set_as_array('jack_menu', self.menu_array)
self.jack_menu_config.set_as_array('jack_menu', self.menu_array, 'menuitem')
# Add the laucher entries at the beginning of the menu
for path, attrib_dict in self.menu_array:
self.menu_items.append((gtk.ImageMenuItem(attrib_dict['name']), self.on_menu_launcher, path))