Show missing pyobjc module message on MacOS menu bar setting

This commit is contained in:
JonnyWong16
2020-06-14 15:22:58 -07:00
parent 451feda86b
commit 89307dad01
4 changed files with 19 additions and 12 deletions

View File

@@ -257,15 +257,12 @@ def main():
plexpy.HTTP_ROOT)
if common.PLATFORM == 'Darwin' and plexpy.CONFIG.SYS_TRAY_ICON:
try:
import AppKit
import Foundation
except ImportError:
if not macos.HAS_PYOBJC:
logger.warn("The pyobjc module is missing. Install this "
"module to enable the menu bar icon.")
"module to enable the MacOS menu bar icon.")
plexpy.CONFIG.SYS_TRAY_ICON = False
if plexpy.CONFIG.SYS_TRAY_ICON and macos.has_rumps:
if plexpy.CONFIG.SYS_TRAY_ICON:
# MacOS menu bar icon must be run on the main thread and is blocking
# Start the rest of Tautulli on a new thread
threading.Thread(target=wait).start()