* modules/gui/macosx/prefs.?:
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 9 May 2003 00:41:11 +0000 (00:41 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 9 May 2003 00:41:11 +0000 (00:41 +0000)
  - made the advanced button better.
  - added missing CONFIG_ITEM_DIRECTORY support
* extras/MacOSX/Resources/English.lproj/MainMenu.nib/*:
  - added the semi 'apple' default of com-, as a hotkey for the prefs.

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/prefs.h
modules/gui/macosx/prefs.m

index b1f3544..2f3a64a 100644 (file)
                 "o_mu_videotrack" = id; 
                 "o_mu_window" = id; 
                 "o_playlist" = id; 
-                "o_prefs" = id; 
                 "o_timefield" = id; 
                 "o_timeslider" = id; 
                 "o_volumeslider" = id; 
index c8c677c..4e30b90 100644 (file)
@@ -7,7 +7,7 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
-               <string>374 542 419 44 0 0 1152 746 </string>
+               <string>439 740 419 44 0 0 1280 1002 </string>
                <key>303</key>
                <string>60 509 104 114 0 0 1280 1002 </string>
                <key>909</key>
@@ -26,6 +26,6 @@
                <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>6L60</string>
+       <string>6L29</string>
 </dict>
 </plist>
index fe3fc00..7479bde 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index eb980e7..2b3268e 100644 (file)
@@ -2,7 +2,7 @@
  * prefs.h: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: prefs.h,v 1.4 2003/02/23 05:53:53 jlj Exp $
+ * $Id: prefs.h,v 1.5 2003/05/09 00:41:11 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *
@@ -29,7 +29,8 @@
 @interface VLCPrefs : NSObject
 {
     intf_thread_t *p_intf;
-
+    vlc_bool_t b_advanced;
+    
     NSMutableDictionary *o_pref_panels;
     NSMutableDictionary *o_toolbars;
     NSMutableDictionary *o_scroll_views;
index c4dd476..411fd59 100644 (file)
@@ -2,7 +2,7 @@
  * prefs.m: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: prefs.m,v 1.17 2003/03/06 10:15:37 hartman Exp $
+ * $Id: prefs.m,v 1.18 2003/05/09 00:41:11 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *
@@ -49,6 +49,7 @@
         o_scroll_views = [[NSMutableDictionary alloc] init];
         o_panel_views = [[NSMutableDictionary alloc] init];
         o_save_prefs = [[NSMutableDictionary alloc] init];
+        b_advanced = config_GetInt( p_intf, "advanced" );
     }
 
     return( self );
 
     if( p_item ) do
     {
-        if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ) )
+        if( p_item->b_advanced && !b_advanced )
         {
             continue;
         }
 
         case CONFIG_ITEM_STRING:
         case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_DIRECTORY:
         {
 
             if( !p_item->ppsz_list )
     DEF_PANEL_BUTTON( 1, _NS("Cancel"), clickedApplyCancelOK: );
     [o_button setKeyEquivalent: @"\E"];
 
-    s_rc.origin.x -= s_rc.size.width;
-    DEF_PANEL_BUTTON( 2, _NS("Apply"), clickedApplyCancelOK: );
-    [o_button setEnabled: NO];
+    s_rc.origin.x = 20;
+    o_button = [[NSButton alloc] initWithFrame: s_rc];
+    [o_button setButtonType: NSSwitchButton];
+    [o_button setAction: @selector(clickedApplyCancelOK:)];
+    [o_button setTarget: self];
+    [o_button setTitle: _NS("Advanced")];
+    [o_button setTag: 2];
+    [o_panel_view addSubview: [o_button autorelease]];
+    [o_button setState: b_advanced];
 
 #undef DEF_PANEL_BUTTON
 
 {
     id o_vlc_control;
     NSEnumerator *o_enum;
-    BOOL b_adv_change = FALSE;
-    
+
     NSWindow *o_pref_panel = [[sender superview] window];
     NSString *o_module_name = [[o_pref_panel toolbar] identifier];
+    NSView *o_config_view = [sender superview];
 
-    if ( ![[sender title] isEqualToString: _NS("Cancel")] )
+    if ( [[sender title] isEqualToString: _NS("OK")] )
     {
-        NSView *o_config_view = [sender superview];
         NSWindow *o_config_panel = [o_config_view window];
-        NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
         NSString *o_module_name = [[o_config_panel toolbar] identifier];
         NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
     
             case CONFIG_ITEM_MODULE:
             case CONFIG_ITEM_STRING:
             case CONFIG_ITEM_FILE:
+            case CONFIG_ITEM_DIRECTORY:
                 {
                     char *psz_value;
                     NSString *o_value;
                 {
                     int i_value = [o_vlc_control intValue];
 
-                    if( !strcmp( psz_name, "advanced" ) && 
-                        ( config_GetInt( p_intf, "advanced" ) != i_value ) )
-                    {
-                        b_adv_change = TRUE;
-                    }
-
                     config_PutInt( p_intf, psz_name, i_value );
                 }
                 break;
             }
         }
     
-        [o_btn_apply setEnabled: NO];
         [o_prefs removeAllObjects];
     
         config_SaveConfigFile( p_intf, NULL );
     }
-    
-    if( ![[sender title] isEqualToString: _NS("Apply")] || b_adv_change )
+    if( [[sender title] isEqualToString: _NS("Advanced")] )
     {
-        [o_pref_panel close];
-
-        if( [self respondsToSelector: @selector(performSelectorOnMainThread:
-                                                withObject:waitUntilDone:)] )
-        {
-            [self performSelectorOnMainThread: @selector(destroyPrefPanel:)
-                                            withObject: o_module_name
-                                            waitUntilDone: YES];
-        }
-        else
-        {
-            [NSTimer scheduledTimerWithTimeInterval: 0.1
-                    target: self selector: @selector(destroyPrefPanel:)
-                    userInfo: o_module_name repeats: NO];
-        }
+        NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
+        b_advanced = !b_advanced;
+        [o_btn_apply setState: b_advanced];
+    }
+    [o_pref_panel close];
 
-        if( [[sender title] isEqualToString: _NS("Apply")] && b_adv_change )
-        {
-            [self createPrefPanel: o_module_name];
-        }
+    if( [self respondsToSelector: @selector(performSelectorOnMainThread:
+                                            withObject:waitUntilDone:)] )
+    {
+        [self performSelectorOnMainThread: @selector(destroyPrefPanel:)
+                                        withObject: o_module_name
+                                        waitUntilDone: YES];
+    }
+    else
+    {
+        [NSTimer scheduledTimerWithTimeInterval: 0.1
+                target: self selector: @selector(destroyPrefPanel:)
+                userInfo: o_module_name repeats: NO];
+    }
+    
+    if( [[sender title] isEqualToString: _NS("Advanced")] )
+    {
+        [self createPrefPanel: o_module_name];
     }
 }