44import os
55import sys
66import subprocess
7- from PyQt6 .QtWidgets import QMainWindow
7+ from PyQt6 .QtWidgets import QMainWindow , QMessageBox
88from PyQt6 .QtCore import Qt , QUrl
99from PyQt6 .uic import loadUi
1010from PyQt6 .QtGui import QDesktopServices
@@ -66,7 +66,7 @@ def masterButton(self):
6666 self .l_versioninfo .setText ('⏳Please wait⏳' )
6767 self .iprocess = InstallSpicetify ()
6868 self .iprocess .finished_signal .connect (self .setup_finished )
69- self .iprocess .progress_signal .connect (self .progressmaster )
69+ self .iprocess .progress_signal .connect (self .installProgress )
7070 self .iprocess .start ()
7171 elif self .managermode == 3 :
7272 self .setCursor (Qt .CursorShape .WaitCursor )
@@ -96,11 +96,16 @@ def masterButton(self):
9696 self .iprocess .start ()
9797
9898 #Update user about progress while installing spicetify
99- def progressmaster (self , action ):
99+ def installProgress (self , action ):
100100 if (action == "fail" ):
101101 self .l_status .setStyleSheet ("color: red" )
102102 self .l_status .setText ("⚠️ Installer has crashed ⚠️" )
103103 errorDialog ("The installation of Spicetify has failed due to an unrecoverable error! Check logs or ask for help." )
104+ elif (action == "done" ):
105+ self .SystemSoftStatusCheck ()
106+ windowsNotification ("Spicetify Manager" , "Spicetify has successfully been installed!" )
107+ dialog = Popup (self )
108+ dialog .exec ()
104109 else :
105110 self .l_status .setStyleSheet ("color: Orange" )
106111 self .l_status .setText (action )
@@ -110,15 +115,19 @@ def progressmaster(self, action):
110115
111116 # Launch uninstaller task
112117 def startRemoval (self ):
113- self .setCursor (Qt .CursorShape .WaitCursor )
114- self .bt_uninstall .setEnabled (False )
115- self .bt_refresh .setEnabled (False )
116- self .bt_master .setEnabled (False )
117- self .l_status .setStyleSheet ("color: Orange" )
118- self .l_status .setText ("Uninstalling Spicetify..." )
119- self .iprocess = UninstallSpicetify ()
120- self .iprocess .finished_signal .connect (self .uninstall_finished )
121- self .iprocess .start ()
118+ reply = QMessageBox .question (None , 'Confirmation' , 'Are you sure you want to uninstall Spicetify?' , QMessageBox .StandardButton .Yes | QMessageBox .StandardButton .No )
119+ if reply == QMessageBox .StandardButton .Yes :
120+ self .setCursor (Qt .CursorShape .WaitCursor )
121+ self .bt_uninstall .setEnabled (False )
122+ self .bt_refresh .setEnabled (False )
123+ self .bt_master .setEnabled (False )
124+ self .l_status .setStyleSheet ("color: Orange" )
125+ self .l_status .setText ("Uninstalling Spicetify..." )
126+ self .iprocess = UninstallSpicetify ()
127+ self .iprocess .finished_signal .connect (self .uninstall_finished )
128+ self .iprocess .start ()
129+ else :
130+ return False
122131
123132
124133 # Run custom commands
@@ -138,10 +147,7 @@ def DisableUpdate(self):
138147
139148 #Called when spicetify is installed or not?
140149 def setup_finished (self ):
141- self .SystemSoftStatusCheck ()
142- dialog = Popup (self )
143- dialog .exec ()
144- windowsNotification ("Spicetify Manager" , "Spicetify has successfully been installed!" )
150+ pass
145151
146152 #Called when spicetify is applied
147153 def apply_finished (self ):
@@ -153,6 +159,7 @@ def update_finished(self):
153159 self .SystemSoftStatusCheck ()
154160 windowsNotification ("Spicetify Manager" , "Spicetify has been updated!" )
155161
162+
156163 #Called when spicetify is uninstalled
157164 def uninstall_finished (self ):
158165 self .SystemSoftStatusCheck ()
@@ -234,10 +241,12 @@ def installerUiUpdate(self):
234241 self .l_versioninfo .setText ('Press install to start the process' )
235242 #self.l_versioninfo.setText('Latest version: '+self.LATESTSPICETIFYVER)
236243 self .bt_master .setText ("Install" )
244+ self .bt_uninstall .setEnabled (False )
237245 self .managermode = 2
238246 else :
239247 self .l_status .setText ("Spotify is not installed" )
240248 self .l_status .setStyleSheet ("color: red" )
241249 self .l_versioninfo .setText ('Download Spotify from the official website' )
242250 self .bt_master .setText ("Download" )
251+ self .bt_uninstall .setEnabled (False )
243252 self .managermode = 1
0 commit comments