blob: 5c713fc3f26fe7b7d5e52aa27f1f0a1d0dae2e79 [file] [log] [blame]
Edric Milaret627500d2015-03-27 16:41:40 -04001/***************************************************************************
Nicolas Jager74fe46f2016-02-29 14:55:09 -05002 * Copyright (C) 2015-2016 by Savoir-faire Linux *
Edric Milaret627500d2015-03-27 16:41:40 -04003 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
Edric Milaret5f316da2015-09-28 11:57:42 -040019#pragma once
Edric Milaret627500d2015-03-27 16:41:40 -040020
21#include <QWidget>
22#include <QItemSelection>
Edric Milaretb25af972015-06-17 16:55:45 -040023#include <QSettings>
Edric Milaretce0ea472016-04-12 10:16:56 -040024#include <QErrorMessage>
Edric Milaret627500d2015-03-27 16:41:40 -040025
26#include "navwidget.h"
27#include "accountdetails.h"
Edric Milaret01f23842015-06-22 14:46:01 -040028#include "accountstatedelegate.h"
Edric Milaret627500d2015-03-27 16:41:40 -040029
30#include "accountmodel.h"
31#include "video/devicemodel.h"
Edric Milarete82782e2016-03-21 12:14:17 -040032#include "codecmodel.h"
Edric Milaret627500d2015-03-27 16:41:40 -040033
34namespace Ui {
35class ConfigurationWidget;
36}
37
38class ConfigurationWidget : public NavWidget
39{
40 Q_OBJECT
41
42public:
43 explicit ConfigurationWidget(QWidget *parent = 0);
44 ~ConfigurationWidget();
Edric Milaret627500d2015-03-27 16:41:40 -040045
Edric Milaret3aeae3a2015-06-01 17:31:54 -040046protected:
47 void showEvent(QShowEvent *event);
48
Edric Milaret627500d2015-03-27 16:41:40 -040049//UI SLOTS
50private slots:
51 void on_deviceBox_currentIndexChanged(int index);
52 void on_sizeBox_currentIndexChanged(int index);
Edric Milaret627500d2015-03-27 16:41:40 -040053 void on_addAccountButton_clicked();
Edric Milaret94b4aab2015-05-08 12:10:44 -040054 void on_startupBox_toggled(bool checked);
Edric Milaret1eece872015-06-10 13:37:51 -040055 void on_clearHistoryButton_clicked();
56 void on_historyDaySettingsSpinBox_valueChanged(int limit);
Edric Milaretb25af972015-06-17 16:55:45 -040057 void on_closeOrMinCheckBox_toggled(bool checked);
Edric Milaret79d3f682015-12-09 12:32:52 -050058 void on_checkUpdateButton_clicked();
59 void on_autoUpdateCheckBox_toggled(bool checked);
60 void on_intervalUpdateCheckSpinBox_valueChanged(int arg1);
Nicolas Jager74fe46f2016-02-29 14:55:09 -050061 void on_stackedWidget_currentChanged(int index);
Edric Milaretfd5a1f22016-02-05 15:30:00 -050062 void on_recordPath_clicked();
Edric Milaretce0ea472016-04-12 10:16:56 -040063 void on_importButton_clicked();
64 void on_exportButton_clicked();
Edric Milaret25236d92016-03-28 09:40:58 -040065 void on_avatarButton_clicked();
66 void on_profileNameEdit_textEdited(const QString& name);
Edric Milaret627500d2015-03-27 16:41:40 -040067
68private slots:
69 void accountSelected(QItemSelection itemSel);
Edric Milaret94b4aab2015-05-08 12:10:44 -040070 void deviceIndexChanged(int index);
Edric Milaret47c40eb2016-03-14 15:06:22 -040071 void outputIndexChanged(int index);
72 void inputIndexChanged(int index);
Edric Milaretf8048cf2016-05-13 10:21:08 -040073 void accountPropertyChanged(Account* a, const QString& name,
74 const QString& newVal, const QString& oldVal);
Edric Milaretce0ea472016-04-12 10:16:56 -040075
Edric Milaret627500d2015-03-27 16:41:40 -040076private:
77 Ui::ConfigurationWidget *ui;
78 AccountModel* accountModel_;
Edric Milaretf8048cf2016-05-13 10:21:08 -040079 QMetaObject::Connection accountConnection_;
Edric Milaret627500d2015-03-27 16:41:40 -040080 Video::DeviceModel* deviceModel_;
81 CodecModel* codecModel_;
82 bool isLoading_;
83 AccountDetails* accountDetails_;
Edric Milaret01f23842015-06-22 14:46:01 -040084 AccountStateDelegate *accountStateDelegate_;
Edric Milaretb25af972015-06-17 16:55:45 -040085 QSettings settings_;
Edric Milaretce0ea472016-04-12 10:16:56 -040086 QErrorMessage errorDlg_;
Edric Milaretef9b85b2016-02-05 11:47:10 -050087 void showPreview();
Edric Milaret627500d2015-03-27 16:41:40 -040088};
89