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

Commit a4c071d

Browse files
committed
Added network connection indicator and background status updates
1 parent ee440b9 commit a4c071d

File tree

4 files changed

+62
-4
lines changed

4 files changed

+62
-4
lines changed

components/statusInfo.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,16 @@ def spicetifyStatusCheck():
166166
return 0
167167
except:
168168
return 0
169+
170+
171+
def checkInternetConnection():
172+
try:
173+
url = f"https://google.com"
174+
response = requests.get(url)
175+
176+
if response.status_code == 200:
177+
return True
178+
else:
179+
return False
180+
except:
181+
return False

main.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import subprocess
77
from PyQt6.QtWidgets import QMainWindow, QMessageBox, QApplication, QSystemTrayIcon, QMenu
8-
from PyQt6.QtCore import Qt, QUrl, QThread
8+
from PyQt6.QtCore import Qt, QUrl, QThread, QTimer
99
from PyQt6.uic import loadUi
1010
from PyQt6.QtGui import QDesktopServices, QMovie, QIcon
1111
from components.popups import errorDialog, warnDialog, windowsToast, confirmationModal, spicetifyStatusToast
@@ -37,6 +37,7 @@ def __init__(self):
3737
self.isNeverRestarting = False
3838
self.isAutoPatching = False
3939
self.isInFaultMode = False
40+
self.isConnectedToInternet = False
4041
self.managermode = 0
4142

4243
self.LOCALSPICETIFYVER = ''
@@ -91,8 +92,14 @@ def InitWindow(self):
9192
self.background_graphics.show()
9293
movie.start()
9394
self.checkUpdateAvailable()
95+
# Status check interval
96+
self.timer = QTimer(self)
97+
self.timer.setInterval(120000)
98+
self.timer.timeout.connect(self.statusUpdate)
99+
self.timer.start()
94100

95101
# Display manager window
102+
96103
def showManagerWindow(self):
97104
self.InitWindow()
98105
self.show()
@@ -415,6 +422,8 @@ def statusUpdate(self):
415422

416423
self.isRunningOnBoot = isAddedToStartup()
417424

425+
self.isConnectedToInternet = checkInternetConnection()
426+
418427
except Exception as e:
419428
print('Error while checking spicetify status')
420429
print(e)
@@ -502,6 +511,11 @@ def uiUpdate(self):
502511
self.check_neverrestart.setChecked(self.isNeverRestarting)
503512
self.check_autopatch.setChecked(self.isAutoPatching)
504513

514+
if self.isConnectedToInternet:
515+
self.network_error_icon.setVisible(False)
516+
else:
517+
self.network_error_icon.setVisible(True)
518+
505519
# Check if manager has update available
506520
def checkUpdateAvailable(self):
507521
if (managerUpdateCheck()):

res/manager.ui

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ QPushButton{
353353
<property name="alignment">
354354
<set>Qt::AlignCenter</set>
355355
</property>
356+
<property name="textInteractionFlags">
357+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
358+
</property>
356359
</widget>
357360
</widget>
358361
<widget class="QPushButton" name="bt_uninstall">
@@ -361,10 +364,10 @@ QPushButton{
361364
</property>
362365
<property name="geometry">
363366
<rect>
364-
<x>740</x>
367+
<x>730</x>
365368
<y>340</y>
366-
<width>41</width>
367-
<height>41</height>
369+
<width>51</width>
370+
<height>51</height>
368371
</rect>
369372
</property>
370373
<property name="font">
@@ -411,6 +414,34 @@ QPushButton:hover
411414
<bool>false</bool>
412415
</property>
413416
</widget>
417+
<widget class="QLabel" name="network_error_icon">
418+
<property name="enabled">
419+
<bool>true</bool>
420+
</property>
421+
<property name="geometry">
422+
<rect>
423+
<x>20</x>
424+
<y>340</y>
425+
<width>49</width>
426+
<height>51</height>
427+
</rect>
428+
</property>
429+
<property name="toolTip">
430+
<string>Your devoce seems to have issues with your internet connection!</string>
431+
</property>
432+
<property name="text">
433+
<string notr="true"/>
434+
</property>
435+
<property name="pixmap">
436+
<pixmap>net_error.png</pixmap>
437+
</property>
438+
<property name="scaledContents">
439+
<bool>true</bool>
440+
</property>
441+
<property name="textInteractionFlags">
442+
<set>Qt::NoTextInteraction</set>
443+
</property>
444+
</widget>
414445
</widget>
415446
<widget class="QWidget" name="tab_2">
416447
<attribute name="icon">

res/net_error.png

35 KB
Loading

0 commit comments

Comments
 (0)