19 #include "ui_ProjectSettingsView.h"
21 #include <QMessageBox>
24 : QWidget(parentWidget)
26 , m_document(document)
29 m_ui->label_6->hide();
30 m_ui->textEdit->hide();
32 setAttribute(Qt::WA_StyledBackground,
true);
33 setProperty(
"stylable",
true);
40 connect(
m_ui->singleInstrumentModeRadio, &QRadioButton::toggled,
this,
43 connect(
m_ui->singleSampleModeRadio, &QRadioButton::toggled,
this,
46 connect(
m_ui->gisasCheck, &QCheckBox::toggled,
this,
48 connect(
m_ui->offspecCheck, &QCheckBox::toggled,
this,
50 connect(
m_ui->reflectometryCheck, &QCheckBox::toggled,
this,
52 connect(
m_ui->depthCheck, &QCheckBox::toggled,
this,
55 connect(
m_ui->storeAsDefaultsButton, &QPushButton::clicked,
this,
69 QSignalBlocker b1(
m_ui->singleInstrumentModeRadio);
72 :
m_ui->multipleInstrumentModeRadio->setChecked(
true);
75 :
m_ui->multipleSampleModeRadio->setChecked(
true);
85 QSignalBlocker b1(
m_ui->gisasCheck);
86 QSignalBlocker b2(
m_ui->offspecCheck);
87 QSignalBlocker b3(
m_ui->reflectometryCheck);
88 QSignalBlocker b4(
m_ui->depthCheck);
98 QString location =
"[not saved yet]";
105 m_ui->currentProjectName->setText(
name);
106 m_ui->currentProjectLocation->setText(location);
121 "This project already contains more than one instrument. Changing "
122 "this setting is not possible.");
124 QSignalBlocker b1(
m_ui->singleInstrumentModeRadio);
125 m_ui->multipleInstrumentModeRadio->setChecked(
true);
140 "This project already contains more than one sample. Changing "
141 "this setting is not possible.");
143 QSignalBlocker b1(
m_ui->singleSampleModeRadio);
144 m_ui->multipleSampleModeRadio->setChecked(
true);
159 "You have to select at least one functionality. Changing "
160 "this setting is not possible.");
171 ProjectDocument::Functionalities f;
ApplicationSettings * appSettings
global pointer to the instance
Defines class ApplicationSettings.
Defines class GroupBoxCollapser.
Defines class Helpers functions.
QVariant toVariant(const ProjectDocument::Functionalities &f)
Defines class ProjectSettingsView.
void setDefaultIsSingleInstrumentMode(bool b)
void setDefaultFunctionalities(const QVariant &functionalities)
void setDefaultIsSingleSampleMode(bool b)
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
QVector< InstrumentItem * > collectedItems() const
QVector< MultiLayerItem * > sampleItems() const
Project document class handles all data related to the opened project (sample, job,...
void setSingleInstrumentMode(bool b)
QString projectFileName() const
void setSingleSampleMode(bool b)
QString projectName() const
InstrumentCollection * collectedItems() const
void setFunctionalities(const Functionalities &f)
bool hasValidNameAndPath()
Functionalities functionalities() const
MultiLayerItems * sampleItems()
bool singleInstrumentMode() const
void modified()
Emitted for any modifications in the document.
bool singleSampleMode() const
Widget to define project settings.
void showEvent(QShowEvent *) override
Ui::ProjectSettingsView * m_ui
ProjectDocument::Functionalities functionalities() const
void writeOptionsToUI()
Write entries in OptionsItem to UI.
ProjectDocument * m_document
void onSingleSampleRadioToggled(bool newState)
void onSingleInstrumentRadioToggled(bool newState)
void onFunctionalityToggled()
ProjectSettingsView(QWidget *parentWidget, ProjectDocument *document)
void writeFunctionalityToUI()
QString const & name(EShape k)
QString withTildeHomePath(const QString &path)
void warning(QWidget *parent, const QString &title, const QString &text, const QString &detailedText)