Finish up
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user