From 4646086e4a621574227cce8aaf30b16803f302bf Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 18 Feb 2020 14:28:06 -0600 Subject: Qt UI: Specifically note when disks appear empty --- ui/qt5/partitionchoicepage.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/qt5/partitionchoicepage.cc b/ui/qt5/partitionchoicepage.cc index 63317e7..f98ab91 100644 --- a/ui/qt5/partitionchoicepage.cc +++ b/ui/qt5/partitionchoicepage.cc @@ -83,9 +83,6 @@ PartitionChoicePage::PartitionChoicePage(QWidget *parent) void PartitionChoicePage::initializePage() { Q_ASSERT(horizonWizard()->chosen_disk.size() > 0); - QString chosen{QString::fromStdString(horizonWizard()->chosen_disk)}; - descLabel->setText(descLabel->text().arg(chosen)); - /* these options are, as of right now, always available */ eraseButton->setHidden(false); eraseLabel->setHidden(false); @@ -109,8 +106,20 @@ void PartitionChoicePage::initializePage() { fitInButton->setHidden(false); fitInLabel->setHidden(false); } + } else { + if(d->has_fs()) { + useExistingButton->setHidden(false); + useExistingLabel->setHidden(false); + } else { + /* No label and no FS. */ + descLabel->setText(tr("The disk at %1 does not contain a recognised disklabel or file system. " + "It may be empty, or it may contain data that isn't readable by System Installation.\n\n" + "Continuing will erase any data present on the disk, if any.")); + } } + QString chosen{QString::fromStdString(horizonWizard()->chosen_disk)}; + descLabel->setText(descLabel->text().arg(chosen)); } bool PartitionChoicePage::isComplete() const { -- cgit v1.2.3-60-g2f50