mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
refactor: clean up unused imports and improve code organization
This commit is contained in:
+12
-11
@@ -76,19 +76,20 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
if state.ignore_updates is False:
|
if state.ignore_updates is False:
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
result = check_for_updates()
|
result = check_for_updates()
|
||||||
assets, latest_version = result
|
if result != (None, None):
|
||||||
|
assets, latest_version = result
|
||||||
|
|
||||||
if assets:
|
if assets:
|
||||||
msg = QMessageBox()
|
msg = QMessageBox()
|
||||||
msg.setIcon(QMessageBox.Information)
|
msg.setIcon(QMessageBox.Information)
|
||||||
msg.setWindowTitle("Update Available")
|
msg.setWindowTitle("Update Available")
|
||||||
msg.setText("A new version is available.")
|
msg.setText("A new version is available.")
|
||||||
msg.setInformativeText("Press Ok to download the update.")
|
msg.setInformativeText("Press Ok to download the update.")
|
||||||
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Ignore)
|
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Ignore)
|
||||||
|
|
||||||
response = msg.exec_()
|
response = msg.exec_()
|
||||||
if response == QMessageBox.Ok:
|
if response == QMessageBox.Ok:
|
||||||
download_update(latest_version)
|
download_update(latest_version)
|
||||||
|
|
||||||
self.setWindowTitle("Software Manager")
|
self.setWindowTitle("Software Manager")
|
||||||
self.setGeometry(100, 100, 800, 600)
|
self.setGeometry(100, 100, 800, 600)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class AppState(QObject):
|
|||||||
self.post_urls: List[str] = []
|
self.post_urls: List[str] = []
|
||||||
self.post_author: List[str] = []
|
self.post_author: List[str] = []
|
||||||
self.downloads: List[str] = []
|
self.downloads: List[str] = []
|
||||||
self.version: str
|
self.version: str = "dev"
|
||||||
self._image_path: str = ""
|
self._image_path: str = ""
|
||||||
self.ignore_updates: bool = False
|
self.ignore_updates: bool = False
|
||||||
self.debug: bool = False
|
self.debug: bool = False
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ def check_for_updates():
|
|||||||
for asset in assets:
|
for asset in assets:
|
||||||
print(f" - {asset['name']}: {asset['browser_download_url']}")
|
print(f" - {asset['name']}: {asset['browser_download_url']}")
|
||||||
return assets, latest_version
|
return assets, latest_version
|
||||||
|
else:
|
||||||
|
return None, None
|
||||||
else:
|
else:
|
||||||
if state.debug:
|
if state.debug:
|
||||||
print("Already up-to-date.")
|
print("Already up-to-date.")
|
||||||
|
|||||||
Reference in New Issue
Block a user