qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
settingswidget.h
Go to the documentation of this file.
1 /*
2  Copyright © 2014-2019 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include <QHBoxLayout>
23 #include <QPushButton>
24 #include <QStyleFactory>
25 
26 #include <array>
27 #include <memory>
28 
29 class Camera;
30 class Core;
31 class GenericForm;
32 class GeneralForm;
33 class IAudioControl;
34 class PrivacyForm;
35 class AVForm;
36 class QLabel;
37 class QTabWidget;
38 class ContentLayout;
39 class UpdateCheck;
40 class Widget;
41 
42 class SettingsWidget : public QWidget
43 {
44  Q_OBJECT
45 public:
46  SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Core *core, Widget* parent = nullptr);
48 
49  bool isShown() const;
50  void show(ContentLayout* contentLayout);
51  void setBodyHeadStyle(QString style);
52 
53  void showAbout();
54 
55 public slots:
56  void onUpdateAvailable(void);
57 
58 private slots:
59  void onTabChanged(int);
60 
61 private:
62  void retranslateUi();
63 
64 private:
65  std::unique_ptr<QVBoxLayout> bodyLayout;
66  std::unique_ptr<QTabWidget> settingsWidgets;
67  std::array<std::unique_ptr<GenericForm>, 6> cfgForms;
69 };
SettingsWidget::cfgForms
std::array< std::unique_ptr< GenericForm >, 6 > cfgForms
Definition: settingswidget.h:67
SettingsWidget::retranslateUi
void retranslateUi()
Definition: settingswidget.cpp:134
SettingsWidget::setBodyHeadStyle
void setBodyHeadStyle(QString style)
Definition: settingswidget.cpp:95
SettingsWidget::bodyLayout
std::unique_ptr< QVBoxLayout > bodyLayout
Definition: settingswidget.h:65
GeneralForm
Definition: generalform.h:30
AVForm
Definition: avform.h:40
SettingsWidget::SettingsWidget
SettingsWidget(UpdateCheck *updateCheck, IAudioControl &audio, Core *core, Widget *parent=nullptr)
Definition: settingswidget.cpp:44
SettingsWidget
Definition: settingswidget.h:42
SettingsWidget::isShown
bool isShown() const
Definition: settingswidget.cpp:105
SettingsWidget::showAbout
void showAbout()
Definition: settingswidget.cpp:100
SettingsWidget::currentIndex
int currentIndex
Definition: settingswidget.h:68
SettingsWidget::show
void show(ContentLayout *contentLayout)
Definition: settingswidget.cpp:115
SettingsWidget::settingsWidgets
std::unique_ptr< QTabWidget > settingsWidgets
Definition: settingswidget.h:66
SettingsWidget::~SettingsWidget
~SettingsWidget()
Definition: settingswidget.cpp:90
ContentLayout
Definition: contentlayout.h:25
SettingsWidget::onUpdateAvailable
void onUpdateAvailable(void)
Definition: settingswidget.cpp:127
UpdateCheck
Definition: updatecheck.h:32
PrivacyForm
Definition: privacyform.h:30
GenericForm
Definition: genericsettings.h:24
SettingsWidget::onTabChanged
void onTabChanged(int)
Definition: settingswidget.cpp:122
Core
Definition: core.h:59
Widget
Definition: widget.h:87