Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / ui / macosx / cocoa_bridge.mm
blob4f20d4f74c51fb610c419559c02a35ad131dfd5a
1 /* cocoa_bridge.mm
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
10 #include <ui/macosx/cocoa_bridge.h>
11 #include <ui/macosx/macos_compat.h>
13 #import <Cocoa/Cocoa.h>
15 void CocoaBridge::cleanOSGeneratedMenuItems()
17     // This code was taken directly from:
18     // https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar
20 #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
21     // Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, if
22     // supported
24     if ([NSWindow respondsToSelector:@selector(setAllowsAutomaticWindowTabbing:)])
25         [NSWindow setAllowsAutomaticWindowTabbing: NO];
26 #endif
28     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
30     // Remove (disable) the "Start Dictation..." and "Emoji & Symbols" menu items
31     // from the "Edit" menu
33     [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
34     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSDisabledCharacterPaletteMenuItem"];
37 void CocoaBridge::showInFinder(char const *file_path)
39     NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:file_path]];
41     [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[url]];