[vlc-devel] commit: macosx: finally implement a Reveal-in-Finder functionality ( Felix Paul Kühne )
git version control
git at videolan.org
Sun Sep 14 18:55:07 CEST 2008
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Sep 14 18:55:52 2008 +0200| [52b2e5b253de9dfb9c3cb65fbf0067adf06e363f] | committer: Felix Paul Kühne
macosx: finally implement a Reveal-in-Finder functionality
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=52b2e5b253de9dfb9c3cb65fbf0067adf06e363f
---
NEWS | 4 +-
.../English.lproj/MainMenu.nib/classes.nib | 3 +
.../Resources/English.lproj/MainMenu.nib/info.nib | 9 +++-
.../English.lproj/MainMenu.nib/keyedobjects.nib | Bin 117758 -> 118449 bytes
modules/gui/macosx/playlist.h | 3 +
modules/gui/macosx/playlist.m | 46 ++++++++++++++++++++
6 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index 915ae8d..287509f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Changes between 0.9.1 and 1.0.0-git:
+Changes between 0.9.2 and 1.0.0-git:
------------------------------------
Inputs:
@@ -15,12 +15,14 @@ Stream output:
* Multiple bridge-in instances are now possible.
* bridge-in can be used to configure a placeholder stream.
+
Changes between 0.9.1 and 0.9.2
-------------------------------
* Restored the old behavior of --sout-keep. It is now de-activated by default.
* Multiple bugfixes
+
Changes between 0.8.6i and 0.9.1:
---------------------------------
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
index ac13cc4..1a9660b 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
@@ -356,6 +356,7 @@
playItem = id;
preparseItem = id;
recursiveExpandNode = id;
+ revealItemInFinder = id;
savePlaylist = id;
searchItem = id;
selectAll = id;
@@ -376,11 +377,13 @@
"o_mi_play" = id;
"o_mi_preparse" = id;
"o_mi_recursive_expand" = id;
+ "o_mi_revealInFinder" = id;
"o_mi_save_playlist" = id;
"o_mi_selectall" = id;
"o_mi_services" = id;
"o_mi_sort_author" = id;
"o_mi_sort_name" = id;
+ "o_mm_mi_revealInFinder" = id;
"o_mm_mi_services" = id;
"o_mm_mu_services" = id;
"o_mu_services" = id;
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
index 31b837c..82cbf13 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
@@ -3,9 +3,11 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>69 71 356 240 0 0 1280 778 </string>
+ <string>166 352 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
+ <key>29</key>
+ <string>478 529 438 44 0 0 1280 778 </string>
<key>3568</key>
<string>476 535 328 85 0 0 1280 778 </string>
<key>915</key>
@@ -19,10 +21,11 @@
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
- <integer>3706</integer>
+ <integer>3568</integer>
<integer>21</integer>
+ <integer>3706</integer>
+ <integer>29</integer>
<integer>915</integer>
- <integer>3568</integer>
</array>
<key>IBSystem Version</key>
<string>9E17</string>
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
index a0a78c6..96946d2 100644
Binary files a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
diff --git a/modules/gui/macosx/playlist.h b/modules/gui/macosx/playlist.h
index 698bb6b..acf040b 100644
--- a/modules/gui/macosx/playlist.h
+++ b/modules/gui/macosx/playlist.h
@@ -80,6 +80,8 @@
IBOutlet id o_mi_delete;
IBOutlet id o_mi_info;
IBOutlet id o_mi_preparse;
+ IBOutlet id o_mi_revealInFinder;
+ IBOutlet id o_mm_mi_revealInFinder;
IBOutlet id o_mi_selectall;
IBOutlet id o_mi_sort_name;
IBOutlet id o_mi_sort_author;
@@ -127,6 +129,7 @@
- (IBAction)servicesChange:(id)sender;
- (IBAction)playItem:(id)sender;
+- (IBAction)revealItemInFinder:(id)sender;
- (IBAction)preparseItem:(id)sender;
- (IBAction)savePlaylist:(id)sender;
- (IBAction)deleteItem:(id)sender;
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index afa1f72..f088863 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -442,6 +442,9 @@
[o_mi_selectall setTitle: _NS("Select All")];
[o_mi_info setTitle: _NS("Information...")];
[o_mi_preparse setTitle: _NS("Fetch Meta Data")];
+ [o_mi_revealInFinder setTitle: _NS("Reveal in Finder")];
+ [o_mm_mi_revealInFinder setTitle: _NS("Reveal in Finder")];
+ [[o_mm_mi_revealInFinder menu] setAutoenablesItems: NO];
[o_mi_sort_name setTitle: _NS("Sort Node by Name")];
[o_mi_sort_author setTitle: _NS("Sort Node by Author")];
[o_mi_services setTitle: _NS("Services discovery")];
@@ -520,6 +523,28 @@
{
/* update our info-panel to reflect the new item */
[[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+
+ /* update the state of our Reveal-in-Finder menu items */
+ NSMutableString *o_mrl;
+ char *psz_uri = input_item_GetURI( p_item->p_input );
+ if( psz_uri )
+ {
+ o_mrl = [NSMutableString stringWithUTF8String: psz_uri];
+
+ /* perform some checks whether it is a file and if it is local at all... */
+ NSRange prefix_range = [o_mrl rangeOfString: @"file:"];
+ if( prefix_range.location != NSNotFound )
+ [o_mrl deleteCharactersInRange: prefix_range];
+
+ if( [o_mrl characterAtIndex:0] == '/' )
+ {
+ [o_mi_revealInFinder setEnabled: YES];
+ [o_mm_mi_revealInFinder setEnabled: YES];
+ return;
+ }
+ }
+ [o_mi_revealInFinder setEnabled: NO];
+ [o_mm_mi_revealInFinder setEnabled: NO];
}
}
@@ -763,6 +788,27 @@
vlc_object_release( p_playlist );
}
+- (IBAction)revealItemInFinder:(id)sender
+{
+ playlist_item_t * p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue];
+ NSMutableString * o_mrl = nil;
+
+ if(! p_item || !p_item->p_input )
+ return;
+
+ char *psz_uri = input_item_GetURI( p_item->p_input );
+ if( psz_uri )
+ o_mrl = [NSMutableString stringWithUTF8String: psz_uri];
+
+ /* perform some checks whether it is a file and if it is local at all... */
+ NSRange prefix_range = [o_mrl rangeOfString: @"file:"];
+ if( prefix_range.location != NSNotFound )
+ [o_mrl deleteCharactersInRange: prefix_range];
+
+ if( [o_mrl characterAtIndex:0] == '/' )
+ [[NSWorkspace sharedWorkspace] selectFile: o_mrl inFileViewerRootedAtPath: o_mrl];
+}
+
/* When called retrieves the selected outlineview row and plays that node or item */
- (IBAction)preparseItem:(id)sender
{
More information about the vlc-devel
mailing list