summaryrefslogtreecommitdiffstats
path: root/ui/macosx/cocoa_bridge.mm
diff options
context:
space:
mode:
Diffstat (limited to 'ui/macosx/cocoa_bridge.mm')
-rw-r--r--ui/macosx/cocoa_bridge.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/macosx/cocoa_bridge.mm b/ui/macosx/cocoa_bridge.mm
index 909bf223..4f20d4f7 100644
--- a/ui/macosx/cocoa_bridge.mm
+++ b/ui/macosx/cocoa_bridge.mm
@@ -1,8 +1,5 @@
/* cocoa_bridge.mm
*
- * This code was taken directly from:
- * https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar
- *
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
@@ -17,6 +14,9 @@
void CocoaBridge::cleanOSGeneratedMenuItems()
{
+ // This code was taken directly from:
+ // https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar
+
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
// Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, if
// supported
@@ -33,3 +33,10 @@ void CocoaBridge::cleanOSGeneratedMenuItems()
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSDisabledCharacterPaletteMenuItem"];
}
+
+void CocoaBridge::showInFinder(char const *file_path)
+{
+ NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:file_path]];
+
+ [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[url]];
+}