[vlc-commits] macosx: delay the 'rebuilding fontcache' dialog (close #6040)

Felix Paul Kühne git at videolan.org
Sun Feb 19 23:31:19 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Feb 19 22:19:53 2012 +0100| [690d07949cb368fc837836efe464e8ed6d8faf16] | committer: Jean-Baptiste Kempf

macosx: delay the 'rebuilding fontcache' dialog (close #6040)
(cherry picked from commit 5b459832fe73699efcce93910ca4bf33d0599973)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=690d07949cb368fc837836efe464e8ed6d8faf16
---

 modules/gui/macosx/coredialogs.h |    1 +
 modules/gui/macosx/coredialogs.m |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/modules/gui/macosx/coredialogs.h b/modules/gui/macosx/coredialogs.h
index 777ead1..fda0b8e 100644
--- a/modules/gui/macosx/coredialogs.h
+++ b/modules/gui/macosx/coredialogs.h
@@ -87,6 +87,7 @@
 -(void)showLoginDialog: (NSValue *)o_value;
 -(IBAction)loginDialogAction:(id)sender;
 
+-(void)showProgressDialogOnMainThread: (NSValue *)o_value;
 -(void)showProgressDialog: (NSValue *)o_value;
 -(IBAction)progDialogAction:(id)sender;
 -(BOOL)progressCancelled;
diff --git a/modules/gui/macosx/coredialogs.m b/modules/gui/macosx/coredialogs.m
index 86adb1f..9a0178a 100644
--- a/modules/gui/macosx/coredialogs.m
+++ b/modules/gui/macosx/coredialogs.m
@@ -79,7 +79,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
     else if( [o_type isEqualToString: @"dialog-login"] )
         [self performSelectorOnMainThread:@selector(showLoginDialog:) withObject:o_value waitUntilDone:YES];
     else if( [o_type isEqualToString: @"dialog-progress-bar"] )
-        [self performSelectorOnMainThread:@selector(showProgressDialog:) withObject:o_value waitUntilDone:YES];
+        [self performSelector:@selector(showProgressDialogOnMainThread:) withObject: o_value afterDelay:3.00];
     else
         msg_Err( VLCIntf, "unhandled dialog type: '%s'", type );
 }
@@ -161,6 +161,14 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
         [NSApp stopModalWithCode: 0];
 }
 
+-(void)showProgressDialogOnMainThread: (NSValue *)o_value
+{
+    /* we work-around a Cocoa limitation here, since you cannot delay an execution
+     * on the main thread within a single call */
+    if (VLCIntf)
+        [self performSelectorOnMainThread:@selector(showProgressDialog:) withObject:o_value waitUntilDone:YES];
+}
+
 -(void)showProgressDialog: (NSValue *)o_value
 {
     dialog_progress_bar_t *p_dialog = [o_value pointerValue];



More information about the vlc-commits mailing list