swift
dbownmodelsdialog.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
4 #include "dbownmodelsdialog.h"
5 
6 #include "ui_dbownmodelsdialog.h"
7 
9 
10 using namespace swift::misc::simulation;
11 
12 namespace swift::gui::components
13 {
14  CDbOwnModelsDialog::CDbOwnModelsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CDbOwnModelsDialog)
15  {
16  ui->setupUi(this);
17  ui->comp_OwnModels->setSimulatorSelectorMode(CSimulatorSelector::ComboBox);
18  this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
19  connect(ui->comp_OwnModels, &CDbOwnModelsComponent::successfullyLoadedModels, this,
21  }
22 
24 
26  {
27  ui->comp_OwnModels->setSimulator(simulator);
28  }
29 
30  bool CDbOwnModelsDialog::requestModelsInBackground(const CSimulatorInfo &simulator, bool onlyIfNotEmpty)
31  {
32  return ui->comp_OwnModels->requestModelsInBackground(simulator, onlyIfNotEmpty);
33  }
34 
35  int CDbOwnModelsDialog::getOwnModelsCount() const { return ui->comp_OwnModels->getOwnModelsCount(); }
36 
37  const CDbOwnModelsComponent *CDbOwnModelsDialog::modelsComponent() const { return ui->comp_OwnModels; }
38 } // namespace swift::gui::components
Handling of own models on disk (the models installed for the simulator)
void successfullyLoadedModels(const swift::misc::simulation::CSimulatorInfo &simulator, int count)
Models have been successfully loaded.
bool requestModelsInBackground(const swift::misc::simulation::CSimulatorInfo &simulator, bool onlyIfNotEmpty)
Forced read for given simulator.
int getOwnModelsCount() const
Number of own models.
const CDbOwnModelsComponent * modelsComponent() const
Direct access to component.
void successfullyLoadedModels(const swift::misc::simulation::CSimulatorInfo &simulator, int count)
Models have been successfully loaded.
void setSimulator(const swift::misc::simulation::CSimulatorInfo &simulator)
Change current simulator for own models.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
High level reusable GUI components.
Definition: aboutdialog.cpp:13