mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d057624548 | |||
| 81f7970c47 | |||
| 6a41ac44c9 | |||
| 26c5410f3f | |||
| 7067f243ae | |||
| d82008c9fe |
@@ -24,7 +24,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-22.04
|
||||||
artifact_name: SoftwareManager-dev-${{ github.sha }}-linux
|
artifact_name: SoftwareManager-dev-${{ github.sha }}-linux
|
||||||
asset_name: SoftwareManager-dev-${{ github.sha }}-linux
|
asset_name: SoftwareManager-dev-${{ github.sha }}-linux
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
@@ -159,7 +159,7 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
name: Create Release
|
name: Create Release
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -172,7 +172,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
SHORT_SHA="${{ needs.build.outputs.short_sha }}"
|
SHORT_SHA="${{ needs.build.outputs.short_sha }}"
|
||||||
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-*-linux release/SoftwareManager-dev-${SHORT_SHA}-linux
|
cp artifacts/ubuntu-22.04-build/SoftwareManager-dev-*-linux release/SoftwareManager-dev-${SHORT_SHA}-linux
|
||||||
cp artifacts/windows-latest-build/SoftwareManager-dev-*-windows.exe release/SoftwareManager-dev-${SHORT_SHA}-windows.exe
|
cp artifacts/windows-latest-build/SoftwareManager-dev-*-windows.exe release/SoftwareManager-dev-${SHORT_SHA}-windows.exe
|
||||||
cp artifacts/macos-latest-build/SoftwareManager-dev-*-macos release/SoftwareManager-dev-${SHORT_SHA}-macos
|
cp artifacts/macos-latest-build/SoftwareManager-dev-*-macos release/SoftwareManager-dev-${SHORT_SHA}-macos
|
||||||
chmod +x release/SoftwareManager-dev-*-linux release/SoftwareManager-dev-*-macos
|
chmod +x release/SoftwareManager-dev-*-linux release/SoftwareManager-dev-*-macos
|
||||||
@@ -207,4 +207,4 @@ jobs:
|
|||||||
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-windows.exe
|
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-windows.exe
|
||||||
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-macos
|
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-macos
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
+22
-11
@@ -93,8 +93,8 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
try:
|
try:
|
||||||
import ctypes
|
import ctypes
|
||||||
myappid = 'SoftwareManager.App.1'
|
appid = 'SoftwareManager'
|
||||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
consoleLog(f"Could not set app ID: {e}")
|
consoleLog(f"Could not set app ID: {e}")
|
||||||
|
|
||||||
@@ -147,6 +147,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
self.downloadList = QTableView()
|
self.downloadList = QTableView()
|
||||||
self.emptyLibrary = QLabel("No items in library.")
|
self.emptyLibrary = QLabel("No items in library.")
|
||||||
self.emptyDownload = QLabel("No items in downloads.")
|
self.emptyDownload = QLabel("No items in downloads.")
|
||||||
|
self.emptyDownload.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
self.consoleLog = QTextEdit()
|
self.consoleLog = QTextEdit()
|
||||||
self.progressbar = QProgressBar()
|
self.progressbar = QProgressBar()
|
||||||
@@ -183,7 +184,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
|
|
||||||
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)
|
||||||
|
|
||||||
@@ -209,9 +210,11 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
elif col == 4:
|
elif col == 4:
|
||||||
return f"{download.download_speed_string()}"
|
return f"{download.download_speed_string()}"
|
||||||
elif col == 5:
|
elif col == 5:
|
||||||
pass
|
return f"{download.completed_length_string()}"
|
||||||
elif col == 6:
|
elif col == 6:
|
||||||
return f"{download.total_length_string()}"
|
return f"{download.total_length_string()}"
|
||||||
|
elif col == 7:
|
||||||
|
return f"{download.eta_string()}"
|
||||||
|
|
||||||
if role == Qt.UserRole and col == 0:
|
if role == Qt.UserRole and col == 0:
|
||||||
return download.is_paused
|
return download.is_paused
|
||||||
@@ -222,8 +225,10 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
download = state.downloads[row]
|
download = state.downloads[row]
|
||||||
if download.is_paused:
|
if download.is_paused:
|
||||||
download.resume()
|
download.resume()
|
||||||
|
consoleLog(f"Resumed download: {download.name}", True)
|
||||||
else:
|
else:
|
||||||
download.pause()
|
download.pause()
|
||||||
|
consoleLog(f"Paused download: {download.name}", True)
|
||||||
idx = self.index(row, 0)
|
idx = self.index(row, 0)
|
||||||
self.dataChanged.emit(idx, idx, [Qt.DisplayRole, Qt.UserRole])
|
self.dataChanged.emit(idx, idx, [Qt.DisplayRole, Qt.UserRole])
|
||||||
|
|
||||||
@@ -265,12 +270,6 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
def on_pause_resume_clicked(row):
|
def on_pause_resume_clicked(row):
|
||||||
download_model.toggle_pause_resume(row)
|
download_model.toggle_pause_resume(row)
|
||||||
|
|
||||||
download = state.downloads[row]
|
|
||||||
if download.is_paused:
|
|
||||||
download.pause()
|
|
||||||
else:
|
|
||||||
download.resume()
|
|
||||||
|
|
||||||
delegate = PauseResumeDelegate(self.downloadList)
|
delegate = PauseResumeDelegate(self.downloadList)
|
||||||
self.downloadList.setItemDelegateForColumn(0, delegate)
|
self.downloadList.setItemDelegateForColumn(0, delegate)
|
||||||
delegate.clicked.connect(on_pause_resume_clicked)
|
delegate.clicked.connect(on_pause_resume_clicked)
|
||||||
@@ -345,6 +344,10 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
self.download_timer.timeout.connect(lambda: run_thread(threading.Thread(target=self.download_list_update)))
|
self.download_timer.timeout.connect(lambda: run_thread(threading.Thread(target=self.download_list_update)))
|
||||||
self.download_timer.start(500)
|
self.download_timer.start(500)
|
||||||
|
|
||||||
|
self.active_timer = QTimer()
|
||||||
|
self.active_timer.timeout.connect(self.show_empty_downloads)
|
||||||
|
self.active_timer.start(500)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_log(text):
|
def add_log(text):
|
||||||
if MainWindow._instance:
|
if MainWindow._instance:
|
||||||
@@ -367,6 +370,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
if self.download_model:
|
if self.download_model:
|
||||||
self.download_model.layoutAboutToBeChanged.emit()
|
self.download_model.layoutAboutToBeChanged.emit()
|
||||||
self.download_model.layoutChanged.emit()
|
self.download_model.layoutChanged.emit()
|
||||||
|
|
||||||
|
|
||||||
def closeEvent(self, event: QCloseEvent):
|
def closeEvent(self, event: QCloseEvent):
|
||||||
closehelper()
|
closehelper()
|
||||||
@@ -384,9 +388,16 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
self.qtablewidget.hide()
|
self.qtablewidget.hide()
|
||||||
self.emptyResults.show()
|
self.emptyResults.show()
|
||||||
else:
|
else:
|
||||||
self.emptyResults.hide()
|
|
||||||
self.qtablewidget.show()
|
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
|
# thank you claude
|
||||||
def resizeEvent(self, event):
|
def resizeEvent(self, event):
|
||||||
|
|||||||
Reference in New Issue
Block a user