blob: f1ddde90548ae05484c872de98c71cc6f6c19563 [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 Milaret627500d2015-03-27 16:41:40 -040055
56private slots:
Edric Milaret3e6aefe2015-06-05 16:07:26 -040057 void onCertButtonClicked();
Edric Milaretb1b00ce2016-02-03 14:10:05 -050058 void ringtonesBoxCurrentIndexChanged(int index);
Edric Milaretdda49b62016-02-05 14:27:38 -050059 void audioCodecSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
60 void videoCodecSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
Edric Milaretb1b00ce2016-02-03 14:10:05 -050061
Edric Milaret627500d2015-03-27 16:41:40 -040062private:
Edric Milaretdda49b62016-02-05 14:27:38 -050063 Ui::AccountDetails* ui;
Edric Milaret627500d2015-03-27 16:41:40 -040064 CodecModel* codecModel_;
65 Account* currentAccount_;
Edric Milaret3e6aefe2015-06-05 16:07:26 -040066 typedef void (Account::*ACC_PTR)(const QString&);
67 QMap<QString, ACC_PTR > certMap_;
Edric Milaret627500d2015-03-27 16:41:40 -040068
Edric Milaretdda49b62016-02-05 14:27:38 -050069 void stopRingtone();
Edric Milaret627500d2015-03-27 16:41:40 -040070};
71