Added icons
authorJames Bunton <jamesbunton@fastmail.fm>
Sun, 2 Jan 2011 19:27:48 +0000 (06:27 +1100)
committerJames Bunton <jamesbunton@fastmail.fm>
Sun, 2 Jan 2011 19:27:48 +0000 (06:27 +1100)
22 files changed:
English.lproj/NotiPod.xib
icons/playlist-books.icns [new file with mode: 0644]
icons/playlist-cd.icns [new file with mode: 0644]
icons/playlist-downloads.icns [new file with mode: 0644]
icons/playlist-folder.icns [new file with mode: 0644]
icons/playlist-genius-mixes.icns [new file with mode: 0644]
icons/playlist-genius-playlist.icns [new file with mode: 0644]
icons/playlist-genius.icns [new file with mode: 0644]
icons/playlist-itunes-dj.icns [new file with mode: 0644]
icons/playlist-itunes-u.icns [new file with mode: 0644]
icons/playlist-movies.icns [new file with mode: 0644]
icons/playlist-music.icns [new file with mode: 0644]
icons/playlist-playlist.icns [new file with mode: 0644]
icons/playlist-podcasts.icns [new file with mode: 0644]
icons/playlist-purchased.icns [new file with mode: 0644]
icons/playlist-radio.icns [new file with mode: 0644]
icons/playlist-ringtones.icns [new file with mode: 0644]
icons/playlist-smart-playlist.icns [new file with mode: 0644]
icons/playlist-tv-shows.icns [new file with mode: 0644]
libnotipod.py
notipod.xcodeproj/project.pbxproj
notipod_gui.py

index 0039003..d184c40 100644 (file)
@@ -8,9 +8,9 @@
                <string key="IBDocument.HIToolboxVersion">461.00</string>
                <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <integer value="29"/>
-                       <integer value="372"/>
+                       <integer value="485"/>
                        <integer value="429"/>
+                       <integer value="29"/>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                <object class="NSOutlineView" id="163779105">
                                                                                        <reference key="NSNextResponder" ref="1071723009"/>
                                                                                        <int key="NSvFlags">256</int>
-                                                                                       <string key="NSFrameSize">{327, 338}</string>
+                                                                                       <string key="NSFrameSize">{327, 322}</string>
                                                                                        <reference key="NSSuperview" ref="1071723009"/>
                                                                                        <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="_NSCornerView" key="NSCornerView">
-                                                                                               <nil key="NSNextResponder"/>
+                                                                                       <object class="NSTableHeaderView" key="NSHeaderView" id="294163332">
+                                                                                               <reference key="NSNextResponder" ref="1048309480"/>
+                                                                                               <int key="NSvFlags">256</int>
+                                                                                               <string key="NSFrameSize">{327, 17}</string>
+                                                                                               <reference key="NSSuperview" ref="1048309480"/>
+                                                                                               <reference key="NSTableView" ref="163779105"/>
+                                                                                       </object>
+                                                                                       <object class="_NSCornerView" key="NSCornerView" id="433894358">
+                                                                                               <reference key="NSNextResponder" ref="52653404"/>
                                                                                                <int key="NSvFlags">-2147483392</int>
                                                                                                <string key="NSFrame">{{313, 0}, {16, 17}}</string>
+                                                                                               <reference key="NSSuperview" ref="52653404"/>
                                                                                        </object>
                                                                                        <object class="NSMutableArray" key="NSTableColumns">
                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                <object class="NSTableColumn" id="611630035">
-                                                                                                       <string key="NSIdentifier">selected</string>
+                                                                                                       <string key="NSIdentifier">icon</string>
                                                                                                        <double key="NSWidth">4.000000e+01</double>
                                                                                                        <double key="NSMinWidth">1.600000e+01</double>
                                                                                                        <double key="NSMaxWidth">1.000000e+03</double>
                                                                                                                        <reference key="NSColor" ref="495955423"/>
                                                                                                                </object>
                                                                                                        </object>
