]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs.m
Implement the full/basic switch correctly and completely. Additionally, fixed a rare...
[vlc] / modules / gui / macosx / prefs.m
index ba9618ff7fb9fd1c13cbbd9511c65635168ecffd..7bdb0e7ea107bd4bdd18cc497f010817e9bffb7f 100644 (file)
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_config_cat.h>
 
-#include "intf.h"
-#include "prefs.h"
-#include "prefs_widgets.h"
-#include "vlc_keys.h"
+#import "intf.h"
+#import "prefs.h"
+#import "simple_prefs.h"
+#import "prefs_widgets.h"
+#import "vlc_keys.h"
 
 /*****************************************************************************
  * VLCPrefs implementation
@@ -112,6 +113,9 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 
 - (void)showPrefs
 {
+    [[o_basicFull_matrix cellAtRow:0 column:0] setState: NSOffState];
+    [[o_basicFull_matrix cellAtRow:0 column:1] setState: NSOnState];
+    
     [o_prefs_window center];
     [o_prefs_window makeKeyAndOrderFront:self];
 }
@@ -123,6 +127,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     [o_cancel_btn setTitle: _NS("Cancel")];
     [o_reset_btn setTitle: _NS("Reset All")];
     [o_advanced_ckb setTitle: _NS("Advanced")];
+    [[o_basicFull_matrix cellAtRow: 0 column: 0] setStringValue: _NS("Basic")];
+    [[o_basicFull_matrix cellAtRow: 0 column: 1] setStringValue: _NS("All")];
 }
 
 - (IBAction)savePrefs: (id)sender
@@ -157,7 +163,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
         [[VLCTreeItem rootItem] resetView];
         [[o_tree itemAtRow:[o_tree selectedRow]]
             showView:o_prefs_view advancedView:
-            ( [o_advanced_ckb state] == NSOnState ) ? VLC_TRUE : VLC_FALSE];
+            ( [o_advanced_ckb state] == NSOnState ) ? true : false];
     }
 }
 
@@ -167,7 +173,15 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     [o_advanced_ckb setState: b_advanced];
     /* refresh the view of the current treeitem */
     [[o_tree itemAtRow:[o_tree selectedRow]] showView:o_prefs_view advancedView:
-        ( [o_advanced_ckb state] == NSOnState ) ? VLC_TRUE : VLC_FALSE];
+        ( [o_advanced_ckb state] == NSOnState ) ? true : false];
+}
+
+- (IBAction)buttonAction: (id)sender
+{
+    [o_prefs_window orderOut: self];
+    [[o_basicFull_matrix cellAtRow:0 column:0] setState: NSOnState];
+    [[o_basicFull_matrix cellAtRow:0 column:1] setState: NSOffState];
+    [[[VLCMain sharedInstance] getSimplePreferences] showSimplePrefs];
 }
 
 - (void)loadConfigTree
@@ -183,7 +197,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 {
     [[o_tree itemAtRow:[o_tree selectedRow]] showView: o_prefs_view
         advancedView:( [o_advanced_ckb state] == NSOnState ) ?
-        VLC_TRUE : VLC_FALSE];
+        true : false];
 }
 
 @end
@@ -393,6 +407,7 @@ static VLCTreeItem *o_root_item = nil;
                 p_item = module_GetConfig( p_module, &confsize );
 
                 if( !p_item ) continue;
+                if( !p_item->i_type ) break;
                 int i_category = -1;
                 int i_subcategory = -1;
                 int i_options = 0;
@@ -413,7 +428,7 @@ static VLCTreeItem *o_root_item = nil;
                 /* Find the right category item */
 
                 long cookie;
-                vlc_bool_t b_found = VLC_FALSE;
+                bool b_found = false;
                 unsigned int i;
                 VLCTreeItem* p_category_item, * p_subcategory_item;
                 for (i = 0 ; i < [o_children count] ; i++)
@@ -421,14 +436,14 @@ static VLCTreeItem *o_root_item = nil;
                     p_category_item = [o_children objectAtIndex: i];
                     if( p_category_item->i_object_id == i_category )
                     {
-                        b_found = VLC_TRUE;
+                        b_found = true;
                         break;
                     }
                 }
                 if( !b_found ) continue;
 
                 /* Find subcategory item */
-                b_found = VLC_FALSE;
+                b_found = false;
                 cookie = -1;
                 for (i = 0 ; i < [p_category_item->o_children count] ; i++)
                 {
@@ -436,7 +451,7 @@ static VLCTreeItem *o_root_item = nil;
                                             objectAtIndex: i];
                     if( p_subcategory_item->i_object_id == i_subcategory )
                     {
-                        b_found = VLC_TRUE;
+                        b_found = true;
                         break;
                     }
                 }
@@ -445,7 +460,7 @@ static VLCTreeItem *o_root_item = nil;
 
                 [p_subcategory_item->o_children addObject:[[VLCTreeItem alloc]
                     initWithName:[[VLCMain sharedInstance]
-                        localizedString: module_GetName( p_module, VLC_FALSE ) ]
+                        localizedString: module_GetName( p_module, false ) ]
                     withTitle:[[VLCMain sharedInstance]
                         localizedString:  module_GetLongName( p_module ) ]
                     withHelp: @""
@@ -523,7 +538,7 @@ static VLCTreeItem *o_root_item = nil;
 }
 
 - (NSView *)showView:(NSScrollView *)o_prefs_view
-    advancedView:(vlc_bool_t) b_advanced
+    advancedView:(bool) b_advanced
 {
     NSRect          s_vrc;
     NSView          *o_view;
@@ -551,7 +566,7 @@ static VLCTreeItem *o_root_item = nil;
         if( i_object_category == -1 )
         {
             p_parser = (module_t *) vlc_object_get( i_object_id );
-            if( !p_parser || ((vlc_object_t*)p_parser)->i_object_type != VLC_OBJECT_MODULE )
+            if( !p_parser )
             {
                 /* 0OOoo something went really bad */
                 return nil;