Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
6424a7eb
Commit
6424a7eb
authored
Apr 30, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: remove duplicate code by using the same IBAction for both Prefs Reset buttons
parent
df97baf7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
167 additions
and
56 deletions
+167
-56
extras/package/macosx/Resources/English.lproj/Preferences.xib
...as/package/macosx/Resources/English.lproj/Preferences.xib
+152
-20
modules/gui/macosx/prefs.h
modules/gui/macosx/prefs.h
+0
-1
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs.m
+0
-24
modules/gui/macosx/simple_prefs.h
modules/gui/macosx/simple_prefs.h
+1
-0
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+14
-11
No files found.
extras/package/macosx/Resources/English.lproj/Preferences.xib
View file @
6424a7eb
...
...
@@ -12,8 +12,10 @@
</object>
<object
class=
"NSMutableArray"
key=
"IBDocument.EditedObjectIDs"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<integer
value=
"2311"
/>
<integer
value=
"2410"
/>
<integer
value=
"1531"
/>
<integer
value=
"2562"
/>
<integer
value=
"2311"
/>
</object>
<object
class=
"NSArray"
key=
"IBDocument.PluginDependencies"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
...
...
@@ -48,7 +50,7 @@
<string
key=
"NSWindowContentMaxSize"
>
{1.7976931348623157e+308, 1.7976931348623157e+308}
</string>
<string
key=
"NSWindowContentMinSize"
>
{775, 485}
</string>
<object
class=
"NSView"
key=
"NSWindowView"
id=
"669190984"
>
<
nil
key=
"NSNextResponder"
/>
<
reference
key=
"NSNextResponder"
/>
<int
key=
"NSvFlags"
>
256
</int>
<object
class=
"NSMutableArray"
key=
"NSSubviews"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
...
...
@@ -341,6 +343,7 @@
</object>
</object>
<string
key=
"NSFrameSize"
>
{775, 485}
</string>
<reference
key=
"NSSuperview"
/>
</object>
<string
key=
"NSScreenRect"
>
{{0, 0}, {1280, 778}}
</string>
<string
key=
"NSMinSize"
>
{775, 507}
</string>
...
...
@@ -364,7 +367,7 @@
<nil
key=
"NSUserInterfaceItemIdentifier"
/>
<string
key=
"NSWindowContentMaxSize"
>
{1.7976931348623157e+308, 1.7976931348623157e+308}
</string>
<object
class=
"NSView"
key=
"NSWindowView"
id=
"323943617"
>
<
nil
key=
"NSNextResponder"
/>
<
reference
key=
"NSNextResponder"
/>
<int
key=
"NSvFlags"
>
256
</int>
<object
class=
"NSMutableArray"
key=
"NSSubviews"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
...
...
@@ -502,6 +505,7 @@
</object>
</object>
<string
key=
"NSFrameSize"
>
{570, 38}
</string>
<reference
key=
"NSSuperview"
/>
</object>
<string
key=
"NSScreenRect"
>
{{0, 0}, {1280, 778}}
</string>
<string
key=
"NSMaxSize"
>
{1.7976931348623157e+308, 1.7976931348623157e+308}
</string>
...
...
@@ -5482,14 +5486,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int
key=
"connectionID"
>
1551
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
resetAll:
</string>
<reference
key=
"source"
ref=
"990163127"
/>
<reference
key=
"destination"
ref=
"703971607"
/>
</object>
<int
key=
"connectionID"
>
1552
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
closePrefs:
</string>
...
...
@@ -5746,14 +5742,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int
key=
"connectionID"
>
2409
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
buttonAction:
</string>
<reference
key=
"source"
ref=
"150917409"
/>
<reference
key=
"destination"
ref=
"910206764"
/>
</object>
<int
key=
"connectionID"
>
2415
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
buttonAction:
</string>
...
...
@@ -7410,6 +7398,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int
key=
"connectionID"
>
3871
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
resetPreferences:
</string>
<reference
key=
"source"
ref=
"150917409"
/>
<reference
key=
"destination"
ref=
"910206764"
/>
</object>
<int
key=
"connectionID"
>
3872
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
resetPreferences:
</string>
<reference
key=
"source"
ref=
"150917409"
/>
<reference
key=
"destination"
ref=
"703971607"
/>
</object>
<int
key=
"connectionID"
>
3873
</int>
</object>
</object>
<object
class=
"IBMutableOrderedSet"
key=
"objectRecords"
>
<object
class=
"NSArray"
key=
"orderedObjects"
>
...
...
@@ -12234,7 +12238,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil
key=
"sourceID"
/>
<int
key=
"maxID"
>
387
1
</int>
<int
key=
"maxID"
>
387
3
</int>
</object>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<object
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptions"
>
...
...
@@ -13456,6 +13460,127 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string
key=
"minorKey"
>
../../../../../modules/gui/macosx/simple_prefs.h
</string>
</object>
</object>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLCPrefs
</string>
<string
key=
"superclassName"
>
NSObject
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<object
class=
"NSArray"
key=
"dict.sortedKeys"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<string>
buttonAction:
</string>
<string>
closePrefs:
</string>
<string>
savePrefs:
</string>
</object>
<object
class=
"NSMutableArray"
key=
"dict.values"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
</object>
</object>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<object
class=
"NSArray"
key=
"dict.sortedKeys"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<string>
buttonAction:
</string>
<string>
closePrefs:
</string>
<string>
savePrefs:
</string>
</object>
<object
class=
"NSMutableArray"
key=
"dict.values"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
buttonAction:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
closePrefs:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
savePrefs:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</object>
</object>
<object
class=
"NSMutableDictionary"
key=
"outlets"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<object
class=
"NSArray"
key=
"dict.sortedKeys"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<string>
o_cancel_btn
</string>
<string>
o_prefs_view
</string>
<string>
o_prefs_window
</string>
<string>
o_reset_btn
</string>
<string>
o_save_btn
</string>
<string>
o_showBasic_btn
</string>
<string>
o_title
</string>
<string>
o_tree
</string>
</object>
<object
class=
"NSMutableArray"
key=
"dict.values"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
</object>
</object>
<object
class=
"NSMutableDictionary"
key=
"toOneOutletInfosByName"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<object
class=
"NSArray"
key=
"dict.sortedKeys"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<string>
o_cancel_btn
</string>
<string>
o_prefs_view
</string>
<string>
o_prefs_window
</string>
<string>
o_reset_btn
</string>
<string>
o_save_btn
</string>
<string>
o_showBasic_btn
</string>
<string>
o_title
</string>
<string>
o_tree
</string>
</object>
<object
class=
"NSMutableArray"
key=
"dict.values"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_cancel_btn
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_prefs_view
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_prefs_window
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_reset_btn
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_save_btn
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_showBasic_btn
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_title
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBToOneOutletInfo"
>
<string
key=
"name"
>
o_tree
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</object>
</object>
<object
class=
"IBClassDescriptionSource"
key=
"sourceIdentifier"
>
<string
key=
"majorKey"
>
IBDocumentRelativeSource
</string>
<string
key=
"minorKey"
>
../../../../../modules/gui/macosx/prefs.h
</string>
</object>
</object>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLCSimplePrefs
</string>
<string
key=
"superclassName"
>
NSObject
</string>
...
...
@@ -13470,6 +13595,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>
inputSettingChanged:
</string>
<string>
interfaceSettingChanged:
</string>
<string>
osdSettingChanged:
</string>
<string>
resetPreferences:
</string>
<string>
showFontPicker:
</string>
<string>
urlHandlerAction:
</string>
<string>
videoSettingChanged:
</string>
...
...
@@ -13486,6 +13612,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
</object>
</object>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
...
...
@@ -13499,6 +13626,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>
inputSettingChanged:
</string>
<string>
interfaceSettingChanged:
</string>
<string>
osdSettingChanged:
</string>
<string>
resetPreferences:
</string>
<string>
showFontPicker:
</string>
<string>
urlHandlerAction:
</string>
<string>
videoSettingChanged:
</string>
...
...
@@ -13533,6 +13661,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string
key=
"name"
>
osdSettingChanged:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
resetPreferences:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
showFontPicker:
</string>
<string
key=
"candidateClassName"
>
id
</string>
...
...
modules/gui/macosx/prefs.h
View file @
6424a7eb
...
...
@@ -50,7 +50,6 @@
-
(
void
)
showPrefsWithLevel
:(
NSInteger
)
i_window_level
;
-
(
IBAction
)
savePrefs
:
(
id
)
sender
;
-
(
IBAction
)
closePrefs
:
(
id
)
sender
;
-
(
IBAction
)
resetAll
:
(
id
)
sender
;
-
(
IBAction
)
buttonAction
:
(
id
)
sender
;
@end
...
...
modules/gui/macosx/prefs.m
View file @
6424a7eb
...
...
@@ -224,30 +224,6 @@ static VLCPrefs *_o_sharedMainInstance = nil;
[
o_prefs_window
orderOut
:
self
];
}
-
(
IBAction
)
resetAll
:
(
id
)
sender
{
NSBeginInformationalAlertSheet
(
_NS
(
"Reset Preferences"
),
_NS
(
"Cancel"
),
_NS
(
"Continue"
),
nil
,
o_prefs_window
,
self
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
NULL
,
nil
,
@"%@"
,
_NS
(
"Beware this will reset the VLC media player preferences.
\n
"
"Are you sure you want to continue?"
));
}
-
(
void
)
sheetDidEnd
:(
NSWindow
*
)
o_sheet
returnCode
:(
int
)
i_return
contextInfo
:(
void
*
)
o_context
{
if
(
i_return
==
NSAlertAlternateReturn
)
{
/* reset VLC's config */
config_ResetAll
(
p_intf
);
[
_rootTreeItem
resetView
];
config_SaveConfigFile
(
p_intf
);
/* reset OS X defaults */
[
NSUserDefaults
resetStandardUserDefaults
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
}
}
-
(
IBAction
)
buttonAction
:
(
id
)
sender
{
[
o_prefs_window
orderOut
:
self
];
...
...
modules/gui/macosx/simple_prefs.h
View file @
6424a7eb
...
...
@@ -208,6 +208,7 @@
-
(
void
)
showSimplePrefsWithLevel
:(
NSInteger
)
i_window_level
;
-
(
IBAction
)
buttonAction
:(
id
)
sender
;
-
(
IBAction
)
resetPreferences
:(
id
)
sender
;
-
(
void
)
sheetDidEnd
:(
NSWindow
*
)
o_sheet
returnCode
:(
int
)
i_return
contextInfo
:(
void
*
)
o_context
;
...
...
modules/gui/macosx/simple_prefs.m
View file @
6424a7eb
...
...
@@ -682,9 +682,17 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
[
self
saveChangedSettings
];
[[
NSFontPanel
sharedFontPanel
]
close
];
[
o_sprefs_win
orderOut
:
sender
];
}
else
if
(
sender
==
o_sprefs_reset_btn
)
}
else
if
(
sender
==
o_sprefs_showAll_btn
)
{
[
o_sprefs_win
orderOut
:
self
];
[[[
VLCMain
sharedInstance
]
preferences
]
showPrefsWithLevel
:[
o_sprefs_win
level
]];
}
else
msg_Warn
(
p_intf
,
"unknown buttonAction sender"
);
}
-
(
IBAction
)
resetPreferences
:(
NSControl
*
)
sender
{
NSBeginInformationalAlertSheet
(
_NS
(
"Reset Preferences"
),
_NS
(
"Cancel"
),
_NS
(
"Continue"
),
nil
,
o_sprefs_win
,
self
,
_NS
(
"Continue"
),
nil
,
[
sender
window
]
,
self
,
@selector
(
sheetDidEnd
:
returnCode
:
contextInfo
:
),
NULL
,
nil
,
@"%@"
,
_NS
(
"This will reset VLC media player's preferences.
\n\n
"
"Note that VLC will restart during the process, so your current "
...
...
@@ -692,11 +700,6 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
"transcoding activities will stop immediately.
\n\n
"
"The Media Library will not be affected.
\n\n
"
"Are you sure you want to continue?"
));
else
if
(
sender
==
o_sprefs_showAll_btn
)
{
[
o_sprefs_win
orderOut
:
self
];
[[[
VLCMain
sharedInstance
]
preferences
]
showPrefsWithLevel
:[
o_sprefs_win
level
]];
}
else
msg_Warn
(
p_intf
,
"unknown buttonAction sender"
);
}
-
(
void
)
sheetDidEnd
:(
NSWindow
*
)
o_sheet
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment