blob: f7f2e47c16e6a99175a202531381949b54fa2f1f [file] [log] [blame]
Edric Milaret627500d2015-03-27 16:41:40 -04001/***************************************************************************
Anthony Léonard2fde81d2017-04-17 10:06:55 -04002 * Copyright (C) 2015-2017 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>
Edric Milaret3e6aefe2015-06-05 16:07:26 -040022#include <QMap>
Edric Milaret627500d2015-03-27 16:41:40 -040023
24#include <QTableWidgetItem>
25
26#include "accountmodel.h"
Edric Milarete82782e2016-03-21 12:14:17 -040027#include "codecmodel.h"
Edric Milaret3e6aefe2015-06-05 16:07:26 -040028#include "account.h"
Edric Milaret627500d2015-03-27 16:41:40 -040029
Nicolas Jager74fe46f2016-02-29 14:55:09 -050030class QPushButton;
31
Edric Milaret627500d2015-03-27 16:41:40 -040032namespace Ui {
33class AccountDetails;
34}
35
36class AccountDetails : public QWidget
37{
38 Q_OBJECT
39
Edric Milaret627500d2015-03-27 16:41:40 -040040public:
Edric Milaretdda49b62016-02-05 14:27:38 -050041 explicit AccountDetails(QWidget* parent = 0);
Edric Milaret627500d2015-03-27 16:41:40 -040042 ~AccountDetails();
43
Edric Milaretdda49b62016-02-05 14:27:38 -050044 void setAccount(Account* currentAccount);
Edric Milaret627500d2015-03-27 16:41:40 -040045 void save();
46
47//UI SLOTS
48private slots:
49 void on_upAudioButton_clicked();
50 void on_downAudioButton_clicked();
51 void on_upVideoButton_clicked();
52 void on_downVideoButton_clicked();
Edric Milaretdda49b62016-02-05 14:27:38 -050053 void on_playButton_clicked();
Edric Milaret57467842016-08-30 13:06:11 -040054 void on_addDeviceButton_clicked();
55 void on_cancelButton_clicked();
56 void on_exportOnRingButton_clicked();
57 void on_exportEndedOkButton_clicked();
58 void on_cancelAddButton_clicked();
Anthony Léonard59db8ce2016-10-19 10:54:11 -040059 void on_devicesStackedWidget_currentChanged(int arg1);
Anthony Léonardaa90e1a2016-10-12 11:24:17 -040060 void on_registerButton_clicked();
Edric Milaret627500d2015-03-27 16:41:40 -040061
62private slots:
Edric Milaret3e6aefe2015-06-05 16:07:26 -040063 void onCertButtonClicked();
Edric Milaretb1b00ce2016-02-03 14:10:05 -050064 void ringtonesBoxCurrentIndexChanged(int index);
Edric Milaretdda49b62016-02-05 14:27:38 -050065 void audioCodecSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
66 void videoCodecSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
Edric Milaret57467842016-08-30 13:06:11 -040067 void exportOnRingEnded(Account::ExportOnRingStatus state, const QString& pin);
Anthony Léonardaa90e1a2016-10-12 11:24:17 -040068 void handle_nameRegistrationEnded(NameDirectory::RegisterNameStatus status, const QString& name);
Olivier SOLDANOd048d172017-09-28 15:34:32 -040069 void on_changePassBtn_clicked();
70 void on_confirmChangeBtn_clicked();
71 void on_cancelChangeBtn_clicked();
Edric Milaretb1b00ce2016-02-03 14:10:05 -050072
Edric Milaret627500d2015-03-27 16:41:40 -040073private:
Edric Milaretdda49b62016-02-05 14:27:38 -050074 Ui::AccountDetails* ui;
Edric Milaret627500d2015-03-27 16:41:40 -040075 CodecModel* codecModel_;
76 Account* currentAccount_;
Edric Milaret3e6aefe2015-06-05 16:07:26 -040077 typedef void (Account::*ACC_PTR)(const QString&);
78 QMap<QString, ACC_PTR > certMap_;
Edric Milaret627500d2015-03-27 16:41:40 -040079
Edric Milaretdda49b62016-02-05 14:27:38 -050080 void stopRingtone();
Olivier SOLDANOd048d172017-09-28 15:34:32 -040081 void resetPasswordChangeUI();
Edric Milaret627500d2015-03-27 16:41:40 -040082};