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 +++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) (limited to 'heimdall-frontend/Source/mainwindow.cpp') 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 { -- cgit v1.1 From 55d6c9551e13b108947410d7bf50b6ba2c01b633 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sun, 5 May 2013 20:53:36 +1000 Subject: Fixed two major bugs in libpit related functionality: - Partitions were being excluded from flashing (and UI) if the block-count was zero. Instead this is now done using a new IsFlashable() method which checks if the partition name is not blank. - PitData::Pack() was packing the partition name where it should have been packing the "flash filename". This resulted in incorrect PIT files being flashed to the device. --- heimdall-frontend/Source/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'heimdall-frontend/Source/mainwindow.cpp') diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index 281fd77..862dc5a 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -102,7 +102,7 @@ void MainWindow::UpdateUnusedPartitionIds(void) { const PitEntry *pitEntry = currentPitData.GetEntry(i); - if (pitEntry->GetBlockCount() > 0 && strcmp(pitEntry->GetPartitionName(), "PIT") != 0 && strcmp(pitEntry->GetPartitionName(), "PT") != 0) + if (pitEntry->IsFlashable() && strcmp(pitEntry->GetPartitionName(), "PIT") != 0 && strcmp(pitEntry->GetPartitionName(), "PT") != 0) unusedPartitionIds.append(pitEntry->GetIdentifier()); } -- cgit v1.1 From 59cc6133d532763dbb11592e15551ddf59c14773 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 6 May 2013 00:01:04 +1000 Subject: Fixed bug in Heimdall Frontend where "resume" wasn't being checked when it should have been. --- heimdall-frontend/Source/mainwindow.cpp | 59 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'heimdall-frontend/Source/mainwindow.cpp') diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index 862dc5a..6949e0c 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -87,7 +87,7 @@ void MainWindow::StartHeimdall(const QStringList& arguments) { flashLabel->setText("Failed to start Heimdall!"); - heimdallState = MainWindow::kHeimdallStateStopped; + heimdallState = HeimdallState::Stopped; UpdateInterfaceAvailability(); } } @@ -236,13 +236,13 @@ void MainWindow::UpdateLoadPackageInterfaceAvailability(void) else developerDonateButton->setEnabled(false); - loadFirmwareButton->setEnabled(heimdallState == MainWindow::kHeimdallStateStopped); + loadFirmwareButton->setEnabled(heimdallState == HeimdallState::Stopped); } } void MainWindow::UpdateFlashInterfaceAvailability(void) { - if (heimdallState == MainWindow::kHeimdallStateStopped) + if (heimdallState == HeimdallState::Stopped) { partitionNameComboBox->setEnabled(partitionsListWidget->currentRow() >= 0); @@ -279,7 +279,7 @@ void MainWindow::UpdateFlashInterfaceAvailability(void) void MainWindow::UpdateCreatePackageInterfaceAvailability(void) { - if (heimdallState == MainWindow::kHeimdallStateStopped) + if (heimdallState == HeimdallState::Stopped) { const FirmwareInfo& firmwareInfo = workingPackageData.GetFirmwareInfo(); @@ -311,7 +311,7 @@ void MainWindow::UpdateCreatePackageInterfaceAvailability(void) void MainWindow::UpdateUtilitiesInterfaceAvailability(void) { - if (heimdallState == MainWindow::kHeimdallStateStopped) + if (heimdallState == HeimdallState::Stopped) { detectDeviceButton->setEnabled(true); closePcScreenButton->setEnabled(true); @@ -354,7 +354,7 @@ void MainWindow::UpdateInterfaceAvailability(void) UpdateCreatePackageInterfaceAvailability(); UpdateUtilitiesInterfaceAvailability(); - if (heimdallState == MainWindow::kHeimdallStateStopped) + if (heimdallState == HeimdallState::Stopped) { // Enable/disable tabs @@ -405,7 +405,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setupUi(this); - heimdallState = MainWindow::kHeimdallStateStopped; + heimdallState = HeimdallState::Stopped; lastDirectory = QDir::toNativeSeparators(QApplication::applicationDirPath()); @@ -918,7 +918,7 @@ void MainWindow::StartFlash(void) { outputPlainTextEdit->clear(); - heimdallState = MainWindow::kHeimdallStateFlashing; + heimdallState = HeimdallState::Flashing; heimdallFailed = false; const FirmwareInfo& firmwareInfo = workingPackageData.GetFirmwareInfo(); @@ -1098,7 +1098,7 @@ void MainWindow::DetectDevice(void) deviceDetectedRadioButton->setChecked(false); utilityOutputPlainTextEdit->clear(); - heimdallState = MainWindow::kHeimdallStateDetectingDevice; + heimdallState = HeimdallState::DetectingDevice; heimdallFailed = false; QStringList arguments; @@ -1116,7 +1116,7 @@ void MainWindow::ClosePcScreen(void) { utilityOutputPlainTextEdit->clear(); - heimdallState = MainWindow::kHeimdallStateClosingPcScreen; + heimdallState = HeimdallState::ClosingPcScreen; heimdallFailed = false; QStringList arguments; @@ -1153,7 +1153,7 @@ void MainWindow::DownloadPit(void) deviceDetectedRadioButton->setChecked(false); utilityOutputPlainTextEdit->clear(); - heimdallState = MainWindow::kHeimdallStateDetectingDevice; + heimdallState = HeimdallState::DownloadingPit; heimdallFailed = false; QStringList arguments; @@ -1214,7 +1214,7 @@ void MainWindow::PrintPit(void) { utilityOutputPlainTextEdit->clear(); - heimdallState = MainWindow::kHeimdallStatePrintingPit; + heimdallState = HeimdallState::PrintingPit; heimdallFailed = false; QStringList arguments; @@ -1258,7 +1258,7 @@ void MainWindow::HandleHeimdallStdout(void) output.remove(QChar('\b')); output.replace(QChar('%'), QString("%\n")); - if (heimdallState == MainWindow::kHeimdallStateFlashing) + if (heimdallState == HeimdallState::Flashing) { outputPlainTextEdit->insertPlainText(output); outputPlainTextEdit->ensureCursorVisible(); @@ -1276,24 +1276,23 @@ void MainWindow::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitS if (exitStatus == QProcess::NormalExit && exitCode == 0) { - if (heimdallState == MainWindow::kHeimdallStateFlashing) + bool executedNoReboot = (heimdallState == HeimdallState::Flashing && loadedPackageData.GetFirmwareInfo().GetNoReboot()) + || (heimdallState == HeimdallState::PrintingPit && printPitDeviceRadioBox->isChecked()) || heimdallState == HeimdallState::DownloadingPit; + + SetResume(executedNoReboot); + + if (heimdallState == HeimdallState::Flashing) { flashLabel->setText("Flash completed successfully!"); } - else if (heimdallState == MainWindow::kHeimdallStateDetectingDevice) + else if (heimdallState == HeimdallState::DetectingDevice) { deviceDetectedRadioButton->setChecked(true); } - - bool executedNoReboot = (heimdallState == kHeimdallStateFlashing && loadedPackageData.GetFirmwareInfo().GetNoReboot()) - || (heimdallState == kHeimdallStatePrintingPit && printPitDeviceRadioBox->isChecked()) || heimdallState == kHeimdallStateDownloadingPit; - - if (executedNoReboot) - SetResume(true); } else { - if (heimdallState == MainWindow::kHeimdallStateFlashing) + if (heimdallState == HeimdallState::Flashing) { QString error = heimdallProcess.readAllStandardError(); @@ -1306,13 +1305,13 @@ void MainWindow::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitS flashLabel->setText(error); } - else if (heimdallState == MainWindow::kHeimdallStateDetectingDevice) + else if (heimdallState == HeimdallState::DetectingDevice) { deviceDetectedRadioButton->setChecked(false); } } - heimdallState = MainWindow::kHeimdallStateStopped; + heimdallState = HeimdallState::Stopped; flashProgressBar->setEnabled(false); UpdateInterfaceAvailability(); } @@ -1321,7 +1320,7 @@ void MainWindow::HandleHeimdallError(QProcess::ProcessError error) { if (error == QProcess::FailedToStart || error == QProcess::Timedout) { - if (heimdallState == kHeimdallStateFlashing) + if (heimdallState == HeimdallState::Flashing) { flashLabel->setText("Failed to start Heimdall!"); flashProgressBar->setEnabled(false); @@ -1332,12 +1331,12 @@ void MainWindow::HandleHeimdallError(QProcess::ProcessError error) } heimdallFailed = true; - heimdallState = MainWindow::kHeimdallStateStopped; + heimdallState = HeimdallState::Stopped; UpdateInterfaceAvailability(); } else if (error == QProcess::Crashed) { - if (heimdallState == kHeimdallStateFlashing) + if (heimdallState == HeimdallState::Flashing) { flashLabel->setText("Heimdall crashed!"); flashProgressBar->setEnabled(false); @@ -1347,12 +1346,12 @@ void MainWindow::HandleHeimdallError(QProcess::ProcessError error) utilityOutputPlainTextEdit->appendPlainText("\nFRONTEND ERROR: Heimdall crashed!"); } - heimdallState = MainWindow::kHeimdallStateStopped; + heimdallState = HeimdallState::Stopped; UpdateInterfaceAvailability(); } else { - if (heimdallState == kHeimdallStateFlashing) + if (heimdallState == HeimdallState::Flashing) { flashLabel->setText("Heimdall reported an unknown error!"); flashProgressBar->setEnabled(false); @@ -1362,7 +1361,7 @@ void MainWindow::HandleHeimdallError(QProcess::ProcessError error) utilityOutputPlainTextEdit->appendPlainText("\nFRONTEND ERROR: Heimdall reported an unknown error!"); } - heimdallState = MainWindow::kHeimdallStateStopped; + heimdallState = HeimdallState::Stopped; UpdateInterfaceAvailability(); } } -- cgit v1.1 From 07dcba54fc8cc5b7c6515305aa233e24a58adc94 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 13 May 2013 00:08:30 +1000 Subject: Update copyright notices, version identifier and documentation for 1.4.0 release. --- heimdall-frontend/Source/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'heimdall-frontend/Source/mainwindow.cpp') diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index 6949e0c..02d7a62 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna +/* Copyright (c) 2010-2013 Benjamin Dobell, Glass Echidna Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -- cgit v1.1 From f47b69d037b74cf0916bbab248abcafe8a1f01a3 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sat, 8 Jun 2013 14:58:37 +1000 Subject: Modified Heimdall Frontend so it can find Heimdall CLI in /usr/local/bin on OS X. Also updated the OS X build files, as well as READMEs for all platforms. --- heimdall-frontend/Source/mainwindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'heimdall-frontend/Source/mainwindow.cpp') diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index 02d7a62..46dc381 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -52,13 +52,19 @@ void MainWindow::StartHeimdall(const QStringList& arguments) QStringList paths; - // Ensure /usr/bin is in PATH + // Ensure /usr/local/bin and /usr/bin are in PATH. for (int i = 0; i < environment.length(); i++) { if (environment[i].left(5) == "PATH=") { paths = environment[i].mid(5).split(':'); - paths.prepend("/usr/bin"); + + if (!paths.contains("/usr/local/bin")) + paths.prepend("/usr/local/bin"); + + if (!paths.contains("/usr/bin")) + paths.prepend("/usr/bin"); + break; } } @@ -71,6 +77,7 @@ void MainWindow::StartHeimdall(const QStringList& arguments) if (heimdallPath.length() > 0) { + utilityOutputPlainTextEdit->clear(); heimdallFailed = false; if (heimdallPath[heimdallPath.length() - 1] != QDir::separator()) -- cgit v1.1