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

Commit a07e6e2

Browse files
committed
Added popup to show after setup has finished
1 parent aa98fd9 commit a07e6e2

File tree

7 files changed

+211
-19
lines changed

7 files changed

+211
-19
lines changed

components/afterinstall_popup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import os
2+
from PyQt6.QtWidgets import QDialog
3+
from PyQt6.uic import loadUi
4+
5+
6+
class Popup(QDialog):
7+
def __init__(self, parent=None):
8+
super().__init__(parent)
9+
parent_directory = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
10+
pathmaster = os.path.join(parent_directory, "res", "afterinstalltip.ui")
11+
loadUi(pathmaster, self)
12+

components/shellbridge.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def getLatestRelease():
6060
else:
6161
return None
6262

63+
def checkInstalled():
64+
folder_path = os.path.join(os.path.join( os.path.expanduser('~'), 'AppData','Local'), 'spicetify')
65+
if os.path.exists(folder_path) and os.path.isdir(folder_path):
66+
return True
67+
else:
68+
return False
69+
6370
def checkApplied():
6471
folder_path = os.path.join( os.path.expanduser('~'), 'AppData','Roaming/Spotify/Apps/xpui')
6572
if os.path.exists(folder_path) and os.path.isdir(folder_path):

manager_window.py

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import sys
1+
22
import os
33
import subprocess
4-
from PyQt6.QtWidgets import QApplication, QDialog, QMainWindow, QErrorMessage
4+
from PyQt6.QtWidgets import QMainWindow, QErrorMessage
55
from PyQt6.QtCore import Qt
66
from PyQt6.uic import loadUi
7-
from components.shellbridge import InstallSpicetify, UpdateSpicetify, UninstallSpicetify, getLatestRelease
7+
from components.shellbridge import InstallSpicetify, UpdateSpicetify, UninstallSpicetify, getLatestRelease,checkApplied
8+
9+
from components.afterinstall_popup import Popup
810

911

1012

@@ -48,6 +50,9 @@ def startInstaller(self):
4850
self.iprocess.start()
4951
def launchSpotify(self):
5052
os.startfile(os.path.join( os.path.expanduser('~'), 'AppData','Roaming/Spotify/Spotify.exe'))
53+
def activateSpicetify(self):
54+
subprocess.check_output('spicetify apply')
55+
self.checkSpicetify()
5156
def startRemoval(self):
5257
self.setCursor(Qt.CursorShape.WaitCursor)
5358
self.bt_uninstall.setEnabled(False)
@@ -85,6 +90,8 @@ def startUpdate(self):
8590

8691
def setup_finished(self):
8792
self.checkSpicetify()
93+
dialog = Popup(self)
94+
dialog.exec()
8895
def update_finished(self):
8996
self.checkSpicetify()
9097
def uninstall_finished(self):
@@ -95,18 +102,33 @@ def checkSpicetify(self):
95102
self.setCursor(Qt.CursorShape.ArrowCursor)
96103
folder_path = os.path.join(os.path.join( os.path.expanduser('~'), 'AppData','Local'), 'spicetify')
97104
if os.path.exists(folder_path) and os.path.isdir(folder_path):
98-
self.l_status.setText("Spicetify is installed")
99-
self.l_status.setStyleSheet("color: green")
100-
versionoutput = subprocess.check_output('spicetify --version',shell=True)
101-
self.l_versioninfo.setText('Version: '+versionoutput.decode("utf-8"))
102-
self.bt_uninstall.setEnabled(True)
103-
self.bt_update.setEnabled(True)
104-
self.bt_install.setEnabled(True)
105-
if self.installmode:
106-
self.installmode = False
107-
self.bt_install.setText("Launch Spotify")
108-
self.bt_install.clicked.disconnect(self.startInstaller)
109-
self.bt_install.clicked.connect(self.launchSpotify)
105+
if not checkApplied():
106+
self.l_status.setText("Spicetify is not activated yet")
107+
self.l_status.setStyleSheet("color: orange")
108+
self.l_versioninfo.setText('Please press activate to apply any modifications')
109+
self.bt_uninstall.setEnabled(True)
110+
self.bt_update.setEnabled(True)
111+
self.bt_install.setEnabled(True)
112+
if self.installmode:
113+
self.installmode = False
114+
self.bt_install.setText("Activate")
115+
self.bt_install.clicked.disconnect(self.startInstaller)
116+
else:
117+
self.bt_install.clicked.disconnect(self.launchSpotify)
118+
self.bt_install.clicked.connect(self.activateSpicetify)
119+
else:
120+
self.l_status.setText("Spotify is spiced up!")
121+
self.l_status.setStyleSheet("color: green")
122+
versionoutput = subprocess.check_output('spicetify --version',shell=True)
123+
self.l_versioninfo.setText('Version: '+versionoutput.decode("utf-8"))
124+
self.bt_uninstall.setEnabled(True)
125+
self.bt_update.setEnabled(True)
126+
self.bt_install.setEnabled(True)
127+
if self.installmode:
128+
self.installmode = False
129+
self.bt_install.setText("Launch Spotify")
130+
self.bt_install.clicked.disconnect(self.startInstaller)
131+
self.bt_install.clicked.connect(self.launchSpotify)
110132
else:
111133
self.l_status.setText("Spicetify is not installed")
112134
self.l_status.setStyleSheet("color: red")

