Compare commits

..

5 Commits

Author SHA1 Message Date
Vxrtrauter 6432511639 Merge branch 'main' of https://github.com/KeksPirates/SoftwareManager 2026-01-31 05:04:28 +01:00
Vxrtrauter 054e1d0aa5 add error handling for update_settings 2026-01-31 05:04:26 +01:00
KeksNino 6f7a9e13f4 switch to uv for github workflow to improve workflow time 2026-01-31 05:00:47 +01:00
Vxrtrauter 89de75c3d7 link update_settings to settings dialog 2026-01-31 04:52:38 +01:00
Vxrtrauter f41520e595 fixed minor issues 2026-01-31 04:42:15 +01:00
4 changed files with 26 additions and 21 deletions
+10 -18
View File
@@ -44,30 +44,22 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Install system dependencies (Linux) - name: Install uv
if: runner.os == 'Linux' uses: astral-sh/setup-uv@v7
run: | with:
sudo apt-get update version: "0.9.7"
sudo apt-get install -y \ enable-cache: true
libxcb-xinerama0 \
libxkbcommon-x11-0 \
libxcb-cursor0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-shape0 \
libxcb-util1
- name: Install Python dependencies - name: Install Python dependencies
run: | run: |
python -m pip install --upgrade pip uv pip install -r requirements.txt
pip install -r requirements.txt uv pip install pyinstaller backports.tarfile pillow
pip install pyinstaller backports.tarfile pillow env:
UV_SYSTEM_PYTHON: 1
- name: Generate version - name: Generate version
id: version id: version
+11 -3
View File
@@ -197,6 +197,9 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
def data(self, index, role=Qt.DisplayRole): def data(self, index, role=Qt.DisplayRole):
if role == Qt.DisplayRole: if role == Qt.DisplayRole:
col = index.column() col = index.column()
if index.row() >= len(state.active_downloads) or index.row() < 0:
return None
magnet_link = list(state.active_downloads.keys())[index.row()] magnet_link = list(state.active_downloads.keys())[index.row()]
magnetdl = state.active_downloads[magnet_link] magnetdl = state.active_downloads[magnet_link]
@@ -263,6 +266,10 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
return None return None
def toggle_pause_resume(self, row): def toggle_pause_resume(self, row):
if row >= len(state.active_downloads) or row < 0:
return
magnet_link = list(state.active_downloads.keys())[row] magnet_link = list(state.active_downloads.keys())[row]
magnetdl = state.active_downloads[magnet_link] magnetdl = state.active_downloads[magnet_link]
status = magnetdl.status() status = magnetdl.status()
@@ -291,10 +298,9 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
clicked = Signal(int) clicked = Signal(int)
def setEditorData(self, editor, index): def setEditorData(self, editor, index):
download = state.downloads[index.row()]
button = editor.findChild(QtWidgets.QPushButton) button = editor.findChild(QtWidgets.QPushButton)
paused = index.data(Qt.UserRole)
magnet_link = list(state.active_downloads.keys())[index.row()] magnet_link = list(state.active_downloads.keys())[index.row()]
magnetdl = state.active_downloads[magnet_link] magnetdl = state.active_downloads[magnet_link]
@@ -309,7 +315,9 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
def createEditor(self, parent, option, index): def createEditor(self, parent, option, index):
download = state.downloads[index.row()] magnet_link = list(state.active_downloads.keys())[index.row()]
magnetdl = state.active_downloads[magnet_link]
status = magnetdl.status()
widget = QWidget(parent) widget = QWidget(parent)
widget.setStyleSheet("border: none;") widget.setStyleSheet("border: none;")
+3
View File
@@ -89,6 +89,9 @@ def dl_status_loop():
def update_settings(): def update_settings():
if state.dl_session is None:
return
settings = { settings = {
"upload_rate_limit": state.up_speed_limit, "upload_rate_limit": state.up_speed_limit,
"download_rate_limit": state.down_speed_limit, "download_rate_limit": state.down_speed_limit,
+2
View File
@@ -1,3 +1,4 @@
from core.network.libtorrent_int import update_settings
from core.utils.data.state import state from core.utils.data.state import state
from .config import create_config from .config import create_config
@@ -20,5 +21,6 @@ def save_settings(close=lambda: None, apiurl=None, download_path=None, down_spee
if max_downloads is not None: if max_downloads is not None:
state.max_downloads = max_downloads state.max_downloads = max_downloads
update_settings()
create_config() create_config()
close() close()