blob: 9564535938aa416ccb0ec07f490ffeb55d03d9d8 [file] [log] [blame]
Olivier SOLDANO47aa97f2017-04-04 10:40:00 -04001/**************************************************************************
Anthony Léonard2fde81d2017-04-17 10:06:55 -04002* Copyright (C) 2015-2017 by Savoir-faire Linux *
Olivier SOLDANO47aa97f2017-04-04 10:40:00 -04003* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
4* Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com> *
5* Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com> *
6* *
7* This program is free software; you can redistribute it and/or modify *
8* it under the terms of the GNU General Public License as published by *
9* the Free Software Foundation; either version 3 of the License, or *
10* (at your option) any later version. *
11* *
12* This program is distributed in the hope that it will be useful, *
13* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15* GNU General Public License for more details. *
16* *
17* You should have received a copy of the GNU General Public License *
18* along with this program. If not, see <http://www.gnu.org/licenses/>. *
19**************************************************************************/
Edric Milaret627500d2015-03-27 16:41:40 -040020
Edric Milaret5f316da2015-09-28 11:57:42 -040021#pragma once
Edric Milaret627500d2015-03-27 16:41:40 -040022
23#include <QWidget>
24#include <QItemSelection>
Edric Milaretb25af972015-06-17 16:55:45 -040025#include <QSettings>
Edric Milaretce0ea472016-04-12 10:16:56 -040026#include <QErrorMessage>
Edric Milaret627500d2015-03-27 16:41:40 -040027
28#include "navwidget.h"
29#include "accountdetails.h"
Edric Milaret01f23842015-06-22 14:46:01 -040030#include "accountstatedelegate.h"
Edric Milaret627500d2015-03-27 16:41:40 -040031
32#include "accountmodel.h"
33#include "video/devicemodel.h"
Edric Milarete82782e2016-03-21 12:14:17 -040034#include "codecmodel.h"
Edric Milaret627500d2015-03-27 16:41:40 -040035
36namespace Ui {
37class ConfigurationWidget;
38}
39
40class ConfigurationWidget : public NavWidget
41{
42 Q_OBJECT
43
44public:
45 explicit ConfigurationWidget(QWidget *parent = 0);
46 ~ConfigurationWidget();
Edric Milaret627500d2015-03-27 16:41:40 -040047
Edric Milaret3aeae3a2015-06-01 17:31:54 -040048protected:
49 void showEvent(QShowEvent *event);
50
Edric Milaret627500d2015-03-27 16:41:40 -040051//UI SLOTS
52private slots:
53 void on_deviceBox_currentIndexChanged(int index);
54 void on_sizeBox_currentIndexChanged(int index);
Edric Milaret627500d2015-03-27 16:41:40 -040055 void on_addAccountButton_clicked();
Edric Milaret94b4aab2015-05-08 12:10:44 -040056 void on_startupBox_toggled(bool checked);
Edric Milaret1eece872015-06-10 13:37:51 -040057 void on_clearHistoryButton_clicked();
58 void on_historyDaySettingsSpinBox_valueChanged(int limit);
Edric Milaretb25af972015-06-17 16:55:45 -040059 void on_closeOrMinCheckBox_toggled(bool checked);
Edric Milaret79d3f682015-12-09 12:32:52 -050060 void on_checkUpdateButton_clicked();
61 void on_autoUpdateCheckBox_toggled(bool checked);
62 void on_intervalUpdateCheckSpinBox_valueChanged(int arg1);
Nicolas Jager74fe46f2016-02-29 14:55:09 -050063 void on_stackedWidget_currentChanged(int index);
Edric Milaretfd5a1f22016-02-05 15:30:00 -050064 void on_recordPath_clicked();
Edric Milaretce0ea472016-04-12 10:16:56 -040065 void on_importButton_clicked();
66 void on_exportButton_clicked();
Edric Milaret25236d92016-03-28 09:40:58 -040067 void on_avatarButton_clicked();
68 void on_profileNameEdit_textEdited(const QString& name);
Edric Milaret568a0e52016-09-02 16:26:58 -040069 void on_notificationCheckBox_toggled(bool checked);
Edric Milaret627500d2015-03-27 16:41:40 -040070
71private slots:
72 void accountSelected(QItemSelection itemSel);
Edric Milaret94b4aab2015-05-08 12:10:44 -040073 void deviceIndexChanged(int index);
Edric Milaret47c40eb2016-03-14 15:06:22 -040074 void outputIndexChanged(int index);
75 void inputIndexChanged(int index);
Edric Milaretf8048cf2016-05-13 10:21:08 -040076 void accountPropertyChanged(Account* a, const QString& name,
77 const QString& newVal, const QString& oldVal);
Edric Milaretce0ea472016-04-12 10:16:56 -040078
Edric Milaret627500d2015-03-27 16:41:40 -040079private:
80 Ui::ConfigurationWidget *ui;
81 AccountModel* accountModel_;
Edric Milaretf8048cf2016-05-13 10:21:08 -040082 QMetaObject::Connection accountConnection_;
Edric Milaret627500d2015-03-27 16:41:40 -040083 Video::DeviceModel* deviceModel_;
84 CodecModel* codecModel_;
85 bool isLoading_;
86 AccountDetails* accountDetails_;
Edric Milaret01f23842015-06-22 14:46:01 -040087 AccountStateDelegate *accountStateDelegate_;
Edric Milaretb25af972015-06-17 16:55:45 -040088 QSettings settings_;
Edric Milaretce0ea472016-04-12 10:16:56 -040089 QErrorMessage errorDlg_;
Olivier SOLDANO9b7e80d2017-05-04 16:06:01 -040090
Edric Milaretef9b85b2016-02-05 11:47:10 -050091 void showPreview();
Edric Milaret627500d2015-03-27 16:41:40 -040092};
93