def add_list(self, _list): model = self.get_model() for my_item in _list: item = model.append(None) cmd , icon , name = my_item BarConf.set_icon(icon, model, item) model.set_value(item, ID_NAME, str(name)) model.set_value(item, ID_CMD, str(cmd)) model.set_value(item, ID_IMG, str(icon))
def add_list(self, _list): model = self.get_model() for my_item in _list: item = model.append(None) cmd, icon, name = my_item BarConf.set_icon(icon, model, item) model.set_value(item, ID_NAME, str(name)) model.set_value(item, ID_CMD, str(cmd)) model.set_value(item, ID_IMG, str(icon))
def new_item_menu(self, widget, menu_item): self.view.new_entry() selection = self.view.get_cursor()[0][0] if (selection is not None): model = self.view.get_model() item = model.get_iter(selection) model.set_value(item, ID_NAME, menu_item.get_name()) command = menu_item.exec_info.split('%')[0] if menu_item.launch_in_terminal: command = 'x-terminal-emulator -e %s' % command model.set_value(item, ID_CMD, command) icon = menu_item.get_icon() BarConf.set_icon(icon, model, item) if len(icon) > 1 and not icon[0] == '/' and re.match(".*\.(png|xpm|svg)$", icon) is not None: icon = icon[:-4] model.set_value(item, ID_IMG, icon)
def new_item_menu(self, widget, app): self.view.new_entry() selection = self.view.get_cursor()[0][0] if (selection is not None): model = self.view.get_model() item = model.get_iter(selection) model.set_value(item, ID_NAME, app.Name) command = app.Exec.split('%')[0] if app.Terminal: command = 'x-terminal-emulator -e %s' % command model.set_value(item, ID_CMD, command) icon = app.Icon BarConf.set_icon(icon, model, item) if len(icon) > 1 and not icon[0] == '/' and re.match(".*\.(png|xpm|svg)$", icon) is not None: icon = icon[:-4] model.set_value(item, ID_IMG, icon)
def new_item_menu(self, widget, app): self.view.new_entry() selection = self.view.get_cursor()[0][0] if (selection is not None): model = self.view.get_model() item = model.get_iter(selection) model.set_value(item, ID_NAME, app.Name) command = app.Exec.split('%')[0] if app.Terminal: command = 'x-terminal-emulator -e %s' % command model.set_value(item, ID_CMD, command) icon = app.Icon BarConf.set_icon(icon, model, item) if len(icon) > 1 and not icon[0] == '/' and re.match( ".*\.(png|xpm|svg)$", icon) is not None: icon = icon[:-4] model.set_value(item, ID_IMG, icon)