BibleTime
cconfigurationdialog.cpp
Go to the documentation of this file.
1 /*********
2 *
3 * In the name of the Father, and of the Son, and of the Holy Spirit.
4 *
5 * This file is part of BibleTime's source code, https://bibletime.info/
6 *
7 * Copyright 1999-2021 by the BibleTime developers.
8 * The BibleTime source code is licensed under the GNU General Public License
9 * version 2.0.
10 *
11 **********/
12 
13 #include "cconfigurationdialog.h"
14 
15 #include <QByteArray>
16 #include "../../backend/config/btconfig.h"
17 #include "btfontsettings.h"
18 #include "cacceleratorsettings.h"
19 #include "cdisplaysettings.h"
20 #include "cswordsettings.h"
21 
22 
23 namespace {
24 auto const GeometryKey = QStringLiteral("GUI/SettingsDialog/geometry");
25 } // anonymous namespace
26 
28  Qt::WindowFlags const f)
29  : BtConfigDialog(parent, f)
30 {
31  setWindowTitle(tr("Configure BibleTime"));
32  setAttribute(Qt::WA_DeleteOnClose);
33 
34  addPage(new CDisplaySettingsPage(this));
35  addPage(new CSwordSettingsPage(this));
36  addPage(new BtFontSettingsPage(this));
38 
39  restoreGeometry(btConfig().value<QByteArray>(GeometryKey, QByteArray()));
40 }
41 
43 { btConfig().setValue(GeometryKey, saveGeometry()); }
BtConfig & btConfig()
This is a shortchand for BtConfig::getInstance().
Definition: btconfig.h:305
void setValue(QString const &key, T const &value)
Sets a value for a key.
Definition: btconfigcore.h:73
void addPage(Page *const pageWidget)
Adds the page to this dialog, taking ownership.
The shortcut settings page.
CConfigurationDialog(QWidget *const parent=nullptr, Qt::WindowFlags const f=Qt::WindowFlags())
~CConfigurationDialog() noexcept override