1 2 /**************************************************************************************** 3 * Copyright (c) 2009 John Atkinson <john@fauxnetic.co.uk> * 4 * * 5 * This program is free software; you can redistribute it and/or modify it under * 6 * the terms of the GNU General Public License as published by the Free Software * 7 * Foundation; either version 2 of the License, or (at your option) any later * 8 * version. * 9 * * 10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 12 * PARTICULAR PURPOSE. See the GNU General Pulic License for more details. * 13 * * 14 * You should have received a copy of the GNU General Public License along with * 15 * this program. If not, see <http://www.gnu.org/licenses/>. * 16 ****************************************************************************************/ 17 18 #ifndef DATABASECONFIG_H 19 #define DATABASECONFIG_H 20 21 #include "ui_DatabaseConfig.h" 22 #include "configdialog/ConfigDialogBase.h" 23 24 class KConfigDialogManager; 25 class KConfigSkeleton; 26 27 class DatabaseConfig : public ConfigDialogBase, public Ui_DatabaseConfig 28 { 29 Q_OBJECT 30 31 public: 32 DatabaseConfig( Amarok2ConfigDialog* parent, KConfigSkeleton *config ); 33 ~DatabaseConfig() override; 34 35 bool hasChanged() override; 36 bool isDefault() override; 37 void updateSettings() override; 38 39 public Q_SLOTS: 40 void toggleExternalConfigAvailable( int checkBoxState ); 41 void testDatabaseConnection(); 42 43 private Q_SLOTS: 44 void updateSQLQuery(); 45 46 private: 47 /** Returns true if the configuration is complete. 48 * 49 * Complete menas that the database, user and host are filled out. 50 */ 51 bool isSQLInfoPresent() const; 52 53 KConfigDialogManager* m_configManager; 54 55 }; 56 57 58 #endif 59 60 61