Finish up

This commit is contained in:
2021-06-12 15:17:35 +02:00
parent 5efbdcbd6a
commit 0c466644ce
23 changed files with 958 additions and 154 deletions

View File

@ -14,9 +14,9 @@ MainWindow::MainWindow(QWidget *parent)
ui->statusbar->showMessage("idle");
connect(ui->actionQuit, &QAction::triggered, [this](bool checked){(void)checked; close();});
connect(ui->actionCameras, &QAction::triggered, [this](bool checked){(void)checked; sigChooseCameras();});
connect(ui->actionProfile, &QAction::triggered, [this](bool checked){(void)checked; sigEditProfiles();});
connect(ui->comboBox, &QComboBox::currentTextChanged, this, &MainWindow::sigProfile);
connect(ui->pushButtonCapture, &QPushButton::clicked, this, &MainWindow::sigCapture);
ui->widget->setLit(true);
refreshProfiles();
}
@ -42,6 +42,33 @@ void MainWindow::removeCamera(std::shared_ptr<Camera> camera)
}
}
bool MainWindow::setProfile(const QString& profileName)
{
ui->comboBox->clear();
QList<QString> profiles = Profile::avaiableProfiles();
int selected = -1;
for(int i = 0; i < profiles.size(); ++i)
{
if(profileName == profiles[i])
selected = i;
ui->comboBox->addItem(profiles[i]);
}
if(selected != -1)
{
ui->comboBox->setCurrentIndex(selected);
return true;
}
else
{
return false;
}
}
QString MainWindow::getProfileName()
{
return ui->comboBox->currentText();
}
void MainWindow::refreshProfiles()
{
ui->comboBox->clear();