~linkinpark342/exaile/kill_all_excepts

« back to all changes in this revision

Viewing changes to xlgui/panel/flatplaylist.py

  • Committer: Abhishek Mukherjee
  • Date: 2009-12-28 22:22:08 UTC
  • mfrom: (2555.1.193 trunk)
  • Revision ID: abhishek.mukher.g@gmail.com-20091228222208-wn1e2tbkfth13ix9
Big merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2009 Adam Olsen 
 
1
# Copyright (C) 2008-2009 Adam Olsen
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
15
15
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
16
#
17
17
#
18
 
# The developers of the Exaile media player hereby grant permission 
19
 
# for non-GPL compatible GStreamer and Exaile plugins to be used and 
20
 
# distributed together with GStreamer and Exaile. This permission is 
21
 
# above and beyond the permissions granted by the GPL license by which 
22
 
# Exaile is covered. If you modify this code, you may extend this 
23
 
# exception to your version of the code, but you are not obligated to 
24
 
# do so. If you do not wish to do so, delete this exception statement 
 
18
# The developers of the Exaile media player hereby grant permission
 
19
# for non-GPL compatible GStreamer and Exaile plugins to be used and
 
20
# distributed together with GStreamer and Exaile. This permission is
 
21
# above and beyond the permissions granted by the GPL license by which
 
22
# Exaile is covered. If you modify this code, you may extend this
 
23
# exception to your version of the code, but you are not obligated to
 
24
# do so. If you do not wish to do so, delete this exception statement
25
25
# from your version.
26
26
 
 
27
import gobject
 
28
import gtk
 
29
 
27
30
from xl.nls import gettext as _
28
31
from xlgui import panel, guiutil, menu
29
32
from xl import metadata
30
 
import gtk, gobject
31
33
 
32
34
class FlatPlaylistPanel(panel.Panel):
33
35
    """
38
40
        'queue-items': (gobject.SIGNAL_RUN_LAST, None, (object,)),
39
41
    }
40
42
 
41
 
    ui_info = ('flatplaylist_panel.glade', 'FlatPlaylistPanelWindow')
 
43
    ui_info = ('flatplaylist_panel.ui', 'FlatPlaylistPanelWindow')
42
44
 
43
45
    def __init__(self, parent, name=None):
44
46
        panel.Panel.__init__(self, parent, name)
106
108
    def _title_data_func(self, col, cell, model, iter):
107
109
        if not model.iter_is_valid(iter): return
108
110
        item = model.get_value(iter, 2)
109
 
        cell.set_property('text', metadata.j(item['title']))
 
111
        cell.set_property('text', item.get_tag_display("title"))
110
112
 
111
113
    def set_playlist(self, pl):
112
114
        self.model.clear()
114
116
        tracks = pl.get_tracks()
115
117
        self.tracks = tracks
116
118
        for i, track in enumerate(tracks):
117
 
            self.model.append([i + 1, metadata.j(track['title']), track])
 
119
            self.model.append([i + 1, track.get_tag_display("title"), track])
118
120
 
119
121
    def get_selected_tracks(self):
120
122
        selection = self.tree.get_selection()
140
142
 
141
143
            if not path:
142
144
                return False
143
 
            
 
145
 
144
146
            if len(self.get_selected_tracks()) >= 2:
145
147
                (mods,paths) = selection.get_selected_rows()
146
148
                if (path[0] in paths):
152
154
        return False
153
155
 
154
156
    def drag_data_received(self, *e):
155
 
        """ 
 
157
        """
156
158
            stub
157
159
        """
158
160
        pass