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 +++ 2 files changed, 52 insertions(+), 5 deletions(-) (limited to 'heimdall-frontend/Source') 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); -- cgit v1.2.3