PageRenderTime 62ms CodeModel.GetById 40ms app.highlight 8ms RepoModel.GetById 13ms app.codeStats 0ms

/src/settingsdialog.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 131 lines | 82 code | 29 blank | 20 comment | 0 complexity | eae1f0a4e3049a9447cb3ce985f9f876 MD5 | raw file
  1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2 *
  3 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
  4 *   Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
  5 *   Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
  6 *   Copyright 2012,      Teo Mrnjavac <teo@kde.org>
  7 *
  8 *   Tomahawk is free software: you can redistribute it and/or modify
  9 *   it under the terms of the GNU General Public License as published by
 10 *   the Free Software Foundation, either version 3 of the License, or
 11 *   (at your option) any later version.
 12 *
 13 *   Tomahawk is distributed in the hope that it will be useful,
 14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 16 *   GNU General Public License for more details.
 17 *
 18 *   You should have received a copy of the GNU General Public License
 19 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
 20 */
 21
 22#ifndef SETTINGSDIALOG_H
 23#define SETTINGSDIALOG_H
 24
 25#include <QDialog>
 26#include <QModelIndex>
 27#include <QActionGroup>
 28#include <QToolBar>
 29
 30class AnimatedSpinner;
 31class QListWidgetItem;
 32class Ui_Settings_Accounts;
 33class Ui_Settings_Collection;
 34class Ui_Settings_Advanced;
 35class SipPlugin;
 36class ResolversModel;
 37class QNetworkReply;
 38class QToolbarTabDialog;
 39
 40namespace Ui
 41{
 42    class ProxyDialog;
 43}
 44
 45namespace Tomahawk
 46{
 47    namespace Accounts
 48    {
 49        class AccountModel;
 50        class Account;
 51        class AccountFactory;
 52class Account;
 53class AccountModelFilterProxy;
 54}
 55}
 56
 57class ProxyDialog : public QDialog
 58{
 59Q_OBJECT
 60
 61public:
 62    explicit ProxyDialog( QWidget* parent = 0 );
 63    ~ProxyDialog() {};
 64
 65    void saveSettings();
 66
 67private:
 68    Ui::ProxyDialog* ui;
 69};
 70
 71class SettingsDialog : public QObject
 72{
 73Q_OBJECT
 74
 75public:
 76    explicit SettingsDialog( QObject* parent = 0 );
 77    ~SettingsDialog();
 78
 79    void show();
 80protected:
 81    void changeEvent( QEvent* e );
 82
 83private slots:
 84    void onRejected();
 85
 86    void toggleRemoteMode();
 87    void toggleProxyEnabled();
 88    void showProxySettings();
 89
 90    void accountsFilterChanged( int );
 91
 92    void createAccountFromFactory( Tomahawk::Accounts::AccountFactory* );
 93    void openAccountConfig( Tomahawk::Accounts::Account*, bool showDelete = false );
 94    void openAccountFactoryConfig( Tomahawk::Accounts::AccountFactory* );
 95
 96    void installFromFile();
 97    void scrollTo( const QModelIndex& );
 98
 99    void updateScanOptionsView();
100
101    void serventReady();
102
103    void aclEntryClearButtonClicked();
104
105    void requiresRestart();
106
107private slots:
108    void saveSettings();
109
110private:
111    Ui_Settings_Accounts* m_accountsWidgetUi;
112    QWidget* m_accountsWidget;
113
114    Ui_Settings_Collection* m_collectionWidgetUi;
115    QWidget* m_collectionWidget;
116
117    Ui_Settings_Advanced* m_advancedWidgetUi;
118    QWidget* m_advancedWidget;
119
120    QToolbarTabDialog* m_dialog;
121
122    ProxyDialog m_proxySettings;
123    bool m_rejected;
124    bool m_restartRequired;
125    Tomahawk::Accounts::AccountModel* m_accountModel;
126    Tomahawk::Accounts::AccountModelFilterProxy* m_accountProxy;
127    AnimatedSpinner* m_sipSpinner;
128};
129
130#endif // SETTINGSDIALOG_H
131