res/afterinstalltip.ui

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>popup</class>
4+
<widget class="QDialog" name="popup">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>500</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="sizePolicy">
14+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
15+
<horstretch>0</horstretch>
16+
<verstretch>0</verstretch>
17+
</sizepolicy>
18+
</property>
19+
<property name="minimumSize">
20+
<size>
21+
<width>500</width>
22+
<height>300</height>
23+
</size>
24+
</property>
25+
<property name="maximumSize">
26+
<size>
27+
<width>500</width>
28+
<height>300</height>
29+
</size>
30+
</property>
31+
<property name="windowTitle">
32+
<string>Spicetify Marketplace</string>
33+
</property>
34+
<property name="windowIcon">
35+
<iconset>
36+
<normaloff>firething.gif</normaloff>firething.gif</iconset>
37+
</property>
38+
<property name="styleSheet">
39+
<string notr="true">QDialog {
40+
41+
background-color: rgb(31, 30, 46);
42+
}</string>
43+
</property>
44+
<property name="locale">
45+
<locale language="English" country="UnitedStates"/>
46+
</property>
47+
<widget class="QDialogButtonBox" name="buttonBox">
48+
<property name="geometry">
49+
<rect>
50+
<x>10</x>
51+
<y>250</y>
52+
<width>481</width>
53+
<height>32</height>
54+
</rect>
55+
</property>
56+
<property name="orientation">
57+
<enum>Qt::Horizontal</enum>
58+
</property>
59+
<property name="standardButtons">
60+
<set>QDialogButtonBox::Close</set>
61+
</property>
62+
<property name="centerButtons">
63+
<bool>true</bool>
64+
</property>
65+
</widget>
66+
<widget class="QLabel" name="label">
67+
<property name="geometry">
68+
<rect>
69+
<x>0</x>
70+
<y>0</y>
71+
<width>81</width>
72+
<height>231</height>
73+
</rect>
74+
</property>
75+
<property name="text">
76+
<string/>
77+
</property>
78+
<property name="pixmap">
79+
<pixmap>spotify_sidebar.jpg</pixmap>
80+
</property>
81+
<property name="scaledContents">
82+
<bool>true</bool>
83+
</property>
84+
</widget>
85+
<widget class="QTextBrowser" name="textBrowser">
86+
<property name="geometry">
87+
<rect>
88+
<x>100</x>
89+
<y>20</y>
90+
<width>381</width>
91+
<height>211</height>
92+
</rect>
93+
</property>
94+
<property name="sizePolicy">
95+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
96+
<horstretch>0</horstretch>
97+
<verstretch>0</verstretch>
98+
</sizepolicy>
99+
</property>
100+
<property name="html">
101+
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
102+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
103+
p, li { white-space: pre-wrap; }
104+
hr { height: 1px; border-width: 0; }
105+
li.unchecked::marker { content: &quot;\2610&quot;; }
106+
li.checked::marker { content: &quot;\2612&quot;; }
107+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
108+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:700;&quot;&gt;Info&lt;/span&gt;&lt;/p&gt;
109+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
110+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Click on the shopping cart under the search icon to open the Spicetify Marketplace.&lt;/span&gt;&lt;/p&gt;
111+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Here you can find themes, extensions, snippets and apps for Spotify.&lt;/span&gt;&lt;/p&gt;
112+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;To download the simply hover over the selected item and click the download symbol in the bottom right corner.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
113+
</property>
114+
</widget>
115+
</widget>
116+
<resources/>
117+
<connections>
118+
<connection>
119+
<sender>buttonBox</sender>
120+
<signal>accepted()</signal>
121+
<receiver>popup</receiver>
122+
<slot>accept()</slot>
123+
<hints>
124+
<hint type="sourcelabel">
125+
<x>248</x>
126+
<y>254</y>
127+
</hint>
128+
<hint type="destinationlabel">
129+
<x>157</x>
130+
<y>274</y>
131+
</hint>
132+
</hints>
133+
</connection>
134+
<connection>
135+
<sender>buttonBox</sender>
136+
<signal>rejected()</signal>
137+
<receiver>popup</receiver>
138+
<slot>reject()</slot>
139+
<hints>
140+
<hint type="sourcelabel">
141+
<x>316</x>
142+
<y>260</y>
143+
</hint>
144+
<hint type="destinationlabel">
145+
<x>286</x>
146+
<y>274</y>
147+
</hint>
148+
</hints>
149+
</connection>
150+
</connections>
151+
</ui>

res/manager.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<string notr="true"/>
5151
</property>
5252
<property name="locale">
53-
<locale language="Kannada" country="India"/>
53+
<locale language="English" country="UnitedStates"/>
5454
</property>
5555
<widget class="QWidget" name="centralwidget">
5656
<property name="palette">
@@ -411,9 +411,9 @@ QPushButton:pressed
411411
<widget class="QLabel" name="l_versioninfo">
412412
<property name="geometry">
413413
<rect>
414-
<x>170</x>
414+
<x>20</x>
415415
<y>90</y>
416-
<width>371</width>
416+
<width>681</width>
417417
<height>31</height>
418418
</rect>
419419
</property>

res/splash.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<string notr="true"/>
2828
</property>
2929
<property name="locale">
30-
<locale language="Kannada" country="India"/>
30+
<locale language="English" country="UnitedStates"/>
3131
</property>
3232
<widget class="QWidget" name="centralwidget">
3333
<property name="styleSheet">

res/spotify_sidebar.jpg

5 KB
Loading

0 commit comments

Comments
 (0)