예제 #1
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)
        """column config"""
        column = gtk.TreeViewColumn(_("Lasm.fm Integration ") +
                                    FCBase().lfm_login,
                                    gtk.CellRendererText(),
                                    text=self.text[0],
                                    font=self.font[0])
        column.set_resizable(True)
        self.set_headers_visible(True)
        self.append_column(column)

        self.configure_send_drag()
        self.configure_recive_drag()

        self.set_type_tree()

        self.services = {
            _("My loved tracks"):
            self.controls.lastfm_service.get_loved_tracks,
            _("My top tracks"): self.controls.lastfm_service.get_top_tracks,
            _("My recent tracks"):
            self.controls.lastfm_service.get_recent_tracks,
            _("My top artists"): self.controls.lastfm_service.get_top_artists
            # _("My friends"):self.controls.lastfm_service.get_friends,
            #_("My neighbours"):self.controls.lastfm_service.get_neighbours
        }

        for name in self.services:
            parent = FModel(name)
            bean = FDModel(_("loading...")).parent(parent).add_is_file(True)
            self.append(parent)
            self.append(bean)
예제 #2
0
파일: dm_tree.py 프로젝트: jose2190/foobnix
    def __init__(self, navigation):
        self.navigation = navigation
        CommonTreeControl.__init__(self, None)
        self.set_reorderable(False)
        self.set_headers_visible(True)

        """column config"""
        column = gtk.TreeViewColumn("Name", gtk.CellRendererText(), text=self.text[0])
        column.set_resizable(True)
        self.append_column(column)
        
        """column config"""
        column = gtk.TreeViewColumn("Progress", gtk.CellRendererProgress(), text=self.persent[0], value=self.persent[0])
        column.set_resizable(True)
        self.append_column(column)
        
        """column config"""
        column = gtk.TreeViewColumn("Size", gtk.CellRendererText(), text=self.size[0])
        column.set_resizable(True)
        self.append_column(column)
        
        """status"""
        column = gtk.TreeViewColumn("Status", gtk.CellRendererText(), text=self.status[0])
        column.set_resizable(True)
        self.append_column(column)
        
        """column config"""
        column = gtk.TreeViewColumn("Path", gtk.CellRendererText(), text=self.save_to[0])
        column.set_resizable(True)
        column.set_expand(True)
        self.append_column(column)
        

        self.set_type_plain()
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     
     """column config"""
     column = gtk.TreeViewColumn(_("Lasm.fm Integration ") + FCBase().lfm_login, gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.set_headers_visible(True)
     self.append_column(column)
     
     self.configure_send_drag()
     self.configure_recive_drag()
     
     self.set_type_tree()
     
     
     self.services = {
                      _("My loved tracks"):self.controls.lastfm_service.get_loved_tracks,
                      _("My top tracks"):self.controls.lastfm_service.get_top_tracks,
                      _("My recent tracks"):self.controls.lastfm_service.get_recent_tracks,
                      _("My top artists"):self.controls.lastfm_service.get_top_artists
                     # _("My friends"):self.controls.lastfm_service.get_friends,
                     #_("My neighbours"):self.controls.lastfm_service.get_neighbours
                      }  
     
     
     for name in self.services:          
         parent = FModel(name)
         bean = FDModel(_("loading...")).parent(parent).add_is_file(True)
         self.append(parent)      
         self.append(bean)
예제 #4
0
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     
     self.controls = controls
     self.full_name = ""
     self.label = gtk.Label()
     
     self.set_headers_visible(True)
     self.set_headers_clickable(True)
             
     """column config"""
     self.column = gtk.TreeViewColumn("File", gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     self._append_column(self.column, _("File"))
     
     def func(column, cell, model, iter, ext=False):
         try:
             data = model.get_value(iter, self.text[0])
         except TypeError:
             pass
         if not model.get_value(iter, self.path[0]): 
             cell.set_property('text', '')
             return
         if os.path.isfile(model.get_value(iter, self.path[0])):
             if ext:
                 cell.set_property('text', os.path.splitext(data)[1][1:])
             else:
                 cell.set_property('text', os.path.splitext(data)[0])
         else:
             if ext:
                 cell.set_property('text', '')
             
     self.name_column = gtk.TreeViewColumn("Name", gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     self.name_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
     for rend in self.name_column.get_cell_renderers():
         self.name_column.set_cell_data_func(rend, func, False)
     self._append_column(self.name_column, _("Name"))
            
     self.ext_column = gtk.TreeViewColumn("Ext", gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     for rend in self.ext_column.get_cell_renderers():
         self.ext_column.set_cell_data_func(rend, func, True)
     self._append_column(self.ext_column, _("Ext"))
       
     self.configure_send_drag()
     self.configure_recive_drag()
     
     self.set_type_tree()
     #self.is_empty = False
     self.connect("button-release-event", self.on_button_release)
     
     '''to force the ext_column to take the minimum size'''
     self.name_column.set_fixed_width(2000)
     def task(*a):
         self.on_click_header(None, None, on_start=True)
     gobject.idle_add(task)
     
     self.scroll.get_vscrollbar().connect('show', task)
     self.scroll.get_vscrollbar().connect('hide', task)
예제 #5
0
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     
     """column config"""
     column = gtk.TreeViewColumn(_("Virtual PlayLists"), gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.set_headers_visible(True)
     self.append_column(column)
     
     self.configure_send_drug()
     self.configure_recive_drug()
     
     self.set_type_tree()
예제 #6
0
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     
     """column config"""
     column = gtk.TreeViewColumn(_("Lasm.fm Integration ") + FC().lfm_login, gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.set_headers_visible(True)
     self.append_column(column)
     
     self.configure_send_drug()
     self.configure_recive_drug()
     
     self.set_type_tree()
예제 #7
0
파일: radio_tree.py 프로젝트: atis/foobnix
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     self.set_reorderable(False)
     self.switcher_label = _("My channels")
     """column config"""
     column = gtk.TreeViewColumn(_("Radio Stations"), gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.set_headers_visible(True)
     self.append_column(column)
     
     self.configure_send_drag()
     self.configure_recive_drag()
     self.set_type_tree()
     self.lazy_load()
예제 #8
0
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     
     self.controls = controls
     
     """column config"""
     column = gtk.TreeViewColumn(_("Music Library"), gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.append_column(column)
     
     self.configure_send_drug()
     
     self.set_type_tree()
     self.is_empty = False
예제 #9
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)
        self.set_reorderable(False)
        
        """column config"""
        column = gtk.TreeViewColumn(_("Radio Stations"), gtk.CellRendererText(), text=self.text[0], font=self.font[0])
        column.set_resizable(True)
        self.set_headers_visible(True)
        self.append_column(column)
        
        self.configure_send_drag()

        self.set_type_tree()
        #self.is_lazy_load = False
        thread.start_new_thread(self.lazy_load, ())
예제 #10
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)
        self.set_reorderable(False)
        """column config"""
        column = gtk.TreeViewColumn(_("Radio Stations"),
                                    gtk.CellRendererText(),
                                    text=self.text[0],
                                    font=self.font[0])
        column.set_resizable(True)
        self.set_headers_visible(True)
        self.append_column(column)

        self.configure_send_drag()

        self.set_type_tree()
        self.is_lazy_load = False
예제 #11
0
 def __init__(self, controls):
     CommonTreeControl.__init__(self, controls)
     
     """column config"""
     column = gtk.TreeViewColumn(_("VK Integration "), gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.set_headers_visible(True)
     self.append_column(column)
     
     self.configure_send_drag()
     self.configure_recive_drag()
     
     self.set_type_tree()
     
     self.lazy = False
     self.cache =[]
예제 #12
0
 def __init__(self, title_name, controls, head_visible=True):        
     CommonTreeControl.__init__(self, controls)
     self.title_name = title_name 
     
     self.set_reorderable(False)
     
     """column config"""
     column = gtk.TreeViewColumn(title_name, gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.append_column(column)
     self.set_headers_visible(head_visible)
     
     self.configure_send_drag()
     
     self.set_type_plain()
     #self.populate_all([FModel("Madonna").add_is_file(True)])
     
     self.line_title = None
예제 #13
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)
        """column config"""
        column = gtk.TreeViewColumn(_("VK Integration "),
                                    gtk.CellRendererText(),
                                    text=self.text[0],
                                    font=self.font[0])
        column.set_resizable(True)
        self.set_headers_visible(True)
        self.append_column(column)

        self.configure_send_drag()
        self.configure_recive_drag()

        self.set_type_tree()

        self.lazy = False
        self.cache = []
예제 #14
0
 def __init__(self, title_name, controls, head_visible=True):        
     CommonTreeControl.__init__(self, controls)
     self.title_name = title_name 
     
     self.set_reorderable(False)
     
     """column config"""
     column = gtk.TreeViewColumn(title_name, gtk.CellRendererText(), text=self.text[0], font=self.font[0])
     column.set_resizable(True)
     self.append_column(column)
     self.set_headers_visible(head_visible)
     
     self.configure_send_drag()
     
     self.set_type_plain()
     #self.populate_all([FModel("Madonna").add_is_file(True)])
     
     self.line_title = None
예제 #15
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)
        #self.set_headers_visible(True)
        
        """Column icon"""
        icon = gtk.TreeViewColumn(None, gtk.CellRendererPixbuf(), stock_id=self.play_icon[0])
        icon.set_fixed_width(5)
        icon.set_min_width(5)
        self.append_column(icon)
        
        """track number"""
        tracknumber = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.tracknumber[0])
        self.append_column(tracknumber)

        """column artist title"""
        description = gtk.TreeViewColumn('Track', gtk.CellRendererText(), text=self.text[0], font=self.font[0])
        #description.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        description.set_expand(True)
        self.append_column(description)
        
        
        """column artist (NOT USED)"""
        artist = gtk.TreeViewColumn('Artist', gtk.CellRendererText(), text=self.artist[0])
        artist.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        #self.append_column(artist)
        
        """column title (NOT USED)"""
        title = gtk.TreeViewColumn('Title', gtk.CellRendererText(), text=self.title[0])
        title.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        #self.append_column(title)

        """column time"""
        time = gtk.TreeViewColumn('Time', gtk.CellRendererText(), text=self.time[0])
        
        self.append_column(time)

        self.configure_send_drug()
        self.configure_recive_drug()
        
        self.set_playlist_plain()
예제 #16
0
    def __init__(self, navigation):
        self.navigation = navigation
        CommonTreeControl.__init__(self, None)
        self.set_reorderable(False)
        self.set_headers_visible(True)
        """column config"""
        column = gtk.TreeViewColumn("Name",
                                    gtk.CellRendererText(),
                                    text=self.text[0])
        column.set_resizable(True)
        self.append_column(column)
        """column config"""
        column = gtk.TreeViewColumn("Progress",
                                    gtk.CellRendererProgress(),
                                    text=self.persent[0],
                                    value=self.persent[0])
        column.set_resizable(True)
        self.append_column(column)
        """column config"""
        column = gtk.TreeViewColumn("Size",
                                    gtk.CellRendererText(),
                                    text=self.size[0])
        column.set_resizable(True)
        self.append_column(column)
        """status"""
        column = gtk.TreeViewColumn("Status",
                                    gtk.CellRendererText(),
                                    text=self.status[0])
        column.set_resizable(True)
        self.append_column(column)
        """column config"""
        column = gtk.TreeViewColumn("Path",
                                    gtk.CellRendererText(),
                                    text=self.save_to[0])
        column.set_resizable(True)
        column.set_expand(True)
        self.append_column(column)

        self.set_type_plain()
예제 #17
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)
        
        self.set_headers_visible(True)
        self.set_headers_clickable(True)
        self.set_reorderable(True)
        
        self.menu = Popup()

        """Column icon"""
        self.icon_col = gtk.TreeViewColumn(None, gtk.CellRendererPixbuf(), stock_id=self.play_icon[0])
        self.icon_col.key = "*"
        self.icon_col.set_fixed_width(5)
        self.icon_col.set_min_width(5)
        self.icon_col.label = gtk.Label("*")
        self._append_column(self.icon_col)
        
        """track number"""
        self.trkn_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.tracknumber[0])
        self.trkn_col.key = "№"
        self.trkn_col.set_clickable(True)
        self.trkn_col.label = gtk.Label("№")
        self.trkn_col.label.show()
        self.trkn_col.item = gtk.CheckMenuItem(_("Number"))
        self.trkn_col.set_widget(self.trkn_col.label)
        self._append_column(self.trkn_col)
        
        """column composer"""
        self.comp_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.composer[0])
        self.comp_col.key = "Composer"
        self.comp_col.set_resizable(True)
        self.comp_col.label = gtk.Label(_("Composer"))
        self.comp_col.item = gtk.CheckMenuItem(_("Composer"))
        self._append_column(self.comp_col)
        
        """column artist title"""
        self.description_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.text[0], font=self.font[0])
        self.description_col.key = "Track"
        self.description_col.set_resizable(True)
        self.description_col.label = gtk.Label(_("Track"))
        self.description_col.item = gtk.CheckMenuItem(_("Track"))
        self._append_column(self.description_col)
                        
        """column artist"""
        self.artist_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.artist[0])
        self.artist_col.key = "Artist"
        self.artist_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        self.artist_col.set_resizable(True)
        self.artist_col.label = gtk.Label(_("Artist"))
        self.artist_col.item = gtk.CheckMenuItem(_("Artist"))
        self._append_column(self.artist_col)
               
        """column title"""
        self.title_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.title[0])
        self.title_col.key = "Title"
        self.title_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        self.title_col.set_resizable(True)
        self.title_col.label = gtk.Label(_("Title"))
        self.title_col.item = gtk.CheckMenuItem(_("Title"))
        self._append_column(self.title_col)
        
        """column album"""
        self.album_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.album[0])
        self.album_col.key = "Album"
        
        
        if not FC().columns.has_key(self.album_col.key):
            FC().columns[self.album_col.key] = [False, 7, 90]
        self.album_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        self.album_col.set_resizable(True)
        self.album_col.label = gtk.Label(_("Album"))
        self.album_col.item = gtk.CheckMenuItem(_("Album"))
        self._append_column(self.album_col)
        
        """column time"""
        self.time_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.time[0])
        self.time_col.key = "Time"
        self.time_col.label = gtk.Label(_("Time"))
        self.time_col.item = gtk.CheckMenuItem(_("Time"))
        self._append_column(self.time_col)

        self.configure_send_drag()
        self.configure_recive_drag()
        
        self.set_playlist_plain()
        
        self.connect("button-release-event", self.on_button_press)
        
        self.on_load()
        
        self.connect("columns-changed", self.on_columns_changed)