-                                                                                                       <object class="NSButtonCell" key="NSDataCell" id="130567970">
+                                                                                                       <object class="NSImageCell" key="NSDataCell" id="105013743">
+                                                                                                               <int key="NSCellFlags">67239424</int>
+                                                                                                               <int key="NSCellFlags2">33685504</int>
+                                                                                                               <reference key="NSSupport" ref="26"/>
+                                                                                                               <int key="NSAlign">0</int>
+                                                                                                               <int key="NSScale">0</int>
+                                                                                                               <int key="NSStyle">0</int>
+                                                                                                               <bool key="NSAnimates">NO</bool>
+                                                                                                       </object>
+                                                                                                       <int key="NSResizingMask">1</int>
+                                                                                                       <bool key="NSIsResizeable">YES</bool>
+                                                                                                       <bool key="NSIsEditable">YES</bool>
+                                                                                                       <reference key="NSTableView" ref="163779105"/>
+                                                                                               </object>
+                                                                                               <object class="NSTableColumn" id="726607121">
+                                                                                                       <string key="NSIdentifier">selected</string>
+                                                                                                       <double key="NSWidth">2.000000e+01</double>
+                                                                                                       <double key="NSMinWidth">1.000000e+01</double>
+                                                                                                       <double key="NSMaxWidth">3.402823e+38</double>
+                                                                                                       <object class="NSTableHeaderCell" key="NSHeaderCell">
+                                                                                                               <int key="NSCellFlags">75628032</int>
+                                                                                                               <int key="NSCellFlags2">0</int>
+                                                                                                               <string key="NSContents"/>
+                                                                                                               <reference key="NSSupport" ref="26"/>
+                                                                                                               <object class="NSColor" key="NSBackgroundColor" id="294261914">
+                                                                                                                       <int key="NSColorSpace">6</int>
+                                                                                                                       <string key="NSCatalogName">System</string>
+                                                                                                                       <string key="NSColorName">headerColor</string>
+                                                                                                                       <object class="NSColor" key="NSColor" id="1023510502">
+                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                               <bytes key="NSWhite">MQA</bytes>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <reference key="NSTextColor" ref="894923077"/>
+                                                                                                       </object>
+                                                                                                       <object class="NSButtonCell" key="NSDataCell" id="1011357989">
                                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                                                <int key="NSCellFlags2">131072</int>
                                                                                                                <string key="NSContents"/>
                                                                                                        </object>
                                                                                                        <int key="NSResizingMask">1</int>
                                                                                                        <bool key="NSIsResizeable">YES</bool>
-                                                                                                       <bool key="NSIsEditable">YES</bool>
                                                                                                        <reference key="NSTableView" ref="163779105"/>
                                                                                                </object>
-                                                                                               <object class="NSTableColumn" id="726607121">
+                                                                                               <object class="NSTableColumn" id="486289408">
                                                                                                        <string key="NSIdentifier">playlist</string>
-                                                                                                       <double key="NSWidth">2.810000e+02</double>
+                                                                                                       <double key="NSWidth">2.580000e+02</double>
                                                                                                        <double key="NSMinWidth">1.000000e+01</double>
                                                                                                        <double key="NSMaxWidth">3.402823e+38</double>
                                                                                                        <object class="NSTableHeaderCell" key="NSHeaderCell">
                                                                                                                <int key="NSCellFlags2">0</int>
                                                                                                                <string key="NSContents"/>
                                                                                                                <reference key="NSSupport" ref="26"/>
-                                                                                                               <object class="NSColor" key="NSBackgroundColor">
-                                                                                                                       <int key="NSColorSpace">6</int>
-                                                                                                                       <string key="NSCatalogName">System</string>
-                                                                                                                       <string key="NSColorName">headerColor</string>
-                                                                                                                       <object class="NSColor" key="NSColor" id="1023510502">
-                                                                                                                               <int key="NSColorSpace">3</int>
-                                                                                                                               <bytes key="NSWhite">MQA</bytes>
-                                                                                                                       </object>
-                                                                                                               </object>
+                                                                                                               <reference key="NSBackgroundColor" ref="294261914"/>
                                                                                                                <reference key="NSTextColor" ref="894923077"/>
                                                                                                        </object>
