[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [Amarok] MySQL database configuration support. Thanks to Jo
From:       John Atkinson <john () fauxnetic ! co ! uk>
Date:       2009-08-30 20:40:58
Message-ID: df20eb0d0908301340m717768cclf39886beacd063 () mail ! gmail ! com
[Download RAW message or body]

Urghh... magic prefixes. My fault for allowing the two to get confused
though.
If I understand this correctly now, this should be fixable by simply
renaming the editable dialog items to remove the "kcfg_" at the start. Then
it should read/write using normal KConfig.

Also, I create do a patch to use KConfigXT properly. That's what most of the
other configuration dialogs seem to use.

- John


2009/8/30 Mark Kretschmann <kretschmann@kde.org>

> I'm sorry, but this patch seems badly broken. It's using config
> options that don't exist, and mixes KConfigXT with classic KConfig. I
> can't really see how that's supposed to work.
>
> The whole "MySQL" group is missing in amarokconfig.kcfg.
>
> Users with debug builds of KDElibs are getting an instant crash when
> opening the dialog:
>
> amarok(4185)/kdecore (KConfigDialogManager)
> KConfigDialogManager::parseChildren: A widget named '
> "kcfg_UseInternalDB" ' was found but there is no setting named '
> "UseInternalDB" '
>
>
> Here's some documentation on KConfigXT:
> http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
>
>
>
> On Sun, Aug 30, 2009 at 3:24 AM, Seb Ruiz<ruiz@kde.org> wrote:
> > commit 698fd3c2b47f876b5ef053d0028d594ca8e34df9
> > Author:     Seb Ruiz <ruiz@kde.org>
> > AuthorDate: Sun Aug 30 10:44:52 2009 +1000
> > Commit:     Seb Ruiz <ruiz@kde.org>
> > CommitDate: Sun Aug 30 10:44:52 2009 +1000
> >
> >    MySQL database configuration support. Thanks to John Atkinson for the
> patch!
> >    CCMAIL: john@fauxnetic.co.uk
> >
> > diff --git a/ChangeLog b/ChangeLog
> > index 5a268f6..cc9efe6 100644
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -62,8 +62,7 @@ VERSION 2.2-beta1
> >       The video can be appended to the playlist, and rendered within the
> applet.
> >     * Photo applet to show images from Flickr, with customizable
> animations.
> >     * Customizable user interface using dock widgets.
> > -    * Support for external MySQL database. See
> > -      http://amarok.kde.org/wiki/MySQL_Server.
> > +    * Support for external MySQL database.
> >     * GHNS integration for downloading and installing Context applets.
> >     * Support for Context applets to be written in QtScript.
> >     * Custom Dynamic Playlists using Last.fm.
> > diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> > index 323fe0d..cab1d28 100644
> > --- a/src/CMakeLists.txt
> > +++ b/src/CMakeLists.txt
> > @@ -187,6 +187,7 @@ set(libconfigdialog_SRCS
> >     configdialog/dialogs/OsdConfig.cpp
> >     configdialog/dialogs/PlaybackConfig.cpp
> >     configdialog/dialogs/ServiceConfig.cpp
> > +    configdialog/dialogs/DatabaseConfig.cpp
> >  )
> >
> >  kde4_add_ui_files(libconfigdialog_SRCS
> > @@ -194,6 +195,7 @@ kde4_add_ui_files(libconfigdialog_SRCS
> >     configdialog/dialogs/GeneralConfig.ui
> >     configdialog/dialogs/OsdConfig.ui
> >     configdialog/dialogs/PlaybackConfig.ui
> > +    configdialog/dialogs/DatabaseConfig.ui
> >  )
> >
> >  set(libbrowserframework_SRCS
> > diff --git a/src/configdialog/ConfigDialog.cpp
> b/src/configdialog/ConfigDialog.cpp
> > index c18239d..b53ae4f 100644
> > --- a/src/configdialog/ConfigDialog.cpp
> > +++ b/src/configdialog/ConfigDialog.cpp
> > @@ -27,6 +27,7 @@
> >  #include "OsdConfig.h"
> >  #include "PlaybackConfig.h"
> >  #include "ServiceConfig.h"
> > +#include "DatabaseConfig.h"
> >
> >  #include <KLocale>
> >
> > @@ -47,6 +48,7 @@ Amarok2ConfigDialog::Amarok2ConfigDialog( QWidget
> *parent, const char* name, KCo
> >     ConfigDialogBase* services    = new ServiceConfig( this );
> >     ConfigDialogBase* playback    = new PlaybackConfig( this );
> >     ConfigDialogBase* osd         = new OsdConfig( this );
> > +    ConfigDialogBase* database    = new DatabaseConfig( this );
> >
> >     connect( general, SIGNAL( lockLayout( bool ) ), The::mainWindow(),
> SLOT ( setLayoutLocked( bool ) ) );
> >
> > @@ -57,6 +59,7 @@ Amarok2ConfigDialog::Amarok2ConfigDialog( QWidget
> *parent, const char* name, KCo
> >     addPage( services,    i18n( "Internet Services" ), "services-amarok",
> i18n( "Configure Services" ) );
> >     addPage( playback,    i18n( "Playback" ),
> "preferences-media-playback-amarok", i18n( "Configure Playback" ) );
> >     addPage( osd,         i18n( "On Screen Display" ),
> "preferences-indicator-amarok", i18n( "Configure On-Screen-Display" ) );
> > +    addPage( database,    i18n( "Database" ),
> "preferences-database-amarok", i18n( "Configure Database" ) );
> >  //    addPage( mediadevice, i18n( "Media Devices" ),
> "preferences-multimedia-player-amarok", i18n( "Configure Portable Player
> Support" ) );
> >
> >     setButtons( Help | Ok | Apply | Cancel );
> > diff --git a/src/configdialog/dialogs/DatabaseConfig.cpp
> b/src/configdialog/dialogs/DatabaseConfig.cpp
> > new file mode 100644
> > index 0000000..8088d8e
> > --- /dev/null
> > +++ b/src/configdialog/dialogs/DatabaseConfig.cpp
> > @@ -0,0 +1,159 @@
> >
> +/****************************************************************************************
> > + * Copyright (c) 2009 John Atkinson <john@fauxnetic.co.uk>
>                  *
> > + *
>                *
> > + * 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 2 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 Pulic 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/>.
>                 *
> > +
> ****************************************************************************************/
> > +
> > +#include "DatabaseConfig.h"
> > +
> > +#include "Amarok.h"
> > +#include "Debug.h"
> > +
> > +#include <KCMultiDialog>
> > +
> > +
> > +DatabaseConfig::DatabaseConfig( QWidget* parent )
> > +    : ConfigDialogBase( parent )
> > +{
> > +    setupUi( this );
> > +    readConfiguration();
> > +
> > +    connect( kcfg_UseInternalDB, SIGNAL( stateChanged(int) ), SLOT(
> toggleExternalConfigAvailable(int) ) );
> > +
> > +    connect( kcfg_DBName,   SIGNAL( editingFinished() ), SLOT(
> updateSQLQuery() ) );
> > +    connect( kcfg_Username, SIGNAL( editingFinished() ), SLOT(
> updateSQLQuery() ) );
> > +    connect( kcfg_Server,   SIGNAL( editingFinished() ), SLOT(
> updateSQLQuery() ) );
> > +
> > +}
> > +
> > +DatabaseConfig::~DatabaseConfig()
> > +{}
> > +
> > +
> > +///////////////////////////////////////////////////////////////
> > +// REIMPLEMENTED METHODS from ConfigDialogBase
> > +///////////////////////////////////////////////////////////////
> > +
> > +bool
> > +DatabaseConfig::hasChanged()
> > +{
> > +    return false;
> > +}
> > +
> > +bool
> > +DatabaseConfig::isDefault()
> > +{
> > +    return false;
> > +}
> > +
> > +void
> > +DatabaseConfig::updateSettings()
> > +{
> > +    writeConfiguration();
> > +}
> > +
> > +
> > +///////////////////////////////////////////////////////////////
> > +// PRIVATE METHODS
> > +///////////////////////////////////////////////////////////////
> > +
> > +void
> > +DatabaseConfig::readConfiguration()
> > +{
> > +    KConfigGroup config = Amarok::config( "MySQL" );
> > +
> > +    kcfg_UseInternalDB->setChecked( !config.readEntry( "UseServer",
> false ) );
> > +
> > +    kcfg_Server->setText( config.readEntry( "Host", "localhost"
> ).toUtf8() );
> > +    kcfg_Port->setValue( config.readEntry( "Port", "3306" ).toInt() );
> > +    kcfg_DBName->setText( config.readEntry( "Database", "amarokdb"
> ).toUtf8() );
> > +
> > +    kcfg_Username->setText( config.readEntry( "User", "amarokuser"
> ).toUtf8() );
> > +    kcfg_Password->setText( config.readEntry( "Password", "" ).toUtf8()
> );
> > +
> > +
> > +    toggleExternalConfigAvailable(kcfg_UseInternalDB->checkState());
> > +    updateSQLQuery();
> > +}
> > +
> > +void
> > +DatabaseConfig::writeConfiguration()
> > +{
> > +    KConfigGroup config = Amarok::config( "MySQL" );
> > +
> > +    bool useExternal = (kcfg_UseInternalDB->checkState() !=
> Qt::Checked);
> > +
> > +    config.writeEntry( "UseServer", useExternal );
> > +
> > +    if(useExternal)
> > +    {
> > +        config.writeEntry( "Host",      kcfg_Server->text() );
> > +        config.writeEntry( "Port",      kcfg_Port->value() );
> > +        config.writeEntry( "Database",  kcfg_DBName->text() );
> > +        config.writeEntry( "User",      kcfg_Username->text() );
> > +        config.writeEntry( "Password",  kcfg_Password->text() );
> > +    }
> > +}
> > +
> > +
> > +void
> > +DatabaseConfig::toggleExternalConfigAvailable( int checkBoxState )
> //SLOT
> > +{
> > +    bool enableExternalConfig = (checkBoxState != Qt::Checked);
> > +
> > +    kcfg_DatabaseEngine->setEnabled( enableExternalConfig );
> > +    group_Connection->setVisible( enableExternalConfig );
> > +
> > +}
> > +
> > +void
> > +DatabaseConfig::updateSQLQuery() //SLOT
> > +{
> > +    if(isSQLInfoPresent())
> > +    {
> > +        // Query template:
> > +        // GRANT ALL ON amarokdb.* TO 'amarokuser'@'localhost'
> IDENTIFIED BY 'mypassword'; FLUSH PRIVILEGES;
> > +
> > +        // Don't print the actual password!
> > +        QString examplePassword = i18nc( "A default password for
> insertion into an example SQL command (so as not to print the real one). To
> be manually replaced by the user.",
> > +                                         "password" );
> > +
> > +        text_SQL->setPlainText( "GRANT ALL ON " + kcfg_DBName->text() +
> ".* " +
> > +                                "TO '" + kcfg_Username->text() + "'@'" +
> kcfg_Server->text() + "' " +
> > +                                "IDENTIFIED BY '" + examplePassword +
> "';\n" +
> > +                                "FLUSH PRIVILEGES;"
> > +                                );
> > +    }
> > +    else
> > +    {
> > +        text_SQL->setPlainText("");
> > +    }
> > +
> > +}
> > +
> > +
> > +bool
> > +DatabaseConfig::isSQLInfoPresent()
> > +{
> > +    if( kcfg_DBName->text().isEmpty() || kcfg_Username->text().isEmpty()
> || kcfg_Server->text().isEmpty() )
> > +    {
> > +        return false;
> > +    }
> > +
> > +    return true;
> > +}
> > +
> > +
> > +#include "DatabaseConfig.moc"
> > +
> > +
> > diff --git a/src/configdialog/dialogs/DatabaseConfig.h
> b/src/configdialog/dialogs/DatabaseConfig.h
> > new file mode 100644
> > index 0000000..d7e1b1d
> > --- /dev/null
> > +++ b/src/configdialog/dialogs/DatabaseConfig.h
> > @@ -0,0 +1,51 @@
> >
> +/****************************************************************************************
> > + * Copyright (c) 2009 John Atkinson <john@fauxnetic.co.uk>
>                  *
> > + *
>                *
> > + * 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 2 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 Pulic 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 DATABASECONFIG_H
> > +#define DATABASECONFIG_H
> > +
> > +#include "ui_DatabaseConfig.h"
> > +#include "ConfigDialogBase.h"
> > +
> > +
> > +class DatabaseConfig : public ConfigDialogBase, public Ui_DatabaseConfig
> > +{
> > +    Q_OBJECT
> > +
> > +    public:
> > +        DatabaseConfig( QWidget* parent );
> > +        virtual ~DatabaseConfig();
> > +
> > +        virtual bool hasChanged();
> > +        virtual bool isDefault();
> > +        virtual void updateSettings();
> > +
> > +    protected:
> > +        void readConfiguration();
> > +        void writeConfiguration();
> > +
> > +    private Q_SLOTS:
> > +        void toggleExternalConfigAvailable( int checkBoxState );
> > +        void updateSQLQuery();
> > +
> > +    private:
> > +        bool isSQLInfoPresent();
> > +};
> > +
> > +
> > +#endif
> > +
> > +
> > diff --git a/src/configdialog/dialogs/DatabaseConfig.ui
> b/src/configdialog/dialogs/DatabaseConfig.ui
> > new file mode 100644
> > index 0000000..f874364
> > --- /dev/null
> > +++ b/src/configdialog/dialogs/DatabaseConfig.ui
> > @@ -0,0 +1,282 @@
> > +<?xml version="1.0" encoding="UTF-8"?>
> > +<ui version="4.0">
> > + <class>DatabaseConfig</class>
> > + <widget class="QWidget" name="DatabaseConfig">
> > +  <property name="geometry">
> > +   <rect>
> > +    <x>0</x>
> > +    <y>0</y>
> > +    <width>440</width>
> > +    <height>426</height>
> > +   </rect>
> > +  </property>
> > +  <layout class="QVBoxLayout" name="verticalLayout_2">
> > +   <item>
> > +    <widget class="QCheckBox" name="kcfg_UseInternalDB">
> > +     <property name="text">
> > +      <string>Use &amp;internal database (default)</string>
> > +     </property>
> > +    </widget>
> > +   </item>
> > +   <item>
> > +    <layout class="QGridLayout" name="gridLayout_4">
> > +     <item row="0" column="1">
> > +      <widget class="QComboBox" name="kcfg_DatabaseEngine">
> > +       <property name="sizePolicy">
> > +        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
> > +         <horstretch>0</horstretch>
> > +         <verstretch>0</verstretch>
> > +        </sizepolicy>
> > +       </property>
> > +       <item>
> > +        <property name="text">
> > +         <string>MySQL</string>
> > +        </property>
> > +       </item>
> > +      </widget>
> > +     </item>
> > +     <item row="0" column="0">
> > +      <widget class="QLabel" name="label_DatabaseEngine">
> > +       <property name="text">
> > +        <string>&amp;External database engine:</string>
> > +       </property>
> > +       <property name="buddy">
> > +        <cstring>kcfg_DatabaseEngine</cstring>
> > +       </property>
> > +      </widget>
> > +     </item>
> > +    </layout>
> > +   </item>
> > +   <item>
> > +    <widget class="QGroupBox" name="group_Connection">
> > +     <property name="title">
> > +      <string>Connection Settings</string>
> > +     </property>
> > +     <layout class="QVBoxLayout" name="verticalLayout_3">
> > +      <item>
> > +       <layout class="QGridLayout" name="gridLayout_3">
> > +        <item row="0" column="0">
> > +         <widget class="QLabel" name="label_Server">
> > +          <property name="text">
> > +           <string>&amp;Server:</string>
> > +          </property>
> > +          <property name="textFormat">
> > +           <enum>Qt::AutoText</enum>
> > +          </property>
> > +          <property name="alignment">
> > +           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
> > +          </property>
> > +          <property name="buddy">
> > +           <cstring>kcfg_Server</cstring>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="0" column="1" colspan="3">
> > +         <widget class="QLineEdit" name="kcfg_Server">
> > +          <property name="text">
> > +           <string notr="true"/>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="0" column="4">
> > +         <widget class="QLabel" name="label_Port">
> > +          <property name="text">
> > +           <string>P&amp;ort:</string>
> > +          </property>
> > +          <property name="textFormat">
> > +           <enum>Qt::AutoText</enum>
> > +          </property>
> > +          <property name="alignment">
> > +           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
> > +          </property>
> > +          <property name="buddy">
> > +           <cstring>kcfg_Port</cstring>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="0" column="5">
> > +         <widget class="QSpinBox" name="kcfg_Port">
> > +          <property name="maximum">
> > +           <number>65535</number>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="1" column="0">
> > +         <widget class="QLabel" name="label_Username">
> > +          <property name="text">
> > +           <string>&amp;Username:</string>
> > +          </property>
> > +          <property name="textFormat">
> > +           <enum>Qt::AutoText</enum>
> > +          </property>
> > +          <property name="alignment">
> > +           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
> > +          </property>
> > +          <property name="buddy">
> > +           <cstring>kcfg_Username</cstring>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="2" column="1" colspan="5">
> > +         <widget class="QLineEdit" name="kcfg_Password">
> > +          <property name="inputMask">
> > +           <string notr="true"/>
> > +          </property>
> > +          <property name="text">
> > +           <string notr="true"/>
> > +          </property>
> > +          <property name="echoMode">
> > +           <enum>QLineEdit::Password</enum>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="2" column="0">
> > +         <widget class="QLabel" name="label_Password">
> > +          <property name="text">
> > +           <string>&amp;Password:</string>
> > +          </property>
> > +          <property name="textFormat">
> > +           <enum>Qt::AutoText</enum>
> > +          </property>
> > +          <property name="alignment">
> > +           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
> > +          </property>
> > +          <property name="buddy">
> > +           <cstring>kcfg_Password</cstring>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="1" column="1" colspan="5">
> > +         <widget class="QLineEdit" name="kcfg_Username">
> > +          <property name="text">
> > +           <string notr="true"/>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="3" column="0">
> > +         <widget class="QLabel" name="label_DBName">
> > +          <property name="text">
> > +           <string>&amp;Database:</string>
> > +          </property>
> > +          <property name="textFormat">
> > +           <enum>Qt::AutoText</enum>
> > +          </property>
> > +          <property name="alignment">
> > +           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
> > +          </property>
> > +          <property name="buddy">
> > +           <cstring>kcfg_DBName</cstring>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +        <item row="3" column="1" colspan="5">
> > +         <widget class="QLineEdit" name="kcfg_DBName">
> > +          <property name="text">
> > +           <string notr="true"/>
> > +          </property>
> > +         </widget>
> > +        </item>
> > +       </layout>
> > +      </item>
> > +      <item>
> > +       <widget class="QFrame" name="frame_info">
> > +        <property name="frameShape">
> > +         <enum>QFrame::StyledPanel</enum>
> > +        </property>
> > +        <property name="frameShadow">
> > +         <enum>QFrame::Raised</enum>
> > +        </property>
> > +        <layout class="QVBoxLayout" name="verticalLayout">
> > +         <item>
> > +          <widget class="QLabel" name="label_Info">
> > +           <property name="font">
> > +            <font>
> > +             <pointsize>8</pointsize>
> > +            </font>
> > +           </property>
> > +           <property name="text">
> > +            <string>Amarok expects the above database and user account
> to already exist. This user also requires full access to the
> database.</string>
> > +           </property>
> > +           <property name="alignment">
> > +            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
> > +           </property>
> > +           <property name="wordWrap">
> > +            <bool>true</bool>
> > +           </property>
> > +          </widget>
> > +         </item>
> > +         <item>
> > +          <widget class="QLabel" name="label_SQL">
> > +           <property name="font">
> > +            <font>
> > +             <pointsize>8</pointsize>
> > +            </font>
> > +           </property>
> > +           <property name="text">
> > +            <string>Access rights can be assigned with the following
> S&amp;QL commands (after replacing the password with the correct
> one):</string>
> > +           </property>
> > +           <property name="wordWrap">
> > +            <bool>true</bool>
> > +           </property>
> > +           <property name="buddy">
> > +            <cstring>text_SQL</cstring>
> > +           </property>
> > +          </widget>
> > +         </item>
> > +         <item>
> > +          <widget class="QPlainTextEdit" name="text_SQL">
> > +           <property name="sizePolicy">
> > +            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
> > +             <horstretch>0</horstretch>
> > +             <verstretch>0</verstretch>
> > +            </sizepolicy>
> > +           </property>
> > +           <property name="maximumSize">
> > +            <size>
> > +             <width>16777215</width>
> > +             <height>50</height>
> > +            </size>
> > +           </property>
> > +           <property name="font">
> > +            <font>
> > +             <pointsize>6</pointsize>
> > +            </font>
> > +           </property>
> > +           <property name="cursor" stdset="0">
> > +            <cursorShape>IBeamCursor</cursorShape>
> > +           </property>
> > +           <property name="acceptDrops">
> > +            <bool>false</bool>
> > +           </property>
> > +           <property name="readOnly">
> > +            <bool>true</bool>
> > +           </property>
> > +           <property name="plainText">
> > +            <string notr="true"/>
> > +           </property>
> > +          </widget>
> > +         </item>
> > +        </layout>
> > +       </widget>
> > +      </item>
> > +     </layout>
> > +    </widget>
> > +   </item>
> > +   <item>
> > +    <spacer name="verticalSpacer">
> > +     <property name="orientation">
> > +      <enum>Qt::Vertical</enum>
> > +     </property>
> > +     <property name="sizeHint" stdset="0">
> > +      <size>
> > +       <width>20</width>
> > +       <height>40</height>
> > +      </size>
> > +     </property>
> > +    </spacer>
> > +   </item>
> > +  </layout>
> > + </widget>
> > + <resources/>
> > + <connections/>
> > +</ui>
> >
> >
> >
>
>
> --
> Mark Kretschmann
> Amarok Developer
> www.kde.org - amarok.kde.org
>

[Attachment #3 (text/html)]

<br>Urghh... magic prefixes. My fault for allowing the two to get confused \
though.<br>If I understand this correctly now, this should be fixable by simply \
renaming the editable dialog items to remove the &quot;kcfg_&quot; at the start. Then \
it should read/write using normal KConfig.<br> <br>Also, I create do a patch to use \
KConfigXT properly. That&#39;s what most of the other configuration dialogs seem to \
use.<br><br>- John<br><br><br><div class="gmail_quote">2009/8/30 Mark Kretschmann \
<span dir="ltr">&lt;<a \
href="mailto:kretschmann@kde.org">kretschmann@kde.org</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;">I&#39;m sorry, but this patch seems badly broken. \
It&#39;s using config<br> options that don&#39;t exist, and mixes KConfigXT with \
classic KConfig. I<br> can&#39;t really see how that&#39;s supposed to work.<br>
<br>
The whole &quot;MySQL&quot; group is missing in amarokconfig.kcfg.<br>
<br>
Users with debug builds of KDElibs are getting an instant crash when<br>
opening the dialog:<br>
<br>
amarok(4185)/kdecore (KConfigDialogManager)<br>
KConfigDialogManager::parseChildren: A widget named &#39;<br>
&quot;kcfg_UseInternalDB&quot; &#39; was found but there is no setting named \
&#39;<br> &quot;UseInternalDB&quot; &#39;<br>
<br>
<br>
Here&#39;s some documentation on KConfigXT:<br>
<a href="http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html" \
target="_blank">http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html</a><br>
 <br>
<br>
<br>
On Sun, Aug 30, 2009 at 3:24 AM, Seb Ruiz&lt;<a \
href="mailto:ruiz@kde.org">ruiz@kde.org</a>&gt; wrote:<br> &gt; commit \
698fd3c2b47f876b5ef053d0028d594ca8e34df9<br> &gt; Author:     Seb Ruiz &lt;<a \
href="mailto:ruiz@kde.org">ruiz@kde.org</a>&gt;<br> &gt; AuthorDate: Sun Aug 30 \
10:44:52 2009 +1000<br> &gt; Commit:     Seb Ruiz &lt;<a \
href="mailto:ruiz@kde.org">ruiz@kde.org</a>&gt;<br> &gt; CommitDate: Sun Aug 30 \
10:44:52 2009 +1000<br> &gt;<br>
&gt;    MySQL database configuration support. Thanks to John Atkinson for the \
patch!<br> &gt;    CCMAIL: <a \
href="mailto:john@fauxnetic.co.uk">john@fauxnetic.co.uk</a><br> &gt;<br>
&gt; diff --git a/ChangeLog b/ChangeLog<br>
&gt; index 5a268f6..cc9efe6 100644<br>
&gt; --- a/ChangeLog<br>
&gt; +++ b/ChangeLog<br>
&gt; @@ -62,8 +62,7 @@ VERSION 2.2-beta1<br>
&gt;       The video can be appended to the playlist, and rendered within the \
applet.<br> &gt;     * Photo applet to show images from Flickr, with customizable \
animations.<br> &gt;     * Customizable user interface using dock widgets.<br>
&gt; -    * Support for external MySQL database. See<br>
&gt; -      <a href="http://amarok.kde.org/wiki/MySQL_Server" \
target="_blank">http://amarok.kde.org/wiki/MySQL_Server</a>.<br> &gt; +    * Support \
for external MySQL database.<br> &gt;     * GHNS integration for downloading and \
installing Context applets.<br> &gt;     * Support for Context applets to be written \
in QtScript.<br> &gt;     * Custom Dynamic Playlists using Last.fm.<br>
&gt; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt<br>
&gt; index 323fe0d..cab1d28 100644<br>
&gt; --- a/src/CMakeLists.txt<br>
&gt; +++ b/src/CMakeLists.txt<br>
&gt; @@ -187,6 +187,7 @@ set(libconfigdialog_SRCS<br>
&gt;     configdialog/dialogs/OsdConfig.cpp<br>
&gt;     configdialog/dialogs/PlaybackConfig.cpp<br>
&gt;     configdialog/dialogs/ServiceConfig.cpp<br>
&gt; +    configdialog/dialogs/DatabaseConfig.cpp<br>
&gt;  )<br>
&gt;<br>
&gt;  kde4_add_ui_files(libconfigdialog_SRCS<br>
&gt; @@ -194,6 +195,7 @@ kde4_add_ui_files(libconfigdialog_SRCS<br>
&gt;     configdialog/dialogs/GeneralConfig.ui<br>
&gt;     configdialog/dialogs/OsdConfig.ui<br>
&gt;     configdialog/dialogs/PlaybackConfig.ui<br>
&gt; +    configdialog/dialogs/DatabaseConfig.ui<br>
&gt;  )<br>
&gt;<br>
&gt;  set(libbrowserframework_SRCS<br>
&gt; diff --git a/src/configdialog/ConfigDialog.cpp \
b/src/configdialog/ConfigDialog.cpp<br> &gt; index c18239d..b53ae4f 100644<br>
&gt; --- a/src/configdialog/ConfigDialog.cpp<br>
&gt; +++ b/src/configdialog/ConfigDialog.cpp<br>
&gt; @@ -27,6 +27,7 @@<br>
&gt;  #include &quot;OsdConfig.h&quot;<br>
&gt;  #include &quot;PlaybackConfig.h&quot;<br>
&gt;  #include &quot;ServiceConfig.h&quot;<br>
&gt; +#include &quot;DatabaseConfig.h&quot;<br>
&gt;<br>
&gt;  #include &lt;KLocale&gt;<br>
&gt;<br>
&gt; @@ -47,6 +48,7 @@ Amarok2ConfigDialog::Amarok2ConfigDialog( QWidget *parent, \
const char* name, KCo<br> &gt;     ConfigDialogBase* services    = new ServiceConfig( \
this );<br> &gt;     ConfigDialogBase* playback    = new PlaybackConfig( this );<br>
&gt;     ConfigDialogBase* osd         = new OsdConfig( this );<br>
&gt; +    ConfigDialogBase* database    = new DatabaseConfig( this );<br>
&gt;<br>
&gt;     connect( general, SIGNAL( lockLayout( bool ) ), The::mainWindow(), SLOT ( \
setLayoutLocked( bool ) ) );<br> &gt;<br>
&gt; @@ -57,6 +59,7 @@ Amarok2ConfigDialog::Amarok2ConfigDialog( QWidget *parent, \
const char* name, KCo<br> &gt;     addPage( services,    i18n( &quot;Internet \
Services&quot; ), &quot;services-amarok&quot;, i18n( &quot;Configure Services&quot; ) \
);<br> &gt;     addPage( playback,    i18n( &quot;Playback&quot; ), \
&quot;preferences-media-playback-amarok&quot;, i18n( &quot;Configure Playback&quot; ) \
);<br> &gt;     addPage( osd,         i18n( &quot;On Screen Display&quot; ), \
&quot;preferences-indicator-amarok&quot;, i18n( &quot;Configure \
On-Screen-Display&quot; ) );<br> &gt; +    addPage( database,    i18n( \
&quot;Database&quot; ), &quot;preferences-database-amarok&quot;, i18n( \
&quot;Configure Database&quot; ) );<br> &gt;  //    addPage( mediadevice, i18n( \
&quot;Media Devices&quot; ), &quot;preferences-multimedia-player-amarok&quot;, i18n( \
&quot;Configure Portable Player Support&quot; ) );<br> &gt;<br>
&gt;     setButtons( Help | Ok | Apply | Cancel );<br>
&gt; diff --git a/src/configdialog/dialogs/DatabaseConfig.cpp \
b/src/configdialog/dialogs/DatabaseConfig.cpp<br> &gt; new file mode 100644<br>
&gt; index 0000000..8088d8e<br>
&gt; --- /dev/null<br>
&gt; +++ b/src/configdialog/dialogs/DatabaseConfig.cpp<br>
&gt; @@ -0,0 +1,159 @@<br>
&gt; +/****************************************************************************************<br>
 &gt; + * Copyright (c) 2009 John Atkinson &lt;<a \
href="mailto:john@fauxnetic.co.uk">john@fauxnetic.co.uk</a>&gt;                       \
*<br> &gt; + *                                                                        \
*<br> &gt; + * This program is free software; you can redistribute it and/or modify \
it under        *<br> &gt; + * the terms of the GNU General Public License as \
published by the Free Software        *<br> &gt; + * Foundation; either version 2 of \
the License, or (at your option) any later           *<br> &gt; + * version.          \
*<br> &gt; + *                                                                        \
*<br> &gt; + * This program is distributed in the hope that it will be useful, but \
WITHOUT ANY      *<br> &gt; + * WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A      *<br> &gt; + * PARTICULAR PURPOSE. See the GNU \
General Pulic License for more details.              *<br> &gt; + *                   \
*<br> &gt; + * You should have received a copy of the GNU General Public License \
along with         *<br> &gt; + * this program.  If not, see &lt;<a \
href="http://www.gnu.org/licenses/" \
target="_blank">http://www.gnu.org/licenses/</a>&gt;.                           *<br> \
&gt; + ****************************************************************************************/<br>
 &gt; +<br>
&gt; +#include &quot;DatabaseConfig.h&quot;<br>
&gt; +<br>
&gt; +#include &quot;Amarok.h&quot;<br>
&gt; +#include &quot;Debug.h&quot;<br>
&gt; +<br>
&gt; +#include &lt;KCMultiDialog&gt;<br>
&gt; +<br>
&gt; +<br>
&gt; +DatabaseConfig::DatabaseConfig( QWidget* parent )<br>
&gt; +    : ConfigDialogBase( parent )<br>
&gt; +{<br>
&gt; +    setupUi( this );<br>
&gt; +    readConfiguration();<br>
&gt; +<br>
&gt; +    connect( kcfg_UseInternalDB, SIGNAL( stateChanged(int) ), SLOT( \
toggleExternalConfigAvailable(int) ) );<br> &gt; +<br>
&gt; +    connect( kcfg_DBName,   SIGNAL( editingFinished() ), SLOT( updateSQLQuery() \
) );<br> &gt; +    connect( kcfg_Username, SIGNAL( editingFinished() ), SLOT( \
updateSQLQuery() ) );<br> &gt; +    connect( kcfg_Server,   SIGNAL( editingFinished() \
), SLOT( updateSQLQuery() ) );<br> &gt; +<br>
&gt; +}<br>
&gt; +<br>
&gt; +DatabaseConfig::~DatabaseConfig()<br>
&gt; +{}<br>
&gt; +<br>
&gt; +<br>
&gt; +///////////////////////////////////////////////////////////////<br>
&gt; +// REIMPLEMENTED METHODS from ConfigDialogBase<br>
&gt; +///////////////////////////////////////////////////////////////<br>
&gt; +<br>
&gt; +bool<br>
&gt; +DatabaseConfig::hasChanged()<br>
&gt; +{<br>
&gt; +    return false;<br>
&gt; +}<br>
&gt; +<br>
&gt; +bool<br>
&gt; +DatabaseConfig::isDefault()<br>
&gt; +{<br>
&gt; +    return false;<br>
&gt; +}<br>
&gt; +<br>
&gt; +void<br>
&gt; +DatabaseConfig::updateSettings()<br>
&gt; +{<br>
&gt; +    writeConfiguration();<br>
&gt; +}<br>
&gt; +<br>
&gt; +<br>
&gt; +///////////////////////////////////////////////////////////////<br>
&gt; +// PRIVATE METHODS<br>
&gt; +///////////////////////////////////////////////////////////////<br>
&gt; +<br>
&gt; +void<br>
&gt; +DatabaseConfig::readConfiguration()<br>
&gt; +{<br>
&gt; +    KConfigGroup config = Amarok::config( &quot;MySQL&quot; );<br>
&gt; +<br>
&gt; +    kcfg_UseInternalDB-&gt;setChecked( !config.readEntry( \
&quot;UseServer&quot;, false ) );<br> &gt; +<br>
&gt; +    kcfg_Server-&gt;setText( config.readEntry( &quot;Host&quot;, \
&quot;localhost&quot; ).toUtf8() );<br> &gt; +    kcfg_Port-&gt;setValue( \
config.readEntry( &quot;Port&quot;, &quot;3306&quot; ).toInt() );<br> &gt; +    \
kcfg_DBName-&gt;setText( config.readEntry( &quot;Database&quot;, &quot;amarokdb&quot; \
).toUtf8() );<br> &gt; +<br>
&gt; +    kcfg_Username-&gt;setText( config.readEntry( &quot;User&quot;, \
&quot;amarokuser&quot; ).toUtf8() );<br> &gt; +    kcfg_Password-&gt;setText( \
config.readEntry( &quot;Password&quot;, &quot;&quot; ).toUtf8() );<br> &gt; +<br>
&gt; +<br>
&gt; +    toggleExternalConfigAvailable(kcfg_UseInternalDB-&gt;checkState());<br>
&gt; +    updateSQLQuery();<br>
&gt; +}<br>
&gt; +<br>
&gt; +void<br>
&gt; +DatabaseConfig::writeConfiguration()<br>
&gt; +{<br>
&gt; +    KConfigGroup config = Amarok::config( &quot;MySQL&quot; );<br>
&gt; +<br>
&gt; +    bool useExternal = (kcfg_UseInternalDB-&gt;checkState() != \
Qt::Checked);<br> &gt; +<br>
&gt; +    config.writeEntry( &quot;UseServer&quot;, useExternal );<br>
&gt; +<br>
&gt; +    if(useExternal)<br>
&gt; +    {<br>
&gt; +        config.writeEntry( &quot;Host&quot;,      kcfg_Server-&gt;text() );<br>
&gt; +        config.writeEntry( &quot;Port&quot;,      kcfg_Port-&gt;value() );<br>
&gt; +        config.writeEntry( &quot;Database&quot;,  kcfg_DBName-&gt;text() );<br>
&gt; +        config.writeEntry( &quot;User&quot;,      kcfg_Username-&gt;text() \
);<br> &gt; +        config.writeEntry( &quot;Password&quot;,  \
kcfg_Password-&gt;text() );<br> &gt; +    }<br>
&gt; +}<br>
&gt; +<br>
&gt; +<br>
&gt; +void<br>
&gt; +DatabaseConfig::toggleExternalConfigAvailable( int checkBoxState ) //SLOT<br>
&gt; +{<br>
&gt; +    bool enableExternalConfig = (checkBoxState != Qt::Checked);<br>
&gt; +<br>
&gt; +    kcfg_DatabaseEngine-&gt;setEnabled( enableExternalConfig );<br>
&gt; +    group_Connection-&gt;setVisible( enableExternalConfig );<br>
&gt; +<br>
&gt; +}<br>
&gt; +<br>
&gt; +void<br>
&gt; +DatabaseConfig::updateSQLQuery() //SLOT<br>
&gt; +{<br>
&gt; +    if(isSQLInfoPresent())<br>
&gt; +    {<br>
&gt; +        // Query template:<br>
&gt; +        // GRANT ALL ON amarokdb.* TO &#39;amarokuser&#39;@&#39;localhost&#39; \
IDENTIFIED BY &#39;mypassword&#39;; FLUSH PRIVILEGES;<br> &gt; +<br>
&gt; +        // Don&#39;t print the actual password!<br>
&gt; +        QString examplePassword = i18nc( &quot;A default password for insertion \
into an example SQL command (so as not to print the real one). To be manually \
replaced by the user.&quot;,<br> &gt; +                                         \
&quot;password&quot; );<br> &gt; +<br>
&gt; +        text_SQL-&gt;setPlainText( &quot;GRANT ALL ON &quot; + \
kcfg_DBName-&gt;text() + &quot;.* &quot; +<br> &gt; +                                \
&quot;TO &#39;&quot; + kcfg_Username-&gt;text() + &quot;&#39;@&#39;&quot; + \
kcfg_Server-&gt;text() + &quot;&#39; &quot; +<br> &gt; +                              \
&quot;IDENTIFIED BY &#39;&quot; + examplePassword + &quot;&#39;;\n&quot; +<br> &gt; + \
&quot;FLUSH PRIVILEGES;&quot;<br> &gt; +                                );<br>
&gt; +    }<br>
&gt; +    else<br>
&gt; +    {<br>
&gt; +        text_SQL-&gt;setPlainText(&quot;&quot;);<br>
&gt; +    }<br>
&gt; +<br>
&gt; +}<br>
&gt; +<br>
&gt; +<br>
&gt; +bool<br>
&gt; +DatabaseConfig::isSQLInfoPresent()<br>
&gt; +{<br>
&gt; +    if( kcfg_DBName-&gt;text().isEmpty() || kcfg_Username-&gt;text().isEmpty() \
|| kcfg_Server-&gt;text().isEmpty() )<br> &gt; +    {<br>
&gt; +        return false;<br>
&gt; +    }<br>
&gt; +<br>
&gt; +    return true;<br>
&gt; +}<br>
&gt; +<br>
&gt; +<br>
&gt; +#include &quot;DatabaseConfig.moc&quot;<br>
&gt; +<br>
&gt; +<br>
&gt; diff --git a/src/configdialog/dialogs/DatabaseConfig.h \
b/src/configdialog/dialogs/DatabaseConfig.h<br> &gt; new file mode 100644<br>
&gt; index 0000000..d7e1b1d<br>
&gt; --- /dev/null<br>
&gt; +++ b/src/configdialog/dialogs/DatabaseConfig.h<br>
&gt; @@ -0,0 +1,51 @@<br>
&gt; +/****************************************************************************************<br>
 &gt; + * Copyright (c) 2009 John Atkinson &lt;<a \
href="mailto:john@fauxnetic.co.uk">john@fauxnetic.co.uk</a>&gt;                       \
*<br> &gt; + *                                                                        \
*<br> &gt; + * This program is free software; you can redistribute it and/or modify \
it under        *<br> &gt; + * the terms of the GNU General Public License as \
published by the Free Software        *<br> &gt; + * Foundation; either version 2 of \
the License, or (at your option) any later           *<br> &gt; + * version.          \
*<br> &gt; + *                                                                        \
*<br> &gt; + * This program is distributed in the hope that it will be useful, but \
WITHOUT ANY      *<br> &gt; + * WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A      *<br> &gt; + * PARTICULAR PURPOSE. See the GNU \
General Pulic License for more details.              *<br> &gt; + *                   \
*<br> &gt; + * You should have received a copy of the GNU General Public License \
along with         *<br> &gt; + * this program.  If not, see &lt;<a \
href="http://www.gnu.org/licenses/" \
target="_blank">http://www.gnu.org/licenses/</a>&gt;.                           *<br> \
&gt; + ****************************************************************************************/<br>
 &gt; +<br>
&gt; +#ifndef DATABASECONFIG_H<br>
&gt; +#define DATABASECONFIG_H<br>
&gt; +<br>
&gt; +#include &quot;ui_DatabaseConfig.h&quot;<br>
&gt; +#include &quot;ConfigDialogBase.h&quot;<br>
&gt; +<br>
&gt; +<br>
&gt; +class DatabaseConfig : public ConfigDialogBase, public Ui_DatabaseConfig<br>
&gt; +{<br>
&gt; +    Q_OBJECT<br>
&gt; +<br>
&gt; +    public:<br>
&gt; +        DatabaseConfig( QWidget* parent );<br>
&gt; +        virtual ~DatabaseConfig();<br>
&gt; +<br>
&gt; +        virtual bool hasChanged();<br>
&gt; +        virtual bool isDefault();<br>
&gt; +        virtual void updateSettings();<br>
&gt; +<br>
&gt; +    protected:<br>
&gt; +        void readConfiguration();<br>
&gt; +        void writeConfiguration();<br>
&gt; +<br>
&gt; +    private Q_SLOTS:<br>
&gt; +        void toggleExternalConfigAvailable( int checkBoxState );<br>
&gt; +        void updateSQLQuery();<br>
&gt; +<br>
&gt; +    private:<br>
&gt; +        bool isSQLInfoPresent();<br>
&gt; +};<br>
&gt; +<br>
&gt; +<br>
&gt; +#endif<br>
&gt; +<br>
&gt; +<br>
&gt; diff --git a/src/configdialog/dialogs/DatabaseConfig.ui \
b/src/configdialog/dialogs/DatabaseConfig.ui<br> &gt; new file mode 100644<br>
&gt; index 0000000..f874364<br>
&gt; --- /dev/null<br>
&gt; +++ b/src/configdialog/dialogs/DatabaseConfig.ui<br>
&gt; @@ -0,0 +1,282 @@<br>
&gt; +&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&gt; +&lt;ui version=&quot;4.0&quot;&gt;<br>
&gt; + &lt;class&gt;DatabaseConfig&lt;/class&gt;<br>
&gt; + &lt;widget class=&quot;QWidget&quot; name=&quot;DatabaseConfig&quot;&gt;<br>
&gt; +  &lt;property name=&quot;geometry&quot;&gt;<br>
&gt; +   &lt;rect&gt;<br>
&gt; +    &lt;x&gt;0&lt;/x&gt;<br>
&gt; +    &lt;y&gt;0&lt;/y&gt;<br>
&gt; +    &lt;width&gt;440&lt;/width&gt;<br>
&gt; +    &lt;height&gt;426&lt;/height&gt;<br>
&gt; +   &lt;/rect&gt;<br>
&gt; +  &lt;/property&gt;<br>
&gt; +  &lt;layout class=&quot;QVBoxLayout&quot; \
name=&quot;verticalLayout_2&quot;&gt;<br> &gt; +   &lt;item&gt;<br>
&gt; +    &lt;widget class=&quot;QCheckBox&quot; \
name=&quot;kcfg_UseInternalDB&quot;&gt;<br> &gt; +     &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +      &lt;string&gt;Use &amp;amp;internal \
database (default)&lt;/string&gt;<br> &gt; +     &lt;/property&gt;<br>
&gt; +    &lt;/widget&gt;<br>
&gt; +   &lt;/item&gt;<br>
&gt; +   &lt;item&gt;<br>
&gt; +    &lt;layout class=&quot;QGridLayout&quot; \
name=&quot;gridLayout_4&quot;&gt;<br> &gt; +     &lt;item row=&quot;0&quot; \
column=&quot;1&quot;&gt;<br> &gt; +      &lt;widget class=&quot;QComboBox&quot; \
name=&quot;kcfg_DatabaseEngine&quot;&gt;<br> &gt; +       &lt;property \
name=&quot;sizePolicy&quot;&gt;<br> &gt; +        &lt;sizepolicy \
hsizetype=&quot;Expanding&quot; vsizetype=&quot;Fixed&quot;&gt;<br> &gt; +         \
&lt;horstretch&gt;0&lt;/horstretch&gt;<br> &gt; +         \
&lt;verstretch&gt;0&lt;/verstretch&gt;<br> &gt; +        &lt;/sizepolicy&gt;<br>
&gt; +       &lt;/property&gt;<br>
&gt; +       &lt;item&gt;<br>
&gt; +        &lt;property name=&quot;text&quot;&gt;<br>
&gt; +         &lt;string&gt;MySQL&lt;/string&gt;<br>
&gt; +        &lt;/property&gt;<br>
&gt; +       &lt;/item&gt;<br>
&gt; +      &lt;/widget&gt;<br>
&gt; +     &lt;/item&gt;<br>
&gt; +     &lt;item row=&quot;0&quot; column=&quot;0&quot;&gt;<br>
&gt; +      &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_DatabaseEngine&quot;&gt;<br> &gt; +       &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +        &lt;string&gt;&amp;amp;External database \
engine:&lt;/string&gt;<br> &gt; +       &lt;/property&gt;<br>
&gt; +       &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +        &lt;cstring&gt;kcfg_DatabaseEngine&lt;/cstring&gt;<br>
&gt; +       &lt;/property&gt;<br>
&gt; +      &lt;/widget&gt;<br>
&gt; +     &lt;/item&gt;<br>
&gt; +    &lt;/layout&gt;<br>
&gt; +   &lt;/item&gt;<br>
&gt; +   &lt;item&gt;<br>
&gt; +    &lt;widget class=&quot;QGroupBox&quot; \
name=&quot;group_Connection&quot;&gt;<br> &gt; +     &lt;property \
name=&quot;title&quot;&gt;<br> &gt; +      &lt;string&gt;Connection \
Settings&lt;/string&gt;<br> &gt; +     &lt;/property&gt;<br>
&gt; +     &lt;layout class=&quot;QVBoxLayout&quot; \
name=&quot;verticalLayout_3&quot;&gt;<br> &gt; +      &lt;item&gt;<br>
&gt; +       &lt;layout class=&quot;QGridLayout&quot; \
name=&quot;gridLayout_3&quot;&gt;<br> &gt; +        &lt;item row=&quot;0&quot; \
column=&quot;0&quot;&gt;<br> &gt; +         &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_Server&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           \
&lt;string&gt;&amp;amp;Server:&lt;/string&gt;<br> &gt; +          \
&lt;/property&gt;<br> &gt; +          &lt;property \
name=&quot;textFormat&quot;&gt;<br> &gt; +           \
&lt;enum&gt;Qt::AutoText&lt;/enum&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;alignment&quot;&gt;<br>
&gt; +           &lt;set&gt;Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter&lt;/set&gt;<br>
 &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +           &lt;cstring&gt;kcfg_Server&lt;/cstring&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;0&quot; column=&quot;1&quot; \
colspan=&quot;3&quot;&gt;<br> &gt; +         &lt;widget class=&quot;QLineEdit&quot; \
name=&quot;kcfg_Server&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           &lt;string \
notr=&quot;true&quot;/&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;0&quot; column=&quot;4&quot;&gt;<br>
&gt; +         &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_Port&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           \
&lt;string&gt;P&amp;amp;ort:&lt;/string&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;textFormat&quot;&gt;<br>
&gt; +           &lt;enum&gt;Qt::AutoText&lt;/enum&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;alignment&quot;&gt;<br>
&gt; +           &lt;set&gt;Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter&lt;/set&gt;<br>
 &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +           &lt;cstring&gt;kcfg_Port&lt;/cstring&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;0&quot; column=&quot;5&quot;&gt;<br>
&gt; +         &lt;widget class=&quot;QSpinBox&quot; \
name=&quot;kcfg_Port&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;maximum&quot;&gt;<br> &gt; +           \
&lt;number&gt;65535&lt;/number&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;1&quot; column=&quot;0&quot;&gt;<br>
&gt; +         &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_Username&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           \
&lt;string&gt;&amp;amp;Username:&lt;/string&gt;<br> &gt; +          \
&lt;/property&gt;<br> &gt; +          &lt;property \
name=&quot;textFormat&quot;&gt;<br> &gt; +           \
&lt;enum&gt;Qt::AutoText&lt;/enum&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;alignment&quot;&gt;<br>
&gt; +           &lt;set&gt;Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter&lt;/set&gt;<br>
 &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +           &lt;cstring&gt;kcfg_Username&lt;/cstring&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;2&quot; column=&quot;1&quot; \
colspan=&quot;5&quot;&gt;<br> &gt; +         &lt;widget class=&quot;QLineEdit&quot; \
name=&quot;kcfg_Password&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;inputMask&quot;&gt;<br> &gt; +           &lt;string \
notr=&quot;true&quot;/&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;text&quot;&gt;<br>
&gt; +           &lt;string notr=&quot;true&quot;/&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;echoMode&quot;&gt;<br>
&gt; +           &lt;enum&gt;QLineEdit::Password&lt;/enum&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;2&quot; column=&quot;0&quot;&gt;<br>
&gt; +         &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_Password&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           \
&lt;string&gt;&amp;amp;Password:&lt;/string&gt;<br> &gt; +          \
&lt;/property&gt;<br> &gt; +          &lt;property \
name=&quot;textFormat&quot;&gt;<br> &gt; +           \
&lt;enum&gt;Qt::AutoText&lt;/enum&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;alignment&quot;&gt;<br>
&gt; +           &lt;set&gt;Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter&lt;/set&gt;<br>
 &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +           &lt;cstring&gt;kcfg_Password&lt;/cstring&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;1&quot; column=&quot;1&quot; \
colspan=&quot;5&quot;&gt;<br> &gt; +         &lt;widget class=&quot;QLineEdit&quot; \
name=&quot;kcfg_Username&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           &lt;string \
notr=&quot;true&quot;/&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;3&quot; column=&quot;0&quot;&gt;<br>
&gt; +         &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_DBName&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           \
&lt;string&gt;&amp;amp;Database:&lt;/string&gt;<br> &gt; +          \
&lt;/property&gt;<br> &gt; +          &lt;property \
name=&quot;textFormat&quot;&gt;<br> &gt; +           \
&lt;enum&gt;Qt::AutoText&lt;/enum&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;alignment&quot;&gt;<br>
&gt; +           &lt;set&gt;Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter&lt;/set&gt;<br>
 &gt; +          &lt;/property&gt;<br>
&gt; +          &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +           &lt;cstring&gt;kcfg_DBName&lt;/cstring&gt;<br>
&gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +        &lt;item row=&quot;3&quot; column=&quot;1&quot; \
colspan=&quot;5&quot;&gt;<br> &gt; +         &lt;widget class=&quot;QLineEdit&quot; \
name=&quot;kcfg_DBName&quot;&gt;<br> &gt; +          &lt;property \
name=&quot;text&quot;&gt;<br> &gt; +           &lt;string \
notr=&quot;true&quot;/&gt;<br> &gt; +          &lt;/property&gt;<br>
&gt; +         &lt;/widget&gt;<br>
&gt; +        &lt;/item&gt;<br>
&gt; +       &lt;/layout&gt;<br>
&gt; +      &lt;/item&gt;<br>
&gt; +      &lt;item&gt;<br>
&gt; +       &lt;widget class=&quot;QFrame&quot; name=&quot;frame_info&quot;&gt;<br>
&gt; +        &lt;property name=&quot;frameShape&quot;&gt;<br>
&gt; +         &lt;enum&gt;QFrame::StyledPanel&lt;/enum&gt;<br>
&gt; +        &lt;/property&gt;<br>
&gt; +        &lt;property name=&quot;frameShadow&quot;&gt;<br>
&gt; +         &lt;enum&gt;QFrame::Raised&lt;/enum&gt;<br>
&gt; +        &lt;/property&gt;<br>
&gt; +        &lt;layout class=&quot;QVBoxLayout&quot; \
name=&quot;verticalLayout&quot;&gt;<br> &gt; +         &lt;item&gt;<br>
&gt; +          &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_Info&quot;&gt;<br> &gt; +           &lt;property \
name=&quot;font&quot;&gt;<br> &gt; +            &lt;font&gt;<br>
&gt; +             &lt;pointsize&gt;8&lt;/pointsize&gt;<br>
&gt; +            &lt;/font&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;text&quot;&gt;<br>
&gt; +            &lt;string&gt;Amarok expects the above database and user account to \
already exist. This user also requires full access to the \
database.&lt;/string&gt;<br> &gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;alignment&quot;&gt;<br>
&gt; +            &lt;set&gt;Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter&lt;/set&gt;<br>
 &gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;wordWrap&quot;&gt;<br>
&gt; +            &lt;bool&gt;true&lt;/bool&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +          &lt;/widget&gt;<br>
&gt; +         &lt;/item&gt;<br>
&gt; +         &lt;item&gt;<br>
&gt; +          &lt;widget class=&quot;QLabel&quot; \
name=&quot;label_SQL&quot;&gt;<br> &gt; +           &lt;property \
name=&quot;font&quot;&gt;<br> &gt; +            &lt;font&gt;<br>
&gt; +             &lt;pointsize&gt;8&lt;/pointsize&gt;<br>
&gt; +            &lt;/font&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;text&quot;&gt;<br>
&gt; +            &lt;string&gt;Access rights can be assigned with the following \
S&amp;amp;QL commands (after replacing the password with the correct \
one):&lt;/string&gt;<br> &gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;wordWrap&quot;&gt;<br>
&gt; +            &lt;bool&gt;true&lt;/bool&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;buddy&quot;&gt;<br>
&gt; +            &lt;cstring&gt;text_SQL&lt;/cstring&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +          &lt;/widget&gt;<br>
&gt; +         &lt;/item&gt;<br>
&gt; +         &lt;item&gt;<br>
&gt; +          &lt;widget class=&quot;QPlainTextEdit&quot; \
name=&quot;text_SQL&quot;&gt;<br> &gt; +           &lt;property \
name=&quot;sizePolicy&quot;&gt;<br> &gt; +            &lt;sizepolicy \
hsizetype=&quot;Expanding&quot; vsizetype=&quot;Fixed&quot;&gt;<br> &gt; +            \
&lt;horstretch&gt;0&lt;/horstretch&gt;<br> &gt; +             \
&lt;verstretch&gt;0&lt;/verstretch&gt;<br> &gt; +            &lt;/sizepolicy&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;maximumSize&quot;&gt;<br>
&gt; +            &lt;size&gt;<br>
&gt; +             &lt;width&gt;16777215&lt;/width&gt;<br>
&gt; +             &lt;height&gt;50&lt;/height&gt;<br>
&gt; +            &lt;/size&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;font&quot;&gt;<br>
&gt; +            &lt;font&gt;<br>
&gt; +             &lt;pointsize&gt;6&lt;/pointsize&gt;<br>
&gt; +            &lt;/font&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;cursor&quot; stdset=&quot;0&quot;&gt;<br>
&gt; +            &lt;cursorShape&gt;IBeamCursor&lt;/cursorShape&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;acceptDrops&quot;&gt;<br>
&gt; +            &lt;bool&gt;false&lt;/bool&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;readOnly&quot;&gt;<br>
&gt; +            &lt;bool&gt;true&lt;/bool&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +           &lt;property name=&quot;plainText&quot;&gt;<br>
&gt; +            &lt;string notr=&quot;true&quot;/&gt;<br>
&gt; +           &lt;/property&gt;<br>
&gt; +          &lt;/widget&gt;<br>
&gt; +         &lt;/item&gt;<br>
&gt; +        &lt;/layout&gt;<br>
&gt; +       &lt;/widget&gt;<br>
&gt; +      &lt;/item&gt;<br>
&gt; +     &lt;/layout&gt;<br>
&gt; +    &lt;/widget&gt;<br>
&gt; +   &lt;/item&gt;<br>
&gt; +   &lt;item&gt;<br>
&gt; +    &lt;spacer name=&quot;verticalSpacer&quot;&gt;<br>
&gt; +     &lt;property name=&quot;orientation&quot;&gt;<br>
&gt; +      &lt;enum&gt;Qt::Vertical&lt;/enum&gt;<br>
&gt; +     &lt;/property&gt;<br>
&gt; +     &lt;property name=&quot;sizeHint&quot; stdset=&quot;0&quot;&gt;<br>
&gt; +      &lt;size&gt;<br>
&gt; +       &lt;width&gt;20&lt;/width&gt;<br>
&gt; +       &lt;height&gt;40&lt;/height&gt;<br>
&gt; +      &lt;/size&gt;<br>
&gt; +     &lt;/property&gt;<br>
&gt; +    &lt;/spacer&gt;<br>
&gt; +   &lt;/item&gt;<br>
&gt; +  &lt;/layout&gt;<br>
&gt; + &lt;/widget&gt;<br>
&gt; + &lt;resources/&gt;<br>
&gt; + &lt;connections/&gt;<br>
&gt; +&lt;/ui&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
--<br>
Mark Kretschmann<br>
Amarok Developer<br>
<a href="http://www.kde.org" target="_blank">www.kde.org</a> - <a \
href="http://amarok.kde.org" target="_blank">amarok.kde.org</a><br> \
</font></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic