]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/intf.m
macosx: Set nib deplyment target to 10.4, and don't use toolbar from nib as this...
[vlc] / modules / gui / macosx / intf.m
index a541ba5392f87336ca3cd073c4d78ebb74bf9f12..51292a47ab0607b9be20c0ea5c73894ec3b65d31 100644 (file)
@@ -392,6 +392,15 @@ static VLCMain *_o_sharedMainInstance = nil;
     [o_msgs_panel setExcludedFromWindowsMenu: YES];
     [o_msgs_panel setDelegate: self];
 
+    /* In code and not in Nib for 10.4 compat */
+    NSToolbar * toolbar = [[[NSToolbar alloc] initWithIdentifier:@"mainControllerToolbar"] autorelease];
+    [toolbar setDelegate:self];
+    [toolbar setShowsBaselineSeparator:NO];
+    [toolbar setAllowsUserCustomization:NO];
+    [toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
+    [toolbar setAutosavesConfiguration:YES];
+    [o_window setToolbar:toolbar];
+
     i_key = config_GetInt( p_intf, "key-quit" );
     [o_mi_quit setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_quit setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
@@ -1221,6 +1230,7 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
     pl_Release( p_intf );
 
     vlc_object_lock( p_intf );
+
     while( vlc_object_alive( p_intf ) )
     {
         vlc_mutex_lock( &p_intf->change_lock );
@@ -1245,6 +1255,10 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
             vlc_object_release( p_input );
             p_input = NULL;
         }
+        else if( cachedInputState != input_GetState( p_input ) )
+        {
+            p_intf->p_sys->b_intf_update = true;
+        }
 
         /* Manage volume status */
         [self manageVolumeSlider];
@@ -1304,10 +1318,10 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
         if( ( b_input = ( p_input != NULL ) ) )
         {
             /* seekable streams */
-            int state = input_GetState( p_input );
-            if ( state == INIT_S ||
-                 state == OPENING_S ||
-                 state == BUFFERING_S )
+            cachedInputState = input_GetState( p_input );
+            if ( cachedInputState == INIT_S ||
+                 cachedInputState == OPENING_S ||
+                 cachedInputState == BUFFERING_S )
             {
                 b_buffering = YES;
             }