diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /ui/macosx | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | ui/macosx/cocoa_bridge.h | 4 | ||||
-rw-r--r-- | ui/macosx/cocoa_bridge.mm | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/ui/macosx/cocoa_bridge.h b/ui/macosx/cocoa_bridge.h index 4665fc29..5cf01dd6 100644 --- a/ui/macosx/cocoa_bridge.h +++ b/ui/macosx/cocoa_bridge.h @@ -1,6 +1,6 @@ /** @file * - * This code was taken directly from: + * This code is based upon: * https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar * * Wireshark - Network traffic analyzer @@ -21,6 +21,8 @@ class CocoaBridge public: static void cleanOSGeneratedMenuItems(); + static void showInFinder(char const *file_path); + }; #endif // COCOABRIDGE_H 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]]; +} |