From 539a05b85867f7427e8066becafeb2f98ce82aa5 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 20 Oct 2023 22:42:13 -0500 Subject: Qt UI: Runner: Show xterm errors, if present This prevents the user from being confounded by a lack of response to the Open Terminal button, if something goes catastrophically wrong that even an Xterm won't open. Closes: #362 --- ui/qt5/runner/errorpage.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/qt5/runner/errorpage.cc b/ui/qt5/runner/errorpage.cc index 73ea1dc..905ebbe 100644 --- a/ui/qt5/runner/errorpage.cc +++ b/ui/qt5/runner/errorpage.cc @@ -60,8 +60,13 @@ ErrorPage::ErrorPage(QWidget *parent) : HorizonWizardPage(parent) { QPushButton *popAnXterm = new QPushButton(tr("Open &Terminal")); popAnXterm->setWhatsThis(tr("Opens a terminal, to allow you to run commands from the installation environment.")); connect(popAnXterm, &QPushButton::clicked, [=]{ - QProcess p; - p.execute("xterm", {"-fa", "Liberation Mono", "-fs", "12"}); + QProcess *p = new QProcess(this); + connect(p, &QProcess::errorOccurred, [=](QProcess::ProcessError error) { + QMessageBox::critical(this, tr("Could Not Open Terminal"), tr("Code %1 while attempting to open a terminal (le=%2).").arg(error).arg(errno)); + }); + connect(p, QOverload::of(&QProcess::finished), + [=](int exitCode, QProcess::ExitStatus exitStatus){ p->deleteLater(); }); + p->start("xterm", {"-fa", "Liberation Mono", "-fs", "12", "-bg", "DarkGreen", "-fg", "White"}); }); QHBoxLayout *buttonLayout = new QHBoxLayout; @@ -122,7 +127,7 @@ void ErrorPage::initializePage() { descLabel->setText(tr("An issue occurred while installing packages.")); deetLabel->setText(tr( "Details: This failure typically indicates an issue connecting to the network. " - "Ensure your network configuration is correct.\n\n" + "Ensure your system clock and network configuration are correct.\n\n" "You may be attempting to install a version or edition of Adélie Linux that your mirror does not provide.\n\n" "Rarely, this may indicate an issue with your installation media, " "or that software you have selected for installation is no longer available.")); -- cgit v1.2.3-70-g09d2