blob: 7271f2ea13a25d260cca21830592ca2c4a9b8c98 [file] [log] [blame]
Edric Milaret627500d2015-03-27 16:41:40 -04001/***************************************************************************
Edric Milaretdda49b62016-02-05 14:27:38 -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>
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
Nicolas Jager74fe46f2016-02-29 14:55:09 -050044 QPushButton* getDeleteAccountButton();
Edric Milaretdda49b62016-02-05 14:27:38 -050045 void setAccount(Account* currentAccount);
Edric Milaret627500d2015-03-27 16:41:40 -040046 void save();
47
48//UI SLOTS
49private slots:
50 void on_upAudioButton_clicked();
51 void on_downAudioButton_clicked();
52 void on_upVideoButton_clicked();
53 void on_downVideoButton_clicked();
Edric Milaretdda49b62016-02-05 14:27:38 -050054 void on_playButton_clicked();
Edric Milaret57467842016-08-30 13:06:11 -040055 void on_addDeviceButton_clicked();
56 void on_cancelButton_clicked();
57 void on_exportOnRingButton_clicked();
58 void on_exportEndedOkButton_clicked();
59 void on_cancelAddButton_clicked();
Anthony Léonard59db8ce2016-10-19 10:54:11 -040060 void on_devicesStackedWidget_currentChanged(int arg1);
Anthony Léonardaa90e1a2016-10-12 11:24:17 -040061 void on_registerButton_clicked();
Edric Milaret627500d2015-03-27 16:41:40 -040062
63private slots:
Edric Milaret3e6aefe2015-06-05 16:07:26 -040064 void onCertButtonClicked();
Edric Milaretb1b00ce2016-02-03 14:10:05 -050065 void ringtonesBoxCurrentIndexChanged(int index);
Edric Milaretdda49b62016-02-05 14:27:38 -050066 void audioCodecSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
67 void videoCodecSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
Edric Milaret57467842016-08-30 13:06:11 -040068 void exportOnRingEnded(Account::ExportOnRingStatus state, const QString& pin);
Anthony Léonardaa90e1a2016-10-12 11:24:17 -040069 void handle_nameRegistrationEnded(NameDirectory::RegisterNameStatus status, const QString& name);
Edric Milaretb1b00ce2016-02-03 14:10:05 -050070
Edric Milaret627500d2015-03-27 16:41:40 -040071private:
Edric Milaretdda49b62016-02-05 14:27:38 -050072 Ui::AccountDetails* ui;
Edric Milaret627500d2015-03-27 16:41:40 -040073 CodecModel* codecModel_;
74 Account* currentAccount_;
Edric Milaret3e6aefe2015-06-05 16:07:26 -040075 typedef void (Account::*ACC_PTR)(const QString&);
76 QMap<QString, ACC_PTR > certMap_;
Edric Milaret627500d2015-03-27 16:41:40 -040077
Edric Milaretdda49b62016-02-05 14:27:38 -050078 void stopRingtone();
Edric Milaret627500d2015-03-27 16:41:40 -040079};