Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e316b5a5
Commit
e316b5a5
authored
Dec 20, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fix and slightly optimize (on 10.6+) the open recent menu (fixes #5538)
parent
74f2f90a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
12 deletions
+31
-12
extras/package/macosx/Resources/English.lproj/MainMenu.xib
extras/package/macosx/Resources/English.lproj/MainMenu.xib
+10
-3
modules/gui/macosx/CompatibilityFixes.h
modules/gui/macosx/CompatibilityFixes.h
+4
-0
modules/gui/macosx/MainMenu.h
modules/gui/macosx/MainMenu.h
+1
-1
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+16
-8
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.xib
View file @
e316b5a5
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<integer
value=
"2730"
/>
<integer
value=
"2730"
/>
<integer
value=
"915"
/>
<integer
value=
"915"
/>
<integer
value=
"1617"
/>
<integer
value=
"1617"
/>
<integer
value=
"
235
"
/>
<integer
value=
"
569
"
/>
<integer
value=
"4596"
/>
<integer
value=
"4596"
/>
<integer
value=
"21"
/>
<integer
value=
"21"
/>
</object>
</object>
...
@@ -11439,7 +11439,7 @@ LCAuLi4</string>
...
@@ -11439,7 +11439,7 @@ LCAuLi4</string>
<boolean
value=
"YES"
/>
<boolean
value=
"YES"
/>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<boolean
value=
"YES"
/>
<boolean
value=
"YES"
/>
<string>
{{
1004, 603
}, {143, 23}}
</string>
<string>
{{
684, 529
}, {143, 23}}
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<boolean
value=
"YES"
/>
<boolean
value=
"YES"
/>
<string>
{{385, 503}, {267, 233}}
</string>
<string>
{{385, 503}, {267, 233}}
</string>
...
@@ -11455,7 +11455,7 @@ LCAuLi4</string>
...
@@ -11455,7 +11455,7 @@ LCAuLi4</string>
<boolean
value=
"YES"
/>
<boolean
value=
"YES"
/>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<boolean
value=
"YES"
/>
<boolean
value=
"YES"
/>
<string>
{{38
8, 425
}, {297, 243}}
</string>
<string>
{{38
7, 419
}, {297, 243}}
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<boolean
value=
"YES"
/>
<boolean
value=
"YES"
/>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<string>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
...
@@ -14787,6 +14787,7 @@ LCAuLi4</string>
...
@@ -14787,6 +14787,7 @@ LCAuLi4</string>
<string>
openDonate:
</string>
<string>
openDonate:
</string>
<string>
openForum:
</string>
<string>
openForum:
</string>
<string>
openReadMe:
</string>
<string>
openReadMe:
</string>
<string>
openRecentItem:
</string>
<string>
openWebsite:
</string>
<string>
openWebsite:
</string>
<string>
resizeVideoWindow:
</string>
<string>
resizeVideoWindow:
</string>
<string>
setPlaybackRate:
</string>
<string>
setPlaybackRate:
</string>
...
@@ -14836,6 +14837,7 @@ LCAuLi4</string>
...
@@ -14836,6 +14837,7 @@ LCAuLi4</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>
</object>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
...
@@ -14854,6 +14856,7 @@ LCAuLi4</string>
...
@@ -14854,6 +14856,7 @@ LCAuLi4</string>
<string>
openDonate:
</string>
<string>
openDonate:
</string>
<string>
openForum:
</string>
<string>
openForum:
</string>
<string>
openReadMe:
</string>
<string>
openReadMe:
</string>
<string>
openRecentItem:
</string>
<string>
openWebsite:
</string>
<string>
openWebsite:
</string>
<string>
resizeVideoWindow:
</string>
<string>
resizeVideoWindow:
</string>
<string>
setPlaybackRate:
</string>
<string>
setPlaybackRate:
</string>
...
@@ -14922,6 +14925,10 @@ LCAuLi4</string>
...
@@ -14922,6 +14925,10 @@ LCAuLi4</string>
<string
key=
"name"
>
openReadMe:
</string>
<string
key=
"name"
>
openReadMe:
</string>
<string
key=
"candidateClassName"
>
id
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
openRecentItem:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
openWebsite:
</string>
<string
key=
"name"
>
openWebsite:
</string>
<string
key=
"candidateClassName"
>
id
</string>
<string
key=
"candidateClassName"
>
id
</string>
...
...
modules/gui/macosx/CompatibilityFixes.h
View file @
e316b5a5
...
@@ -61,6 +61,10 @@ enum {
...
@@ -61,6 +61,10 @@ enum {
extern
OSErr
UpdateSystemActivity
(
UInt8
activity
);
extern
OSErr
UpdateSystemActivity
(
UInt8
activity
);
#define UsrActivity 1
#define UsrActivity 1
#endif
#endif
@interface
NSMenu
(
IntroducedInSnowLeopard
)
-
(
void
)
removeAllItems
;
@end
#endif
#endif
#pragma mark -
#pragma mark -
...
...
modules/gui/macosx/MainMenu.h
View file @
e316b5a5
...
@@ -199,7 +199,7 @@
...
@@ -199,7 +199,7 @@
-
(
void
)
setRateControlsEnabled
:(
BOOL
)
b_enabled
;
-
(
void
)
setRateControlsEnabled
:(
BOOL
)
b_enabled
;
-
(
IBAction
)
clearRecentItems
:(
id
)
sender
;
-
(
IBAction
)
clearRecentItems
:(
id
)
sender
;
-
(
void
)
openRecentItem
:(
id
)
item
;
-
(
IBAction
)
openRecentItem
:(
id
)
item
;
-
(
IBAction
)
intfOpenFile
:(
id
)
sender
;
-
(
IBAction
)
intfOpenFile
:(
id
)
sender
;
-
(
IBAction
)
intfOpenFileGeneric
:(
id
)
sender
;
-
(
IBAction
)
intfOpenFileGeneric
:(
id
)
sender
;
...
...
modules/gui/macosx/MainMenu.m
View file @
e316b5a5
...
@@ -538,15 +538,14 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -538,15 +538,14 @@ static VLCMainMenu *_o_sharedInstance = nil;
#pragma mark -
#pragma mark -
#pragma mark Recent Items
#pragma mark Recent Items
-
(
void
)
openRecentItem
:(
id
)
item
-
(
IBAction
)
openRecentItem
:(
id
)
item
{
{
[[
VLCMain
sharedInstance
]
application
:
nil
openFile
:
[
item
title
]];
[[
VLCMain
sharedInstance
]
application
:
nil
openFile
:
[
item
title
]];
}
}
-
(
IBAction
)
clearRecentItems
:(
id
)
sender
-
(
IBAction
)
clearRecentItems
:(
id
)
sender
{
{
[[
NSDocumentController
sharedDocumentController
]
[[
NSDocumentController
sharedDocumentController
]
clearRecentDocuments
:
nil
];
clearRecentDocuments:
nil
];
}
}
#pragma mark -
#pragma mark -
...
@@ -1107,15 +1106,22 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -1107,15 +1106,22 @@ static VLCMainMenu *_o_sharedInstance = nil;
{
{
NSMenu
*
o_menu
=
[
o_mi_open_recent
submenu
];
NSMenu
*
o_menu
=
[
o_mi_open_recent
submenu
];
int
i_nb_items
=
[
o_menu
numberOfItems
];
int
i_nb_items
=
[
o_menu
numberOfItems
];
NSArray
*
o_docs
=
[[
NSDocumentController
sharedDocumentController
]
NSArray
*
o_docs
=
[[
NSDocumentController
sharedDocumentController
]
recentDocumentURLs
];
recentDocumentURLs
];
UInt32
i_nb_docs
=
[
o_docs
count
];
UInt32
i_nb_docs
=
[
o_docs
count
];
if
(
i_nb_items
>
1
)
if
(
i_nb_items
>
1
)
{
{
while
(
--
i_nb_items
)
if
(
OSX_LEOPARD
)
{
{
[
o_menu
removeItemAtIndex
:
0
];
while
(
--
i_nb_items
)
{
[
o_menu
removeItemAtIndex
:
0
];
}
}
else
{
// this is more efficient than removing the items one by one
[
o_menu
removeAllItems
];
}
}
}
}
...
@@ -1123,6 +1129,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -1123,6 +1129,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
{
{
NSURL
*
o_url
;
NSURL
*
o_url
;
NSString
*
o_doc
;
NSString
*
o_doc
;
NSMenuItem
*
o_menuitem
;
[
o_menu
insertItem
:
[
NSMenuItem
separatorItem
]
atIndex
:
0
];
[
o_menu
insertItem
:
[
NSMenuItem
separatorItem
]
atIndex
:
0
];
...
@@ -1137,9 +1144,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -1137,9 +1144,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
else
else
o_doc
=
[
o_url
absoluteString
];
o_doc
=
[
o_url
absoluteString
];
[
o_menu
insertItemWithTitle
:
o_doc
o_menuitem
=
[
o_menu
insertItemWithTitle
:
o_doc
action:
@selector
(
openRecentItem
:)
action:
@selector
(
openRecentItem
:)
keyEquivalent:
@""
atIndex
:
0
];
keyEquivalent:
@""
atIndex
:
0
];
[
o_menuitem
setTarget
:
self
];
if
(
i_nb_docs
==
0
)
if
(
i_nb_docs
==
0
)
break
;
break
;
...
...
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