Make plasma libs build.
[amarok.git] / src / dbsetup.ui.h
blob726c2bc3bfac4a896661b85742e7f080d850f52f
1 /***************************************************************************
2 * copyright : (C) 2005 Ian Monroe <ian@monroe.nu>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License or (at your option) version 3 or any later version
8 * accepted by the membership of KDE e.V. (or its successor approved
9 * by the membership of KDE e.V.), which shall act as a proxy
10 * defined in Section 14 of version 3 of the license.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **************************************************************************/
20 /****************************************************************************
21 ** ui.h extension file, included from the uic-generated form implementation.
23 ** If you want to add, delete, or rename functions or slots, use
24 ** Qt Designer to update this file, preserving your code.
26 ** You should not define a constructor or destructor in this file.
27 ** Instead, write your code in functions called init() and destroy().
28 ** These will automatically be called by the form's constructor and
29 ** destructor.
30 *****************************************************************************/
31 #include "config-amarok.h"
32 #include "amarokconfig.h"
33 #include "collectiondb.h"
35 void DbSetup::init()
37 configStack->raiseWidget( 0 );
38 #ifdef USE_MYSQL
39 databaseEngine->addItem( "MySQL", -1 );
40 if (AmarokConfig::databaseEngine() == QString::number(DbConnection::mysql))
42 databaseEngine->setCurrentItem("MySQL");
43 configStack->raiseWidget( 1 );
45 #endif
47 #ifdef USE_POSTGRESQL
48 databaseEngine->addItem( "Postgresql", -1 );
49 if (AmarokConfig::databaseEngine() == QString::number(DbConnection::postgresql))
51 databaseEngine->setCurrentItem("Postgresql");
52 configStack->raiseWidget( 2 );
54 #endif
57 void DbSetup::databaseEngine_activated( int item )
59 if( item == 0 )
60 configStack->raiseWidget( 0 );
62 // If built with MySQL support, the PostgreSQL config widget is #2
63 // Without MySQL it's #1
64 #ifdef USE_MYSQL
65 else if( item == 1 )
66 configStack->raiseWidget( 1 );
67 else if( item == 2 )
68 configStack->raiseWidget( 2 );
69 #elif defined(USE_POSTGRESQL)
70 else if( item == 1 )
71 configStack->raiseWidget( 2 );
72 #endif