update version, fix bug / validate flash fw
This commit is contained in:
20
main.py
20
main.py
@@ -28,7 +28,7 @@ from core.ssh_flasher import flash_device_ssh
|
||||
from core.workers import ScanThread, FlashThread
|
||||
|
||||
from utils.network import _resolve_hostname, get_default_network
|
||||
from utils.system import resource_path, get_machine_info
|
||||
from utils.system import resource_path, get_machine_info, get_version
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class App(QWidget):
|
||||
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
layout.addWidget(title)
|
||||
|
||||
copyright_label = QLabel(f"© {datetime.datetime.now().year} Smatec — R&D Software Team. v1.1.0")
|
||||
copyright_label = QLabel(f"© {datetime.datetime.now().year} Smatec — R&D Software Team. v{get_version()}")
|
||||
copyright_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
copyright_label.setStyleSheet(
|
||||
"color: #9399b2; font-size: 11px; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto;"
|
||||
@@ -337,12 +337,12 @@ class App(QWidget):
|
||||
parallel_row.addStretch()
|
||||
flash_layout.addLayout(parallel_row)
|
||||
|
||||
btn_flash = QPushButton("⚡ FLASH SELECTED DEVICES")
|
||||
btn_flash.setObjectName("flash")
|
||||
btn_flash.setMinimumHeight(45)
|
||||
btn_flash.setStyleSheet("QPushButton#flash { font-size: 16px; font-weight: bold; letter-spacing: 1px; }")
|
||||
btn_flash.clicked.connect(self.flash_all)
|
||||
flash_layout.addWidget(btn_flash)
|
||||
self.btn_flash = QPushButton("⚡ FLASH SELECTED DEVICES")
|
||||
self.btn_flash.setObjectName("flash")
|
||||
self.btn_flash.setMinimumHeight(45)
|
||||
self.btn_flash.setStyleSheet("QPushButton#flash { font-size: 16px; font-weight: bold; letter-spacing: 1px; }")
|
||||
self.btn_flash.clicked.connect(self.flash_all)
|
||||
flash_layout.addWidget(self.btn_flash)
|
||||
|
||||
flash_group.setLayout(flash_layout)
|
||||
layout.addWidget(flash_group)
|
||||
@@ -657,6 +657,9 @@ class App(QWidget):
|
||||
self.flash_thread.device_status.connect(self._on_flash_status)
|
||||
self.flash_thread.device_done.connect(self._on_flash_done)
|
||||
self.flash_thread.all_done.connect(self._on_flash_all_done)
|
||||
|
||||
# Disable flash button during flashing
|
||||
self.btn_flash.setEnabled(False)
|
||||
self.flash_thread.start()
|
||||
|
||||
def _on_flash_status(self, index, msg):
|
||||
@@ -690,6 +693,7 @@ class App(QWidget):
|
||||
|
||||
def _on_flash_all_done(self):
|
||||
"""All flashing complete."""
|
||||
self.btn_flash.setEnabled(True)
|
||||
QMessageBox.information(self, "Flash Complete", "All devices have been processed.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user