configurationwidget.h 2.7 KB
Newer Older
Edric Milaret's avatar
Edric Milaret committed
1
/***************************************************************************
2
 * Copyright (C) 2015 by Savoir-Faire Linux                                *
Edric Milaret's avatar
Edric Milaret committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU General Public License as published by    *
 * the Free Software Foundation; either version 3 of the License, or       *
 * (at your option) any later version.                                     *
 *                                                                         *
 * This program is distributed in the hope that it will be useful,         *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 * GNU General Public License for more details.                            *
 *                                                                         *
 * You should have received a copy of the GNU General Public License       *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 **************************************************************************/

#ifndef CONFIGURATIONWIDGET_H
#define CONFIGURATIONWIDGET_H

#include <QWidget>
#include <QItemSelection>
24
#include <QSettings>
Edric Milaret's avatar
Edric Milaret committed
25 26 27

#include "navwidget.h"
#include "accountdetails.h"
Edric Milaret's avatar
Edric Milaret committed
28
#include "accountstatedelegate.h"
Edric Milaret's avatar
Edric Milaret committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

#include "accountmodel.h"
#include "video/devicemodel.h"
#include "audio/codecmodel.h"

namespace Ui {
class ConfigurationWidget;
}

class ConfigurationWidget : public NavWidget
{
    Q_OBJECT

public:
    explicit ConfigurationWidget(QWidget *parent = 0);
    ~ConfigurationWidget();
    void atExit();

47 48 49
protected:
    void showEvent(QShowEvent *event);

Edric Milaret's avatar
Edric Milaret committed
50 51 52 53 54 55 56
//UI SLOTS
private slots:
    void on_deviceBox_currentIndexChanged(int index);
    void on_sizeBox_currentIndexChanged(int index);
    void on_rateBox_currentIndexChanged(int index);
    void on_deleteAccountButton_clicked();
    void on_addAccountButton_clicked();
57
    void on_startupBox_toggled(bool checked);
58 59
    void on_clearHistoryButton_clicked();
    void on_historyDaySettingsSpinBox_valueChanged(int limit);
60
    void on_closeOrMinCheckBox_toggled(bool checked);
Edric Milaret's avatar
Edric Milaret committed
61 62 63

private slots:
    void accountSelected(QItemSelection itemSel);
64
    void deviceIndexChanged(int index);
65

Edric Milaret's avatar
Edric Milaret committed
66 67 68 69 70 71 72
private:
    Ui::ConfigurationWidget *ui;
    AccountModel* accountModel_;
    Video::DeviceModel* deviceModel_;
    CodecModel* codecModel_;
    bool isLoading_;
    AccountDetails* accountDetails_;
Edric Milaret's avatar
Edric Milaret committed
73
    AccountStateDelegate *accountStateDelegate_;
74
    QSettings settings_;
Edric Milaret's avatar
Edric Milaret committed
75 76 77
};

#endif // CONFIGURATIONWIDGET_H