mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Replaced Set Active button with a checkbox. Fixes #459.
This commit is contained in:
parent
ad45bb9a47
commit
b27ef52025
3 changed files with 12 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue