Skip to content

Commit

Permalink
#1861: macos platform fixups: add features toggle to macos menu
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@19892 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 9, 2018
1 parent ec02443 commit 620736f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/xpra/platform/darwin/osx_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SHOW_UPLOAD, SHOW_VERSION_CHECK, RUNCOMMAND_MENU, SHOW_SERVER_COMMANDS, SHOW_SHUTDOWN
from xpra.platform.paths import get_icon
from xpra.platform.darwin.gui import get_OSXApplication
from xpra.client import mixin_features

from xpra.log import Logger
log = Logger("osx", "tray", "menu")
Expand Down Expand Up @@ -189,11 +190,12 @@ def get_extra_menus(self):
features_menu = self.make_menu()
menus.append(("Features", features_menu))
self.append_featuresmenuitems(features_menu)
features_menu.add(self.make_swapkeysmenuitem())
features_menu.add(self.make_invertmousewheelmenuitem())
features_menu.add(self.make_numlockmenuitem())
features_menu.add(self.make_scalingmenuitem())
if SHOW_CLIPBOARD_MENU:
if mixin_features.windows:
features_menu.add(self.make_swapkeysmenuitem())
features_menu.add(self.make_invertmousewheelmenuitem())
features_menu.add(self.make_numlockmenuitem())
features_menu.add(self.make_scalingmenuitem())
if mixin_features.clipboard and SHOW_CLIPBOARD_MENU:
clipboard_menu = self.make_menu()
menus.append(("Clipboard", clipboard_menu))
for label in CLIPBOARD_LABELS:
Expand All @@ -203,14 +205,14 @@ def get_extra_menus(self):
clipboard_menu.add(self.make_clipboard_submenuitem(label, self._clipboard_direction_changed))
clipboard_menu.show_all()
self.client.after_handshake(self.set_clipboard_menu, clipboard_menu)
if SHOW_SOUND_MENU:
if mixin_features.audio and SHOW_SOUND_MENU:
sound_menu = self.make_menu()
if self.client.speaker_allowed and len(self.client.speaker_codecs)>0:
sound_menu.add(self.make_speakermenuitem())
if self.client.microphone_allowed and len(self.client.microphone_codecs)>0:
sound_menu.add(self.make_microphonemenuitem())
menus.append(("Sound", sound_menu))
if SHOW_ENCODINGS_MENU:
if mixin_features.windows and SHOW_ENCODINGS_MENU:
encodings_menu = self.make_menu()
def set_encodings_menu(*_args):
from xpra.codecs.loader import PREFERED_ENCODING_ORDER
Expand All @@ -222,7 +224,7 @@ def set_encodings_menu(*_args):
populate_encodingsmenu(encodings_menu, self.get_current_encoding, self.set_current_encoding, encodings, server_encodings)
self.client.after_handshake(set_encodings_menu)
menus.append(("Encoding", encodings_menu))
if SHOW_ACTIONS_MENU:
if mixin_features.windows and SHOW_ACTIONS_MENU:
actions_menu = self.make_menu()
actions_menu.add(self.make_refreshmenuitem())
actions_menu.add(self.make_raisewindowsmenuitem())
Expand Down

0 comments on commit 620736f

Please sign in to comment.