Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 5ac5b4c

Browse files
committed
Dialog improvements
1 parent 8357715 commit 5ac5b4c

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

components/popups.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ def infoDialog(text):
2222
info_dialog.exec()
2323

2424

25-
def confirmDialog(title, text):
26-
confirm_dialog = QMessageBox()
27-
confirm_dialog.setIcon(QMessageBox.Icon.Question)
28-
confirm_dialog.setWindowTitle(title)
29-
confirm_dialog.setText(text)
30-
confirm_dialog.setStandardButtons(QMessageBox.StandardButton.Ok)
31-
confirm_dialog.exec()
25+
def warnDialog(text):
26+
info_dialog = QMessageBox()
27+
info_dialog.setIcon(QMessageBox.Icon.Warning)
28+
info_dialog.setWindowTitle('Warning')
29+
info_dialog.setText(text)
30+
info_dialog.exec()
31+
32+
33+
def confirmationModal(title, message):
34+
return QMessageBox.question(None, title, QMessageBox.Icon.Information, message, QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
3235

3336

3437
def windowsToast(title, message):

components/shellbridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run(self):
5050
print("Update started")
5151
try:
5252
self.progress_signal.emit("Auto Updating...")
53-
subprocess.run('spicetify upgrade -q', shell=True)
53+
subprocess.run('spicetify upgrade -q -n', shell=True)
5454
self.progress_signal.emit("done")
5555
except Exception as e:
5656
self.progress_signal.emit("fail")

components/tools.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
def initConfig():
11-
print('!! Temporary Action3 called !!')
1211
try:
1312
file_path = os.path.join(os.path.join(os.path.expanduser(
1413
'~'), 'AppData', 'Local'), 'spicetify', 'Manager.ini')
@@ -21,7 +20,7 @@ def initConfig():
2120
autoclose = False
2221
'''
2322
except:
24-
print("Error while creating config file")
23+
print("Error while checking config file")
2524
try:
2625
with open(file_path, 'w') as f:
2726
f.write(config_dict)
@@ -31,9 +30,7 @@ def initConfig():
3130

3231
# Reads config files
3332
def readConfig(section, key):
34-
print('!! Temporary Action1 called !!')
3533
try:
36-
print(key)
3734
file_path = os.path.join(os.path.join(os.path.expanduser(
3835
'~'), 'AppData', 'Local'), 'spicetify', 'Manager.ini')
3936
config = configparser.ConfigParser()
@@ -50,7 +47,6 @@ def readConfig(section, key):
5047

5148

5249
def writeConfig(section, key, value):
53-
print('!! Temporary Action2 called !!')
5450
try:
5551
file_path = os.path.join(os.path.join(os.path.expanduser(
5652
'~'), 'AppData', 'Local'), 'spicetify', 'Manager.ini')
@@ -131,6 +127,7 @@ def isAddedToStartup():
131127
except FileNotFoundError:
132128
return False
133129
except Exception as e:
130+
print("Error while checking if added to startup")
134131
print(e)
135132
return False
136133

manager_window.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from PyQt6.QtCore import Qt, QUrl
99
from PyQt6.uic import loadUi
1010
from PyQt6.QtGui import QDesktopServices, QMovie
11-
from components.popups import errorDialog, infoDialog, windowsToast, winUpdateToast
11+
from components.popups import errorDialog, infoDialog, windowsToast, confirmationModal
1212
from components.shellbridge import InstallSpicetify, watchwitchInjector, UpdateSpicetify, ApplySpicetify, UninstallSpicetify, CustomCommand, checkApplied, blockSpotifyUpdate, checkUpdateSupression
1313
from components.tools import getLatestSpicetifyRelease, readConfig, writeConfig, addToStartup
1414
from components.dialog_windows import AfterInstall
@@ -64,9 +64,10 @@ def InitWindow(self):
6464

6565
self.background_graphics.setMovie(movie)
6666
self.background_graphics.show()
67-
self.background_graphics.setStyleSheet("opacity: 0.2;")
6867
movie.start()
69-
infoDialog('Lorem Ipsum')
68+
reply = confirmationModal('hi', 'User')
69+
if reply == QMessageBox.StandardButton.Yes:
70+
print('confirm')
7071

7172
# Ask user to keep manager in background
7273

@@ -191,8 +192,8 @@ def updateProgress(self, action):
191192

192193
# Launch uninstaller task
193194
def startRemoval(self):
194-
reply = QMessageBox.question(None, 'Uninstall', 'Are you sure you want to uninstall Spicetify and remove all installed mods/themes ?',
195-
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
195+
reply = confirmationModal(
196+
'Uninstall', 'Are you sure you want to uninstall Spicetify and remove all installed mods/themes ?')
196197
if reply == QMessageBox.StandardButton.Yes:
197198
self.setCursor(Qt.CursorShape.WaitCursor)
198199
self.bt_uninstall.setEnabled(False)
@@ -218,8 +219,8 @@ def DisableUpdate(self):
218219
writeConfig('Manager', 'NoUpdate', str(
219220
self.check_noupdate.isChecked()))
220221
if self.check_noupdate.isChecked():
221-
reply = QMessageBox.question(None, 'Deactivate Updates', 'This function will try to disable all automatic updates for Spotify! Are you sure you want to do this?',
222-
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
222+
reply = confirmationModal(
223+
'Disable Updates', 'Are you sure you want to disable all automatic updates for Spotify?')
223224
if reply == QMessageBox.StandardButton.Yes:
224225
if (blockSpotifyUpdate(self.check_noupdate.isChecked())):
225226
pass
@@ -240,7 +241,6 @@ def DisableUpdate(self):
240241

241242
# Apply Watchwitch server
242243
def PatchWatchWitch(self):
243-
print(self.check_watchwitch.isChecked())
244244
folder_path = os.path.join(os.path.join(os.path.expanduser(
245245
'~'), 'AppData', 'Local'), 'spicetify', 'Manager.exe')
246246
if os.path.exists(folder_path):
@@ -252,8 +252,8 @@ def PatchWatchWitch(self):
252252
self.check_watchwitch.setChecked(False)
253253
folder_path = os.path.join(os.path.join(
254254
os.path.expanduser('~'), 'AppData', 'Local'), 'spicetify')
255-
reply = QMessageBox.question(None, 'Executeable not found', 'Please put the manager executeable in the "localappdata/spicetify/Manager.exe" folder! \n Do you want to open the folder?',
256-
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
255+
reply = confirmationModal(
256+
'Executeable not found', 'Please put the manager executeable in the "localappdata/spicetify/Manager.exe" folder! \n Do you want to open the folder?')
257257
if reply == QMessageBox.StandardButton.Yes:
258258
os.startfile(folder_path)
259259
# Auto close manager after completing actions (does not check for status!)
@@ -352,6 +352,7 @@ def SystemSoftStatusCheck(self):
352352
self.check_autoclose.setChecked(False)
353353
self.isAutoClosing = False
354354
except Exception as e:
355+
print('Error while checking spicetify status')
355356
print(e)
356357

357358
self.installerUiUpdate()

0 commit comments

Comments
 (0)