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
0aad5ff3
Commit
0aad5ff3
authored
May 16, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Use NSWindowController for error panel, lazy initialization
parent
d7657086
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
56 deletions
+72
-56
extras/package/macosx/Resources/English.lproj/ErrorPanel.xib
extras/package/macosx/Resources/English.lproj/ErrorPanel.xib
+32
-13
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+1
-1
modules/gui/macosx/coredialogs.h
modules/gui/macosx/coredialogs.h
+23
-23
modules/gui/macosx/coredialogs.m
modules/gui/macosx/coredialogs.m
+16
-19
No files found.
extras/package/macosx/Resources/English.lproj/ErrorPanel.xib
View file @
0aad5ff3
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
</object>
</object>
<array
class=
"NSMutableArray"
key=
"IBDocument.RootObjects"
id=
"638050510"
>
<array
class=
"NSMutableArray"
key=
"IBDocument.RootObjects"
id=
"638050510"
>
<object
class=
"NSCustomObject"
id=
"923016430"
>
<object
class=
"NSCustomObject"
id=
"923016430"
>
<string
key=
"NSClassName"
>
VLCErrorPanel
</string>
<string
key=
"NSClassName"
>
ErrorWindowController
</string>
</object>
</object>
<object
class=
"NSCustomObject"
id=
"159526500"
>
<object
class=
"NSCustomObject"
id=
"159526500"
>
<string
key=
"NSClassName"
>
FirstResponder
</string>
<string
key=
"NSClassName"
>
FirstResponder
</string>
...
@@ -303,14 +303,6 @@
...
@@ -303,14 +303,6 @@
</object>
</object>
<int
key=
"connectionID"
>
13
</int>
<int
key=
"connectionID"
>
13
</int>
</object>
</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=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
cleanupTable:
</string>
<string
key=
"label"
>
cleanupTable:
</string>
...
@@ -319,6 +311,14 @@
...
@@ -319,6 +311,14 @@
</object>
</object>
<int
key=
"connectionID"
>
15
</int>
<int
key=
"connectionID"
>
15
</int>
</object>
</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=
"IBConnectionRecord"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
dataSource
</string>
<string
key=
"label"
>
dataSource
</string>
...
@@ -474,13 +474,13 @@
...
@@ -474,13 +474,13 @@
<nil
key=
"activeLocalization"
/>
<nil
key=
"activeLocalization"
/>
<dictionary
class=
"NSMutableDictionary"
key=
"localizations"
/>
<dictionary
class=
"NSMutableDictionary"
key=
"localizations"
/>
<nil
key=
"sourceID"
/>
<nil
key=
"sourceID"
/>
<int
key=
"maxID"
>
7
4
</int>
<int
key=
"maxID"
>
7
5
</int>
</object>
</object>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<array
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptions"
>
<array
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptions"
>
<object
class=
"IBPartialClassDescription"
>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLCErrorPanel
</string>
<string
key=
"className"
>
ErrorWindowController
</string>
<string
key=
"superclassName"
>
NS
Object
</string>
<string
key=
"superclassName"
>
NS
WindowController
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"NS.key.0"
>
cleanupTable:
</string>
<string
key=
"NS.key.0"
>
cleanupTable:
</string>
<string
key=
"NS.object.0"
>
id
</string>
<string
key=
"NS.object.0"
>
id
</string>
...
@@ -517,7 +517,7 @@
...
@@ -517,7 +517,7 @@
</object>
</object>
</object>
</object>
<object
class=
"IBPartialClassDescription"
>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLCErrorPanel
</string>
<string
key=
"className"
>
ErrorWindowController
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"NS.key.0"
>
cleanupTable:
</string>
<string
key=
"NS.key.0"
>
cleanupTable:
</string>
<string
key=
"NS.object.0"
>
id
</string>
<string
key=
"NS.object.0"
>
id
</string>
...
@@ -680,6 +680,25 @@
...
@@ -680,6 +680,25 @@
<string
key=
"minorKey"
>
AppKit.framework/Headers/NSWindow.h
</string>
<string
key=
"minorKey"
>
AppKit.framework/Headers/NSWindow.h
</string>
</object>
</object>
</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>
</array>
</object>
</object>
<int
key=
"IBDocument.localizationMode"
>
0
</int>
<int
key=
"IBDocument.localizationMode"
>
0
</int>
...
...
modules/gui/macosx/MainMenu.m
View file @
0aad5ff3
...
@@ -1262,7 +1262,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -1262,7 +1262,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
-
(
IBAction
)
viewErrorsAndWarnings
:(
id
)
sender
-
(
IBAction
)
viewErrorsAndWarnings
:(
id
)
sender
{
{
[[[[
VLCMain
sharedInstance
]
coreDialogProvider
]
errorPanel
]
show
Panel
];
[[[[
VLCMain
sharedInstance
]
coreDialogProvider
]
errorPanel
]
show
Window
:
self
];
}
}
-
(
IBAction
)
showInformationPanel
:(
id
)
sender
-
(
IBAction
)
showInformationPanel
:(
id
)
sender
...
...
modules/gui/macosx/coredialogs.h
View file @
0aad5ff3
...
@@ -25,35 +25,15 @@
...
@@ -25,35 +25,15 @@
#import <vlc_dialog.h>
#import <vlc_dialog.h>
#import <Cocoa/Cocoa.h>
#import <Cocoa/Cocoa.h>
/*****************************************************************************
/*****************************************************************************
* VLC
ErrorPanel
interface
* VLC
CoreDialogProvider
interface
*****************************************************************************/
*****************************************************************************/
@interface
VLCErrorPanel
:
NSObject
@class
ErrorWindowController
;
{
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
/*****************************************************************************
* VLCCoreDialogProvider interface
*****************************************************************************/
@interface
VLCCoreDialogProvider
:
NSObject
@interface
VLCCoreDialogProvider
:
NSObject
{
{
VLCErrorPanel
*
o_error_panel
;
ErrorWindowController
*
o_error_panel
;
/* authentication dialogue */
/* authentication dialogue */
IBOutlet
id
o_auth_cancel_btn
;
IBOutlet
id
o_auth_cancel_btn
;
...
@@ -96,3 +76,23 @@
...
@@ -96,3 +76,23 @@
-
(
id
)
errorPanel
;
-
(
id
)
errorPanel
;
@end
@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;
...
@@ -49,7 +49,6 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
[
self
dealloc
];
[
self
dealloc
];
else
{
else
{
_o_sharedInstance
=
[
super
init
];
_o_sharedInstance
=
[
super
init
];
o_error_panel
=
[[
VLCErrorPanel
alloc
]
init
];
b_progress_cancelled
=
NO
;
b_progress_cancelled
=
NO
;
}
}
...
@@ -89,8 +88,8 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
...
@@ -89,8 +88,8 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
{
{
dialog_fatal_t
*
p_dialog
=
[
o_value
pointerValue
];
dialog_fatal_t
*
p_dialog
=
[
o_value
pointerValue
];
[
o_error_panel
addError
:
toNSStr
(
p_dialog
->
title
)
withMsg
:
toNSStr
(
p_dialog
->
message
)];
[
[
self
errorPanel
]
addError
:
toNSStr
(
p_dialog
->
title
)
withMsg
:
toNSStr
(
p_dialog
->
message
)];
[
o_error_panel
showPanel
];
[
[
self
errorPanel
]
showWindow
:
self
];
}
}
-
(
void
)
showFatalWaitDialog
:
(
NSValue
*
)
o_value
-
(
void
)
showFatalWaitDialog
:
(
NSValue
*
)
o_value
...
@@ -211,6 +210,9 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
...
@@ -211,6 +210,9 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
-
(
id
)
errorPanel
-
(
id
)
errorPanel
{
{
if
(
!
o_error_panel
)
o_error_panel
=
[[
ErrorWindowController
alloc
]
init
];
return
o_error_panel
;
return
o_error_panel
;
}
}
...
@@ -219,25 +221,25 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
...
@@ -219,25 +221,25 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
/*****************************************************************************
/*****************************************************************************
* VLCErrorPanel implementation
* VLCErrorPanel implementation
*****************************************************************************/
*****************************************************************************/
@implementation
VLCErrorPanel
-
(
id
)
init
{
[
super
init
];
if
(
!
b_nib_loaded
)
@implementation
ErrorWindowController
b_nib_loaded
=
[
NSBundle
loadNibNamed
:
@"ErrorPanel"
owner
:
self
];
/* init data sources */
-
(
id
)
init
o_errors
=
[[
NSMutableArray
alloc
]
init
];
{
o_icons
=
[[
NSMutableArray
alloc
]
init
];
self
=
[
super
initWithWindowNibName
:
@"ErrorPanel"
];
if
(
self
)
{
/* init data sources */
o_errors
=
[[
NSMutableArray
alloc
]
init
];
o_icons
=
[[
NSMutableArray
alloc
]
init
];
}
return
self
;
return
self
;
}
}
-
(
void
)
awakeFromNib
-
(
void
)
windowDidLoad
{
{
/* init strings */
/* init strings */
[
o_window
setTitle
:
_NS
(
"Errors and Warnings"
)];
[
[
self
window
]
setTitle
:
_NS
(
"Errors and Warnings"
)];
[
o_cleanup_button
setTitle
:
_NS
(
"Clean up"
)];
[
o_cleanup_button
setTitle
:
_NS
(
"Clean up"
)];
}
}
...
@@ -248,11 +250,6 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
...
@@ -248,11 +250,6 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
[
super
dealloc
];
[
super
dealloc
];
}
}
-
(
void
)
showPanel
{
[
o_window
makeKeyAndOrderFront
:
self
];
}
-
(
void
)
addError
:
(
NSString
*
)
o_error
withMsg
:(
NSString
*
)
o_msg
-
(
void
)
addError
:
(
NSString
*
)
o_error
withMsg
:(
NSString
*
)
o_msg
{
{
/* format our string as desired */
/* format our string as desired */
...
...
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