예제 #18
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)

        self.controls = controls

        self.set_headers_visible(True)
        self.set_headers_clickable(True)
        """column config"""
        self.column = gtk.TreeViewColumn("File",
                                         gtk.CellRendererText(),
                                         text=self.text[0],
                                         font=self.font[0])
        self._append_column(self.column, _("File"))

        def func(column, cell, model, iter, ext=False):
            data = model.get_value(iter, self.text[0])
            if not model.get_value(iter, self.path[0]):
                cell.set_property('text', '')
                return
            if os.path.isfile(model.get_value(iter, self.path[0])):
                if ext:
                    cell.set_property('text', os.path.splitext(data)[1][1:])
                else:
                    cell.set_property('text', os.path.splitext(data)[0])
            else:
                if ext:
                    cell.set_property('text', '')

        self.name_column = gtk.TreeViewColumn("Name",
                                              gtk.CellRendererText(),
                                              text=self.text[0],
                                              font=self.font[0])
        self.name_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
        for rend in self.name_column.get_cell_renderers():
            self.name_column.set_cell_data_func(rend, func, False)
        self._append_column(self.name_column, _("Name"))

        self.ext_column = gtk.TreeViewColumn("Ext",
                                             gtk.CellRendererText(),
                                             text=self.text[0],
                                             font=self.font[0])
        for rend in self.ext_column.get_cell_renderers():
            self.ext_column.set_cell_data_func(rend, func, True)
        self._append_column(self.ext_column, _("Ext"))

        self.configure_send_drag()
        self.configure_recive_drag()

        self.set_type_tree()
        self.is_empty = False
        self.connect("button-release-event", self.on_button_release)
        '''to force the ext_column to take the minimum size'''
        self.name_column.set_fixed_width(2000)

        def task(*a):
            self.on_click_header(None, None, on_start=True)

        gobject.idle_add(task)

        self.scroll.get_vscrollbar().connect('show', task)
        self.scroll.get_vscrollbar().connect('hide', task)