-                                                                                                       <object class="NSTextFieldCell" key="NSDataCell" id="517291656">
+                                                                                                       <object class="NSTextFieldCell" key="NSDataCell" id="18460085">
                                                                                                                <int key="NSCellFlags">337772096</int>
                                                                                                                <int key="NSCellFlags2">2048</int>
-                                                                                                               <string key="NSContents"/>
+                                                                                                               <string key="NSContents">Text Cell</string>
                                                                                                                <reference key="NSSupport" ref="822023840"/>
                                                                                                                <reference key="NSControlView" ref="163779105"/>
                                                                                                                <object class="NSColor" key="NSBackgroundColor" id="928689894">
                                                                                        <int key="NSTableViewDraggingDestinationStyle">1</int>
                                                                                </object>
                                                                        </object>
-                                                                       <string key="NSFrame">{{1, 1}, {327, 338}}</string>
+                                                                       <string key="NSFrame">{{1, 17}, {327, 322}}</string>
                                                                        <reference key="NSSuperview" ref="52653404"/>
                                                                        <reference key="NSNextKeyView" ref="163779105"/>
                                                                        <reference key="NSDocView" ref="163779105"/>
                                                                        <reference key="NSSuperview" ref="52653404"/>
                                                                        <reference key="NSTarget" ref="52653404"/>
                                                                        <string key="NSAction">_doScroller:</string>
-                                                                       <double key="NSPercent">9.970502e-01</double>
+                                                                       <double key="NSPercent">9.969040e-01</double>
                                                                </object>
                                                                <object class="NSScroller" id="573066292">
                                                                        <reference key="NSNextResponder" ref="52653404"/>
                                                                        <string key="NSAction">_doScroller:</string>
                                                                        <double key="NSPercent">9.969512e-01</double>
                                                                </object>
+                                                               <object class="NSClipView" id="1048309480">
+                                                                       <reference key="NSNextResponder" ref="52653404"/>
+                                                                       <int key="NSvFlags">2304</int>
+                                                                       <object class="NSMutableArray" key="NSSubviews">
+                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                               <reference ref="294163332"/>
+                                                                       </object>
+                                                                       <string key="NSFrame">{{1, 0}, {327, 17}}</string>
+                                                                       <reference key="NSSuperview" ref="52653404"/>
+                                                                       <reference key="NSNextKeyView" ref="294163332"/>
+                                                                       <reference key="NSDocView" ref="294163332"/>
+                                                                       <reference key="NSBGColor" ref="928689894"/>
+                                                                       <int key="NScvFlags">4</int>
+                                                               </object>
+                                                               <reference ref="433894358"/>
                                                        </object>
                                                        <string key="NSFrame">{{32, 160}, {329, 340}}</string>
                                                        <reference key="NSSuperview" ref="439893737"/>
                                                        <reference key="NSVScroller" ref="171818306"/>
                                                        <reference key="NSHScroller" ref="573066292"/>
                                                        <reference key="NSContentView" ref="1071723009"/>
+                                                       <reference key="NSHeaderClipView" ref="1048309480"/>
+                                                       <reference key="NSCornerView" ref="433894358"/>
                                                        <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
                                                </object>
                                        </object>
                                                        <reference ref="171818306"/>
                                                        <reference ref="573066292"/>
                                                        <reference ref="163779105"/>
+                                                       <reference ref="294163332"/>
                                                </object>
                                                <reference key="parent" ref="439893737"/>
                                        </object>
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <reference ref="611630035"/>
                                                        <reference ref="726607121"/>
+                                                       <reference ref="486289408"/>
                                                </object>
                                                <reference key="parent" ref="52653404"/>
                                        </object>
                                                <reference key="object" ref="611630035"/>
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="130567970"/>
+                                                       <reference ref="105013743"/>
                                                </object>
                                                <reference key="parent" ref="163779105"/>
                                        </object>
                                                <reference key="object" ref="371072707"/>
                                                <reference key="parent" ref="0"/>
                                        </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">484</int>
