Compare commits

...

4 Commits

Author SHA1 Message Date
Vxrtrauter 26c5410f3f Merge branch 'main' of https://github.com/KeksPirates/SoftwareManager 2026-01-20 17:41:43 +01:00
Vxrtrauter 7067f243ae update appid 2026-01-20 17:39:06 +01:00
Vxrtrauter d82008c9fe fix no item in downloads text 2026-01-20 11:26:49 +01:00
Vxrtrauter 83ff2720c8 add error handling for magnet uri being none 2026-01-20 10:43:02 +01:00
3 changed files with 22 additions and 7 deletions
+17 -4
View File
@@ -93,8 +93,8 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
if platform.system() == "Windows":
try:
import ctypes
myappid = 'SoftwareManager.App.1'
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
appid = 'SoftwareManager'
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid)
except Exception as e:
consoleLog(f"Could not set app ID: {e}")
@@ -147,6 +147,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.downloadList = QTableView()
self.emptyLibrary = QLabel("No items in library.")
self.emptyDownload = QLabel("No items in downloads.")
self.emptyDownload.setAlignment(Qt.AlignCenter)
self.consoleLog = QTextEdit()
self.progressbar = QProgressBar()
@@ -183,7 +184,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
def rowCount(self, parent=QModelIndex()):
return len(state.downloads)
def columnCount(self, parent=QModelIndex()):
return len(self.headers)
@@ -345,6 +346,10 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.download_timer.timeout.connect(lambda: run_thread(threading.Thread(target=self.download_list_update)))
self.download_timer.start(500)
self.active_timer = QTimer()
self.active_timer.timeout.connect(self.show_empty_downloads)
self.active_timer.start(500)
@staticmethod
def add_log(text):
if MainWindow._instance:
@@ -367,6 +372,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
if self.download_model:
self.download_model.layoutAboutToBeChanged.emit()
self.download_model.layoutChanged.emit()
def closeEvent(self, event: QCloseEvent):
closehelper()
@@ -384,9 +390,16 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.qtablewidget.hide()
self.emptyResults.show()
else:
self.emptyResults.hide()
self.qtablewidget.show()
self.emptyResults.hide()
def show_empty_downloads(self):
if len(state.downloads) > 0:
self.emptyDownload.hide()
self.downloadList.show()
else:
self.emptyDownload.show()
self.downloadList.hide()
# thank you claude
def resizeEvent(self, event):
+5 -2
View File
@@ -8,8 +8,11 @@ def start_client():
consoleLog("Started Aria2p")
def add_magnet(uri):
aria2.add_magnet(uri)
consoleLog("Magnet URI added to Aria2")
if uri is not None and uri.startswith("magnet:?"):
aria2.add_magnet(uri)
consoleLog("Magnet URI added to Aria2")
else:
consoleLog(f"Invalid Magnet Link: {uri}")
-1
View File
@@ -1,4 +1,3 @@
from core.utils.data.state import state
from core.utils.general.logs import consoleLog
from core.utils.network.download import run_download_direct