Compare commits

..

5 Commits

Author SHA1 Message Date
KeksNino 59e45efbb6 fix aria2c dependency in pyinstaller 2025-10-25 21:59:29 +02:00
KeksNino 27f0a3f71d fix wget path on windows in workflows 2025-10-25 21:57:31 +02:00
KeksNino 1d500305f7 add aria2c dependency to exe binary on windows 2025-10-25 21:52:39 +02:00
Vxrtrauter 20a310264f Merge branch 'main' of https://github.com/KeksPirates/SoftwareManager 2025-10-24 10:51:51 +02:00
Vxrtrauter aee8f16353 rm unused import 2025-10-24 10:50:52 +02:00
2 changed files with 27 additions and 21 deletions
+8 -1
View File
@@ -90,9 +90,16 @@ jobs:
}' }'
$json | Out-File -Encoding utf8 build_info.json $json | Out-File -Encoding utf8 build_info.json
- name: Download aria2c (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p deps
C:\msys64\usr\bin\wget.exe https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0-win-64bit-build1.zip
unzip -j aria2-1.37.0-win-64bit-build1.zip aria2-1.37.0-win-64bit-build1/aria2c.exe -d deps/
- name: Build executable with PyInstaller (Windows) - name: Build executable with PyInstaller (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: pyinstaller --onefile --windowed --add-data "build_info.json:." --name ${{ env.APP_NAME }} main.py run: pyinstaller --onefile --windowed --add-data "build_info.json:." --add-data "deps/aria2c.exe:." --name ${{ env.APP_NAME }} main.py
- name: Build executable with PyInstaller (Unix) - name: Build executable with PyInstaller (Unix)
if: runner.os != 'Windows' if: runner.os != 'Windows'
+19 -20
View File
@@ -3,14 +3,14 @@ from PySide6 import QtCore
from PySide6.QtCore import Qt, QTimer, QModelIndex, QAbstractTableModel from PySide6.QtCore import Qt, QTimer, QModelIndex, QAbstractTableModel
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QLineEdit, QLineEdit,
QTableView, QTableView,
QWidget, QWidget,
QVBoxLayout, QVBoxLayout,
QListWidget, QListWidget,
QToolBar, QToolBar,
QLabel, QLabel,
QHBoxLayout, QHBoxLayout,
QComboBox, QComboBox,
QTabWidget, QTabWidget,
QProgressBar, QProgressBar,
QHeaderView, QHeaderView,
@@ -38,7 +38,6 @@ from core.interface.utils.searchhelper import return_pressed
from core.interface.dialogs.settings import settings_dialog from core.interface.dialogs.settings import settings_dialog
from core.network.aria2_integration import dlprogress from core.network.aria2_integration import dlprogress
print(os.path.abspath(__file__))
def download_update(latest_version): def download_update(latest_version):
old_filename = f"SoftwareManager-dev-{state.version.replace('-dev', '')}-windows.exe" old_filename = f"SoftwareManager-dev-{state.version.replace('-dev', '')}-windows.exe"
@@ -52,11 +51,12 @@ def download_update(latest_version):
with open(new_filename, "wb") as f: with open(new_filename, "wb") as f:
f.write(response.content) f.write(response.content)
if not os.path.exists(new_filename): if not os.path.exists(new_filename):
raise FileNotFoundError(f"Executable not found") raise FileNotFoundError("Executable not found")
subprocess.Popen([new_filename], shell=True) subprocess.Popen([new_filename], shell=True)
time.sleep(0.5) time.sleep(0.5)
sys.exit(0) sys.exit(0)
class MainWindow(QtWidgets.QMainWindow, QWidget): class MainWindow(QtWidgets.QMainWindow, QWidget):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@@ -77,7 +77,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
msg = QMessageBox() msg = QMessageBox()
msg.setIcon(QMessageBox.Information) msg.setIcon(QMessageBox.Information)
msg.setWindowTitle("Update Available") msg.setWindowTitle("Update Available")
msg.setText(f"A new version is available.") msg.setText("A new version is available.")
msg.setInformativeText("Please visit the GitHub releases page to download the latest version.") msg.setInformativeText("Please visit the GitHub releases page to download the latest version.")
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Ignore) msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Ignore)
@@ -97,7 +97,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.searchbar.setClearButtonEnabled(True) self.searchbar.setClearButtonEnabled(True)
self.searchbar.setMinimumHeight(30) self.searchbar.setMinimumHeight(30)
self.searchbar.returnPressed.connect(lambda: run_thread(threading.Thread(target=return_pressed, args=(self,)))) # Triggers data function thread on enter self.searchbar.returnPressed.connect(lambda: run_thread(threading.Thread(target=return_pressed, args=(self,)))) # Triggers data function thread on enter
self.dlbutton = QtWidgets.QPushButton("Download") self.dlbutton = QtWidgets.QPushButton("Download")
self.libraryList = QListWidget() self.libraryList = QListWidget()
@@ -105,7 +105,6 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.emptyResults.setAlignment(Qt.AlignCenter) self.emptyResults.setAlignment(Qt.AlignCenter)
self.emptyResults.hide() self.emptyResults.hide()
self.download_model = None self.download_model = None
self.downloadList = QTableView() self.downloadList = QTableView()
self.emptyLibrary = QLabel("No items in library.") self.emptyLibrary = QLabel("No items in library.")
@@ -134,13 +133,13 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.headers = ["Name", "Status", "Progress", "Speed", "Size", "Total Size"] self.headers = ["Name", "Status", "Progress", "Speed", "Size", "Total Size"]
def rowCount(self, parent=QModelIndex()): def rowCount(self, parent=QModelIndex()):
return len(state.downloads) return len(state.downloads)
def columnCount(self, parent=QModelIndex()): def columnCount(self, parent=QModelIndex()):
return len(self.headers) return len(self.headers)
def headerData(self, section, orientation, role=Qt.DisplayRole): def headerData(self, section, orientation, role=Qt.DisplayRole):
if role == Qt.DisplayRole and orientation == Qt.Horizontal: if role == Qt.DisplayRole and orientation == Qt.Horizontal:
return self.headers[section] return self.headers[section]
@@ -150,7 +149,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
if role == Qt.DisplayRole: if role == Qt.DisplayRole:
download = state.downloads[index.row()] download = state.downloads[index.row()]
col = index.column() col = index.column()
if col == 0: if col == 0:
return download.name return download.name
elif col == 1: elif col == 1:
@@ -185,12 +184,12 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.horizontal_layout = QHBoxLayout() self.horizontal_layout = QHBoxLayout()
self.horizontal_layout.addWidget(self.emptyResults, stretch=3) self.horizontal_layout.addWidget(self.emptyResults, stretch=3)
self.horizontal_layout.addWidget(self.qtablewidget) self.horizontal_layout.addWidget(self.qtablewidget)
self.tab1 = create_tab("Search", self.searchbar, self.qtablewidget, self.tabs, self.dlbutton, self.horizontal_layout) self.tab1 = create_tab("Search", self.searchbar, self.qtablewidget, self.tabs, self.dlbutton, self.horizontal_layout)
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)
containerLayout.addWidget(self.tabs) containerLayout.addWidget(self.tabs)
@@ -199,7 +198,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
toolbar = QToolBar("Main Toolbar") toolbar = QToolBar("Main Toolbar")
self.addToolBar(toolbar) self.addToolBar(toolbar)
toolbar.setLayoutDirection(Qt.RightToLeft) toolbar.setLayoutDirection(Qt.RightToLeft)
self.tracker_list = QComboBox() self.tracker_list = QComboBox()
self.tracker_list.addItems(["rutracker", "uztracker", "m0nkrus"]) self.tracker_list.addItems(["rutracker", "uztracker", "m0nkrus"])
self.tracker_list.activated.connect(self.set_tracker) self.tracker_list.activated.connect(self.set_tracker)
@@ -217,7 +216,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.progressbar.setValue(0) self.progressbar.setValue(0)
containerLayout.addWidget(self.progressbar) containerLayout.addWidget(self.progressbar)
self.progress_timer = QTimer() self.progress_timer = QTimer()
self.progress_timer.timeout.connect(lambda: run_thread(threading.Thread(target=self.update_progress))) self.progress_timer.timeout.connect(lambda: run_thread(threading.Thread(target=self.update_progress)))
self.progress_timer.start(1000) self.progress_timer.start(1000)