Bump version to 0.6.5 and enhance update download functionality
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
- Updated version number in __init__.py to 0.6.5. - Modified the download_update method in updater.py to accept a progress_callback for tracking download progress. - Implemented chunked downloading in _download_file to report progress via the callback. - Adjusted installer launching logic in updater.py to handle MSI files correctly using msiexec. - Connected download progress signal in main_window.py to update the downloading dialog.
This commit is contained in:
parent
fba25534d9
commit
9609a12ae7
9 changed files with 2930 additions and 2884 deletions
|
|
@ -1519,6 +1519,7 @@ class MainWindow(QMainWindow):
|
|||
# Connect signals
|
||||
worker.download_complete.connect(self._on_download_complete)
|
||||
worker.download_failed.connect(self._on_download_failed)
|
||||
worker.download_progress.connect(self._on_download_progress)
|
||||
worker.update_status.connect(self._on_update_status)
|
||||
worker.finished.connect(thread.quit)
|
||||
worker.finished.connect(worker.deleteLater)
|
||||
|
|
@ -1620,6 +1621,16 @@ class MainWindow(QMainWindow):
|
|||
f"Could not download the update:\n\n{error}\n\nPlease try again later.",
|
||||
)
|
||||
|
||||
def _on_download_progress(self, downloaded: int, total: int) -> None:
|
||||
"""Forward download progress to the downloading dialog.
|
||||
|
||||
Args:
|
||||
downloaded: Bytes downloaded so far
|
||||
total: Total bytes (0 if unknown)
|
||||
"""
|
||||
if hasattr(self, "downloading_dialog") and self.downloading_dialog:
|
||||
self.downloading_dialog.set_progress(downloaded, total)
|
||||
|
||||
def _do_install(self, installer_path: Path) -> None:
|
||||
"""Execute the installer.
|
||||
|
||||
|
|
@ -1718,6 +1729,7 @@ class UpdateDownloadWorker(QObject):
|
|||
# Define signals at class level
|
||||
download_complete = Signal(Path) # Emits installer_path
|
||||
download_failed = Signal(str) # Emits error message
|
||||
download_progress = Signal(int, int) # Emits (bytes_downloaded, total_bytes)
|
||||
update_status = Signal(str, str) # Emits (status_text, emoji)
|
||||
finished = Signal()
|
||||
|
||||
|
|
@ -1749,7 +1761,15 @@ class UpdateDownloadWorker(QObject):
|
|||
# Download with 5 minute timeout (300 seconds)
|
||||
logger.info("Starting download with 5-minute timeout")
|
||||
installer_path = loop.run_until_complete(
|
||||
asyncio.wait_for(self.manager.download_update(self.release), timeout=300)
|
||||
asyncio.wait_for(
|
||||
self.manager.download_update(
|
||||
self.release,
|
||||
progress_callback=lambda cur, tot: self.download_progress.emit(
|
||||
cur, tot
|
||||
),
|
||||
),
|
||||
timeout=300,
|
||||
)
|
||||
)
|
||||
|
||||
if not installer_path:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue