Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 1 | /*************************************************************************** |
Nicolas Jager | 74fe46f | 2016-02-29 14:55:09 -0500 | [diff] [blame] | 2 | * Copyright (C) 2015-2016 by Savoir-faire Linux * |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 3 | * 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 Milaret | 5f316da | 2015-09-28 11:57:42 -0400 | [diff] [blame] | 19 | #pragma once |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 20 | |
| 21 | #include <QWidget> |
| 22 | #include <QItemSelection> |
Edric Milaret | b25af97 | 2015-06-17 16:55:45 -0400 | [diff] [blame] | 23 | #include <QSettings> |
Edric Milaret | ce0ea47 | 2016-04-12 10:16:56 -0400 | [diff] [blame] | 24 | #include <QErrorMessage> |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 25 | |
| 26 | #include "navwidget.h" |
| 27 | #include "accountdetails.h" |
Edric Milaret | 01f2384 | 2015-06-22 14:46:01 -0400 | [diff] [blame] | 28 | #include "accountstatedelegate.h" |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 29 | |
| 30 | #include "accountmodel.h" |
| 31 | #include "video/devicemodel.h" |
Edric Milaret | e82782e | 2016-03-21 12:14:17 -0400 | [diff] [blame] | 32 | #include "codecmodel.h" |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 33 | |
| 34 | namespace Ui { |
| 35 | class ConfigurationWidget; |
| 36 | } |
| 37 | |
| 38 | class ConfigurationWidget : public NavWidget |
| 39 | { |
| 40 | Q_OBJECT |
| 41 | |
| 42 | public: |
| 43 | explicit ConfigurationWidget(QWidget *parent = 0); |
| 44 | ~ConfigurationWidget(); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 45 | |
Edric Milaret | 3aeae3a | 2015-06-01 17:31:54 -0400 | [diff] [blame] | 46 | protected: |
| 47 | void showEvent(QShowEvent *event); |
| 48 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 49 | //UI SLOTS |
| 50 | private slots: |
| 51 | void on_deviceBox_currentIndexChanged(int index); |
| 52 | void on_sizeBox_currentIndexChanged(int index); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 53 | void on_addAccountButton_clicked(); |
Edric Milaret | 94b4aab | 2015-05-08 12:10:44 -0400 | [diff] [blame] | 54 | void on_startupBox_toggled(bool checked); |
Edric Milaret | 1eece87 | 2015-06-10 13:37:51 -0400 | [diff] [blame] | 55 | void on_clearHistoryButton_clicked(); |
| 56 | void on_historyDaySettingsSpinBox_valueChanged(int limit); |
Edric Milaret | b25af97 | 2015-06-17 16:55:45 -0400 | [diff] [blame] | 57 | void on_closeOrMinCheckBox_toggled(bool checked); |
Edric Milaret | 79d3f68 | 2015-12-09 12:32:52 -0500 | [diff] [blame] | 58 | void on_checkUpdateButton_clicked(); |
| 59 | void on_autoUpdateCheckBox_toggled(bool checked); |
| 60 | void on_intervalUpdateCheckSpinBox_valueChanged(int arg1); |
Nicolas Jager | 74fe46f | 2016-02-29 14:55:09 -0500 | [diff] [blame] | 61 | void on_stackedWidget_currentChanged(int index); |
Edric Milaret | fd5a1f2 | 2016-02-05 15:30:00 -0500 | [diff] [blame] | 62 | void on_recordPath_clicked(); |
Edric Milaret | ce0ea47 | 2016-04-12 10:16:56 -0400 | [diff] [blame] | 63 | void on_importButton_clicked(); |
| 64 | void on_exportButton_clicked(); |
Edric Milaret | 25236d9 | 2016-03-28 09:40:58 -0400 | [diff] [blame] | 65 | void on_avatarButton_clicked(); |
| 66 | void on_profileNameEdit_textEdited(const QString& name); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 67 | |
| 68 | private slots: |
| 69 | void accountSelected(QItemSelection itemSel); |
Edric Milaret | 94b4aab | 2015-05-08 12:10:44 -0400 | [diff] [blame] | 70 | void deviceIndexChanged(int index); |
Edric Milaret | 47c40eb | 2016-03-14 15:06:22 -0400 | [diff] [blame] | 71 | void outputIndexChanged(int index); |
| 72 | void inputIndexChanged(int index); |
Edric Milaret | f8048cf | 2016-05-13 10:21:08 -0400 | [diff] [blame] | 73 | void accountPropertyChanged(Account* a, const QString& name, |
| 74 | const QString& newVal, const QString& oldVal); |
Edric Milaret | ce0ea47 | 2016-04-12 10:16:56 -0400 | [diff] [blame] | 75 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 76 | private: |
| 77 | Ui::ConfigurationWidget *ui; |
| 78 | AccountModel* accountModel_; |
Edric Milaret | f8048cf | 2016-05-13 10:21:08 -0400 | [diff] [blame] | 79 | QMetaObject::Connection accountConnection_; |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 80 | Video::DeviceModel* deviceModel_; |
| 81 | CodecModel* codecModel_; |
| 82 | bool isLoading_; |
| 83 | AccountDetails* accountDetails_; |
Edric Milaret | 01f2384 | 2015-06-22 14:46:01 -0400 | [diff] [blame] | 84 | AccountStateDelegate *accountStateDelegate_; |
Edric Milaret | b25af97 | 2015-06-17 16:55:45 -0400 | [diff] [blame] | 85 | QSettings settings_; |
Edric Milaret | ce0ea47 | 2016-04-12 10:16:56 -0400 | [diff] [blame] | 86 | QErrorMessage errorDlg_; |
Edric Milaret | ef9b85b | 2016-02-05 11:47:10 -0500 | [diff] [blame] | 87 | void showPreview(); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 88 | }; |
| 89 | |