Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Combobox.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PyQt5.QtWidgets import QComboBox,QListView
from PyQt5.QtCore import pyqtSignal
from PyQt6.QtWidgets import QComboBox, QListView
from PyQt6.QtCore import pyqtSignal


class ComboBox(QComboBox):
Expand Down
2 changes: 1 addition & 1 deletion helpAbout.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def strAbout():
<br>
<b>'''+tr("About")+''':</b>
<br><br>
'''+tr("Release with")+" Python" +str(py_version[0]+py_version[1]/10)+ ''' + PyQt5<br><br>
'''+tr("Release with")+" Python" +str(py_version[0]+py_version[1]/10)+ ''' + PyQt6<br><br>
<div><div>'''+parameters.appName+" "+tr("is a Open source project created by")+''' </div><a style="vertical-align: middle;" href="http://www.sipeed.com"><img src="'''+strPath+"/"+parameters.appLogo2+'''" width=109 height=32></img></a><br></div>
''' +tr("Author")+":"+parameters.author+'''<br><br>

Expand Down
35 changes: 18 additions & 17 deletions kflash_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
import json, zipfile, struct, hashlib

# from COMTool.wave import Wave
from PyQt5.QtCore import pyqtSignal,Qt
from PyQt5.QtWidgets import (QApplication, QWidget,QToolTip,QPushButton,QMessageBox,QDesktopWidget,QMainWindow,
QVBoxLayout,QHBoxLayout,QGridLayout,QLabel,
QLineEdit,QGroupBox,QSplitter,QFileDialog,QCheckBox,
from PyQt6.QtCore import pyqtSignal
from PyQt6.QtWidgets import (QApplication, QWidget, QToolTip, QPushButton, QMessageBox, QMainWindow,
QVBoxLayout, QHBoxLayout, QGridLayout, QLabel,
QLineEdit, QGroupBox, QFileDialog, QCheckBox,
QProgressBar)
from PyQt5.QtGui import QIcon,QFont,QTextCursor,QPixmap
from PyQt6.QtGui import QIcon, QFont, QPixmap

import serial
import serial.tools.list_ports
import threading
Expand Down Expand Up @@ -381,7 +382,7 @@ def initWindow(self):
self.setWindowTitle(parameters.appName+" V"+str(helpAbout.versionMajor)+"."+str(helpAbout.versionMinor))
icon = QIcon()
print("icon path:"+self.DataPath+"/"+parameters.appIcon)
icon.addPixmap(QPixmap(self.DataPath+"/"+parameters.appIcon), QIcon.Normal, QIcon.Off)
icon.addPixmap(QPixmap(self.DataPath+"/"+parameters.appIcon), QIcon.Mode.Normal, QIcon.State.Off)
self.setWindowIcon(icon)
if sys.platform == "win32":
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(parameters.appName)
Expand Down Expand Up @@ -444,10 +445,11 @@ def portComboboxClicked(self):

def MoveToCenter(self):
qr = self.frameGeometry()
cp = QDesktopWidget().availableGeometry().center()
screen = QApplication.primaryScreen()
cp = screen.availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())

def changeFunc(self):
if self.burning or self.packing or self.erasing:
self.hintSignal.emit(tr("Busy"), tr("Busy"))
Expand Down Expand Up @@ -579,10 +581,10 @@ def erase(self):

self.eraseStatus.setText("<font color=%s>%s</font>" %("#0eb40e", tr("Preparing Erase") ))
eraseThread = threading.Thread(target=self.eraseProcess, args=(addr, length, config['dev'], config['baud'], config['board'], config['color'], config['slow']))
eraseThread.setDaemon(True)
eraseThread.daemon = True
eraseThread.start()
eraseStatusThread = threading.Thread(target=self.updateEraseStatus, args=(length_text, unit, eraseTimeEstimate))
eraseStatusThread.setDaemon(True)
eraseStatusThread.daemon = True
eraseStatusThread.start()

def setEraseButton(self, cancel):
Expand Down Expand Up @@ -874,7 +876,7 @@ def packFiles(self):

# pack and save
t = threading.Thread(target=self.packFileProccess, args=(files, fileName_choose,))
t.setDaemon(True)
t.daemon = True
t.start()

def packFileProccess(self, files, fileSaveName):
Expand Down Expand Up @@ -975,7 +977,7 @@ def mergeBin(self):

# pack and save
t = threading.Thread(target=self.mergeBinProccess, args=(files, fileName_choose,))
t.setDaemon(True)
t.daemon = True
t.start()

def mergeBinProccess(self, files, fileSaveName):
Expand Down Expand Up @@ -1060,7 +1062,7 @@ def detectSerialPort(self):
if not self.isDetectSerialPort:
self.isDetectSerialPort = True
t = threading.Thread(target=self.detectSerialPortProcess)
t.setDaemon(True)
t.daemon = True
t.start()

def showCombobox(self):
Expand Down Expand Up @@ -1320,7 +1322,7 @@ def download(self):
self.progressHint.setText(hint)
# download
burnThread = threading.Thread(target=self.flashBurnProcess, args=(config['dev'], config['baud'], config['board'], config['sram'], fileType, filesInfo, self.progress, config['color'], config['slow'], config['iomode']))
burnThread.setDaemon(True)
burnThread.daemon = True
burnThread.start()

def flashBurnProcess(self, dev, baud, board, sram, fileType, files, callback, color, slow, io_mode):
Expand Down Expand Up @@ -1415,10 +1417,9 @@ def main():
app.setStyleSheet(qss)
mainWindow.detectSerialPort()
t = threading.Thread(target=mainWindow.autoUpdateDetect)
t.setDaemon(True)
t.daemon = True
t.start()
sys.exit(app.exec_())

sys.exit(app.exec())
if __name__ == '__main__':
main()

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bs4>=0.0.1
pyelftools>=0.28
pyinstaller>=5.1
PyQt5>=5.15.7
PyQt6>=6.8.0
pyserial>=3.5
requests>=2.28.0
tinyaes>=1.0.3
Expand Down
Loading