-                                               <reference key="object" ref="130567970"/>
-                                               <reference key="parent" ref="611630035"/>
-                                       </object>
                                        <object class="IBObjectRecord">
                                                <int key="objectID">485</int>
                                                <reference key="object" ref="726607121"/>
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="517291656"/>
+                                                       <reference ref="1011357989"/>
                                                </object>
                                                <reference key="parent" ref="163779105"/>
                                        </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">486</int>
-                                               <reference key="object" ref="517291656"/>
-                                               <reference key="parent" ref="726607121"/>
-                                       </object>
                                        <object class="IBObjectRecord">
                                                <int key="objectID">490</int>
                                                <reference key="object" ref="377758519"/>
                                                <reference key="object" ref="250030516"/>
                                                <reference key="parent" ref="172442330"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">517</int>
+                                               <reference key="object" ref="486289408"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="18460085"/>
+                                               </object>
+                                               <reference key="parent" ref="163779105"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">518</int>
+                                               <reference key="object" ref="18460085"/>
+                                               <reference key="parent" ref="486289408"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">520</int>
+                                               <reference key="object" ref="294163332"/>
+                                               <reference key="parent" ref="52653404"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">521</int>
+                                               <reference key="object" ref="105013743"/>
+                                               <reference key="parent" ref="611630035"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">522</int>
+                                               <reference key="object" ref="1011357989"/>
+                                               <reference key="parent" ref="726607121"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>470.IBPluginDependency</string>
                                        <string>472.IBPluginDependency</string>
                                        <string>477.IBPluginDependency</string>
-                                       <string>484.IBPluginDependency</string>
                                        <string>485.IBPluginDependency</string>
-                                       <string>486.IBPluginDependency</string>
                                        <string>490.IBPluginDependency</string>
                                        <string>509.IBPluginDependency</string>
                                        <string>510.IBPluginDependency</string>
                                        <string>514.IBPluginDependency</string>
                                        <string>515.IBPluginDependency</string>
+                                       <string>521.IBPluginDependency</string>
+                                       <string>522.IBPluginDependency</string>
                                        <string>56.IBPluginDependency</string>
                                        <string>56.ImportedFromIB2</string>
                                        <string>57.IBPluginDependency</string>
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">516</int>
+                       <int key="maxID">522</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
                                                        <string>id</string>
                                                </object>
                                        </object>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier" id="344772374">
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier" id="409041613">
                                                <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">NotiPod.py</string>
+                                               <string key="minorKey">notipod_gui.py</string>
                                        </object>
                                </object>
                                <object class="IBPartialClassDescription">
                                                        <string>id</string>
                                                </object>
                                        </object>
-                                       <reference key="sourceIdentifier" ref="344772374"/>
+                                       <reference key="sourceIdentifier" ref="409041613"/>
                                </object>
                                <object class="IBPartialClassDescription">
                                        <string key="className">NotiPodController</string>
                                                <string key="NS.key.0">outlineView</string>
                                                <string key="NS.object.0">id</string>
                                        </object>
-                                       <reference key="sourceIdentifier" ref="344772374"/>
+                                       <reference key="sourceIdentifier" ref="409041613"/>
                                </object>
                        </object>
                </object>
