Exemplo n.º 1
0
    def new_itempool(self, item):
        """ Creates a new ItemPool. """

        returnlst = []

        pool_settings = self.settings["ItemPool:%s" % item]
        structure = pool_settings["structure"].split(" ")

        for item in structure:

            if item == "-":
                # Separator
                returnlst.append(Separator())
                continue

            if "%s_icon" % item in pool_settings:
                icon = pool_settings["%s_icon" % item]
            else:
                icon = None

            _item = Item(label=pool_settings["%s_label" % item],
                         icon=self.IconPool.get_icon(icon))

            # Create an action...
            action = ExecuteAction(pool_settings["%s_executable" % item])

            _item.append(action)

            returnlst.append(_item)

        return returnlst
Exemplo n.º 2
0
	def new_itempool(self, item):
		""" Creates a new ItemPool. """
		
		returnlst = []
		
		pool_settings = self.settings["ItemPool:%s" % item]
		structure = pool_settings["structure"].split(" ")
		
		for item in structure:
			
			if item == "-":
				# Separator
				returnlst.append(Separator())
				continue
			
			if "%s_icon" % item in pool_settings:
				icon = pool_settings["%s_icon" % item]
			else:
				icon = None
			
			_item = Item(label=pool_settings["%s_label" % item],
				icon=self.IconPool.get_icon(icon)
			)
			
			# Create an action...
			action = ExecuteAction(pool_settings["%s_executable" % item])
			
			_item.append(action)
			
			returnlst.append(_item)
		
		return returnlst
Exemplo n.º 3
0
    def new_launcher_pool(self, item):
        """ Creates a new LauncherPool """

        returnlst = []

        launcher_settings = self.settings["LauncherPool:%s" % item]
        if "structure" in launcher_settings:
            structure = launcher_settings["structure"].split(" ")
        else:
            structure = launcher_settings["__ConfigParser"].options(
                "LauncherPool:%s" % item)

        for item in structure:

            if item == "-":
                # Separator
                returnlst.append(Separator())
                continue

            item_file = launcher_settings[item]
            if not os.path.exists(item_file): continue
            item_file = xdg.DesktopEntry.DesktopEntry(item_file)

            item = Item(label=item_file.getName(),
                        icon=self.IconPool.get_icon(item_file.getIcon()))
            # Create an action...
            action = ExecuteAction(
                re.sub(' [^ ]*%[fFuUdDnNickvm]', '', item_file.getExec()))

            item.append(action)

            returnlst.append(item)

        return returnlst
Exemplo n.º 4
0
	def new_launcher_pool(self, item):
		""" Creates a new LauncherPool """
		
		returnlst = []
		
		launcher_settings = self.settings["LauncherPool:%s" % item]
		if "structure" in launcher_settings:
			structure = launcher_settings["structure"].split(" ")
		else:
			structure = launcher_settings["__ConfigParser"].options("LauncherPool:%s" % item)
				
		for item in structure:

			if item == "-":
				# Separator
				returnlst.append(Separator())
				continue

			item_file = launcher_settings[item]
			if not os.path.exists(item_file): continue
			item_file = xdg.DesktopEntry.DesktopEntry(item_file)
			
			item = Item(label=item_file.getName(), icon=self.IconPool.get_icon(item_file.getIcon()))
			# Create an action...
			action = ExecuteAction(re.sub(' [^ ]*%[fFuUdDnNickvm]', '', item_file.getExec()))
			
			item.append(action)
			
			returnlst.append(item)
		
		return returnlst
Exemplo n.º 5
0
	def return_executable_item(self, label, command, icon=None):
		""" Returns an executable item. """
		
		item = Item(label=label, icon=self.IconPool.get_icon(icon))
		action = ExecuteAction(command)
		item.append(action)
		
		return item
Exemplo n.º 6
0
	def return_executable_item(self, label, target, icon=None):
		""" Returns an executable item. """
		
		item = Item(label=label, icon=self.IconPool.get_icon(icon))
		action = ExecuteAction(target)
		item.append(action)
		
		return item
Exemplo n.º 7
0
	def return_executable_item(self, label, target, icon=None):
		""" Returns an executable item. """
		
		item = Item(label=label, icon=self.IconPool.get_icon(icon))
		action = ExecuteAction("%s \"%s\"" % (self.filemanager, target))
		item.append(action)
		
		return item
Exemplo n.º 8
0
	def return_executable_item(self, label, url, icon=None):
		""" Returns an executable item. """
		
		item = Item(label=label, icon=icon)
		action = ExecuteAction("x-www-browser %s" % url)
		item.append(action)
		
		return item
Exemplo n.º 9
0
	def return_executable_item(self, label, player, player_action, icon=None):
		""" Returns an executable item. """
				
		item = Item(label=label, icon=self.IconPool.get_icon(icon))
		if player and player_action:
			action = ExecuteAction("alan-pipe %s %s -a \"%s %s\"" % (self.pipe_arguments, self.extensionName, player, player_action))
			item.append(action)
		
		return item
Exemplo n.º 10
0
    def return_executable_item(self, label, player, player_action, icon=None):
        """ Returns an executable item. """

        item = Item(label=label, icon=self.IconPool.get_icon(icon))
        if player and player_action:
            action = ExecuteAction("alan-pipe %s %s -a \"%s %s\"" %
                                   (self.pipe_arguments, self.extensionName,
                                    player, player_action))
            item.append(action)

        return item