Skip to content

Commit

Permalink
Added pref option to display int spec fit parameters to the right of …
Browse files Browse the repository at this point in the history
…it instead of the bottom
  • Loading branch information
Arthur Glowacki committed Jun 28, 2024
1 parent 98ab325 commit a5b6b92
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/mvc/FitSpectraWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,14 @@ void FitSpectraWidget::createLayout()
tab_and_buttons_widget->setLayout(vlayout_tab);

QSplitter* splitter = new QSplitter();
splitter->setOrientation(Qt::Vertical);
if(Preferences::inst()->getValue(STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION).toBool())
{
splitter->setOrientation(Qt::Horizontal);
}
else
{
splitter->setOrientation(Qt::Vertical);
}
splitter->addWidget(_spectra_dock);
splitter->setStretchFactor(0, 1);
splitter->addWidget(tab_and_buttons_widget);
Expand Down
3 changes: 2 additions & 1 deletion src/preferences/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ Preferences::Preferences()
{STR_PRF_STRICT_REGEX, QVariant()},
{STR_PRF_FILE_SIZE, QVariant()},
{STR_PRF_SHOW_DATASET_ON_LOAD, QVariant()},
{STR_PREF_RADIO_LOAD_SELECTED_OPTION, QVariant()}
{STR_PREF_RADIO_LOAD_SELECTED_OPTION, QVariant()},
{STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION, QVariant()}
};
load();
}
Expand Down
1 change: 1 addition & 0 deletions src/preferences/Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
#define STR_PRF_FILE_SIZE "FileSize"
#define STR_PRF_SHOW_DATASET_ON_LOAD "ShowOnLoad"
#define STR_PREF_RADIO_LOAD_SELECTED_OPTION "Load_Selected_Opt"
#define STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION "Spectra_Controls_Horizontal"

/**
* @brief Read and save preferences between application restarts, the vaule key
Expand Down
8 changes: 8 additions & 0 deletions src/preferences/PreferencesDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ PreferencesDisplay::PreferencesDisplay(QWidget* parent) : QWidget(parent)
_ck_show_dataset_on_load = new QCheckBox();
_ck_show_dataset_on_load->setChecked(Preferences::inst()->getValue(STR_PRF_SHOW_DATASET_ON_LOAD).toBool());

QLabel* lblIntSpecControlLoc = new QLabel("Integreated Spectra Controls On the Right of spectra? (Unchecked = Below)");
lblIntSpecControlLoc->setFont(font);
_ck_int_spec_horiz = new QCheckBox();
_ck_int_spec_horiz->setChecked(Preferences::inst()->getValue(STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION).toBool());


QLabel* lblSearchDatasets = new QLabel("Search sub folders for datasets (ESRF datasets).");
lblSearchDatasets->setFont(font);
_ck_search_datasets = new QCheckBox();
Expand Down Expand Up @@ -92,6 +98,7 @@ PreferencesDisplay::PreferencesDisplay(QWidget* parent) : QWidget(parent)
mainLayout->addRow(lblFileSize, _cb_file_size);
mainLayout->addRow(lblShowDatasetOnSelect, _ck_show_dataset_on_select);
mainLayout->addRow(lblShowDatasetOnLoad, _ck_show_dataset_on_load);
mainLayout->addRow(lblIntSpecControlLoc, _ck_int_spec_horiz);
mainLayout->addRow(lblSearchDatasets, _ck_search_datasets);
mainLayout->addRow(lblStrictRegex, _ck_strict_regex);

Expand Down Expand Up @@ -155,6 +162,7 @@ void PreferencesDisplay::acceptChanges()
Preferences::inst()->setValue(STR_PRF_DecimalPrecision, getDecimalPrecision());
Preferences::inst()->setValue(STR_PRF_SHOW_DATASET_ON_FILE_SELECT, _ck_show_dataset_on_select->isChecked());
Preferences::inst()->setValue(STR_PRF_SHOW_DATASET_ON_LOAD, _ck_show_dataset_on_load->isChecked());
Preferences::inst()->setValue(STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION, _ck_int_spec_horiz->isChecked());
Preferences::inst()->setValue(STR_SEARCH_SUB_DIR_FOR_DATASETS, _ck_search_datasets->isChecked());
Preferences::inst()->setValue(STR_PRF_STRICT_REGEX, _ck_strict_regex->isChecked());
Preferences::inst()->setValue(STR_PRF_FILE_SIZE, _cb_file_size->currentIndex());
Expand Down
2 changes: 2 additions & 0 deletions src/preferences/PreferencesDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public slots:
QCheckBox* _ck_strict_regex;

QComboBox* _cb_file_size;

QCheckBox* _ck_int_spec_horiz;
};

//---------------------------------------------------------------------------
Expand Down

0 comments on commit a5b6b92

Please sign in to comment.