diff --git a/icons/playlist-books.icns b/icons/playlist-books.icns
new file mode 100644 (file)
index 0000000..0f08b4e
Binary files /dev/null and b/icons/playlist-books.icns differ
diff --git a/icons/playlist-cd.icns b/icons/playlist-cd.icns
new file mode 100644 (file)
index 0000000..9a6f270
Binary files /dev/null and b/icons/playlist-cd.icns differ
diff --git a/icons/playlist-downloads.icns b/icons/playlist-downloads.icns
new file mode 100644 (file)
index 0000000..447f67b
Binary files /dev/null and b/icons/playlist-downloads.icns differ
diff --git a/icons/playlist-folder.icns b/icons/playlist-folder.icns
new file mode 100644 (file)
index 0000000..4ac9082
Binary files /dev/null and b/icons/playlist-folder.icns differ
diff --git a/icons/playlist-genius-mixes.icns b/icons/playlist-genius-mixes.icns
new file mode 100644 (file)
index 0000000..9e744bc
Binary files /dev/null and b/icons/playlist-genius-mixes.icns differ
diff --git a/icons/playlist-genius-playlist.icns b/icons/playlist-genius-playlist.icns
new file mode 100644 (file)
index 0000000..75a9afa
Binary files /dev/null and b/icons/playlist-genius-playlist.icns differ
diff --git a/icons/playlist-genius.icns b/icons/playlist-genius.icns
new file mode 100644 (file)
index 0000000..89458ca
Binary files /dev/null and b/icons/playlist-genius.icns differ
diff --git a/icons/playlist-itunes-dj.icns b/icons/playlist-itunes-dj.icns
new file mode 100644 (file)
index 0000000..6ce0647
Binary files /dev/null and b/icons/playlist-itunes-dj.icns differ
diff --git a/icons/playlist-itunes-u.icns b/icons/playlist-itunes-u.icns
new file mode 100644 (file)
index 0000000..142c80f
Binary files /dev/null and b/icons/playlist-itunes-u.icns differ
diff --git a/icons/playlist-movies.icns b/icons/playlist-movies.icns
new file mode 100644 (file)
index 0000000..45e1e35
Binary files /dev/null and b/icons/playlist-movies.icns differ
diff --git a/icons/playlist-music.icns b/icons/playlist-music.icns
new file mode 100644 (file)
index 0000000..065eb7c
Binary files /dev/null and b/icons/playlist-music.icns differ
diff --git a/icons/playlist-playlist.icns b/icons/playlist-playlist.icns
new file mode 100644 (file)
index 0000000..7173572
Binary files /dev/null and b/icons/playlist-playlist.icns differ
diff --git a/icons/playlist-podcasts.icns b/icons/playlist-podcasts.icns
new file mode 100644 (file)
index 0000000..38a8c57
Binary files /dev/null and b/icons/playlist-podcasts.icns differ
diff --git a/icons/playlist-purchased.icns b/icons/playlist-purchased.icns
new file mode 100644 (file)
index 0000000..a8824a8
Binary files /dev/null and b/icons/playlist-purchased.icns differ
diff --git a/icons/playlist-radio.icns b/icons/playlist-radio.icns
new file mode 100644 (file)
index 0000000..53dcab4
Binary files /dev/null and b/icons/playlist-radio.icns differ
diff --git a/icons/playlist-ringtones.icns b/icons/playlist-ringtones.icns
new file mode 100644 (file)
index 0000000..77ce59f
Binary files /dev/null and b/icons/playlist-ringtones.icns differ
diff --git a/icons/playlist-smart-playlist.icns b/icons/playlist-smart-playlist.icns
new file mode 100644 (file)
index 0000000..a6dbd13
Binary files /dev/null and b/icons/playlist-smart-playlist.icns differ
diff --git a/icons/playlist-tv-shows.icns b/icons/playlist-tv-shows.icns
new file mode 100644 (file)
index 0000000..1c76e8e
Binary files /dev/null and b/icons/playlist-tv-shows.icns differ
index 49af34a..02f7c30 100644 (file)
@@ -27,9 +27,10 @@ class Playlist(NSObject):
        def init(self):
                return self
 
-       def set(self, name, pid, tracks, parent):
+       def set(self, name, pid, ptype, tracks, parent):
                self.name = name
                self.pid = pid
+               self.ptype = ptype
                self.children = []
                self.tracks = tracks
                self.parent = parent
@@ -48,6 +49,8 @@ class ITunesLibrary(NSObject):
                self.playlists = {}
                for pl_playlist in plist["Playlists"]:
                        playlist = self.make_playlist(pl_playlist, pl_tracks)
+                       if not playlist:
+                               continue
                        yield "Read playlist: " + playlist.name
                        self.playlists[playlist.pid] = playlist
 
@@ -55,8 +58,33 @@ class ITunesLibrary(NSObject):
                return urllib.splithost(urllib.splittype(urllib.unquote(location))[1])[1]
 
        def make_playlist(self, pl_playlist, pl_tracks):
