MCPcopy Create free account
hub / github.com/KDE/labplot / SettingsGeneralPage

Method SettingsGeneralPage

src/frontend/SettingsGeneralPage.cpp:22–62  ·  view source on GitHub ↗

* \brief Page for the 'General' settings of the Labplot settings dialog. */

Source from the content-addressed store, hash-verified

20 * \brief Page for the 'General' settings of the Labplot settings dialog.
21 */
22SettingsGeneralPage::SettingsGeneralPage(QWidget* parent, const QLocale& locale)
23 : SettingsPage(parent)
24 , m_defaultSystemLocale(locale) {
25 ui.setupUi(this);
26 ui.sbAutoSaveInterval->setSuffix(i18n("min."));
27#ifdef NDEBUG
28 ui.chkDebugTrace->setVisible(false);
29#endif
30 retranslateUi();
31
32 connect(ui.cbLoadOnStart, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::loadOnStartChanged);
33 connect(ui.cbNewProject, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::newProjectChanged);
34 connect(ui.cbNewProjectNotebook, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::changed);
35 connect(ui.cbDockWindowPositionReopen, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::changed);
36 connect(ui.cbLoadOnStart, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::changed);
37 connect(ui.cbTitleBar, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::changed);
38 connect(ui.cbUnits, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::changed);
39 connect(ui.cbNumberFormat, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SettingsGeneralPage::changed);
40 connect(ui.chkGUMTerms, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
41 connect(ui.chkOmitGroupSeparator, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
42 connect(ui.chkOmitLeadingZeroInExponent, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
43 connect(ui.chkIncludeTrailingZeroesAfterDot, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
44 connect(ui.chkUseHyphen, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
45 connect(ui.chkAutoSave, &QCheckBox::toggled, this, &SettingsGeneralPage::autoSaveChanged);
46 connect(ui.chkSaveDockStates, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
47 connect(ui.chkSaveCalculations, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
48 connect(ui.chkCompatible, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
49 connect(ui.chkInfoTrace, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
50 connect(ui.chkDebugTrace, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
51 connect(ui.chkPerfTrace, &QCheckBox::toggled, this, &SettingsGeneralPage::changed);
52
53#ifdef HAVE_CANTOR_LIBS
54 for (auto* backend : Cantor::Backend::availableBackends()) {
55 if (backend->isEnabled())
56 ui.cbNewProjectNotebook->addItem(QIcon::fromTheme(backend->icon()), backend->name());
57 }
58#endif
59
60 loadSettings();
61 autoSaveChanged(ui.chkAutoSave->isChecked());
62}
63
64QLocale::Language SettingsGeneralPage::numberFormat() const {
65 return static_cast<QLocale::Language>(ui.cbNumberFormat->currentData().toInt());

Callers

nothing calls this directly

Calls 4

setSuffixMethod · 0.80
setVisibleMethod · 0.45
iconMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected