| 264 | } |
| 265 | |
| 266 | void PlotTemplateDialog::changePreviewSource(int row) { |
| 267 | if (mLoading) |
| 268 | return; |
| 269 | |
| 270 | TemplateListModel* model = mTemplateListModelDefault; |
| 271 | if (row == 1) |
| 272 | model = mTemplateListModelCustom; |
| 273 | |
| 274 | ui->cbLocation->setToolTip(model->searchPath()); |
| 275 | |
| 276 | ui->lCustomFolder->setVisible(row == 1); |
| 277 | ui->leCustomFolder->setVisible(row == 1); |
| 278 | ui->pbCustomFolder->setVisible(row == 1); |
| 279 | ui->lvInstalledTemplates->setModel(model); |
| 280 | |
| 281 | // must be done every time the model changes |
| 282 | connect(ui->lvInstalledTemplates->selectionModel(), &QItemSelectionModel::currentChanged, this, &PlotTemplateDialog::listViewTemplateChanged); |
| 283 | ui->lvInstalledTemplates->setCurrentIndex(model->index(0, 0)); |
| 284 | |
| 285 | if (!model->index(0, 0).isValid()) |
| 286 | showPreview(); |
| 287 | } |
| 288 | |
| 289 | // ########################################################################################################## |
| 290 | // Listmodel |
nothing calls this directly
no test coverage detected