Commit fca62c49 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: don't use NSNotifcations to handle VLC's dialog callbacks, always...

macosx: don't use NSNotifcations to handle VLC's dialog callbacks, always perform NSAlert and friends on main thread

additionally, removed 2 clients of the manageInterface loop, which will be removed all together shortly
parent 2ac54856
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
} }
+ (VLCCoreDialogProvider *)sharedInstance; + (VLCCoreDialogProvider *)sharedInstance;
-(void)performDialogEvent: (NSNotification *)o_notification; -(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type;
-(void)showFatalDialog: (NSValue *)o_value; -(void)showFatalDialog: (NSValue *)o_value;
-(void)showFatalWaitDialog: (NSValue *)o_value; -(void)showFatalWaitDialog: (NSValue *)o_value;
......
...@@ -70,23 +70,22 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -70,23 +70,22 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
} }
-(void)performDialogEvent: (NSNotification *)o_notification -(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{ {
NSValue *o_value = [[o_notification userInfo] objectForKey:@"VLCDialogPointer"]; NSString *o_type = [NSString stringWithUTF8String:type];
NSString *o_type = [[o_notification userInfo] objectForKey:@"VLCDialogType"];
if( [o_type isEqualToString: @"dialog-error"] ) if( [o_type isEqualToString: @"dialog-error"] )
[self showFatalDialog: o_value]; [self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES];
else if( [o_type isEqualToString: @"dialog-critical"] ) else if( [o_type isEqualToString: @"dialog-critical"] )
[self showFatalWaitDialog: o_value]; [self performSelectorOnMainThread:@selector(showFatalWaitDialog:) withObject:o_value waitUntilDone:YES];
else if( [o_type isEqualToString: @"dialog-question"] ) else if( [o_type isEqualToString: @"dialog-question"] )
[self showQuestionDialog: o_value]; [self performSelectorOnMainThread:@selector(showQuestionDialog:) withObject:o_value waitUntilDone:YES];
else if( [o_type isEqualToString: @"dialog-login"] ) else if( [o_type isEqualToString: @"dialog-login"] )
[self showLoginDialog: o_value]; [self performSelectorOnMainThread:@selector(showLoginDialog:) withObject:o_value waitUntilDone:YES];
else if( [o_type isEqualToString: @"dialog-progress-bar"] ) else if( [o_type isEqualToString: @"dialog-progress-bar"] )
[self showProgressDialog: o_value]; [self performSelectorOnMainThread:@selector(showProgressDialog:) withObject:o_value waitUntilDone:YES];
else else
msg_Err( VLCIntf, "unhandled dialog type: '%s'", [o_type UTF8String] ); msg_Err( VLCIntf, "unhandled dialog type: '%s'", type );
} }
-(void)showFatalDialog: (NSValue *)o_value -(void)showFatalDialog: (NSValue *)o_value
......
...@@ -75,8 +75,6 @@ struct intf_sys_t ...@@ -75,8 +75,6 @@ struct intf_sys_t
bool b_playlist_update; bool b_playlist_update;
bool b_playmode_update; bool b_playmode_update;
bool b_current_title_update; bool b_current_title_update;
bool b_fullscreen_update;
bool b_intf_show;
/* menus handlers */ /* menus handlers */
bool b_input_update; bool b_input_update;
......
...@@ -248,7 +248,14 @@ static int ShowController( vlc_object_t *p_this, const char *psz_variable, ...@@ -248,7 +248,14 @@ static int ShowController( vlc_object_t *p_this, const char *psz_variable,
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
if( p_intf && p_intf->p_sys ) if( p_intf && p_intf->p_sys )
p_intf->p_sys->b_intf_show = true; {
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
if( [[[VLCCoreInteraction sharedInstance] voutView] isFullscreen] && config_GetInt( VLCIntf, "macosx-fspanel" ) )
[[[[VLCMain sharedInstance] controls] fspanel] fadeIn];
else
[[VLCMainWindow sharedInstance] makeKeyAndOrderFront: nil];
[o_pool release];
}
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -261,7 +268,7 @@ static int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable, ...@@ -261,7 +268,7 @@ static int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable,
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
if( p_intf && p_intf->p_sys ) if( p_intf && p_intf->p_sys )
p_intf->p_sys->b_fullscreen_update = true; NSLog( @"we should update fullscreen state" ); //FIXME
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -286,7 +293,7 @@ static int DialogCallback( vlc_object_t *p_this, const char *type, vlc_value_t p ...@@ -286,7 +293,7 @@ static int DialogCallback( vlc_object_t *p_this, const char *type, vlc_value_t p
} }
NSValue *o_value = [NSValue valueWithPointer:value.p_address]; NSValue *o_value = [NSValue valueWithPointer:value.p_address];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewCoreDialogEventNotification" object:[interface coreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_value, @"VLCDialogPointer", [NSString stringWithUTF8String: type], @"VLCDialogType", nil]]; [[VLCCoreDialogProvider sharedInstance] performEventWithObject: o_value ofType: type];
[o_pool release]; [o_pool release];
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -1374,21 +1381,6 @@ static void manage_cleanup( void * args ) ...@@ -1374,21 +1381,6 @@ static void manage_cleanup( void * args )
p_intf->p_sys->b_playlist_update = false; p_intf->p_sys->b_playlist_update = false;
} }
if( p_intf->p_sys->b_fullscreen_update )
{
p_intf->p_sys->b_fullscreen_update = false;
}
if( p_intf->p_sys->b_intf_show )
{
if( [[o_coreinteraction voutView] isFullscreen] && config_GetInt( VLCIntf, "macosx-fspanel" ) )
[[o_controls fspanel] fadeIn];
else
[o_mainwindow makeKeyAndOrderFront: self];
p_intf->p_sys->b_intf_show = false;
}
p_input = pl_CurrentInput( p_intf ); p_input = pl_CurrentInput( p_intf );
if( p_input && vlc_object_alive (p_input) ) if( p_input && vlc_object_alive (p_input) )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment