From e355395ee830bdffe3f88c39c77e3aca2043a19c Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 24 May 2020 21:36:17 -0500 Subject: Qt UI: Fix a few issues with the Runtime wizard --- ui/qt5/CMakeLists.txt | 4 ++-- ui/qt5/horizonwizard.cc | 4 ---- ui/qt5/mountdialog.cc | 3 +++ ui/qt5/partitiondiskpage.cc | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/qt5/CMakeLists.txt b/ui/qt5/CMakeLists.txt index d277a7a..87f4d64 100644 --- a/ui/qt5/CMakeLists.txt +++ b/ui/qt5/CMakeLists.txt @@ -20,6 +20,7 @@ set(UI_SOURCES partitiondiskpage.cc partitionchoicepage.cc partitionmanualpage.cc + partitionmountpage.cc networkingpage.cc networkifacepage.cc netsimplewifipage.cc @@ -53,8 +54,7 @@ IF(INSTALL) LIST(APPEND UI_SOURCES commitpage.cc partitionprobe.cc - partitionpage.cc - partitionmountpage.cc) + partitionpage.cc) ELSE(INSTALL) LIST(APPEND UI_SOURCES writeoutpage.cc) ENDIF(INSTALL) diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc index 556a6f3..359e697 100644 --- a/ui/qt5/horizonwizard.cc +++ b/ui/qt5/horizonwizard.cc @@ -252,9 +252,7 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) { setPage(Page_PartitionDisk, new PartitionDiskPage); setPage(Page_PartitionChoose, new PartitionChoicePage); setPage(Page_PartitionManual, new PartitionManualPage); -#ifdef HAS_INSTALL_ENV setPage(Page_PartitionMount, new PartitionMountPage); -#endif /* HAS_INSTALL_ENV */ setPage(Page_Network, new NetworkingPage); setPage(Page_Network_Iface, new NetworkIfacePage); setPage(Page_Network_Wireless, new NetworkSimpleWirelessPage); @@ -542,9 +540,7 @@ QString HorizonWizard::toHScript() { break; } -#ifdef HAS_INSTALL_ENV part_lines << (dynamic_cast(page(Page_PartitionMount)))->mountLines(); -#endif /* HAS_INSTALL_ENV */ if(chosen_disk.empty()) { lines << part_lines; diff --git a/ui/qt5/mountdialog.cc b/ui/qt5/mountdialog.cc index 103e442..111bce6 100644 --- a/ui/qt5/mountdialog.cc +++ b/ui/qt5/mountdialog.cc @@ -61,6 +61,9 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, #else partInput = new QLineEdit; partInput->setWhatsThis(tr("Input the name of a partition, such as /dev/sda1, here.")); + connect(partInput, &QLineEdit::textChanged, [=] { + ok->setEnabled(partInput->text().startsWith("/dev/")); + }); #endif QStringList pathCandidates = {"/", "/home", "/opt", "/srv", "/usr", diff --git a/ui/qt5/partitiondiskpage.cc b/ui/qt5/partitiondiskpage.cc index eeb07eb..69a56f0 100644 --- a/ui/qt5/partitiondiskpage.cc +++ b/ui/qt5/partitiondiskpage.cc @@ -139,6 +139,6 @@ bool PartitionDiskPage::isComplete() const { #ifdef HAS_INSTALL_ENV return diskChooser->currentIndex().row() != -1; #else /* !HAS_INSTALL_ENV */ - return !diskChooser->text().isEmpty(); + return diskChooser->text().startsWith("/dev/"); #endif /* HAS_INSTALL_ENV */ } -- cgit v1.2.3-60-g2f50