mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
feat: QoL features to Updater, workflow trigger.
This commit is contained in:
@@ -205,11 +205,9 @@ def _download_update(assets):
|
||||
time.sleep(1)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def windowCloseHelper():
|
||||
QGuiApplication.quit()
|
||||
|
||||
|
||||
class ElidedItemDelegate(QStyledItemDelegate):
|
||||
def __init__(self, get_hovered_row, parent=None):
|
||||
super().__init__(parent)
|
||||
@@ -274,13 +272,13 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
||||
state.version = build_info.get("version")
|
||||
|
||||
if state.ignore_updates is False and platform.system() == "Windows":
|
||||
assets = get_updates()
|
||||
assets, latest = get_updates()
|
||||
if assets != None:
|
||||
msg = QMessageBox()
|
||||
msg.setIcon(QMessageBox.Icon.Information)
|
||||
msg.setWindowTitle("Update Available")
|
||||
msg.setText("A new version is available.")
|
||||
msg.setInformativeText("Press Ok to download the update.")
|
||||
msg.setText(f"A new version is available\n({latest})")
|
||||
msg.setInformativeText("Press Ok to download.")
|
||||
msg.setStandardButtons(QMessageBox.StandardButton.Ok | QMessageBox.StandardButton.Ignore)
|
||||
response = msg.exec_()
|
||||
if response == QMessageBox.StandardButton.Ok:
|
||||
|
||||
@@ -4,7 +4,6 @@ from core.utils.logging.logs import consoleLog
|
||||
|
||||
def get_updates():
|
||||
url = f"https://api.github.com/repos/KeksPirates/SoftwareManager/releases/latest"
|
||||
|
||||
try:
|
||||
response = requests.get(url, timeout=15)
|
||||
except requests.RequestException as e:
|
||||
@@ -33,9 +32,9 @@ def get_updates():
|
||||
url=asset['browser_download_url'],
|
||||
hash=asset.get('digest')
|
||||
))
|
||||
return release_assets
|
||||
return release_assets, latest_version
|
||||
else:
|
||||
return None
|
||||
return None, None
|
||||
else:
|
||||
consoleLog("Already up-to-date.")
|
||||
return None
|
||||
return None, None
|
||||
|
||||
Reference in New Issue
Block a user