Rename system tray to menu bar on MacOS

This commit is contained in:
JonnyWong16 2020-06-14 14:59:37 -07:00
commit 451feda86b
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
4 changed files with 10 additions and 7 deletions

View file

@ -7,7 +7,7 @@
* Python 2 is still supported for the time being, but it is recommended to upgrade to Python 3.
* UI:
* New: Windows and MacOS setting to enable Tautulli to start automatically when you login.
* New: Added system tray icon for MacOS.
* New: Added menu bar icon for MacOS.
* New: Ability to import a Tautulli database in the settings.
* New: Added Tautulli news area on the settings page.
* Other:

View file

@ -262,11 +262,11 @@ def main():
import Foundation
except ImportError:
logger.warn("The pyobjc module is missing. Install this "
"module to enable the system tray icon.")
"module to enable the menu bar icon.")
plexpy.CONFIG.SYS_TRAY_ICON = False
if plexpy.CONFIG.SYS_TRAY_ICON and macos.has_rumps:
# MacOS system tray icon must be run on the main thread and is blocking
# 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()
plexpy.MAC_SYS_TRAY_ICON = macos.MacOSSystemTray()

View file

@ -458,11 +458,14 @@
<p class="help-block">Note: Web interface changes require a restart.</p>
% if common.PLATFORM in ('Windows', 'Darwin'):
<%
tray = {'Windows': 'System Tray', 'Darwin': 'Menu Bar'}
%>
<div class="checkbox">
<label>
<input type="checkbox" class="http-settings" name="sys_tray_icon" id="sys_tray_icon" value="1" ${config['sys_tray_icon']}> Enable System Tray Icon
<input type="checkbox" class="http-settings" name="sys_tray_icon" id="sys_tray_icon" value="1" ${config['sys_tray_icon']}> Enable ${tray[common.PLATFORM]} Icon
</label>
<p class="help-block">Show Tautulli shortcut in the system tray.</p>
<p class="help-block">Show Tautulli shortcut in the ${tray[common.PLATFORM].lower()}.</p>
</div>
<div class="checkbox">
<label>

View file

@ -64,11 +64,11 @@ class MacOSSystemTray(object):
self.tray_icon = rumps.App(common.PRODUCT, icon=self.icon, menu=self.menu, quit_button=None)
def start(self):
logger.info("Launching MacOS system tray icon.")
logger.info("Launching MacOS menu bar icon.")
try:
self.tray_icon.run()
except Exception as e:
logger.error("Unable to launch system tray icon: %s." % e)
logger.error("Unable to launch menu bar icon: %s." % e)
def shutdown(self):
rumps.quit_application()