From 1451ad4d932f060e14b55ff49d4779a31c977ce0 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Mon, 3 Jan 2011 06:44:39 +1100 Subject: [PATCH] Animate progress bar --- English.lproj/NotiPod.xib | 48 +++++++++++++++++++++++---------------- notipod_gui.py | 3 +++ 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/English.lproj/NotiPod.xib b/English.lproj/NotiPod.xib index a655feb..7e59475 100644 --- a/English.lproj/NotiPod.xib +++ b/English.lproj/NotiPod.xib @@ -392,7 +392,7 @@ - + 67239424 33685504 @@ -416,7 +416,7 @@ 0 - + 6 System headerColor @@ -427,7 +427,7 @@ - + 67239424 131072 @@ -451,7 +451,7 @@ YES - + playlist 2.580000e+02 1.000000e+01 @@ -461,10 +461,10 @@ 0 - + - + 337772096 2048 Text Cell @@ -771,6 +771,14 @@ 516 + + + loadingIndicator + + + + 524 + @@ -1094,7 +1102,7 @@ YES - + @@ -1103,7 +1111,7 @@ YES - + @@ -1117,7 +1125,7 @@ YES - + @@ -1156,26 +1164,26 @@ 517 - + YES - + 518 - - + + 521 - + 522 - + @@ -1369,7 +1377,7 @@ - 523 + 524 @@ -1394,7 +1402,7 @@ id - + IBProjectSource notipod_gui.py @@ -1420,6 +1428,7 @@ YES folderModel + loadingIndicator loadingLabel loadingSheet playlistModel @@ -1432,9 +1441,10 @@ id id id + id - + NotiPodController @@ -1451,7 +1461,7 @@ outlineView id - + diff --git a/notipod_gui.py b/notipod_gui.py index 39d911f..f4c6dde 100644 --- a/notipod_gui.py +++ b/notipod_gui.py @@ -116,6 +116,7 @@ class NotiPodController(NSObject): folderModel = objc.IBOutlet() loadingSheet = objc.IBOutlet() loadingLabel = objc.IBOutlet() + loadingIndicator = objc.IBOutlet() def awakeFromNib(self): self.runningGenerator = False @@ -141,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) @@ -161,6 +163,7 @@ class NotiPodController(NSObject): self.runningGenerator = False NSApp.endSheet_(self.loadingSheet) self.loadingSheet.orderOut_(self) + self.loadingIndicator.stopAnimation_(self) finish() @objc.IBAction -- 2.39.2