From ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Fri, 8 Mar 2013 00:00:52 +1100 Subject: - Removed legacy command line hard-coded partition name parameters. - As a result of the above two points, there are no "known boot partitions", and hence boot partitions are not automatically flashed last. - Made partitions flash in the order in order in which partition arguments are specified. Hence, it's recommended that you specify boot partitions last. - Added --usb-level argument that can be used for debugging libusbx, or flashing issues in general. - Removed generally non-functional firmware dumping behaviour. - Removed auto-resume functionality - Although this feature was definitely nice to have; I believe it may be responsible for flashing compatibility issues for a variety of devices. - As a result of the above. In order perform another action after a --no-reboot action, you must provide the --resume flag. - Heimdall Frontend also has support for specifying the --resume flag via a GUI. Heimdall Frontend also tries to keep track of your actions and enable "Resume" automatically after a "No Reboot" action. - Refactored quite a few of the actions, and code responsible for flashing (particularly PIT file flashing). - Bumped version to 1.4RC3 *however* this commit is not yet an official release candidate. It's still a WIP. In particular build files still have not been updated for Linux and OS X. --- heimdall-frontend/Source/mainwindow.cpp | 53 ++++++- heimdall-frontend/Source/mainwindow.h | 4 + heimdall-frontend/aboutform.ui | 2 +- heimdall-frontend/mainwindow.ui | 239 +++++++++++++++++++------------- 4 files changed, 193 insertions(+), 105 deletions(-) (limited to 'heimdall-frontend') diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index f990cdd..281fd77 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -262,7 +262,10 @@ void MainWindow::UpdateFlashInterfaceAvailability(void) flashProgressBar->setEnabled(false); optionsGroup->setEnabled(true); + sessionGroup->setEnabled(true); startFlashButton->setEnabled(validFlashSettings); + noRebootCheckBox->setEnabled(validFlashSettings); + resumeCheckbox->setEnabled(validFlashSettings); } else { @@ -270,7 +273,7 @@ void MainWindow::UpdateFlashInterfaceAvailability(void) flashProgressBar->setEnabled(true); optionsGroup->setEnabled(false); - startFlashButton->setEnabled(false); + sessionGroup->setEnabled(false); } } @@ -314,10 +317,7 @@ void MainWindow::UpdateUtilitiesInterfaceAvailability(void) closePcScreenButton->setEnabled(true); pitSaveAsButton->setEnabled(true); - if (!pitDestinationLineEdit->text().isEmpty()) - downloadPitButton->setEnabled(true); - else - downloadPitButton->setEnabled(false); + downloadPitButton->setEnabled(!pitDestinationLineEdit->text().isEmpty()); if (printPitDeviceRadioBox->isChecked()) { @@ -331,6 +331,7 @@ void MainWindow::UpdateUtilitiesInterfaceAvailability(void) printLocalPitGroup->setEnabled(true); printLocalPitLineEdit->setEnabled(true); printLocalPitBrowseButton->setEnabled(true); + printPitButton->setEnabled(!printLocalPitLineEdit->text().isEmpty()); } } @@ -420,6 +421,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) // Menu QObject::connect(actionDonate, SIGNAL(triggered()), this, SLOT(OpenDonationWebpage())); QObject::connect(actionVerboseOutput, SIGNAL(toggled(bool)), this, SLOT(SetVerboseOutput(bool))); + QObject::connect(actionResumeConnection, SIGNAL(toggled(bool)), this, SLOT(SetResume(bool))); QObject::connect(actionAboutHeimdall, SIGNAL(triggered()), this, SLOT(ShowAbout())); // Load Package Tab @@ -439,7 +441,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) QObject::connect(pitBrowseButton, SIGNAL(clicked()), this, SLOT(SelectPit())); QObject::connect(repartitionCheckBox, SIGNAL(stateChanged(int)), this, SLOT(SetRepartition(int))); + QObject::connect(noRebootCheckBox, SIGNAL(stateChanged(int)), this, SLOT(SetNoReboot(int))); + QObject::connect(resumeCheckbox, SIGNAL(stateChanged(int)), this, SLOT(SetResume(int))); QObject::connect(startFlashButton, SIGNAL(clicked()), this, SLOT(StartFlash())); @@ -882,13 +886,32 @@ void MainWindow::SelectPit(void) } } + void MainWindow::SetRepartition(int enabled) { workingPackageData.GetFirmwareInfo().SetRepartition(enabled); + + repartitionCheckBox->setChecked(enabled); } + void MainWindow::SetNoReboot(int enabled) { workingPackageData.GetFirmwareInfo().SetNoReboot(enabled); + + noRebootCheckBox->setChecked(enabled); +} + +void MainWindow::SetResume(bool enabled) +{ + resume = enabled; + + actionResumeConnection->setChecked(enabled); + resumeCheckbox->setChecked(enabled); +} + +void MainWindow::SetResume(int enabled) +{ + SetResume(enabled != 0); } void MainWindow::StartFlash(void) @@ -922,6 +945,9 @@ void MainWindow::StartFlash(void) if (firmwareInfo.GetNoReboot()) arguments.append("--no-reboot"); + if (resume) + arguments.append("--resume"); + if (verboseOutput) arguments.append("--verbose"); @@ -1095,6 +1121,9 @@ void MainWindow::ClosePcScreen(void) QStringList arguments; arguments.append("close-pc-screen"); + + if (resume) + arguments.append("--resume"); if (verboseOutput) arguments.append("--verbose"); @@ -1135,6 +1164,9 @@ void MainWindow::DownloadPit(void) arguments.append("--no-reboot"); + if (resume) + arguments.append("--resume"); + if (verboseOutput) arguments.append("--verbose"); @@ -1196,6 +1228,9 @@ void MainWindow::PrintPit(void) arguments.append("--stdout-errors"); arguments.append("--no-reboot"); + + if (resume) + arguments.append("--resume"); if (verboseOutput) arguments.append("--verbose"); @@ -1237,6 +1272,8 @@ void MainWindow::HandleHeimdallStdout(void) void MainWindow::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitStatus) { + HandleHeimdallStdout(); + if (exitStatus == QProcess::NormalExit && exitCode == 0) { if (heimdallState == MainWindow::kHeimdallStateFlashing) @@ -1247,6 +1284,12 @@ void MainWindow::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitS { deviceDetectedRadioButton->setChecked(true); } + + bool executedNoReboot = (heimdallState == kHeimdallStateFlashing && loadedPackageData.GetFirmwareInfo().GetNoReboot()) + || (heimdallState == kHeimdallStatePrintingPit && printPitDeviceRadioBox->isChecked()) || heimdallState == kHeimdallStateDownloadingPit; + + if (executedNoReboot) + SetResume(true); } else { diff --git a/heimdall-frontend/Source/mainwindow.h b/heimdall-frontend/Source/mainwindow.h index bea15cd..4abee8c 100644 --- a/heimdall-frontend/Source/mainwindow.h +++ b/heimdall-frontend/Source/mainwindow.h @@ -81,6 +81,7 @@ namespace HeimdallFrontend QList unusedPartitionIds; bool verboseOutput; + bool resume; void StartHeimdall(const QStringList& arguments); @@ -133,7 +134,10 @@ namespace HeimdallFrontend void SelectPit(void); void SetRepartition(int enabled); + void SetNoReboot(int enabled); + void SetResume(bool enabled); + void SetResume(int enabled); void StartFlash(void); diff --git a/heimdall-frontend/aboutform.ui b/heimdall-frontend/aboutform.ui index 142de47..ef1b947 100644 --- a/heimdall-frontend/aboutform.ui +++ b/heimdall-frontend/aboutform.ui @@ -114,7 +114,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Heimdall Frontend</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Version 1.4 RC1</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Version 1.4 RC3</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright © 2010-2012 Benjamin Dobell, Glass Echidna</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Heimdall (command line)</span></p> diff --git a/heimdall-frontend/mainwindow.ui b/heimdall-frontend/mainwindow.ui index 6a165fb..ce42a89 100644 --- a/heimdall-frontend/mainwindow.ui +++ b/heimdall-frontend/mainwindow.ui @@ -401,7 +401,7 @@ 10 300 - 751 + 511 171 @@ -414,9 +414,9 @@ - 350 + 280 130 - 271 + 221 31 @@ -432,8 +432,8 @@ 10 30 - 731 - 91 + 491 + 81 @@ -451,7 +451,7 @@ 10 130 - 331 + 261 21 @@ -468,59 +468,6 @@ Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - false - - - - 620 - 130 - 91 - 31 - - - - Start - - - - - - 720 - 130 - 21 - 23 - - - - - 75 - true - - - - The "Start" button will remain inactive until at least one partition/file is added. - - - QFrame::Panel - - - QFrame::Raised - - - 2 - - - 0 - - - ? - - - Qt::AlignCenter - - @@ -540,7 +487,7 @@ 10 20 391 - 61 + 91 @@ -624,6 +571,25 @@ Qt::AlignCenter + + + false + + + + 10 + 60 + 131 + 21 + + + + Repartitioning will wipe all data for your phone and install the selected PIT file. + + + Repartition + + @@ -738,44 +704,6 @@ - - - false - - - - 250 - 90 - 151 - 21 - - - - Can be enabled to prevent your device rebooting after the flash finishes. - - - No Reboot - - - - - false - - - - 20 - 90 - 151 - 21 - - - - Repartitioning will wipe all data for your phone and install the selected PIT file. - - - Repartition - - @@ -872,6 +800,110 @@ + + + + 530 + 300 + 231 + 171 + + + + Session + + + + false + + + + 10 + 30 + 211 + 21 + + + + Can be enabled to prevent your device rebooting after the flash finishes. + + + No Reboot + + + + + false + + + + 10 + 60 + 211 + 21 + + + + Can be enabled to prevent your device rebooting after the flash finishes. + + + Resume (use after "No Reboot") + + + + + false + + + + 50 + 120 + 111 + 31 + + + + Start + + + + + + 170 + 120 + 21 + 23 + + + + + 75 + true + + + + The "Start" button will remain inactive until at least one partition/file is added. + + + QFrame::Panel + + + QFrame::Raised + + + 2 + + + 0 + + + ? + + + Qt::AlignCenter + + + @@ -1826,6 +1858,8 @@ Advanced + + @@ -1860,6 +1894,14 @@ Verbose Output + + + true + + + Resume Connection + + @@ -1883,7 +1925,6 @@ partitionFileLineEdit partitionFileBrowseButton outputPlainTextEdit - startFlashButton createFirmwareNameLineEdit createFirmwareVersionLineEdit createPlatformNameLineEdit -- cgit v1.1