@@ -38,7 +38,6 @@ def __init__(self):
3838 self .InitWindow ()
3939
4040 self .bt_master .clicked .connect (self .masterButton )
41- self .bt_update .clicked .connect (self .startUpdate )
4241 self .bt_uninstall .clicked .connect (self .startRemoval )
4342 self .bt_cmd .clicked .connect (self .Custom )
4443 self .check_noupdate .stateChanged .connect (self .DisableUpdate )
@@ -74,6 +73,7 @@ def masterButton(self):
7473 self .bt_update .setEnabled (False )
7574 self .bt_uninstall .setEnabled (False )
7675 self .l_status .setText ("Installling Spicetify..." )
76+ self .l_versioninfo .setText ('⏳Please wait⏳' )
7777 self .iprocess = InstallSpicetify ()
7878 self .iprocess .finished_signal .connect (self .setup_finished )
7979 self .iprocess .progress_signal .connect (self .progressmaster )
@@ -84,6 +84,7 @@ def masterButton(self):
8484 self .bt_update .setEnabled (False )
8585 self .bt_uninstall .setEnabled (False )
8686 self .l_status .setText ("Running apply" )
87+ self .l_versioninfo .setText ('⏳Please wait⏳' )
8788 self .iprocess = ApplySpicetify ()
8889 self .iprocess .finished_signal .connect (self .apply_finished )
8990 self .iprocess .start ()
@@ -93,6 +94,16 @@ def masterButton(self):
9394 os .remove (killpath1 )
9495 os .remove (killpath2 )
9596 self .SystemSoftStatusCheck ()
97+ elif self .managermode == 5 :
98+ self .setCursor (Qt .CursorShape .WaitCursor )
99+ self .bt_master .setEnabled (False )
100+ self .bt_update .setEnabled (False )
101+ self .bt_uninstall .setEnabled (False )
102+ self .l_status .setText ("Updating patcher" )
103+ self .l_versioninfo .setText ('⏳Please wait⏳' )
104+ self .iprocess = UpdateSpicetify ()
105+ self .iprocess .finished_signal .connect (self .update_finished )
106+ self .iprocess .start ()
96107 else :
97108 print ("Error selection overshoot!" )
98109
@@ -110,33 +121,6 @@ def startRemoval(self):
110121 self .iprocess .start ()
111122
112123
113- # Launch updater task
114- def startUpdate (self ):
115- try :
116- self .setCursor (Qt .CursorShape .WaitCursor )
117- self .bt_update .setEnabled (False )
118- self .bt_uninstall .setEnabled (False )
119- self .bt_master .setEnabled (False )
120- self .l_status .setStyleSheet ("color: Orange" )
121- self .l_status .setText ("Checking for updates..." )
122- localversion = subprocess .check_output ('spicetify --version' ,shell = True ).decode ("utf-8" ).strip ()
123- latestrelease = getLatestRelease ().replace ("v" ,"" ).strip ()
124- if (latestrelease == localversion ):
125- self .l_status .setStyleSheet ("color: Green" )
126- self .l_status .setText ("You are up to date!" )
127- self .setCursor (Qt .CursorShape .ArrowCursor )
128- self .bt_update .setEnabled (True )
129- self .bt_uninstall .setEnabled (True )
130- self .bt_master .setEnabled (True )
131- else :
132- self .l_status .setStyleSheet ("color: Orange" )
133- self .l_status .setText ("Updating..." )
134- self .iprocess = UpdateSpicetify ()
135- self .iprocess .finished_signal .connect (self .update_finished )
136- self .iprocess .start ()
137- except :
138- print ("E: Error while checking version during update!" )
139-
140124 # Run custom commands
141125 def Custom (self ):
142126 self .iprocess = CustomCommand (self .combo_cmd .currentIndex ())
@@ -157,29 +141,32 @@ def setup_finished(self):
157141 self .SystemSoftStatusCheck ()
158142 dialog = Popup (self )
159143 dialog .exec ()
160- windowsNotification ("Spicetify Manager" , "Spicetify has been installed!" )
144+ windowsNotification ("Spicetify Manager" , "Spicetify has successfully been installed!" )
145+
161146 #Called when spicetify is applied
162147 def apply_finished (self ):
163148 self .SystemSoftStatusCheck ()
164149 windowsNotification ("Spicetify Manager" , "Spicetify has been applied!" )
150+
165151 #Called when spicetify is updated
166152 def update_finished (self ):
167153 self .SystemSoftStatusCheck ()
168154 windowsNotification ("Spicetify Manager" , "Spicetify has been updated!" )
155+
169156 #Called when spicetify is uninstalled
170157 def uninstall_finished (self ):
171158 self .SystemSoftStatusCheck ()
172159 windowsNotification ("Spicetify Manager" , "Spicetify has been uninstalled!" )
173160
174- # Spicetify status check V2
161+
162+ # Spicetify status check
175163 def SystemSoftStatusCheck (self ):
176164 spotipath = os .path .join (os .path .join ( os .path .expanduser ('~' ), 'AppData' ,'Roaming' ), 'Spotify' , 'Spotify.exe' )
177165 if os .path .exists (spotipath ):
178166 self .isSpotifyInstalled = True
179167 else :
180168 self .isSpotifyInstalled = False
181169
182- # maybe (also) check executable in local appdata
183170 spicypath = os .path .join (os .path .join ( os .path .expanduser ('~' ), 'AppData' ,'Local' ), 'spicetify' , 'spicetify.exe' )
184171 if os .path .exists (spicypath ):
185172 self .isSpicetifyInstalled = True
@@ -208,24 +195,35 @@ def installerUiUpdate(self):
208195 self .bt_update .setEnabled (True )
209196 self .bt_uninstall .setEnabled (True )
210197 self .bt_master .setEnabled (True )
198+
211199 if (self .isSpotifyInstalled ):
200+
212201 if (self .isSpicetifyInstalled ):
202+
213203 if (self .isApplied ):
204+
214205 if (self .isActive ):
215- #Implement update checker here
216- self .l_status .setText ("Spotify is spiced up!" )
217- self .l_status .setStyleSheet ("color: lime" )
218- self .bt_master .setText ("Launch Spotify" )
219- self .l_versioninfo .setText ('Version: ' + self .LOCALSPICETIFYVER )
220- self .managermode = 0
206+
207+ if (self .LOCALSPICETIFYVER == self .LATESTSPICETIFYVER ):
208+ self .l_status .setText ("🔥 Spotify is spiced up 🔥" )
209+ self .l_status .setStyleSheet ("color: lime" )
210+ self .bt_master .setText ("Launch Spotify" )
211+ self .l_versioninfo .setText ('Version: ' + self .LOCALSPICETIFYVER )
212+ self .managermode = 0
213+ else :
214+ self .l_status .setText ("♻️ Update available ♻️" )
215+ self .l_status .setStyleSheet ("color: yellow" )
216+ self .l_versioninfo .setText ('Update now to the latest version: ' + self .LATESTSPICETIFYVER )
217+ self .bt_master .setText ("Update" )
218+ self .managermode = 5
221219 else :
222- self .l_status .setText ("Spicetify is inactive" )
220+ self .l_status .setText ("⚠️ Spicetify is inactive ⚠️ " )
223221 self .l_status .setStyleSheet ("color: yellow" )
224222 self .l_versioninfo .setText ('Press activate to activate Spicetify' )
225223 self .bt_master .setText ("Activate" )
226224 self .managermode = 4
227225 else :
228- self .l_status .setText ("Spicetify is not applied yet " )
226+ self .l_status .setText ("🩹 Modifications not applied 🩹 " )
229227 self .l_status .setStyleSheet ("color: orange" )
230228 self .l_versioninfo .setText ('Press apply to enable modifications' )
231229 self .bt_master .setText ("Apply" )
0 commit comments