]> git.sesse.net Git - vlc/commitdiff
* Section titles for the OSX Preferences.
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 19 Aug 2005 16:16:34 +0000 (16:16 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 19 Aug 2005 16:16:34 +0000 (16:16 +0000)
extras/MacOSX/Resources/English.lproj/Preferences.nib/classes.nib
extras/MacOSX/Resources/English.lproj/Preferences.nib/info.nib
extras/MacOSX/Resources/English.lproj/Preferences.nib/keyedobjects.nib
modules/gui/macosx/prefs.h
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.h
modules/gui/macosx/prefs_widgets.m

index 49d891704293fb71d3dc60868ed2afdd1715e9c9..a135413f2e1354719ecb544e2859f67767f0f5dd 100644 (file)
                 "o_prefs_window" = id; 
                 "o_reset_btn" = id; 
                 "o_save_btn" = id; 
+                "o_title" = id; 
                 "o_tree" = id; 
             }; 
             SUPERCLASS = NSObject; 
index 4fd9f4434ea34c5bba713ede86d9efcd69916db6..6b65ca7acad5d19acae7a4799edff366ce161309 100644 (file)
@@ -3,9 +3,9 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>30 60 505 518 0 0 800 578 </string>
+       <string>169 56 505 518 0 0 1280 1002 </string>
        <key>IBFramework Version</key>
-       <string>364.0</string>
+       <string>439.0</string>
        <key>IBLockedObjects</key>
        <array>
                <integer>2203</integer>
                <integer>2206</integer>
                <integer>2199</integer>
        </array>
+       <key>IBOpenObjects</key>
+       <array>
+               <integer>1530</integer>
+       </array>
        <key>IBSystem Version</key>
-       <string>7W98</string>
+       <string>8C46</string>
 </dict>
 </plist>
index be6db355d75718a1d77f75ff740c1bf03ab3712c..bcd31b5bb92eee34fd1b4bc2f2d31daf0e9ad237 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/Preferences.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/Preferences.nib/keyedobjects.nib differ
index b22d6642c0b7c61696648ea5d5ef8402d81ca37d..490d07d16e8e4317e0ebd2701ed34667d2e3cb55 100644 (file)
@@ -24,6 +24,8 @@
 @interface VLCTreeItem : NSObject
 {
     NSString *o_name;
+    NSString *o_title;
+    NSString *o_help;
     int i_object_id;
     VLCTreeItem *o_parent;
     NSMutableArray *o_children;
@@ -36,6 +38,8 @@
 - (VLCTreeItem *)childAtIndex:(int)i_index;
 - (int)getObjectID;
 - (NSString *)getName;
+- (NSString *)getTitle;
+- (NSString *)getHelp;
 - (BOOL)hasPrefs:(NSString *)o_module_name;
 - (NSView *)showView:(NSScrollView *)o_prefs_view advancedView:(vlc_bool_t) b_advanced;
 - (void)applyChanges;
@@ -67,6 +71,7 @@
 + (VLCPrefs *)sharedInstance;
 
 - (void)initStrings;
+- (void)setTitle: (NSString *) o_title_name;
 - (void)showPrefs;
 - (IBAction)savePrefs: (id)sender;
 - (IBAction)closePrefs: (id)sender;
index 77e2f6aba779cc87d1dd45a2d67aabe310bd838c..4a262aeef3164534993262fd112267d8fc8b64a7 100644 (file)
@@ -101,6 +101,11 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     [o_tree selectRow:0 byExtendingSelection:NO];
 }
 
