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 @@ ...@@ -162,7 +162,6 @@
"o_mu_videotrack" = id; "o_mu_videotrack" = id;
"o_mu_window" = id; "o_mu_window" = id;
"o_playlist" = id; "o_playlist" = id;
"o_prefs" = id;
"o_timefield" = id; "o_timefield" = id;
"o_timeslider" = id; "o_timeslider" = id;
"o_volumeslider" = id; "o_volumeslider" = id;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>29</key> <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> <key>303</key>
<string>60 509 104 114 0 0 1280 1002 </string> <string>60 509 104 114 0 0 1280 1002 </string>
<key>909</key> <key>909</key>
...@@ -26,6 +26,6 @@ ...@@ -26,6 +26,6 @@
<integer>29</integer> <integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>6L60</string> <string>6L29</string>
</dict> </dict>
</plist> </plist>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* prefs.h: MacOS X plugin for vlc * prefs.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * 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> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
@interface VLCPrefs : NSObject @interface VLCPrefs : NSObject
{ {
intf_thread_t *p_intf; intf_thread_t *p_intf;
vlc_bool_t b_advanced;
NSMutableDictionary *o_pref_panels; NSMutableDictionary *o_pref_panels;
NSMutableDictionary *o_toolbars; NSMutableDictionary *o_toolbars;
NSMutableDictionary *o_scroll_views; NSMutableDictionary *o_scroll_views;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* prefs.m: MacOS X plugin for vlc * prefs.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * 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> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
o_scroll_views = [[NSMutableDictionary alloc] init]; o_scroll_views = [[NSMutableDictionary alloc] init];
o_panel_views = [[NSMutableDictionary alloc] init]; o_panel_views = [[NSMutableDictionary alloc] init];
o_save_prefs = [[NSMutableDictionary alloc] init]; o_save_prefs = [[NSMutableDictionary alloc] init];
b_advanced = config_GetInt( p_intf, "advanced" );
} }
return( self ); return( self );
...@@ -283,7 +284,7 @@ ...@@ -283,7 +284,7 @@
if( p_item ) do if( p_item ) do
{ {
if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ) ) if( p_item->b_advanced && !b_advanced )
{ {
continue; continue;
} }
...@@ -438,6 +439,7 @@ ...@@ -438,6 +439,7 @@
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
{ {
if( !p_item->ppsz_list ) if( !p_item->ppsz_list )
...@@ -586,9 +588,15 @@ ...@@ -586,9 +588,15 @@
DEF_PANEL_BUTTON( 1, _NS("Cancel"), clickedApplyCancelOK: ); DEF_PANEL_BUTTON( 1, _NS("Cancel"), clickedApplyCancelOK: );
[o_button setKeyEquivalent: @"\E"]; [o_button setKeyEquivalent: @"\E"];
s_rc.origin.x -= s_rc.size.width; s_rc.origin.x = 20;
DEF_PANEL_BUTTON( 2, _NS("Apply"), clickedApplyCancelOK: ); o_button = [[NSButton alloc] initWithFrame: s_rc];
[o_button setEnabled: NO]; [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 #undef DEF_PANEL_BUTTON
...@@ -731,16 +739,14 @@ ...@@ -731,16 +739,14 @@
{ {
id o_vlc_control; id o_vlc_control;
NSEnumerator *o_enum; NSEnumerator *o_enum;
BOOL b_adv_change = FALSE;
NSWindow *o_pref_panel = [[sender superview] window]; NSWindow *o_pref_panel = [[sender superview] window];
NSString *o_module_name = [[o_pref_panel toolbar] identifier]; 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]; 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]; NSString *o_module_name = [[o_config_panel toolbar] identifier];
NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name]; NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
...@@ -757,6 +763,7 @@ ...@@ -757,6 +763,7 @@
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
{ {
char *psz_value; char *psz_value;
NSString *o_value; NSString *o_value;
...@@ -774,12 +781,6 @@ ...@@ -774,12 +781,6 @@
{ {
int i_value = [o_vlc_control intValue]; 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 ); config_PutInt( p_intf, psz_name, i_value );
} }
break; break;
...@@ -795,34 +796,35 @@ ...@@ -795,34 +796,35 @@
} }
} }
[o_btn_apply setEnabled: NO];
[o_prefs removeAllObjects]; [o_prefs removeAllObjects];
config_SaveConfigFile( p_intf, NULL ); config_SaveConfigFile( p_intf, NULL );
} }
if( [[sender title] isEqualToString: _NS("Advanced")] )
if( ![[sender title] isEqualToString: _NS("Apply")] || b_adv_change )
{ {
[o_pref_panel close]; NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
b_advanced = !b_advanced;
if( [self respondsToSelector: @selector(performSelectorOnMainThread: [o_btn_apply setState: b_advanced];
withObject:waitUntilDone:)] ) }
{ [o_pref_panel close];
[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("Apply")] && b_adv_change ) if( [self respondsToSelector: @selector(performSelectorOnMainThread:
{ withObject:waitUntilDone:)] )
[self createPrefPanel: o_module_name]; {
} [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];
} }
} }
......
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