Beispiel #1
0
    def _load_sub_directory(self, app, dir_name, filenames):
        """
        Create the tree menu for a given directory full name
        
        """
        for filename in filenames:
            path = os.path.join(dir_name, filename)
            path = os.path.abspath(path)

            if self.hidden_file_pattern.match(path):
                continue

            if os.path.isdir(path) or self.item_filter(path):
                item = MenuItem(short_name=os.path.basename(path))
                if os.path.isdir(path):
                    icon_path = self.folder_icon_path
                else:
                    icon_path = self.item_icon_path or path
                    item.set_action_callback(self.item_action)
                    item.set_focus_callback(self.item_focus)

                item.set_target_path(path)
                item.set_icon_path(icon_path)

                if self.item_filter(path) and self.action_menu:
                    self.action_menu(item)

                master = self.get_master_plugin()
                parent = master.get_item_with_target(os.path.dirname(path))
                if not parent:
                    parent = master
                parent.add_item(item)
Beispiel #2
0
    def add_action_menu(self, menu_item):
        
        self.play = MenuItem(short_name="Play")
        self.play.set_target_path("play")
        self.play.set_icon_path('elisa/skins/default_skin/pictures/player_play.png')
        self.play.set_action_callback(self.play_parent_movie)

        self.pause = MenuItem(short_name="Pause")
        self.pause.set_target_path("pause")
        self.pause.set_icon_path('elisa/skins/default_skin/pictures/player_pause.png')
        self.pause.set_action_callback(self.pause_parent_movie)

        self.seekf = MenuItem(short_name="Seek+")
        self.seekf.set_icon_path('elisa/skins/default_skin/pictures/2rightarrow.png')
        self.seekf.set_action_callback(self.seekf_parent_movie)

        self.seekb = MenuItem(short_name="Seek-")
        self.seekb.set_icon_path('elisa/skins/default_skin/pictures/2leftarrow.png')
        self.seekb.set_action_callback(self.seekb_parent_movie)

        self.stop = MenuItem(short_name="Stop")
        self.stop.set_icon_path('elisa/skins/default_skin/pictures/stop.png')
        self.stop.set_action_callback(self.stop_parent_movie)
        
        remove = MenuItem(short_name="Remove")
        remove.set_icon_path('elisa/skins/default_skin/pictures/trash.png')

        menu_item.add_item(self.play)
        menu_item.add_item(remove)