Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
0aad5ff3
Commit
0aad5ff3
authored
May 16, 2015
by
David
Browse files
macosx: Use NSWindowController for error panel, lazy initialization
parent
d7657086
Changes
4
Hide whitespace changes
Inline
Side-by-side
extras/package/macosx/Resources/English.lproj/ErrorPanel.xib
View file @
0aad5ff3
...
...
@@ -32,7 +32,7 @@
</object>
<array
class=
"NSMutableArray"
key=
"IBDocument.RootObjects"
id=
"638050510"
>
<object
class=
"NSCustomObject"
id=
"923016430"
>
<string
key=
"NSClassName"
>
VLC
Error
Panel
</string>
<string
key=
"NSClassName"
>
Error
WindowController
</string>
</object>
<object
class=
"NSCustomObject"
id=
"159526500"
>
<string
key=
"NSClassName"
>
FirstResponder
</string>
...
...
@@ -303,14 +303,6 @@
</object>
<int
key=
"connectionID"
>
13
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
o_window
</string>
<reference
key=
"source"
ref=
"923016430"
/>
<reference
key=
"destination"
ref=
"883469087"
/>
</object>
<int
key=
"connectionID"
>
14
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
cleanupTable:
</string>
...
...
@@ -319,6 +311,14 @@
</object>
<int
key=
"connectionID"
>
15
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
window
</string>
<reference
key=
"source"
ref=
"923016430"
/>
<reference
key=
"destination"
ref=
"883469087"
/>
</object>
<int
key=
"connectionID"
>
75
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
dataSource
</string>
...
...
@@ -474,13 +474,13 @@
<nil
key=
"activeLocalization"
/>
<dictionary
class=
"NSMutableDictionary"
key=
"localizations"
/>
<nil
key=
"sourceID"
/>
<int
key=
"maxID"
>
7
4
</int>
<int
key=
"maxID"
>
7
5
</int>
</object>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<array
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptions"
>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLC
Error
Panel
</string>
<string
key=
"superclassName"
>
NS
Object
</string>
<string
key=
"className"
>
Error
WindowController
</string>
<string
key=
"superclassName"
>
NS
WindowController
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"NS.key.0"
>
cleanupTable:
</string>
<string
key=
"NS.object.0"
>
id
</string>
...
...
@@ -517,7 +517,7 @@
</object>
</object>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLC
Error
Panel
</string>
<string
key=
"className"
>
Error
WindowController
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"NS.key.0"
>
cleanupTable:
</string>
<string
key=
"NS.object.0"
>
id
</string>
...
...
@@ -680,6 +680,25 @@
<string
key=
"minorKey"
>
AppKit.framework/Headers/NSWindow.h
</string>
</object>
</object>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
NSWindowController
</string>
<string
key=
"superclassName"
>
NSResponder
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"NS.key.0"
>
showWindow:
</string>
<string
key=
"NS.object.0"
>
id
</string>
</object>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
<string
key=
"NS.key.0"
>
showWindow:
</string>
<object
class=
"IBActionInfo"
key=
"NS.object.0"
>
<string
key=
"name"
>
showWindow:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</object>
<object
class=
"IBClassDescriptionSource"
key=
"sourceIdentifier"
>
<string
key=
"majorKey"
>
IBFrameworkSource
</string>
<string
key=
"minorKey"
>
AppKit.framework/Headers/NSWindowController.h
</string>
</object>
</object>
</array>
</object>
<int
key=
"IBDocument.localizationMode"
>
0
</int>
...
...
modules/gui/macosx/MainMenu.m
View file @
0aad5ff3
...
...
@@ -1262,7 +1262,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
-
(
IBAction
)
viewErrorsAndWarnings
:(
id
)
sender
{
[[[[
VLCMain
sharedInstance
]
coreDialogProvider
]
errorPanel
]
show
Pan
el
];
[[[[
VLCMain
sharedInstance
]
coreDialogProvider
]
errorPanel
]
show
Window
:
s
el
f
];
}
-
(
IBAction
)
showInformationPanel
:(
id
)
sender
...
...
modules/gui/macosx/coredialogs.h
View file @
0aad5ff3
...
...
@@ -25,35 +25,15 @@
#import <vlc_dialog.h>
#import <Cocoa/Cocoa.h>
/*****************************************************************************
* VLC
ErrorPanel
interface
* VLC
CoreDialogProvider
interface
*****************************************************************************/
@interface
VLCErrorPanel
:
NSObject
{
IBOutlet
id
o_window
;
IBOutlet
id
o_cleanup_button
;
IBOutlet
id
o_error_table
;
NSMutableArray
*
o_errors
;
NSMutableArray
*
o_icons
;
BOOL
b_nib_loaded
;
}
-
(
IBAction
)
cleanupTable
:(
id
)
sender
;
-
(
void
)
showPanel
;
-
(
void
)
addError
:
(
NSString
*
)
o_error
withMsg
:(
NSString
*
)
o_msg
;
@end
@class
ErrorWindowController
;
/*****************************************************************************
* VLCCoreDialogProvider interface
*****************************************************************************/
@interface
VLCCoreDialogProvider
:
NSObject
{
VLC
Error
Panel
*
o_error_panel
;
Error
WindowController
*
o_error_panel
;
/* authentication dialogue */
IBOutlet
id
o_auth_cancel_btn
;
...
...
@@ -96,3 +76,23 @@
-
(
id
)
errorPanel
;
@end
/*****************************************************************************
* VLCErrorPanel interface
*****************************************************************************/
@interface
ErrorWindowController
:
NSWindowController
{
IBOutlet
id
o_cleanup_button
;
IBOutlet
id
o_error_table
;
NSMutableArray
*
o_errors
;
NSMutableArray
*
o_icons
;
}
-
(
IBAction
)
cleanupTable
:(
id
)
sender
;
-
(
void
)
addError
:(
NSString
*
)
o_error
withMsg
:(
NSString
*
)
o_msg
;
@end
modules/gui/macosx/coredialogs.m
View file @
0aad5ff3
...
...
@@ -49,7 +49,6 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
[
self
dealloc
];
else
{
_o_sharedInstance
=
[
super
init
];
o_error_panel
=
[[
VLCErrorPanel
alloc
]
init
];
b_progress_cancelled
=
NO
;
}
...
...
@@ -89,8 +88,8 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
{
dialog_fatal_t
*
p_dialog
=
[
o_value
pointerValue
];
[
o_
error
_p
anel
addError
:
toNSStr
(
p_dialog
->
title
)
withMsg
:
toNSStr
(
p_dialog
->
message
)];
[
o_
error
_p
anel
show
Pan
el
];
[
[
self
error
P
anel
]
addError
:
toNSStr
(
p_dialog
->
title
)
withMsg
:
toNSStr
(
p_dialog
->
message
)];
[
[
self
error
P
anel
]
show
Window
:
s
el
f
];
}
-
(
void
)
showFatalWaitDialog
:
(
NSValue
*
)
o_value
...
...
@@ -211,6 +210,9 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
-
(
id
)
errorPanel
{
if
(
!
o_error_panel
)
o_error_panel
=
[[
ErrorWindowController
alloc
]
init
];
return
o_error_panel
;
}
...
...
@@ -219,25 +221,25 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
/*****************************************************************************
* VLCErrorPanel implementation
*****************************************************************************/
@implementation
VLCErrorPanel
-
(
id
)
init
{
[
super
init
];
if
(
!
b_nib_loaded
)
b_nib_loaded
=
[
NSBundle
loadNibNamed
:
@"ErrorPanel"
owner
:
self
];
@implementation
ErrorWindowController
/* init data sources */
o_errors
=
[[
NSMutableArray
alloc
]
init
];
o_icons
=
[[
NSMutableArray
alloc
]
init
];
-
(
id
)
init
{
self
=
[
super
initWithWindowNibName
:
@"ErrorPanel"
];
if
(
self
)
{
/* init data sources */
o_errors
=
[[
NSMutableArray
alloc
]
init
];
o_icons
=
[[
NSMutableArray
alloc
]
init
];
}
return
self
;
}
-
(
void
)
awakeFromNib
-
(
void
)
windowDidLoad
{
/* init strings */
[
o_
window
setTitle
:
_NS
(
"Errors and Warnings"
)];
[
[
self
window
]
setTitle
:
_NS
(
"Errors and Warnings"
)];
[
o_cleanup_button
setTitle
:
_NS
(
"Clean up"
)];
}
...
...
@@ -248,11 +250,6 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
[
super
dealloc
];
}
-
(
void
)
showPanel
{
[
o_window
makeKeyAndOrderFront
:
self
];
}
-
(
void
)
addError
:
(
NSString
*
)
o_error
withMsg
:(
NSString
*
)
o_msg
{
/* format our string as desired */
...
...
Write
Preview
Supports
Markdown
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