+               if int(pl_playlist.get("Master", 0)):
+                       return
+               kind = int(pl_playlist.get("Distinguished Kind", -1))
+               if kind == 26:
+                       # Don't do genius
+                       return
+
                name = pl_playlist["Name"]
                pid = pl_playlist["Playlist Persistent ID"]
+               if kind > 0:
+                       ptype = {
+                               2: "movies",
+                               3: "tv-shows",
+                               4: "music",
+                               5: "books",
+                               10: "podcasts",
+                               19: "purchased",
+                               22: "itunes-dj",
+                               31: "itunes-u",
+                       }.get(kind, "playlist")
+               elif pl_playlist.has_key("Smart Info"):
+                       ptype = "smart-playlist"
+               elif int(pl_playlist.get("Folder", 0)):
+                       ptype = "folder"
+               else:
+                       ptype = "playlist"
+
                parent = None
                try:
                        parent_pid = pl_playlist["Parent Persistent ID"]
@@ -75,7 +103,7 @@ class ITunesLibrary(NSObject):
                        filename = strip_prefix(filename, self.folder)
                        tracks.append(filename)
                playlist = Playlist.alloc().init()
-               playlist.set(name, pid, tracks, parent)
+               playlist.set(name, pid, ptype, tracks, parent)
                return playlist
 
        def has_playlist_name(self, name):
index 08adab1..67db772 100644 (file)
                8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
                8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
                8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+               939819EF12D107B300306B20 /* playlist-books.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819DD12D107B300306B20 /* playlist-books.icns */; };