+- (void)setTitle: (NSString *) o_title_name
+{
+    [o_title setStringValue: o_title_name];
+}
+
 - (void)showPrefs
 {
     /* load our nib (if not already loaded) */
@@ -214,7 +219,10 @@ static VLCTreeItem *o_root_item = nil;
 
 #define IsALeafNode ((id)-1)
 
-- (id)initWithName: (NSString *)o_item_name ID: (int)i_id
+- (id)initWithName: (NSString *)o_item_name
+    withTitle: (NSString *)o_item_title
+    withHelp: (NSString *)o_item_help
+    ID: (int)i_id
     parent:(VLCTreeItem *)o_parent_item
     children:(NSMutableArray *)o_children_array
     whithCategory: (int) i_category
@@ -224,6 +232,8 @@ static VLCTreeItem *o_root_item = nil;
     if( self != nil )
     {
         o_name = [o_item_name copy];
+        o_title= [o_item_title copy];
+        o_help= [o_item_help copy];
         i_object_id = i_id;
         o_parent = o_parent_item;
         o_children = o_children_array;
@@ -236,7 +246,7 @@ static VLCTreeItem *o_root_item = nil;
 + (VLCTreeItem *)rootItem
 {
    if (o_root_item == nil)
-        o_root_item = [[VLCTreeItem alloc] initWithName:@"main" ID:0
+        o_root_item = [[VLCTreeItem alloc] initWithName:@"main" withTitle:@"main" withHelp:@"" ID:0
             parent:nil children:[[NSMutableArray alloc] initWithCapacity:10]
             whithCategory: -1];
    return o_root_item;
@@ -246,6 +256,8 @@ static VLCTreeItem *o_root_item = nil;
 {
     if (o_children != IsALeafNode) [o_children release];
     [o_name release];
+    [o_title release];
+    [o_help release];
     [super dealloc];
 }
 
@@ -295,14 +307,21 @@ static VLCTreeItem *o_root_item = nil;
                 if( p_item ) do
                 {
                     NSString *o_child_name;
+                    NSString *o_child_title;
+                    NSString *o_child_help;
                     switch( p_item->i_type )
                     {
                     case CONFIG_CATEGORY:
                         o_child_name = [[VLCMain sharedInstance]
-    localizedString: config_CategoryNameGet(p_item->i_value ) ];
+                            localizedString: config_CategoryNameGet( p_item->i_value ) ];
+                        o_child_title = o_child_name;
+                        o_child_help = [[VLCMain sharedInstance]
+                            localizedString: config_CategoryHelpGet( p_item->i_value ) ];
                         p_last_category = [VLCTreeItem alloc];
                         [o_children addObject:[p_last_category
                             initWithName: o_child_name
+                            withTitle: o_child_title
+                            withHelp: o_child_help
                             ID: p_item->i_value
                             parent:self
                             children:[[NSMutableArray alloc]
@@ -311,13 +330,18 @@ static VLCTreeItem *o_root_item = nil;
                         break;
                     case CONFIG_SUBCATEGORY:
                         o_child_name = [[VLCMain sharedInstance]
-    localizedString: config_CategoryNameGet(p_item->i_value ) ];
+                            localizedString: config_CategoryNameGet( p_item->i_value ) ];
+                        o_child_title = o_child_name;
+                        o_child_help = [[VLCMain sharedInstance]
+                            localizedString: config_CategoryHelpGet( p_item->i_value ) ];
                         if( p_item->i_value != SUBCAT_PLAYLIST_GENERAL &&
                             p_item->i_value != SUBCAT_VIDEO_GENERAL &&
                             p_item->i_value != SUBCAT_AUDIO_GENERAL )
                             [p_last_category->o_children
                                 addObject:[[VLCTreeItem alloc]
                                 initWithName: o_child_name
+                                withTitle: o_child_title
+                                withHelp: o_child_help
                                 ID: p_item->i_value
                                 parent:p_last_category
                                 children:[[NSMutableArray alloc]
@@ -402,6 +426,10 @@ static VLCTreeItem *o_root_item = nil;
                     initWithName:[[VLCMain sharedInstance]
                         localizedString: p_module->psz_shortname ?
                         p_module->psz_shortname : p_module->psz_object_name ]
+                    withTitle:[[VLCMain sharedInstance]
+                        localizedString: p_module->psz_longname ?
+                        p_module->psz_longname : p_module->psz_object_name ]
+                    withHelp: @""
                     ID: p_module->i_object_id
                     parent:p_subcategory_item
                     children:IsALeafNode
@@ -423,6 +451,16 @@ static VLCTreeItem *o_root_item = nil;
     return o_name;
 }
 
+- (NSString *)getTitle
+{
+    return o_title;
+}
+
+- (NSString *)getHelp
+{
+    return o_help;
+}
+
 - (VLCTreeItem *)childAtIndex:(int)i_index
 {
     return [[self children] objectAtIndex:i_index];
@@ -469,6 +507,8 @@ static VLCTreeItem *o_root_item = nil;
     NSRect          s_vrc;
     NSView          *o_view;
 
+    [[VLCPrefs sharedInstance] setTitle: [self getTitle]];
+    /* NSLog( [self getHelp] ); */ 
     s_vrc = [[o_prefs_view contentView] bounds]; s_vrc.size.height -= 4;
     o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
     [o_view setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin |
@@ -509,16 +549,17 @@ static VLCTreeItem *o_root_item = nil;
                 {
                 case CONFIG_SUBCATEGORY:
                     break;
-                case CONFIG_SECTION:
-                    break;
                 case CONFIG_CATEGORY:
                     break;
+                case CONFIG_SECTION:
+                    break;
                 case CONFIG_HINT_END:
                     break;
                 case CONFIG_HINT_USAGE:
                     break;
                 default:
                 {
+                NSLog( @"one" );
                     VLCConfigControl *o_control = nil;
                     o_control = [VLCConfigControl newControl:p_item
                                                   withView:o_view];
@@ -572,14 +613,14 @@ static VLCTreeItem *o_root_item = nil;
                     msg_Err( p_intf, "null item found" );
                     break;
                 }
-                switch(p_item->i_type)
+                switch( p_item->i_type )
                 {
                 case CONFIG_SUBCATEGORY:
                     break;
-                case CONFIG_SECTION:
-                    break;
                 case CONFIG_CATEGORY:
                     break;
+                case CONFIG_SECTION:
+                    break;
                 case CONFIG_HINT_END:
                     break;
                 case CONFIG_HINT_USAGE:
index 4ef8557735889523f8726dd0255831481f7c35fa..890ebbaca6068fa573547dc3cae5f953f767a512 100644 (file)
@@ -216,7 +216,7 @@ static NSMenu   *o_keys_menu = nil;
 
 - (id) initWithItem: (module_config_t *)_p_item
            withView: (NSView *)o_parent_view;
-
+           
 @end
 
 //#undef CONFIG_ITEM_LIST_STRING
index 83f6853c98fc43ebbbb73d8742d3e9881c6ad8e3..559ac0b1ada00e58599ecfff1a57794e522facc4 100644 (file)
@@ -1936,39 +1936,27 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     {
         i_view_type = CONFIG_ITEM_BOOL;
 
+        /* add the checkbox */
+        o_tooltip = [[VLCMain sharedInstance]
+            wrapString: [[VLCMain sharedInstance]
+            localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
+        ADD_CHECKBOX( o_checkbox, mainFrame, 0,
+                        0, @"", o_tooltip, p_item->i_value, NSImageLeft)
+        [o_checkbox setAutoresizingMask:NSViewNotSizable ];
+        [self addSubview: o_checkbox];
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, 0, o_labelString )
+        ADD_LABEL( o_label, mainFrame, [o_checkbox frame].size.width, 0, o_labelString )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
-        /* add the checkbox */
-        o_tooltip = [[VLCMain sharedInstance]
-            wrapString: [[VLCMain sharedInstance]
-            localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_CHECKBOX( o_checkbox, mainFrame, [o_label frame].size.width,
-                        0, @"", o_tooltip, p_item->i_value, NSImageLeft)
-        [o_checkbox setAutoresizingMask:NSViewNotSizable ];
-        [self addSubview: o_checkbox];
     }
     return self;
 }
 
-- (void) alignWithXPosition:(int)i_xPos
-{
-    NSRect frame;
-    frame = [o_label frame];
-    frame.origin.x = i_xPos - frame.size.width - 3;
-    [o_label setFrame:frame];
-
-    frame = [o_checkbox frame];
-    frame.origin.x = i_xPos;
-    [o_checkbox setFrame:frame];
-}
-
 - (void)dealloc
 {
     [o_checkbox release];