Replaced Set Active button with a checkbox. Fixes #459.

This commit is contained in:
Leonardo Zide 2020-04-18 08:49:11 -07:00
parent ad45bb9a47
commit b27ef52025
3 changed files with 12 additions and 7 deletions

View file

@ -17,7 +17,12 @@ lcQModelListDialog::lcQModelListDialog(QWidget* Parent, QList<QPair<QString, lcM
Item->setData(Qt::UserRole, QVariant::fromValue<uintptr_t>((uintptr_t)it->second));
ui->ModelList->addItem(Item);
}
ui->ModelList->setCurrentRow(lcGetActiveProject()->GetActiveModelIndex());
QSettings Settings;
ui->SetActiveModel->setChecked(Settings.value("Settings/ModelListSetActive", true).toBool());
UpdateButtons();
}
@ -69,6 +74,12 @@ void lcQModelListDialog::accept()
mModels.append(QPair<QString, lcModel*>(Item->text(), (lcModel*)Item->data(Qt::UserRole).value<uintptr_t>()));
}
if (ui->SetActiveModel->isChecked())
mActiveModelItem = ui->ModelList->currentItem();
QSettings Settings;
Settings.setValue("Settings/ModelListSetActive", ui->SetActiveModel->isChecked());
QDialog::accept();
}
@ -247,11 +258,6 @@ void lcQModelListDialog::on_MoveDown_clicked()
UpdateButtons();
}
void lcQModelListDialog::on_SetActiveModel_clicked()
{
mActiveModelItem = ui->ModelList->currentItem();
}
void lcQModelListDialog::on_ModelList_itemDoubleClicked(QListWidgetItem* Item)
{
mActiveModelItem = Item;

View file

@ -26,7 +26,6 @@ public slots:
void on_ExportModel_clicked();
void on_MoveUp_clicked();
void on_MoveDown_clicked();
void on_SetActiveModel_clicked();
void on_ModelList_itemDoubleClicked(QListWidgetItem* Item);
void on_ModelList_itemSelectionChanged();

View file

@ -68,7 +68,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="SetActiveModel">
<widget class="QCheckBox" name="SetActiveModel">
<property name="text">
<string>Set Active</string>
</property>