/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. #ifndef SETTINGSDIALOG_H
  22. #define SETTINGSDIALOG_H
  23. #include <QDialog>
  24. #include <QModelIndex>
  25. #include <QActionGroup>
  26. #include <QToolBar>
  27. class AnimatedSpinner;
  28. class QListWidgetItem;
  29. class Ui_Settings_Accounts;
  30. class Ui_Settings_Collection;
  31. class Ui_Settings_Advanced;
  32. class SipPlugin;
  33. class ResolversModel;
  34. class QNetworkReply;
  35. class QToolbarTabDialog;
  36. namespace Ui
  37. {
  38. class ProxyDialog;
  39. }
  40. namespace Tomahawk
  41. {
  42. namespace Accounts
  43. {
  44. class AccountModel;
  45. class Account;
  46. class AccountFactory;
  47. class Account;
  48. class AccountModelFilterProxy;
  49. }
  50. }
  51. class ProxyDialog : public QDialog
  52. {
  53. Q_OBJECT
  54. public:
  55. explicit ProxyDialog( QWidget* parent = 0 );
  56. ~ProxyDialog() {};
  57. void saveSettings();
  58. private:
  59. Ui::ProxyDialog* ui;
  60. };
  61. class SettingsDialog : public QObject
  62. {
  63. Q_OBJECT
  64. public:
  65. explicit SettingsDialog( QObject* parent = 0 );
  66. ~SettingsDialog();
  67. void show();
  68. protected:
  69. void changeEvent( QEvent* e );
  70. private slots:
  71. void onRejected();
  72. void toggleRemoteMode();
  73. void toggleProxyEnabled();
  74. void showProxySettings();
  75. void accountsFilterChanged( int );
  76. void createAccountFromFactory( Tomahawk::Accounts::AccountFactory* );
  77. void openAccountConfig( Tomahawk::Accounts::Account*, bool showDelete = false );
  78. void openAccountFactoryConfig( Tomahawk::Accounts::AccountFactory* );
  79. void installFromFile();
  80. void scrollTo( const QModelIndex& );
  81. void updateScanOptionsView();
  82. void serventReady();
  83. void aclEntryClearButtonClicked();
  84. void requiresRestart();
  85. private slots:
  86. void saveSettings();
  87. private:
  88. Ui_Settings_Accounts* m_accountsWidgetUi;
  89. QWidget* m_accountsWidget;
  90. Ui_Settings_Collection* m_collectionWidgetUi;
  91. QWidget* m_collectionWidget;
  92. Ui_Settings_Advanced* m_advancedWidgetUi;
  93. QWidget* m_advancedWidget;
  94. QToolbarTabDialog* m_dialog;
  95. ProxyDialog m_proxySettings;
  96. bool m_rejected;
  97. bool m_restartRequired;
  98. Tomahawk::Accounts::AccountModel* m_accountModel;
  99. Tomahawk::Accounts::AccountModelFilterProxy* m_accountProxy;
  100. AnimatedSpinner* m_sipSpinner;
  101. };
  102. #endif // SETTINGSDIALOG_H