104 lines
2.0 KiB
C++
104 lines
2.0 KiB
C++
#ifndef PROJECTSETTINGS_H
|
|
#define PROJECTSETTINGS_H
|
|
|
|
#include <QDialog>
|
|
#include <QLineEdit>
|
|
#include <QSettings>
|
|
|
|
class ProjectMetadata {
|
|
public:
|
|
ProjectMetadata(){};
|
|
~ProjectMetadata(){};
|
|
|
|
void read(QSettings &settings);
|
|
|
|
void store(QSettings &settings);
|
|
|
|
void project(const QString &name) {
|
|
this->projectName = name;
|
|
};
|
|
|
|
QString project() const {
|
|
return this->projectName;
|
|
};
|
|
|
|
void experiment(const QString &experiment) {
|
|
this->experimentName = experiment;
|
|
};
|
|
|
|
QString experiment() const {
|
|
return this->experimentName;
|
|
};
|
|
|
|
void condition(const QString &condition) {
|
|
this->cond = condition;
|
|
};
|
|
|
|
QString condition() const {
|
|
return this->cond;
|
|
};
|
|
|
|
void experimenter(const QString &experimenter) {
|
|
this->experimenterName = experimenter;
|
|
};
|
|
|
|
QString experimenter() const {
|
|
return this->experimenterName;
|
|
};
|
|
|
|
void subject(const QString &subject) {
|
|
this->subj = subject;
|
|
};
|
|
|
|
QString subject() const {
|
|
return this->subj;
|
|
};
|
|
|
|
void setup(const QString &setup){
|
|
this->setupName = setup;
|
|
};
|
|
|
|
QString setup() const {
|
|
return this->setupName;
|
|
};
|
|
|
|
void comment(const QString &comment) {
|
|
this->cmmnt = comment;
|
|
};
|
|
|
|
QString comment() const {
|
|
return this->cmmnt;
|
|
};
|
|
|
|
private:
|
|
QString projectName;
|
|
QString experimenterName;
|
|
QString experimentName;
|
|
QString cond;
|
|
QString subj;
|
|
QString setupName;
|
|
QString cmmnt;
|
|
};
|
|
|
|
|
|
//! [0]
|
|
class ProjectSettings : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ProjectSettings(QWidget *parent = nullptr);
|
|
~ProjectSettings();
|
|
|
|
ProjectMetadata getMetadata();
|
|
|
|
private:
|
|
QSettings settings;
|
|
ProjectMetadata metadata;
|
|
QLineEdit *projectEdit, *experimentEdit, *experimenterEdit, *subjectEdit, *setupEdit, *conditionEdit, *commentEdit;
|
|
|
|
void accept();
|
|
void readMetadata();
|
|
|
|
};
|
|
|
|
#endif |