forked from teamnwah/openmw-tes3coop
Some minor cleanups
This commit is contained in:
parent
445f96434e
commit
3a37761d76
4 changed files with 15 additions and 15 deletions
|
@ -14,10 +14,10 @@ Wizard::ExistingInstallationPage::ExistingInstallationPage(MainWizard *wizard) :
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
connect(detectedList, SIGNAL(currentTextChanged(QString)),
|
connect(installationsList, SIGNAL(currentTextChanged(QString)),
|
||||||
this, SLOT(textChanged(QString)));
|
this, SLOT(textChanged(QString)));
|
||||||
|
|
||||||
connect(detectedList,SIGNAL(itemSelectionChanged()),
|
connect(installationsList,SIGNAL(itemSelectionChanged()),
|
||||||
this, SIGNAL(completeChanged()));
|
this, SIGNAL(completeChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ void Wizard::ExistingInstallationPage::on_browseButton_clicked()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString path(QDir::toNativeSeparators(info.absolutePath()));
|
QString path(QDir::toNativeSeparators(info.absolutePath()));
|
||||||
QList<QListWidgetItem*> items = detectedList->findItems(path, Qt::MatchExactly);
|
QList<QListWidgetItem*> items = installationsList->findItems(path, Qt::MatchExactly);
|
||||||
|
|
||||||
if (items.isEmpty())
|
if (items.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -44,10 +44,10 @@ void Wizard::ExistingInstallationPage::on_browseButton_clicked()
|
||||||
mWizard->addInstallation(path);
|
mWizard->addInstallation(path);
|
||||||
|
|
||||||
QListWidgetItem *item = new QListWidgetItem(path);
|
QListWidgetItem *item = new QListWidgetItem(path);
|
||||||
detectedList->addItem(item);
|
installationsList->addItem(item);
|
||||||
detectedList->setCurrentItem(item); // Select it too
|
installationsList->setCurrentItem(item); // Select it too
|
||||||
} else {
|
} 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)
|
void Wizard::ExistingInstallationPage::textChanged(const QString &text)
|
||||||
{
|
{
|
||||||
// Set the installation path manually, as registerField doesn't work
|
// 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())
|
if (!text.isEmpty())
|
||||||
mWizard->setField("installation.path", text);
|
mWizard->setField("installation.path", text);
|
||||||
}
|
}
|
||||||
|
@ -67,11 +68,11 @@ void Wizard::ExistingInstallationPage::initializePage()
|
||||||
if (paths.isEmpty())
|
if (paths.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
detectedList->clear();
|
installationsList->clear();
|
||||||
|
|
||||||
foreach (const QString &path, paths) {
|
foreach (const QString &path, paths) {
|
||||||
QListWidgetItem *item = new QListWidgetItem(path);
|
QListWidgetItem *item = new QListWidgetItem(path);
|
||||||
detectedList->addItem(item);
|
installationsList->addItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -122,7 +123,7 @@ bool Wizard::ExistingInstallationPage::validatePage()
|
||||||
|
|
||||||
bool Wizard::ExistingInstallationPage::isComplete() const
|
bool Wizard::ExistingInstallationPage::isComplete() const
|
||||||
{
|
{
|
||||||
if (detectedList->selectionModel()->hasSelection()) {
|
if (installationsList->selectionModel()->hasSelection()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -29,6 +29,7 @@ Wizard::MainWizard::MainWizard(QWidget *parent) :
|
||||||
setDefaultProperty("QComboBox", "currentText", "currentIndexChanged");
|
setDefaultProperty("QComboBox", "currentText", "currentIndexChanged");
|
||||||
|
|
||||||
setDefaultProperty("ComponentListWidget", "mCheckedItems", "checkedItemsChanged");
|
setDefaultProperty("ComponentListWidget", "mCheckedItems", "checkedItemsChanged");
|
||||||
|
setDefaultProperty("InstallationListWidget", "mCurrentText", "currentTextChanged");
|
||||||
|
|
||||||
setupInstallations();
|
setupInstallations();
|
||||||
setupPages();
|
setupPages();
|
||||||
|
|
|
@ -24,6 +24,4 @@ private slots:
|
||||||
void updateCheckedItems(QListWidgetItem *item);
|
void updateCheckedItems(QListWidgetItem *item);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // COMPONENTLISTWIDGET_HPP
|
#endif // COMPONENTLISTWIDGET_HPP
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>396</width>
|
<width>394</width>
|
||||||
<height>296</height>
|
<height>294</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -21,14 +21,14 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="detectedLabel">
|
<widget class="QLabel" name="installationsLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Detected installations:</string>
|
<string>Detected installations:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="detectedList">
|
<widget class="QListWidget" name="installationsList">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>No existing installations detected</string>
|
<string>No existing installations detected</string>
|
||||||
|
|
Loading…
Reference in a new issue