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
6f31dda7
Commit
6f31dda7
authored
Jan 01, 2016
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: messages panel: create outlets in the new style
parent
80f24bf7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
extras/package/macosx/Resources/English.lproj/DebugMessageVisualizer.xib
...macosx/Resources/English.lproj/DebugMessageVisualizer.xib
+4
-4
modules/gui/macosx/DebugMessageVisualizer.h
modules/gui/macosx/DebugMessageVisualizer.h
+5
-6
modules/gui/macosx/DebugMessageVisualizer.m
modules/gui/macosx/DebugMessageVisualizer.m
+16
-16
No files found.
extras/package/macosx/Resources/English.lproj/DebugMessageVisualizer.xib
View file @
6f31dda7
...
...
@@ -7,10 +7,10 @@
<objects>
<customObject
id=
"-2"
userLabel=
"File's Owner"
customClass=
"VLCDebugMessageVisualizer"
>
<connections>
<outlet
property=
"
_clearButton"
destination=
"RCj-GY-IGn"
id=
"chJ-sn-o6c
"
/>
<outlet
property=
"
_msgs_refresh_btn"
destination=
"4"
id=
"17
"
/>
<outlet
property=
"
_msgs_save_btn"
destination=
"3"
id=
"19
"
/>
<outlet
property=
"
_msgs_table"
destination=
"6"
id=
"20
"
/>
<outlet
property=
"
clearButton"
destination=
"RCj-GY-IGn"
id=
"bi1-74-dyp
"
/>
<outlet
property=
"
messageTable"
destination=
"6"
id=
"BzW-Qh-PMq
"
/>
<outlet
property=
"
refreshButton"
destination=
"4"
id=
"bdj-c0-rau
"
/>
<outlet
property=
"
saveButton"
destination=
"3"
id=
"WDG-KN-R01
"
/>
<outlet
property=
"window"
destination=
"1"
id=
"24"
/>
</connections>
</customObject>
...
...
modules/gui/macosx/DebugMessageVisualizer.h
View file @
6f31dda7
...
...
@@ -26,12 +26,11 @@
#import <Cocoa/Cocoa.h>
@interface
VLCDebugMessageVisualizer
:
NSWindowController
{
IBOutlet
NSButton
*
_clearButton
;
IBOutlet
NSButton
*
_msgs_save_btn
;
IBOutlet
NSButton
*
_msgs_refresh_btn
;
IBOutlet
id
_msgs_table
;
}
@property
(
assign
)
IBOutlet
NSTableView
*
messageTable
;
@property
(
assign
)
IBOutlet
NSButton
*
saveButton
;
@property
(
assign
)
IBOutlet
NSButton
*
clearButton
;
@property
(
assign
)
IBOutlet
NSButton
*
refreshButton
;
-
(
void
)
showWindow
:(
id
)
sender
;
...
...
modules/gui/macosx/DebugMessageVisualizer.m
View file @
6f31dda7
...
...
@@ -37,7 +37,7 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
@interface
VLCDebugMessageVisualizer
()
<
NSWindowDelegate
>
{
NSMutableArray
*
_m
sg_arr
;
NSMutableArray
*
_m
essageArray
;
}
-
(
void
)
appendMessage
:(
NSMutableAttributedString
*
)
message
;
...
...
@@ -91,7 +91,7 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
{
self
=
[
super
initWithWindowNibName
:
@"DebugMessageVisualizer"
];
if
(
self
)
{
_m
sg_arr
=
[
NSMutableArray
arrayWithCapacity
:
600
];
_m
essageArray
=
[
NSMutableArray
arrayWithCapacity
:
600
];
}
return
self
;
}
...
...
@@ -106,9 +106,9 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
[
self
.
window
setExcludedFromWindowsMenu
:
YES
];
[
self
.
window
setDelegate
:
self
];
[
self
.
window
setTitle
:
_NS
(
"Messages"
)];
[
_
msgs_save_bt
n
setTitle
:
_NS
(
"Save this Log..."
)];
[
_
saveButto
n
setTitle
:
_NS
(
"Save this Log..."
)];
[
_clearButton
setTitle
:
_NS
(
"Clear"
)];
[
_
msgs_refresh_bt
n
setImage
:
[
NSImage
imageNamed
:
NSImageNameRefreshTemplate
]];
[
_
refreshButto
n
setImage
:
[
NSImage
imageNamed
:
NSImageNameRefreshTemplate
]];
}
#pragma mark - UI interaction
...
...
@@ -128,8 +128,8 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
-
(
void
)
windowDidBecomeKey
:(
NSNotification
*
)
notification
{
[
_m
sgs_t
able
reloadData
];
[
_m
sgs_table
scrollRowToVisible
:
[
_msg_arr
count
]
-
1
];
[
_m
essageT
able
reloadData
];
[
_m
essageTable
scrollRowToVisible
:
[
_messageArray
count
]
-
1
];
}
-
(
void
)
windowWillClose
:(
NSNotification
*
)
notification
...
...
@@ -148,10 +148,10 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
[
saveFolderPanel
setNameFieldStringValue
:[
NSString
stringWithFormat
:
_NS
(
"VLC Debug Log (%s).rtf"
),
VERSION_MESSAGE
]];
[
saveFolderPanel
beginSheetModalForWindow
:
self
.
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
if
(
returnCode
==
NSOKButton
)
{
NSUInteger
count
=
[
_m
sg_arr
count
];
NSUInteger
count
=
[
_m
essageArray
count
];
NSMutableAttributedString
*
string
=
[[
NSMutableAttributedString
alloc
]
init
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
[
string
appendAttributedString
:
[
_m
sg_arr
objectAtIndex
:
i
]];
[
string
appendAttributedString
:
[
_m
essageArray
objectAtIndex
:
i
]];
NSData
*
data
=
[
string
RTFFromRange
:
NSMakeRange
(
0
,
[
string
length
])
documentAttributes:
[
NSDictionary
dictionaryWithObject
:
NSRTFTextDocumentType
forKey
:
NSDocumentTypeDocumentAttribute
]];
...
...
@@ -164,35 +164,35 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
-
(
IBAction
)
clearLog
:(
id
)
sender
{
[
_m
sg_arr
removeAllObjects
];
[
_m
essageArray
removeAllObjects
];
// Reregister handler, to write new header to log
vlc_LogSet
(
VLCIntf
->
p_libvlc
,
NULL
,
NULL
);
vlc_LogSet
(
VLCIntf
->
p_libvlc
,
MsgCallback
,
(
__bridge
void
*
)
self
);
[
_m
sgs_t
able
reloadData
];
[
_m
essageT
able
reloadData
];
}
#pragma mark - data handling
-
(
NSInteger
)
numberOfRowsInTableView
:(
NSTableView
*
)
aTableView
{
return
[
_m
sg_arr
count
];
return
[
_m
essageArray
count
];
}
-
(
id
)
tableView
:(
NSTableView
*
)
aTableView
objectValueForTableColumn
:(
NSTableColumn
*
)
aTableColumn
row
:(
NSInteger
)
rowIndex
{
return
[
_m
sg_arr
objectAtIndex
:
rowIndex
];
return
[
_m
essageArray
objectAtIndex
:
rowIndex
];
}
-
(
void
)
appendMessage
:(
NSMutableAttributedString
*
)
message
{
if
([
_m
sg_arr
count
]
>
1000000
)
{
[
_m
sg_arr
removeObjectAtIndex
:
0
];
[
_m
sg_arr
removeObjectAtIndex
:
1
];
if
([
_m
essageArray
count
]
>
1000000
)
{
[
_m
essageArray
removeObjectAtIndex
:
0
];
[
_m
essageArray
removeObjectAtIndex
:
1
];
}
[
_m
sg_arr
addObject
:
message
];
[
_m
essageArray
addObject
:
message
];
}
@end
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