Small gui improvements in phone information displayment.

This commit is contained in:
cygnusx 2022-01-17 11:45:59 +01:00
parent 72c927e08e
commit 4543fc713c
3 changed files with 47 additions and 16 deletions

18
mtk_gui
View file

@ -218,11 +218,15 @@ class MainWindow(QMainWindow):
@Slot(int)
def updateProgress(self, progress):
if self.Status["rpmb"]:
self.Status["currentPartitionSizeDone"] = progress
else:
self.Status["currentPartitionSizeDone"] = progress * self.devhandler.da_handler.mtk.daloader.progress.pagesize
self.updateState()
try:
if self.Status["rpmb"]:
self.Status["currentPartitionSizeDone"] = progress
else:
self.Status["currentPartitionSizeDone"] = progress * self.devhandler.da_handler.mtk.daloader.progress.pagesize
self.updateState()
except:
pass
def setdevhandler(self, devhandler):
self.devhandler = devhandler
@ -277,7 +281,7 @@ class MainWindow(QMainWindow):
@Slot(str)
def update_status_text(self, text):
self.ui.phoneInfoTextbox.setText(text)
self.ui.phoneDebugInfoTextbox.setText(text)
@Slot()
def disablebuttons(self):
@ -480,6 +484,7 @@ class MainWindow(QMainWindow):
def updateGui(self):
global phoneInfo
phoneInfo['chipset'] = phoneInfo['chipset'].replace("()", "")
if phoneInfo['cdcInit'] and phoneInfo['bootMode'] == "":
self.ui.phoneInfoTextbox.setText(QCoreApplication.translate("main","Phone detected:\nReading model info..."))
else:
@ -491,6 +496,7 @@ class MainWindow(QMainWindow):
#self.ui.status.setText(QCoreApplication.translate("main","Device connected :)"))
self.ui.menubar.setEnabled(True)
self.pixmap = QPixmap(path.get_images_path("phone_connected.png"))
self.ui.phoneDebugInfoTextbox.setText("")
self.ui.pic.setPixmap(self.pixmap)
self.spinnerAnim.stop()
self.ui.spinner_pic.setHidden(True)

View file

@ -279,6 +279,14 @@ class Ui_MainWindow(object):
self.verticalLayout_7.addWidget(self.phoneInfoTextbox)
self.phoneDebugInfoTextbox = QLabel(self.centralwidget)
self.phoneDebugInfoTextbox.setObjectName(u"phoneDebugInfoTextbox")
self.phoneDebugInfoTextbox.setStyleSheet(u"color:#888;")
self.phoneDebugInfoTextbox.setTextFormat(Qt.PlainText)
self.phoneDebugInfoTextbox.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter)
self.verticalLayout_7.addWidget(self.phoneDebugInfoTextbox)
self.horizontalLayout_2 = QHBoxLayout()
self.horizontalLayout_2.setSpacing(0)
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
@ -286,11 +294,11 @@ class Ui_MainWindow(object):
self.horizontalLayout_2.addItem(self.horizontalSpacer_8)
self.pushButton = QPushButton(self.centralwidget)
self.pushButton.setObjectName(u"pushButton")
self.pushButton.setMaximumSize(QSize(200, 16777215))
self.consettingsbtn = QPushButton(self.centralwidget)
self.consettingsbtn.setObjectName(u"consettingsbtn")
self.consettingsbtn.setMaximumSize(QSize(200, 16777215))
self.horizontalLayout_2.addWidget(self.pushButton)
self.horizontalLayout_2.addWidget(self.consettingsbtn)
self.verticalLayout_7.addLayout(self.horizontalLayout_2)
@ -422,7 +430,7 @@ class Ui_MainWindow(object):
self.writepartitionList.setWidgetResizable(True)
self.scrollAreaWidgetContents_2 = QWidget()
self.scrollAreaWidgetContents_2.setObjectName(u"scrollAreaWidgetContents_2")
self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 547, 286))
self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 98, 278))
self.writepartitionList.setWidget(self.scrollAreaWidgetContents_2)
self.gridLayout_6.addWidget(self.writepartitionList, 1, 0, 2, 1)
@ -453,7 +461,7 @@ class Ui_MainWindow(object):
self.erasepartitionList.setWidgetResizable(True)
self.scrollAreaWidgetContents_3 = QWidget()
self.scrollAreaWidgetContents_3.setObjectName(u"scrollAreaWidgetContents_3")
self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 570, 278))
self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 98, 278))
self.erasepartitionList.setWidget(self.scrollAreaWidgetContents_3)
self.gridLayout_5.addWidget(self.erasepartitionList, 2, 0, 2, 1)
@ -742,7 +750,8 @@ class Ui_MainWindow(object):
self.logoPic.setText("")
self.copyrightInfo.setText(QCoreApplication.translate("MainWindow", u"<b>Made by:</b> Bjoern Kerler<br/><b>Gui by:</b> Geert-Jan Kreileman<br/><br/><b>Credits:</b><br/>kamakiri [xyzz]<br/>linecode exploit [chimera]<br/>Chaosmaster<br/>and all contributers</p>", None))
self.phoneInfoTextbox.setText(QCoreApplication.translate("MainWindow", u"No phone detected.", None))
self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Connection settings", None))
self.phoneDebugInfoTextbox.setText("")
self.consettingsbtn.setText(QCoreApplication.translate("MainWindow", u"Connection settings", None))
self.pic.setText("")
self.spinner_pic.setText("")
self.readDumpGPTCheckbox.setText(QCoreApplication.translate("MainWindow", u"Dump GPT", None))

View file

@ -510,6 +510,22 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="phoneDebugInfoTextbox">
<property name="styleSheet">
<string notr="true">color:#888;</string>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0">
<property name="spacing">
@ -846,8 +862,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>547</width>
<height>286</height>
<width>98</width>
<height>278</height>
</rect>
</property>
</widget>
@ -905,7 +921,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<width>98</width>
<height>278</height>
</rect>
</property>