Remove tray update icon

This commit is contained in:
JonnyWong16 2020-12-04 18:30:56 -08:00
parent 964c503223
commit 6659802689
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 12 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

View file

@ -44,11 +44,12 @@ else:
class MacOSSystemTray(object): class MacOSSystemTray(object):
def __init__(self): def __init__(self):
self.image_dir = os.path.join(plexpy.PROG_DIR, 'data/interfaces/', plexpy.CONFIG.INTERFACE, 'images') self.image_dir = os.path.join(plexpy.PROG_DIR, 'data/interfaces/', plexpy.CONFIG.INTERFACE, 'images')
self.icon = os.path.join(self.image_dir, 'logo-flat-white.ico')
if plexpy.UPDATE_AVAILABLE: if plexpy.UPDATE_AVAILABLE:
self.icon = os.path.join(self.image_dir, 'logo-circle-update.ico') self.title = common.PRODUCT + ' - Update Available!'
else: else:
self.icon = os.path.join(self.image_dir, 'logo-circle.ico') self.title = common.PRODUCT
self.menu = [ self.menu = [
rumps.MenuItem('Open Tautulli', callback=self.tray_open), rumps.MenuItem('Open Tautulli', callback=self.tray_open),
@ -65,7 +66,8 @@ class MacOSSystemTray(object):
self.menu[2].state = plexpy.CONFIG.LAUNCH_STARTUP self.menu[2].state = plexpy.CONFIG.LAUNCH_STARTUP
self.menu[3].state = plexpy.CONFIG.LAUNCH_BROWSER self.menu[3].state = plexpy.CONFIG.LAUNCH_BROWSER
self.tray_icon = rumps.App(common.PRODUCT, icon=self.icon, menu=self.menu, quit_button=None) self.tray_icon = rumps.App(common.PRODUCT, title=self.title,
icon=self.icon, menu=self.menu, quit_button=None)
def start(self): def start(self):
logger.info("Launching MacOS menu bar icon.") logger.info("Launching MacOS menu bar icon.")
@ -80,6 +82,8 @@ class MacOSSystemTray(object):
def update(self, **kwargs): def update(self, **kwargs):
if 'icon' in kwargs: if 'icon' in kwargs:
self.tray_icon.icon = kwargs['icon'] self.tray_icon.icon = kwargs['icon']
if 'title' in kwargs:
self.tray_icon.title = kwargs['title']
def tray_open(self, tray_icon): def tray_open(self, tray_icon):
plexpy.launch_browser(plexpy.CONFIG.HTTP_HOST, plexpy.HTTP_PORT, plexpy.HTTP_ROOT) plexpy.launch_browser(plexpy.CONFIG.HTTP_HOST, plexpy.HTTP_PORT, plexpy.HTTP_ROOT)
@ -107,10 +111,10 @@ class MacOSSystemTray(object):
def change_tray_update_icon(self): def change_tray_update_icon(self):
if plexpy.UPDATE_AVAILABLE: if plexpy.UPDATE_AVAILABLE:
self.icon = os.path.join(self.image_dir, 'logo-circle-update.ico') self.title = common.PRODUCT + ' - Update Available!'
else: else:
self.icon = os.path.join(self.image_dir, 'logo-circle.ico') self.title = common.PRODUCT + ' - No Update Available'
self.update(icon=self.icon) self.update(title=self.title)
def change_tray_icons(self): def change_tray_icons(self):
self.tray_icon.menu['Start Tautulli at Login'].state = plexpy.CONFIG.LAUNCH_STARTUP self.tray_icon.menu['Start Tautulli at Login'].state = plexpy.CONFIG.LAUNCH_STARTUP

View file

@ -43,12 +43,11 @@ else:
class WindowsSystemTray(object): class WindowsSystemTray(object):
def __init__(self): def __init__(self):
self.image_dir = os.path.join(plexpy.PROG_DIR, 'data/interfaces/', plexpy.CONFIG.INTERFACE, 'images') self.image_dir = os.path.join(plexpy.PROG_DIR, 'data/interfaces/', plexpy.CONFIG.INTERFACE, 'images')
self.icon = os.path.join(self.image_dir, 'logo-circle.ico')
if plexpy.UPDATE_AVAILABLE: if plexpy.UPDATE_AVAILABLE:
self.icon = os.path.join(self.image_dir, 'logo-circle-update.ico')
self.hover_text = common.PRODUCT + ' - Update Available!' self.hover_text = common.PRODUCT + ' - Update Available!'
else: else:
self.icon = os.path.join(self.image_dir, 'logo-circle.ico')
self.hover_text = common.PRODUCT self.hover_text = common.PRODUCT
if plexpy.CONFIG.LAUNCH_STARTUP: if plexpy.CONFIG.LAUNCH_STARTUP:
@ -116,12 +115,10 @@ class WindowsSystemTray(object):
def change_tray_update_icon(self): def change_tray_update_icon(self):
if plexpy.UPDATE_AVAILABLE: if plexpy.UPDATE_AVAILABLE:
self.icon = os.path.join(self.image_dir, 'logo-circle-update.ico')
self.hover_text = common.PRODUCT + ' - Update Available!' self.hover_text = common.PRODUCT + ' - Update Available!'
else: else:
self.icon = os.path.join(self.image_dir, 'logo-circle.ico')
self.hover_text = common.PRODUCT + ' - No Update Available' self.hover_text = common.PRODUCT + ' - No Update Available'
self.update(icon=self.icon, hover_text=self.hover_text) self.update(hover_text=self.hover_text)
def change_tray_icons(self): def change_tray_icons(self):
if plexpy.CONFIG.LAUNCH_STARTUP: if plexpy.CONFIG.LAUNCH_STARTUP: