]> code.delx.au - notipod/blobdiff - notipod_gui.py
Reordered tags
[notipod] / notipod_gui.py
index 084b1d75482050c82e0866b3b396f2e03fe1d13d..f4c6dde72d74e0a651019f6f916fc13538f876db 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
@@ -109,6 +116,7 @@ class NotiPodController(NSObject):
        folderModel = objc.IBOutlet()
        loadingSheet = objc.IBOutlet()
        loadingLabel = objc.IBOutlet()
+       loadingIndicator = objc.IBOutlet()
 
        def awakeFromNib(self):
                self.runningGenerator = False
@@ -134,6 +142,7 @@ class NotiPodController(NSObject):
        def runGenerator(self, func, finish):
                assert not self.runningGenerator
                self.runningGenerator = True
+               self.loadingIndicator.startAnimation_(self)
                NSApp.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(self.loadingSheet, self.window, None, None, None)
                arg = (func(), finish)
                self.performSelectorInBackground_withObject_(self.runGeneratorThread, arg)
@@ -149,11 +158,12 @@ class NotiPodController(NSObject):
                        self.stopGenerator, finish, True)
                self.runningGenerator = False
                del pool
-       
+
        def stopGenerator(self, finish):
                self.runningGenerator = False
                NSApp.endSheet_(self.loadingSheet)
                self.loadingSheet.orderOut_(self)
+               self.loadingIndicator.stopAnimation_(self)
                finish()
 
        @objc.IBAction