+               939819F012D107B300306B20 /* playlist-cd.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819DE12D107B300306B20 /* playlist-cd.icns */; };
+               939819F112D107B300306B20 /* playlist-downloads.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819DF12D107B300306B20 /* playlist-downloads.icns */; };
+               939819F212D107B300306B20 /* playlist-folder.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E012D107B300306B20 /* playlist-folder.icns */; };
+               939819F312D107B300306B20 /* playlist-genius-mixes.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E112D107B300306B20 /* playlist-genius-mixes.icns */; };
+               939819F412D107B300306B20 /* playlist-genius-playlist.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E212D107B300306B20 /* playlist-genius-playlist.icns */; };
+               939819F512D107B300306B20 /* playlist-genius.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E312D107B300306B20 /* playlist-genius.icns */; };
+               939819F612D107B300306B20 /* playlist-itunes-dj.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E412D107B300306B20 /* playlist-itunes-dj.icns */; };
+               939819F712D107B300306B20 /* playlist-itunes-u.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E512D107B300306B20 /* playlist-itunes-u.icns */; };
+               939819F812D107B300306B20 /* playlist-movies.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E612D107B300306B20 /* playlist-movies.icns */; };
+               939819F912D107B300306B20 /* playlist-music.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E712D107B300306B20 /* playlist-music.icns */; };
+               939819FA12D107B300306B20 /* playlist-playlist.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E812D107B300306B20 /* playlist-playlist.icns */; };
+               939819FB12D107B300306B20 /* playlist-podcasts.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819E912D107B300306B20 /* playlist-podcasts.icns */; };
+               939819FC12D107B300306B20 /* playlist-purchased.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819EA12D107B300306B20 /* playlist-purchased.icns */; };
+               939819FD12D107B300306B20 /* playlist-radio.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819EB12D107B300306B20 /* playlist-radio.icns */; };
+               939819FE12D107B300306B20 /* playlist-ringtones.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819EC12D107B300306B20 /* playlist-ringtones.icns */; };
+               939819FF12D107B300306B20 /* playlist-smart-playlist.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819ED12D107B300306B20 /* playlist-smart-playlist.icns */; };
+               93981A0012D107B300306B20 /* playlist-tv-shows.icns in Resources */ = {isa = PBXBuildFile; fileRef = 939819EE12D107B300306B20 /* playlist-tv-shows.icns */; };
                93EE29F312D0C5450002BB95 /* libnotipod.py in Resources */ = {isa = PBXBuildFile; fileRef = 93EE29F012D0C5450002BB95 /* libnotipod.py */; };
                93EE29F412D0C5450002BB95 /* notipod_cli.py in Resources */ = {isa = PBXBuildFile; fileRef = 93EE29F112D0C5450002BB95 /* notipod_cli.py */; };
                93EE29F512D0C5450002BB95 /* notipod_gui.py in Resources */ = {isa = PBXBuildFile; fileRef = 93EE29F212D0C5450002BB95 /* notipod_gui.py */; };
                77C8C1F80C07829500965286 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/NotiPod.xib; sourceTree = "<group>"; };
                8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
                8D1107320486CEB800E47090 /* notipod.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = notipod.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               939819DD12D107B300306B20 /* playlist-books.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-books.icns"; sourceTree = "<group>"; };
+               939819DE12D107B300306B20 /* playlist-cd.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-cd.icns"; sourceTree = "<group>"; };
+               939819DF12D107B300306B20 /* playlist-downloads.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-downloads.icns"; sourceTree = "<group>"; };
+               939819E012D107B300306B20 /* playlist-folder.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-folder.icns"; sourceTree = "<group>"; };
+               939819E112D107B300306B20 /* playlist-genius-mixes.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-genius-mixes.icns"; sourceTree = "<group>"; };
+               939819E212D107B300306B20 /* playlist-genius-playlist.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-genius-playlist.icns"; sourceTree = "<group>"; };
+               939819E312D107B300306B20 /* playlist-genius.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-genius.icns"; sourceTree = "<group>"; };
+               939819E412D107B300306B20 /* playlist-itunes-dj.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-itunes-dj.icns"; sourceTree = "<group>"; };
+               939819E512D107B300306B20 /* playlist-itunes-u.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-itunes-u.icns"; sourceTree = "<group>"; };
+               939819E612D107B300306B20 /* playlist-movies.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-movies.icns"; sourceTree = "<group>"; };
+               939819E712D107B300306B20 /* playlist-music.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-music.icns"; sourceTree = "<group>"; };
+               939819E812D107B300306B20 /* playlist-playlist.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-playlist.icns"; sourceTree = "<group>"; };
+               939819E912D107B300306B20 /* playlist-podcasts.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-podcasts.icns"; sourceTree = "<group>"; };
+               939819EA12D107B300306B20 /* playlist-purchased.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-purchased.icns"; sourceTree = "<group>"; };
+               939819EB12D107B300306B20 /* playlist-radio.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-radio.icns"; sourceTree = "<group>"; };
+               939819EC12D107B300306B20 /* playlist-ringtones.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-ringtones.icns"; sourceTree = "<group>"; };
+               939819ED12D107B300306B20 /* playlist-smart-playlist.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-smart-playlist.icns"; sourceTree = "<group>"; };
+               939819EE12D107B300306B20 /* playlist-tv-shows.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "playlist-tv-shows.icns"; sourceTree = "<group>"; };
                93EE29F012D0C5450002BB95 /* libnotipod.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = libnotipod.py; sourceTree = "<group>"; };
                93EE29F112D0C5450002BB95 /* notipod_cli.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = notipod_cli.py; sourceTree = "<group>"; };
                93EE29F212D0C5450002BB95 /* notipod_gui.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = notipod_gui.py; sourceTree = "<group>"; };
                29B97317FDCFA39411CA2CEA /* Resources */ = {
                        isa = PBXGroup;
                        children = (
+                               939819DC12D107B300306B20 /* icons */,
                                77C8C1F70C07829500965286 /* NotiPod.xib */,
                                8D1107310486CEB800E47090 /* Info.plist */,
                                089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
                        name = Frameworks;
                        sourceTree = "<group>";
                };
+               939819DC12D107B300306B20 /* icons */ = {
+                       isa = PBXGroup;
+                       children = (
+                               939819DD12D107B300306B20 /* playlist-books.icns */,
+                               939819DE12D107B300306B20 /* playlist-cd.icns */,
+                               939819DF12D107B300306B20 /* playlist-downloads.icns */,
+                               939819E012D107B300306B20 /* playlist-folder.icns */,
+                               939819E112D107B300306B20 /* playlist-genius-mixes.icns */,
+                               939819E212D107B300306B20 /* playlist-genius-playlist.icns */,
+                               939819E312D107B300306B20 /* playlist-genius.icns */,
+                               939819E412D107B300306B20 /* playlist-itunes-dj.icns */,
+                               939819E512D107B300306B20 /* playlist-itunes-u.icns */,
+                               939819E612D107B300306B20 /* playlist-movies.icns */,
+                               939819E712D107B300306B20 /* playlist-music.icns */,
+                               939819E812D107B300306B20 /* playlist-playlist.icns */,
+                               939819E912D107B300306B20 /* playlist-podcasts.icns */,
+                               939819EA12D107B300306B20 /* playlist-purchased.icns */,
+                               939819EB12D107B300306B20 /* playlist-radio.icns */,
+                               939819EC12D107B300306B20 /* playlist-ringtones.icns */,
+                               939819ED12D107B300306B20 /* playlist-smart-playlist.icns */,
+                               939819EE12D107B300306B20 /* playlist-tv-shows.icns */,
+                       );
+                       path = icons;
+                       sourceTree = "<group>";
+               };
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
                                93EE29F312D0C5450002BB95 /* libnotipod.py in Resources */,
                                93EE29F412D0C5450002BB95 /* notipod_cli.py in Resources */,
                                93EE29F512D0C5450002BB95 /* notipod_gui.py in Resources */,
+                               939819EF12D107B300306B20 /* playlist-books.icns in Resources */,
+                               939819F012D107B300306B20 /* playlist-cd.icns in Resources */,
+                               939819F112D107B300306B20 /* playlist-downloads.icns in Resources */,
+                               939819F212D107B300306B20 /* playlist-folder.icns in Resources */,
+                               939819F312D107B300306B20 /* playlist-genius-mixes.icns in Resources */,
+                               939819F412D107B300306B20 /* playlist-genius-playlist.icns in Resources */,
+                               939819F512D107B300306B20 /* playlist-genius.icns in Resources */,
+                               939819F612D107B300306B20 /* playlist-itunes-dj.icns in Resources */,
+                               939819F712D107B300306B20 /* playlist-itunes-u.icns in Resources */,
+                               939819F812D107B300306B20 /* playlist-movies.icns in Resources */,
+                               939819F912D107B300306B20 /* playlist-music.icns in Resources */,
+                               939819FA12D107B300306B20 /* playlist-playlist.icns in Resources */,
+                               939819FB12D107B300306B20 /* playlist-podcasts.icns in Resources */,
+                               939819FC12D107B300306B20 /* playlist-purchased.icns in Resources */,
+                               939819FD12D107B300306B20 /* playlist-radio.icns in Resources */,
+                               939819FE12D107B300306B20 /* playlist-ringtones.icns in Resources */,
+                               939819FF12D107B300306B20 /* playlist-smart-playlist.icns in Resources */,
+                               93981A0012D107B300306B20 /* playlist-tv-shows.icns in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 9b299ea..39d911f 100644 (file)
@@ -48,16 +48,23 @@ class PlaylistModel(NSObject):
                        return len(playlist.children)
 
        def outlineView_objectValueForTableColumn_byItem_(self, _, col, playlist):
-               col = col.identifier() if col else "playlist"
+               if not col:
+                       return
+               col = col.identifier()
 
                if col == "selected":
                        selected = NSApp.delegate().playlists()
                        return playlist.pid in selected
-               if col == None or col == "playlist":
+               if col == "icon":
+                       return NSImage.imageNamed_("playlist-" + playlist.ptype)
+               if col == "playlist":
                        return playlist.name
 
        def outlineView_setObjectValue_forTableColumn_byItem_(self, _, v, col, playlist):
-               col = col.identifier() if col else "playlist"
+               if not col:
+                       return
+               col = col.identifier()
+
 
                if col != "selected":
                        return