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
d4ec3a04
Commit
d4ec3a04
authored
Jul 22, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fix playlist column creation and customization
parent
68827bcd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
42 deletions
+29
-42
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+28
-41
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+1
-1
No files found.
modules/gui/macosx/MainMenu.m
View file @
d4ec3a04
...
...
@@ -81,32 +81,6 @@
#pragma mark - Initialization
-
(
id
)
init
{
self
=
[
super
init
];
if
(
self
)
{
_translationsForPlaylistTableColumns
=
[[
NSDictionary
alloc
]
initWithObjectsAndKeys
:
_NS
(
"Track Number"
),
TRACKNUM_COLUMN
,
_NS
(
"Title"
),
TITLE_COLUMN
,
_NS
(
"Author"
),
ARTIST_COLUMN
,
_NS
(
"Duration"
),
DURATION_COLUMN
,
_NS
(
"Genre"
),
GENRE_COLUMN
,
_NS
(
"Album"
),
ALBUM_COLUMN
,
_NS
(
"Description"
),
DESCRIPTION_COLUMN
,
_NS
(
"Date"
),
DATE_COLUMN
,
_NS
(
"Language"
),
LANGUAGE_COLUMN
,
_NS
(
"URI"
),
URI_COLUMN
,
_NS
(
"File Size"
),
FILESIZE_COLUMN
,
nil
];
// this array also assigns tags (index) to type of menu item
_menuOrderOfPlaylistTableColumns
=
[[
NSArray
alloc
]
initWithObjects
:
TRACKNUM_COLUMN
,
TITLE_COLUMN
,
ARTIST_COLUMN
,
DURATION_COLUMN
,
GENRE_COLUMN
,
ALBUM_COLUMN
,
DESCRIPTION_COLUMN
,
DATE_COLUMN
,
LANGUAGE_COLUMN
,
URI_COLUMN
,
FILESIZE_COLUMN
,
nil
];
}
return
self
;
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
...
...
@@ -127,6 +101,25 @@
[
self
setRateControlsEnabled
:
NO
];
_translationsForPlaylistTableColumns
=
[[
NSDictionary
alloc
]
initWithObjectsAndKeys
:
_NS
(
"Track Number"
),
TRACKNUM_COLUMN
,
_NS
(
"Title"
),
TITLE_COLUMN
,
_NS
(
"Author"
),
ARTIST_COLUMN
,
_NS
(
"Duration"
),
DURATION_COLUMN
,
_NS
(
"Genre"
),
GENRE_COLUMN
,
_NS
(
"Album"
),
ALBUM_COLUMN
,
_NS
(
"Description"
),
DESCRIPTION_COLUMN
,
_NS
(
"Date"
),
DATE_COLUMN
,
_NS
(
"Language"
),
LANGUAGE_COLUMN
,
_NS
(
"URI"
),
URI_COLUMN
,
_NS
(
"File Size"
),
FILESIZE_COLUMN
,
nil
];
// this array also assigns tags (index) to type of menu item
_menuOrderOfPlaylistTableColumns
=
[[
NSArray
alloc
]
initWithObjects
:
TRACKNUM_COLUMN
,
TITLE_COLUMN
,
ARTIST_COLUMN
,
DURATION_COLUMN
,
GENRE_COLUMN
,
ALBUM_COLUMN
,
DESCRIPTION_COLUMN
,
DATE_COLUMN
,
LANGUAGE_COLUMN
,
URI_COLUMN
,
FILESIZE_COLUMN
,
nil
];
#ifdef HAVE_SPARKLE
[
_checkForUpdate
setAction
:
@selector
(
checkForUpdates
:)];
[
_checkForUpdate
setTarget
:[
SUUpdater
sharedUpdater
]];
...
...
@@ -376,7 +369,7 @@
[
_toggleEffectsButton
setState
:
config_GetInt
(
VLCIntf
,
"macosx-show-effects-button"
)];
[
_toggleSidebar
setTitle
:
_NS
(
"Show Sidebar"
)];
[
_toggleSidebar
setState
:
config_GetInt
(
VLCIntf
,
"macosx-show-sidebar"
)];
[
_playlistTableColumnsMenu
setTitle
:
_NS
(
"Playlist Table Columns"
)
];
[
self
setupPlaylistTableColumnsForMenu
:
_playlistTableColumnsMenu
];
[
_playlistTableColumns
setTitle
:
_NS
(
"Playlist Table Columns"
)];
[
_controlsMenu
setTitle
:
_NS
(
"Playback"
)];
...
...
@@ -513,20 +506,17 @@
-
(
NSMenu
*
)
setupPlaylistTableColumnsMenu
{
NSMenu
*
contextMenu
=
[[
NSMenu
alloc
]
init
];
[
self
setupPlaylistTableColumnsForMenu
:
contextMenu
];
return
contextMenu
;
}
-
(
void
)
setupPlaylistTableColumnsForMenu
:(
NSMenu
*
)
menu
{
NSMenuItem
*
menuItem
;
NSUInteger
count
=
[
_menuOrderOfPlaylistTableColumns
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSString
*
title
=
[
_translationsForPlaylistTableColumns
objectForKey
:[
_menuOrderOfPlaylistTableColumns
objectAtIndex
:
i
]];
menuItem
=
[
_playlistTableColumnsMenu
addItemWithTitle
:
title
action:
@selector
(
togglePlaylistColumnTable
:)
keyEquivalent:
@""
];
/* don't set a valid target for the title column selector, since we want it to be disabled */
if
(
!
[[
_menuOrderOfPlaylistTableColumns
objectAtIndex
:
i
]
isEqualToString
:
TITLE_COLUMN
])
[
menuItem
setTarget
:
self
];
[
menuItem
setTag
:
i
];
menuItem
=
[
contextMenu
addItemWithTitle
:
title
menuItem
=
[
menu
addItemWithTitle
:
title
action:
@selector
(
togglePlaylistColumnTable
:)
keyEquivalent:
@""
];
/* don't set a valid target for the title column selector, since we want it to be disabled */
...
...
@@ -534,9 +524,6 @@
[
menuItem
setTarget
:
self
];
[
menuItem
setTag
:
i
];
}
if
(
!
_playlistTableColumnsContextMenu
)
_playlistTableColumnsContextMenu
=
contextMenu
;
return
contextMenu
;
}
#pragma mark - Termination
...
...
modules/gui/macosx/intf.m
View file @
d4ec3a04
...
...
@@ -202,6 +202,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
NSDictionary
*
appDefaults
=
[
NSDictionary
dictionaryWithObject
:
@"NO"
forKey
:
@"LiveUpdateTheMessagesPanel"
];
[
defaults
registerDefaults
:
appDefaults
];
_mainmenu
=
[[
VLCMainMenu
alloc
]
init
];
_voutController
=
[[
VLCVoutWindowController
alloc
]
init
];
}
...
...
@@ -224,7 +225,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
[
NSBundle
loadNibNamed
:
@"MainWindow"
owner
:
self
];
[[
self
mainWindow
]
makeKeyAndOrderFront
:
nil
];
_open
=
[[
VLCOpen
alloc
]
init
];
_mainmenu
=
[[
VLCMainMenu
alloc
]
init
];
_coreinteraction
=
[
VLCCoreInteraction
sharedInstance
];
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
...
...
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