예제 #19
0
    def __init__(self, controls):
        CommonTreeControl.__init__(self, controls)

        self.set_headers_visible(True)
        self.set_headers_clickable(True)
        self.set_reorderable(True)

        self.menu = Popup()
        """Column icon"""
        self.icon_col = gtk.TreeViewColumn(None,
                                           gtk.CellRendererPixbuf(),
                                           stock_id=self.play_icon[0])
        self.icon_col.key = "*"
        self.icon_col.set_fixed_width(5)
        self.icon_col.set_min_width(5)
        self.icon_col.label = gtk.Label("*")
        self._append_column(self.icon_col)
        """track number"""
        self.trkn_col = gtk.TreeViewColumn(None,
                                           gtk.CellRendererText(),
                                           text=self.tracknumber[0])
        self.trkn_col.key = "№"
        self.trkn_col.set_clickable(True)
        self.trkn_col.label = gtk.Label("№")
        self.trkn_col.label.show()
        self.trkn_col.item = gtk.CheckMenuItem(_("Number"))
        self.trkn_col.set_widget(self.trkn_col.label)
        self._append_column(self.trkn_col)
        """column composer"""
        self.comp_col = gtk.TreeViewColumn(None,
                                           gtk.CellRendererText(),
                                           text=self.composer[0])
        self.comp_col.key = "Composer"
        self.comp_col.set_resizable(True)
        self.comp_col.label = gtk.Label(_("Composer"))
        self.comp_col.item = gtk.CheckMenuItem(_("Composer"))
        self._append_column(self.comp_col)
        """column artist title"""
        self.description_col = gtk.TreeViewColumn(None,
                                                  gtk.CellRendererText(),
                                                  text=self.text[0],
                                                  font=self.font[0])
        self.description_col.key = "Track"
        self.description_col.set_resizable(True)
        self.description_col.label = gtk.Label(_("Track"))
        self.description_col.item = gtk.CheckMenuItem(_("Track"))
        self._append_column(self.description_col)
        """column artist"""
        self.artist_col = gtk.TreeViewColumn(None,
                                             gtk.CellRendererText(),
                                             text=self.artist[0])
        self.artist_col.key = "Artist"
        self.artist_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        self.artist_col.set_resizable(True)
        self.artist_col.label = gtk.Label(_("Artist"))
        self.artist_col.item = gtk.CheckMenuItem(_("Artist"))
        self._append_column(self.artist_col)
        """column title"""
        self.title_col = gtk.TreeViewColumn(None,
                                            gtk.CellRendererText(),
                                            text=self.title[0])
        self.title_col.key = "Title"
        self.title_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        self.title_col.set_resizable(True)
        self.title_col.label = gtk.Label(_("Title"))
        self.title_col.item = gtk.CheckMenuItem(_("Title"))
        self._append_column(self.title_col)
        """column time"""
        self.time_col = gtk.TreeViewColumn(None,
                                           gtk.CellRendererText(),
                                           text=self.time[0])
        self.time_col.key = "Time"
        self.time_col.label = gtk.Label(_("Time"))
        self.time_col.item = gtk.CheckMenuItem(_("Time"))
        self._append_column(self.time_col)

        self.configure_send_drag()
        self.configure_recive_drag()

        self.set_playlist_plain()

        self.connect("button-release-event", self.on_button_release)

        self.on_load()

        self.connect("columns-changed", self.on_columns_changed)