@@ -1134,10 +1134,10 @@ def onPlayCallback(self):
1134
1134
"""Handle when playback is started"""
1135
1135
# Set icon on Play button
1136
1136
if self .initialized :
1137
- from themes . manager import ThemeManager
1138
- theme = ThemeManager () .get_current_theme ()
1139
- if theme :
1140
- theme .togglePlayIcon (True )
1137
+ if get_app (). theme_manager :
1138
+ theme = get_app (). theme_manager .get_current_theme ()
1139
+ if theme :
1140
+ theme .togglePlayIcon (True )
1141
1141
1142
1142
def onPauseCallback (self ):
1143
1143
"""Handle when playback is paused"""
@@ -1146,10 +1146,10 @@ def onPauseCallback(self):
1146
1146
1147
1147
# Set icon on Pause button
1148
1148
if self .initialized :
1149
- from themes . manager import ThemeManager
1150
- theme = ThemeManager () .get_current_theme ()
1151
- if theme :
1152
- theme .togglePlayIcon (False )
1149
+ if get_app (). theme_manager :
1150
+ theme = get_app (). theme_manager .get_current_theme ()
1151
+ if theme :
1152
+ theme .togglePlayIcon (False )
1153
1153
1154
1154
def actionSaveFrame_trigger (self , checked = True ):
1155
1155
log .info ("actionSaveFrame_trigger" )
@@ -2992,19 +2992,22 @@ def foundCurrentVersion(self, version):
2992
2992
# Add toolbar button for non-cosmic dusk themes
2993
2993
# Cosmic dusk has a hidden toolbar button which is made visible
2994
2994
# by the setVisible() call above this
2995
- from themes .manager import ThemeManager , ThemeName
2996
- theme = ThemeManager ().get_current_theme ()
2997
- if theme and theme .name != ThemeName .COSMIC .value :
2998
- # Add spacer and 'New Version Available' toolbar button (default hidden)
2999
- spacer = QWidget (self )
3000
- spacer .setSizePolicy (QSizePolicy .Expanding , QSizePolicy .Preferred )
3001
- self .toolBar .addWidget (spacer )
3002
-
3003
- # Add update available button (with icon and text)
3004
- updateButton = QToolButton (self )
3005
- updateButton .setDefaultAction (self .actionUpdate )
3006
- updateButton .setToolButtonStyle (Qt .ToolButtonTextBesideIcon )
3007
- self .toolBar .addWidget (updateButton )
2995
+ if get_app ().theme_manager :
2996
+ from themes .manager import ThemeName
2997
+ theme = get_app ().theme_manager .get_current_theme ()
2998
+ if theme and theme .name != ThemeName .COSMIC .value :
2999
+ # Add spacer and 'New Version Available' toolbar button (default hidden)
3000
+ spacer = QWidget (self )
3001
+ spacer .setSizePolicy (QSizePolicy .Expanding , QSizePolicy .Preferred )
3002
+ self .toolBar .addWidget (spacer )
3003
+
3004
+ # Add update available button (with icon and text)
3005
+ updateButton = QToolButton (self )
3006
+ updateButton .setDefaultAction (self .actionUpdate )
3007
+ updateButton .setToolButtonStyle (Qt .ToolButtonTextBesideIcon )
3008
+ self .toolBar .addWidget (updateButton )
3009
+ else :
3010
+ log .warning ("No ThemeManager loaded yet. Skip update available button." )
3008
3011
3009
3012
# Initialize sentry exception tracing (now that we know the current version)
3010
3013
from classes import sentry
0 commit comments