mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-14 03:04:54 -05:00
Fix mtk_gui thread
This commit is contained in:
parent
f1bece6ead
commit
57c0ea0165
1 changed files with 8 additions and 7 deletions
15
mtk_gui.py
15
mtk_gui.py
|
@ -123,7 +123,7 @@ def load_translations(application):
|
|||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
def __init__(self, thread):
|
||||
super(MainWindow, self).__init__()
|
||||
self.readpartitionCheckboxes = None
|
||||
self.ui = Ui_MainWindow()
|
||||
|
@ -142,7 +142,7 @@ class MainWindow(QMainWindow):
|
|||
self.ui.connectInfo.setMinimumSize(200, 500)
|
||||
self.ui.connectInfo.setMaximumSize(9900, 500)
|
||||
self.ui.showdebugbtn.clicked.connect(self.showDebugInfo)
|
||||
|
||||
self.thread = thread
|
||||
self.devhandler = None
|
||||
self.readflash = None
|
||||
|
||||
|
@ -240,7 +240,7 @@ class MainWindow(QMainWindow):
|
|||
|
||||
def initread(self):
|
||||
self.readflash = ReadFlashWindow(self.ui, self, self.devhandler.da_handler, self.sendToLog)
|
||||
thread.sendUpdateSignal.connect(win.updateGui)
|
||||
self.thread.sendUpdateSignal.connect(self.updateGui)
|
||||
self.readflash.enableButtonsSignal.connect(self.enablebuttons)
|
||||
self.readflash.disableButtonsSignal.connect(self.disablebuttons)
|
||||
self.ui.readpartitionsbtn.clicked.connect(self.readflash.dumpPartition)
|
||||
|
@ -509,7 +509,10 @@ def main():
|
|||
app = QApplication(sys.argv)
|
||||
load_translations(app)
|
||||
|
||||
win = MainWindow()
|
||||
loglevel = logging.INFO
|
||||
devhandler = DeviceHandler(parent=app, preloader=None, loglevel=loglevel)
|
||||
thread = asyncThread(parent=app, n=0, function=getDevInfo, parameters=[loglevel, phoneInfo, devhandler])
|
||||
win = MainWindow(thread)
|
||||
|
||||
icon = QIcon()
|
||||
icon.addFile(path.get_images_path('logo_32.png'), QSize(32, 32))
|
||||
|
@ -535,11 +538,9 @@ def main():
|
|||
# win.setFixedSize(746, 400 + addTopMargin)
|
||||
|
||||
# Device setup
|
||||
loglevel = logging.INFO
|
||||
devhandler = DeviceHandler(parent=app, preloader=None, loglevel=loglevel)
|
||||
devhandler.sendToLogSignal.connect(win.sendToLog)
|
||||
# Get the device info
|
||||
thread = asyncThread(parent=app, n=0, function=getDevInfo, parameters=[loglevel, phoneInfo, devhandler])
|
||||
|
||||
thread.sendToLogSignal.connect(win.sendToLog)
|
||||
thread.sendUpdateSignal.connect(win.updateGui)
|
||||
thread.sendToProgressSignal.connect(win.sendToProgress)
|
||||
|
|
Loading…
Reference in a new issue