Commit a4fc3454 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* modules/gui/macosx/prefs.?:

  - 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.
parent b4b40a47
......@@ -162,7 +162,6 @@
"o_mu_videotrack" = id;
"o_mu_window" = id;
"o_playlist" = id;
"o_prefs" = id;
"o_timefield" = id;
"o_timeslider" = id;
"o_volumeslider" = id;
......
......@@ -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>
......@@ -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,6 +29,7 @@
@interface VLCPrefs : NSObject
{
intf_thread_t *p_intf;
vlc_bool_t b_advanced;
NSMutableDictionary *o_pref_panels;
NSMutableDictionary *o_toolbars;
......
......@@ -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 );
......@@ -283,7 +284,7 @@
if( p_item ) do
{
if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ) )
if( p_item->b_advanced && !b_advanced )
{
continue;
}
......@@ -438,6 +439,7 @@
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
{
if( !p_item->ppsz_list )
......@@ -586,9 +588,15 @@
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
......@@ -731,16 +739,14 @@
{
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];
......@@ -757,6 +763,7 @@
case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
{
char *psz_value;
NSString *o_value;
......@@ -774,12 +781,6 @@
{
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;
......@@ -795,14 +796,16 @@
}
}
[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")] )
{
NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
b_advanced = !b_advanced;
[o_btn_apply setState: b_advanced];
}
[o_pref_panel close];
if( [self respondsToSelector: @selector(performSelectorOnMainThread:
......@@ -819,11 +822,10 @@
userInfo: o_module_name repeats: NO];
}
if( [[sender title] isEqualToString: _NS("Apply")] && b_adv_change )
if( [[sender title] isEqualToString: _NS("Advanced")] )
{
[self createPrefPanel: o_module_name];
}
}
}
@end
......
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