mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 01:49:42 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 356f3bf070 | |||
| 6ff29e2ea6 | |||
| 847b50ab10 | |||
| 5bc81b5215 |
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
+13
-3
@@ -1,5 +1,4 @@
|
|||||||
from PySide6 import QtWidgets
|
from PySide6 import QtWidgets
|
||||||
from PySide6 import QtCore
|
|
||||||
from PySide6.QtCore import Qt, QTimer, QModelIndex, QAbstractTableModel, Signal
|
from PySide6.QtCore import Qt, QTimer, QModelIndex, QAbstractTableModel, Signal
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QLineEdit,
|
QLineEdit,
|
||||||
@@ -16,7 +15,7 @@ from PySide6.QtWidgets import (
|
|||||||
QHeaderView,
|
QHeaderView,
|
||||||
QMessageBox,
|
QMessageBox,
|
||||||
QTableWidget,
|
QTableWidget,
|
||||||
QTextEdit
|
QTextEdit,
|
||||||
)
|
)
|
||||||
|
|
||||||
from PySide6.QtGui import QIcon, QAction, QCloseEvent, QImage, QPixmap
|
from PySide6.QtGui import QIcon, QAction, QCloseEvent, QImage, QPixmap
|
||||||
@@ -45,7 +44,7 @@ def download_update(latest_version):
|
|||||||
new_filename = f"SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
new_filename = f"SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
||||||
url = f"https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
url = f"https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
||||||
|
|
||||||
consoleLog("Downloading update...")
|
consoleLog("Downloading update...", True)
|
||||||
response = r.get(url, allow_redirects=True)
|
response = r.get(url, allow_redirects=True)
|
||||||
with open(new_filename, "wb") as f:
|
with open(new_filename, "wb") as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
@@ -71,6 +70,15 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
MainWindow._instance = self
|
MainWindow._instance = self
|
||||||
self.log_signal.connect(self._on_log_signal)
|
self.log_signal.connect(self._on_log_signal)
|
||||||
|
self.setWindowIcon(QIcon(os.path.join('core/interface/assets/logo.png')))
|
||||||
|
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
try:
|
||||||
|
import ctypes
|
||||||
|
myappid = 'SoftwareManager.App.1'
|
||||||
|
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
||||||
|
except Exception as e:
|
||||||
|
consoleLog(f"Could not set app ID: {e}")
|
||||||
|
|
||||||
build_info_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "build_info.json")
|
build_info_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "build_info.json")
|
||||||
if os.path.exists(build_info_path):
|
if os.path.exists(build_info_path):
|
||||||
@@ -210,6 +218,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
self.tab2 = create_tab("Library", self.emptyLibrary, self.libraryList, self.tabs, None, None)
|
self.tab2 = create_tab("Library", self.emptyLibrary, self.libraryList, self.tabs, None, None)
|
||||||
self.tab3 = create_tab("Downloads", self.emptyDownload, self.downloadList, self.tabs, None, None)
|
self.tab3 = create_tab("Downloads", self.emptyDownload, self.downloadList, self.tabs, None, None)
|
||||||
|
|
||||||
|
if state.image_path is not None and os.path.exists(state.image_path):
|
||||||
self.image = QImage(state.image_path)
|
self.image = QImage(state.image_path)
|
||||||
self.pixmap = QPixmap.fromImage(self.image)
|
self.pixmap = QPixmap.fromImage(self.image)
|
||||||
self.overlay_label = QLabel(self)
|
self.overlay_label = QLabel(self)
|
||||||
@@ -223,6 +232,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
y = self.height() - self.overlay_label.height() - offset_y
|
y = self.height() - self.overlay_label.height() - offset_y
|
||||||
self.overlay_label.move(x, y)
|
self.overlay_label.move(x, y)
|
||||||
|
|
||||||
|
|
||||||
# temporarily disabled
|
# temporarily disabled
|
||||||
# state.image_changed.connect(self.update_image_overlay)
|
# state.image_changed.connect(self.update_image_overlay)
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ def set_main_window(window):
|
|||||||
global _main_window
|
global _main_window
|
||||||
_main_window = window
|
_main_window = window
|
||||||
|
|
||||||
def consoleLog(text):
|
def consoleLog(text, printAnyways = False):
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
current_time = now.strftime("%H:%M:%S")
|
current_time = now.strftime("%H:%M:%S")
|
||||||
|
|
||||||
@@ -175,5 +175,5 @@ def consoleLog(text):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if state.debug:
|
if state.debug or printAnyways:
|
||||||
print(f"[{current_time}] {text}")
|
print(f"[{current_time}] {text}")
|
||||||
Reference in New Issue
Block a user