summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-23 23:28:39 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-23 23:28:39 -0500
commitbeeb5c9377c26ae44a8723609af2d672c32d00b7 (patch)
tree44ce9266da62b8c67a472def7c8a4258b8dfaabc /ui
parent9f9bcaad0e17231355d592607a3564b6035b685c (diff)
downloadhorizon-beeb5c9377c26ae44a8723609af2d672c32d00b7.tar.gz
horizon-beeb5c9377c26ae44a8723609af2d672c32d00b7.tar.bz2
horizon-beeb5c9377c26ae44a8723609af2d672c32d00b7.tar.xz
horizon-beeb5c9377c26ae44a8723609af2d672c32d00b7.zip
Qt UI: Fix building non-install environment
Diffstat (limited to 'ui')
-rw-r--r--ui/qt5/horizonwizard.cc2
-rw-r--r--ui/qt5/mountdialog.cc13
2 files changed, 15 insertions, 0 deletions
diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc
index 143ae43..556a6f3 100644
--- a/ui/qt5/horizonwizard.cc
+++ b/ui/qt5/horizonwizard.cc
@@ -542,7 +542,9 @@ QString HorizonWizard::toHScript() {
break;
}
+#ifdef HAS_INSTALL_ENV
part_lines << (dynamic_cast<PartitionMountPage *>(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 f986423..103e442 100644
--- a/ui/qt5/mountdialog.cc
+++ b/ui/qt5/mountdialog.cc
@@ -16,6 +16,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
+#include <QSet>
#include <QVBoxLayout>
MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts,
@@ -75,7 +76,11 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts,
QVBoxLayout *controlLayout = new QVBoxLayout;
controlLayout->addWidget(new QLabel(tr("Partition")));
+#ifdef HAS_INSTALL_ENV
controlLayout->addWidget(partList);
+#else /* !HAS_INSTALL_ENV */
+ controlLayout->addWidget(partInput);
+#endif /* HAS_INSTALL_ENV */
controlLayout->addWidget(new QLabel(tr("will be mounted on")));
controlLayout->addWidget(pathInput);
@@ -87,14 +92,22 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts,
}
QString MountDialog::partition() const {
+#ifdef HAS_INSTALL_ENV
assert(partList->currentItem() != nullptr);
return partList->currentItem()->text();
+#else /* !HAS_INSTALL_ENV */
+ return partInput->text();
+#endif /* HAS_INSTALL_ENV */
}
void MountDialog::setPartition(const QString &part) {
+#ifdef HAS_INSTALL_ENV
QList<QListWidgetItem *> candidate = partList->findItems(part, Qt::MatchExactly);
if(candidate.empty()) return;
partList->setCurrentItem(candidate.at(0));
+#else /* !HAS_INSTALL_ENV */
+ partInput->setText(part);
+#endif /* HAS_INSTALL_ENV */
}
QString MountDialog::mountPoint() const {