From 3a37761d76147bad3467e74c84911fe111ead020 Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 24 Dec 2013 23:47:04 +0100 Subject: [PATCH] Some minor cleanups --- apps/wizard/existinginstallationpage.cpp | 19 ++++++++++--------- apps/wizard/mainwizard.cpp | 1 + apps/wizard/utils/componentlistwidget.hpp | 2 -- files/ui/wizard/existinginstallationpage.ui | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/wizard/existinginstallationpage.cpp b/apps/wizard/existinginstallationpage.cpp index aeaa5a1f6..5c66ceb4f 100644 --- a/apps/wizard/existinginstallationpage.cpp +++ b/apps/wizard/existinginstallationpage.cpp @@ -14,10 +14,10 @@ Wizard::ExistingInstallationPage::ExistingInstallationPage(MainWizard *wizard) : { setupUi(this); - connect(detectedList, SIGNAL(currentTextChanged(QString)), + connect(installationsList, SIGNAL(currentTextChanged(QString)), this, SLOT(textChanged(QString))); - connect(detectedList,SIGNAL(itemSelectionChanged()), + connect(installationsList,SIGNAL(itemSelectionChanged()), this, SIGNAL(completeChanged())); } @@ -36,7 +36,7 @@ void Wizard::ExistingInstallationPage::on_browseButton_clicked() return; QString path(QDir::toNativeSeparators(info.absolutePath())); - QList items = detectedList->findItems(path, Qt::MatchExactly); + QList items = installationsList->findItems(path, Qt::MatchExactly); if (items.isEmpty()) { @@ -44,10 +44,10 @@ void Wizard::ExistingInstallationPage::on_browseButton_clicked() mWizard->addInstallation(path); QListWidgetItem *item = new QListWidgetItem(path); - detectedList->addItem(item); - detectedList->setCurrentItem(item); // Select it too + installationsList->addItem(item); + installationsList->setCurrentItem(item); // Select it too } else { - detectedList->setCurrentItem(items.first()); + installationsList->setCurrentItem(items.first()); } } @@ -55,6 +55,7 @@ void Wizard::ExistingInstallationPage::on_browseButton_clicked() void Wizard::ExistingInstallationPage::textChanged(const QString &text) { // Set the installation path manually, as registerField doesn't work + // Because it doesn't accept two widgets operating on a single field if (!text.isEmpty()) mWizard->setField("installation.path", text); } @@ -67,11 +68,11 @@ void Wizard::ExistingInstallationPage::initializePage() if (paths.isEmpty()) return; - detectedList->clear(); + installationsList->clear(); foreach (const QString &path, paths) { QListWidgetItem *item = new QListWidgetItem(path); - detectedList->addItem(item); + installationsList->addItem(item); } } @@ -122,7 +123,7 @@ bool Wizard::ExistingInstallationPage::validatePage() bool Wizard::ExistingInstallationPage::isComplete() const { - if (detectedList->selectionModel()->hasSelection()) { + if (installationsList->selectionModel()->hasSelection()) { return true; } else { return false; diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index 9b133cee1..fde82e998 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -29,6 +29,7 @@ Wizard::MainWizard::MainWizard(QWidget *parent) : setDefaultProperty("QComboBox", "currentText", "currentIndexChanged"); setDefaultProperty("ComponentListWidget", "mCheckedItems", "checkedItemsChanged"); + setDefaultProperty("InstallationListWidget", "mCurrentText", "currentTextChanged"); setupInstallations(); setupPages(); diff --git a/apps/wizard/utils/componentlistwidget.hpp b/apps/wizard/utils/componentlistwidget.hpp index c9c782d45..6869629d3 100644 --- a/apps/wizard/utils/componentlistwidget.hpp +++ b/apps/wizard/utils/componentlistwidget.hpp @@ -24,6 +24,4 @@ private slots: void updateCheckedItems(QListWidgetItem *item); }; - - #endif // COMPONENTLISTWIDGET_HPP diff --git a/files/ui/wizard/existinginstallationpage.ui b/files/ui/wizard/existinginstallationpage.ui index 3ca831636..b887fb06c 100644 --- a/files/ui/wizard/existinginstallationpage.ui +++ b/files/ui/wizard/existinginstallationpage.ui @@ -6,8 +6,8 @@ 0 0 - 396 - 296 + 394 + 294 @@ -21,14 +21,14 @@ - + Detected installations: - + No existing installations detected