[recorder] add project metadata action

This commit is contained in:
Jan Grewe 2021-03-25 18:15:19 +01:00
parent b1f49966c4
commit d16b00bb9c
2 changed files with 19 additions and 2 deletions

View File

@ -422,10 +422,16 @@ void PylonRecorder::createActions() {
storeSettingsAction->setStatusTip(tr("store current settings as defaults")); storeSettingsAction->setStatusTip(tr("store current settings as defaults"));
connect(storeSettingsAction, &QAction::triggered, this, &PylonRecorder::storeSettings); connect(storeSettingsAction, &QAction::triggered, this, &PylonRecorder::storeSettings);
projectSettingsAction = new QAction(tr("set project name"), this);
projectSettingsAction->setStatusTip(tr("Set the project name"));
connect(projectSettingsAction, &QAction::triggered, this, &PylonRecorder::editProjectMetadata);
QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings")); QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings"));
settingsMenu->addAction(selectStorageAction); settingsMenu->addAction(selectStorageAction);
settingsMenu->addAction(storeSettingsAction); settingsMenu->addAction(projectSettingsAction);
settingsMenu->addSeparator();
settingsMenu->setToolTipsVisible(true); settingsMenu->setToolTipsVisible(true);
settingsMenu->addAction(storeSettingsAction);
QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(tr("&About"), this, &PylonRecorder::about); helpMenu->addAction(tr("&About"), this, &PylonRecorder::about);
@ -713,6 +719,7 @@ void PylonRecorder::grabStillFromPylon() {
} }
} }
void PylonRecorder::selectStorageLocation() { void PylonRecorder::selectStorageLocation() {
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
"/home", "/home",
@ -724,3 +731,8 @@ void PylonRecorder::selectStorageLocation() {
selectStorageAction->setStatusTip(tr("Storage location: ") + storageLocation); selectStorageAction->setStatusTip(tr("Storage location: ") + storageLocation);
} }
} }
void PylonRecorder::editProjectMetadata(){
std::cerr << "EditProjectSettings" << std::endl;
}

View File

@ -69,6 +69,10 @@ private:
void updateActions(); void updateActions();
void applySettings(); void applySettings();
void storeSettings(); void storeSettings();
void editProjectMetadata();
void setExperimentName();
void setExperimenterName();
void setSubjectID();
QColor progressColor(int value); QColor progressColor(int value);
std::string createFilename(); std::string createFilename();
@ -99,6 +103,7 @@ private:
QString inactiveLabelStyle = ("QLabel { font-size: 10pt;font-family: Arial; color :gray; }"); QString inactiveLabelStyle = ("QLabel { font-size: 10pt;font-family: Arial; color :gray; }");
QSpinBox *framerateSpinner, *buffersizeSpinner, *exposureSpinner, *gainSpinner; QSpinBox *framerateSpinner, *buffersizeSpinner, *exposureSpinner, *gainSpinner;
QAction *selectStorageAction, *storeSettingsAction; QAction *selectStorageAction, *storeSettingsAction;
QAction *projectSettingsAction;
QString storageLocation = ""; QString storageLocation = "";
#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer) #if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer)