Ejemplo n.º 1
0
void ChatWindow::updateConnection(ConnectionObject *connection)
{
  if( connection == m_chatConnection ){
    return;
  }
  disconnect( this, SLOT(connectionChanged()) );
  disconnect( this, SLOT(connectionDestroyed()) );
  m_chatConnection = connection;
  connect( m_chatConnection, SIGNAL(sigChange(ConnectionObject*)), this, SLOT(connectionChanged()) );
  connect( m_chatConnection, SIGNAL(destroyed()), this, SLOT(connectionDestroyed()) );
  connectionChanged();
}
Ejemplo n.º 2
0
void Connection::setUserEmail(const QString &v)
{
    if (userEmail_ == v)
        return;
    userEmail_ = v;
    emit connectionChanged();
}
Ejemplo n.º 3
0
void ContactUser::onConnected()
{
    m_settings->write("lastConnected", QDateTime::currentDateTime());

    if (m_contactRequest && m_connection->purpose() == Protocol::Connection::Purpose::OutboundRequest) {
        qDebug() << "Sending contact request for" << uniqueID << nickname();
        m_contactRequest->sendRequest(m_connection);
    }

    if (!m_settings->read("sentUpgradeNotification").isNull())
        m_settings->unset("sentUpgradeNotification");

    /* The 'rejected' mark comes from failed authentication to someone who we thought was a known
     * contact. Normally, it would mean that you were removed from that person's contacts. It's
     * possible for this to be undone; for example, if that person sends you a new contact request,
     * it will be automatically accepted. If this happens, unset the 'rejected' flag for correct UI.
     */
    if (m_settings->read("rejected").toBool()) {
        qDebug() << "Contact had marked us as rejected, but now they've connected again. Re-enabling.";
        m_settings->unset("rejected");
    }

    updateStatus();
    if (isConnected()) {
        emit connected();
        emit connectionChanged(m_connection);
    }

    if (m_status != Online && m_status != RequestPending) {
        BUG() << "Contact has a connection while in status" << m_status << "which is not expected.";
        m_connection->close();
    }
}
Ejemplo n.º 4
0
void NetworkSession::onNetworkConfigurationChanged(const QNetworkConfiguration& config)
{
    if (d.enabled && config.state() == QNetworkConfiguration::Active && d.config.state() != QNetworkConfiguration::Active) {
        d.config = config;
        emit connectionChanged();
    }
}
Ejemplo n.º 5
0
void HexySerial::closeSerialPort()
{
	if (serial->isOpen()) {
		serial->close();
		emit connectionChanged();
	}
	qDebug()<<"Disconnected";
}
Ejemplo n.º 6
0
bool OSCQueryDevice::reconnect()
{
  const auto& cur_settings = settings();
  const auto& stgs
      = cur_settings.deviceSpecificSettings.value<OSCQuerySpecificSettings>();

  if (m_dev && m_mirror && m_oldSettings == cur_settings)
  {
    // TODO update settings
    try
    {
      m_mirror->reconnect();
      m_connected = true;
    }
    catch (std::exception& e)
    {
      qDebug() << "Could not connect: " << e.what();
      m_connected = false;
    }
    catch (...)
    {
      // TODO save the reason of the non-connection.
      m_connected = false;
    }

    connectionChanged(m_connected);
    return connected();
  }

  disconnect();

  std::thread resolver([this, host = stgs.host.toStdString()] {
    bool ok = resolve_ip(host);
    if (ok)
    {
      sig_createDevice();
    }

    m_connected = false;
    connectionChanged(m_connected);
  });

  resolver.detach();

  return connected();
}
Ejemplo n.º 7
0
void Connection::setApiKey(const QString &v)
{
    if (apiKey_ == v)
        return;
    apiKey_ = v;
    emit connectionChanged();
    updateValidFlag();
}
Ejemplo n.º 8
0
void BrowseModel::setEnabled(bool e)
{
    if (e==enabled) {
        return;
    }
    enabled=e;

    if (enabled) {
        connect(MPDConnection::self(), SIGNAL(folderContents(QString,QStringList,QList<Song>)), this, SLOT(folderContents(QString,QStringList,QList<Song>)));
        connect(MPDConnection::self(), SIGNAL(connectionChanged(MPDConnectionDetails)), this, SLOT(connectionChanged()));
        connect(MPDConnection::self(), SIGNAL(statsUpdated(MPDStatsValues)), this, SLOT(statsUpdated(MPDStatsValues)));
    } else {
        disconnect(MPDConnection::self(), SIGNAL(folderContents(QString,QStringList,QList<Song>)), this, SLOT(folderContents(QString,QStringList,QList<Song>)));
        disconnect(MPDConnection::self(), SIGNAL(connectionChanged(MPDConnectionDetails)), this, SLOT(connectionChanged()));
        disconnect(MPDConnection::self(), SIGNAL(statsUpdated(MPDStatsValues)), this, SLOT(statsUpdated(MPDStatsValues)));
        clear();
    }
}
Ejemplo n.º 9
0
//==============================================================================
// Client Connection Changed Slot
//==============================================================================
void TestClient::clientConnectionChanged(const unsigned int& aID, const bool& aConnected)
{
    qDebug() << "TestClient::clientConnectionChanged - aID: " << aID << " - aConnected: " << aConnected;

    // ...

    // Emit Connection Changed Signal
    emit connectionChanged(this, aConnected);
}
Ejemplo n.º 10
0
void OSCQueryDevice::slot_createDevice()
{
  const auto& cur_settings = settings();
  const auto& stgs
      = cur_settings.deviceSpecificSettings.value<OSCQuerySpecificSettings>();

  try
  {
    std::unique_ptr<ossia::net::protocol_base> ossia_settings
        = std::make_unique<ossia::oscquery::oscquery_mirror_protocol>(
            stgs.host.toStdString());

    auto& p = static_cast<ossia::oscquery::oscquery_mirror_protocol&>(
        *ossia_settings);
    m_mirror = &p;

    if (stgs.rate)
    {
      ossia_settings = std::make_unique<ossia::net::rate_limiting_protocol>(
          std::chrono::milliseconds{*stgs.rate}, std::move(ossia_settings));
    }

    // run the commands in the Qt event loop
    // FIXME they should be disabled upon manual disconnection

    m_dev = std::make_unique<ossia::net::generic_device>(
        std::move(ossia_settings), settings().name.toStdString());

    deviceChanged(nullptr, m_dev.get());

    p.set_command_callback([=] { sig_command(); });
    p.set_disconnect_callback([=] { sig_disconnect(); });
    p.set_fail_callback([=] { sig_disconnect(); });

    setLogging_impl(Device::get_cur_logging(isLogging()));

    enableCallbacks();
    m_connected = true;
  }
  catch (std::exception& e)
  {
    qDebug() << "Could not connect: " << e.what();
    m_connected = false;
    if (!m_dev)
      m_mirror = nullptr;
  }
  catch (...)
  {
    // TODO save the reason of the non-connection.
    m_connected = false;
    if (!m_dev)
      m_mirror = nullptr;
  }

  connectionChanged(m_connected);
}
Ejemplo n.º 11
0
HexyTool::HexyTool(QWidget *parent)
	: QWidget(parent)
	, ui(new Ui::HexyTool)
	, serial(new HexySerial(this))
	, settings(nullptr)
{
	ui->setupUi(this);
	ui->tryToggleConnect->configure("Connect","Connecting","Connected", "#e1be4e");
	if(!connect(serial,SIGNAL(settingsChanged()), this, SLOT(onHexySettingsChanged()))) {
		qWarning()<<"ERROR: could not connect";
	}

	if(!connect(serial,SIGNAL(connectionChanged()), this, SLOT(onHexyConenctionChanged()))) {
		qWarning()<<"ERROR: could not connect";
	}
	if(!connect(ui->tryToggleConnect, SIGNAL(stateChanged(const TryToggleState, const TryToggleState)), this, SLOT(onConnectChanged(const TryToggleState, const TryToggleState)))) {
		qWarning()<<"ERROR: could not connect";
	}

	if(!connect(ui->widgetLimbIK, SIGNAL(IKUpadted()), this, SLOT(onLimbIKUpdated()))) {
		qWarning()<<"ERROR: could not connect";
	}


	for(quint32 i=0; i<HexySerial::SERVO_COUNT; ++i) {
		ServoInput *si=new ServoInput();
		if(0!=si) {
			si->configure(settings,i);
			if(!connect(si,SIGNAL(servoMoved(quint32, qreal)),this,SLOT(onServoMoved(quint32, qreal)),OC_CONTYPE)) {
				qWarning()<<"ERROR: could not connect";
			}
			if(!connect(si,SIGNAL(servoKilled(quint32)),this,SLOT(onServoKilled(quint32)),OC_CONTYPE)) {
				qWarning()<<"ERROR: could not connect";
			}
			ui->scrollAreaWidgetContents->layout()->addWidget(si);
		}
	}

	QSpacerItem *vs = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
	ui->verticalLayoutServos->addItem(vs);
	ui->scrollAreaServos->setEnabled(false);
	ui->widgetGait->setGait(gait);
	killAll();
	gaitTimer.setTimerType(Qt::PreciseTimer);
	gaitTimer.setInterval(40);
	if(!connect(&gaitTimer,SIGNAL(timeout()),this,SLOT(onUpdateGaitTimer()))) {
		qWarning()<<"ERROR: Could not connect";
	}
	gait.setDirection(0.5,0.5);
}
Ejemplo n.º 12
0
MpdLibraryDb::MpdLibraryDb(QObject *p)
    : LibraryDb(p, "MPD")
    , loading(false)
    , coverQuery(nullptr)
    , albumIdOnlyCoverQuery(nullptr)
    , artistImageQuery(nullptr)
{
    connect(MPDConnection::self(), SIGNAL(updatingLibrary(time_t)), this, SLOT(updateStarted(time_t)));
    connect(MPDConnection::self(), SIGNAL(librarySongs(QList<Song>*)), this, SLOT(insertSongs(QList<Song>*)));
    connect(MPDConnection::self(), SIGNAL(updatedLibrary()), this, SLOT(updateFinished()));
    connect(MPDConnection::self(), SIGNAL(statsUpdated(MPDStatsValues)), this, SLOT(statsUpdated(MPDStatsValues)));
    connect(this, SIGNAL(loadLibrary()), MPDConnection::self(), SLOT(loadLibrary()));
    connect(MPDConnection::self(), SIGNAL(connectionChanged(MPDConnectionDetails)), this, SLOT(connectionChanged(MPDConnectionDetails)));
    DBUG;
}
Ejemplo n.º 13
0
void HexySerial::openSerialPort()
{
	SerialSettings p = settings->settings();
	serial->setPortName(p.name);
	serial->setBaudRate(p.baudRate);
	serial->setDataBits(p.dataBits);
	serial->setParity(p.parity);
	serial->setStopBits(p.stopBits);
	serial->setFlowControl(p.flowControl);
	if (serial->open(QIODevice::ReadWrite)) {
		qDebug()<<tr("Connected to %1 : %2, %3, %4, %5, %6").arg(p.name).arg(p.stringBaudRate).arg(p.stringDataBits).arg(p.stringParity).arg(p.stringStopBits).arg(p.stringFlowControl);
		emit connectionChanged();
	} else {
		qDebug()<<"ERROR OPENING: "<<serial->errorString();
	}
}
Ejemplo n.º 14
0
void Client::setConnection(Connection *connection)
{
    Q_D(Client);
    if (d->connection != connection) {
        if (d->connection) {
            d->connection.data()->deleteLater();
        }

        d->connection = connection;
        connect(connection, SIGNAL(connectionStateChanged(Vreen::Client::State)),
                this, SLOT(_q_connection_state_changed(Vreen::Client::State)));
        connect(connection, SIGNAL(error(Vreen::Client::Error)), this, SIGNAL(error(Vreen::Client::Error)));

        emit connectionChanged(d->connection);
    }
}
Ejemplo n.º 15
0
void MainWindow::startSensorThread()
{
    sensorThread = new SensorThread();
    //QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), this, SLOT(printData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
    QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), this, SLOT(updateCursors(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
    QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), getWidget(WidgetType::settingsWidget), SLOT(displayData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
    QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), getWidget(WidgetType::homeWidget), SLOT(switchMenu(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
    QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), getWidget(WidgetType::desktopWidget), SLOT(switchMenu(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
    QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), getWidget(WidgetType::galleryWidget), SLOT(displayData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
    QObject::connect(sensorThread, SIGNAL(connectionChanged(QString)), getWidget(WidgetType::loadingWidget), SLOT(updateSubtitle(QString)));
    QObject::connect(sensorThread, SIGNAL(initializationChanged(WidgetType)), this, SLOT(setActiveWidget(WidgetType)));
    QObject::connect(getWidget(WidgetType::homeWidget), SIGNAL(menuSelected(WidgetType)), this, SLOT(setActiveWidget(WidgetType)));
    QObject::connect(sensorThread, SIGNAL(finished()), sensorThread, SLOT(deleteLater()));
    for (int i = 0; i < widgetsList.size(); i++){
        QObject::connect(sensorThread, SIGNAL(receivedData(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)), widgetsList[i], SLOT(collapse(QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>,QPair<SensorData*,SensorData*>)));
        QObject::connect(widgetsList[i], SIGNAL(returnHome(WidgetType)), this, SLOT(setActiveWidget(WidgetType)));}
    sensorThread->start();
}
Ejemplo n.º 16
0
void XmppStream::setConnection(IConnection *AConnection)
{
	if (FStreamState==SS_OFFLINE && FConnection!=AConnection)
	{
		if (FConnection)
			FConnection->instance()->disconnect(this);

		if (AConnection)
		{
			connect(AConnection->instance(),SIGNAL(connected()),SLOT(onConnectionConnected()));
			connect(AConnection->instance(),SIGNAL(readyRead(qint64)),SLOT(onConnectionReadyRead(qint64)));
			connect(AConnection->instance(),SIGNAL(error(const QString &)),SLOT(onConnectionError(const QString &)));
			connect(AConnection->instance(),SIGNAL(disconnected()),SLOT(onConnectionDisconnected()));
		}

		FConnection = AConnection;
		emit connectionChanged(AConnection);
	}
}
Ejemplo n.º 17
0
void ContactUser::onDisconnected()
{
    qDebug() << "Contact" << uniqueID << "disconnected";
    m_settings->write("lastConnected", QDateTime::currentDateTime());

    if (m_connection) {
        if (m_connection->isConnected()) {
            BUG() << "onDisconnected called, but connection is still connected";
            return;
        }

        m_connection.clear();
    } else {
        BUG() << "onDisconnected called without a connection";
    }

    updateStatus();
    emit disconnected();
    emit connectionChanged(m_connection);
}
Ejemplo n.º 18
0
void AbstractInputSlot::setFeedback(bool isFeedback)
{
    m_isFeedback = isFeedback;

    connectionChanged();
}
Ejemplo n.º 19
0
FastForwardImporterConfig::FastForwardImporterConfig( QWidget *parent )
    : DatabaseImporterConfig( parent )
{
    QString fastForwardDataPath = QDir::homePath() + "/.kde/share/apps/amarok";

    QWidget *gridHolder = new QWidget( this );

    QGridLayout *databaseLayout = new QGridLayout( gridHolder );

    QLabel *connectionLabel = new QLabel( i18n( "Connection" ), gridHolder );
    m_connectionCombo = new QComboBox( gridHolder );
    m_connectionCombo->insertItem( 0, "SQLite", FastForwardImporter::SQLite );
    m_connectionCombo->insertItem( 1, "MySQL", FastForwardImporter::MySQL );
    m_connectionCombo->insertItem( 2, "PostgreSQL", FastForwardImporter::PostgreSQL );

    m_databaseLocationLabel = new QLabel( i18n( "Database Location" ), gridHolder );
    m_databaseLocationInput = new QLineEdit( gridHolder );
    QCompleter *completer = new QCompleter( this );
    completer->setModel( new QDirModel( completer ) );
    m_databaseLocationInput->setCompleter( completer );
    m_databaseLocationInput->setText( fastForwardDataPath + "/collection.db" );
    m_databaseLocationLabel->setBuddy( m_databaseLocationInput );

    m_usernameLabel = new QLabel( i18n( "Username" ), gridHolder );
    m_usernameInput = new QLineEdit( gridHolder );
    m_usernameLabel->setBuddy( m_usernameInput );

    m_passwordLabel = new QLabel( i18n( "Password" ), gridHolder );
    m_passwordInput = new QLineEdit( gridHolder );
    m_passwordInput->setEchoMode( QLineEdit::Password );
    m_passwordLabel->setBuddy( m_passwordInput );

    m_databaseLabel = new QLabel( i18n( "Database Name" ), gridHolder );
    m_databaseInput = new QLineEdit( gridHolder );
    m_databaseLabel->setBuddy( m_databaseInput );

    m_hostnameLabel = new QLabel( i18n( "Hostname" ), gridHolder );
    m_hostnameInput = new QLineEdit( gridHolder );
    m_hostnameInput->setText( "localhost" );
    m_hostnameLabel->setBuddy( m_hostnameInput );

    databaseLayout->addWidget( connectionLabel, 0, 0 );
    databaseLayout->addWidget( m_connectionCombo, 0, 1 );

    databaseLayout->addWidget( m_usernameLabel, 1, 0 );
    databaseLayout->addWidget( m_usernameInput, 1, 1 );
    databaseLayout->addWidget( m_passwordLabel, 2, 0 );
    databaseLayout->addWidget( m_passwordInput, 2, 1 );
    
    databaseLayout->addWidget( m_databaseLabel, 3, 0 );
    databaseLayout->addWidget( m_databaseInput, 3, 1 );
    databaseLayout->addWidget( m_hostnameLabel, 4, 0 );
    databaseLayout->addWidget( m_hostnameInput, 4, 1 );

    databaseLayout->addWidget( m_databaseLocationLabel, 5, 0 );
    databaseLayout->addWidget( m_databaseLocationInput, 5, 1 );

    gridHolder->setLayout( databaseLayout );

    connect( m_connectionCombo, SIGNAL( currentIndexChanged( int ) ), SLOT( connectionChanged( int ) ) );
    connectionChanged( m_connectionCombo->currentIndex() ); // Make sure we sync the UI as appropriate

    m_smartMatchCheck = new QCheckBox( i18n( "Match tracks by meta tags" ), this );
    m_smartMatchCheck->setToolTip( i18n( "Perform meta information search on non-existing "
            "files, possibly detecting file renames. See <b>What's This</b>" ) );
    m_smartMatchCheck->setWhatsThis( i18n( "If enabled, tracks from the old collection that "
            "do not exist anymore in the file system are searched for (by metadata) in the current "
            "collection. If a match is found, statistics for the matched track are updated, "
            "even if the file locations differ." ) );
    m_smartMatchCheck->setChecked( true );

    m_importArtworkCheck = new QCheckBox( i18n( "Import downloaded artwork" ), this );
    m_importArtworkCheck->setChecked( true );

    const QString oldCoverPath = fastForwardDataPath + "/albumcovers/large/";

    QWidget *artworkDirHolder = new QWidget( this );

    QGridLayout *artworkDirLayout = new QGridLayout( artworkDirHolder );

    QLabel *artworkDirLabel = new QLabel( i18n( "Artwork directory" ), artworkDirHolder );
    m_importArtworkDirInput = new QLineEdit( artworkDirHolder );
    m_importArtworkDirInput->setText( oldCoverPath );

    artworkDirLayout->addWidget( artworkDirLabel, 0, 0 );
    artworkDirLayout->addWidget( m_importArtworkDirInput, 0, 1 );

    artworkDirHolder->setLayout( artworkDirLayout );

    connect( m_importArtworkCheck, SIGNAL( stateChanged( int ) ), SLOT( importArtworkChanged( int ) ) );

    QWidget *spacer = new QWidget( this );
    spacer->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
}
void ContactWrapper::setupAccountConnects()
{
    // keep track of presence (online/offline is all we need)
    connect(m_account.data(), SIGNAL(connectionChanged(Tp::ConnectionPtr)), this, SLOT(onConnectionChanged(Tp::ConnectionPtr)));
    connect(m_account.data(), SIGNAL(currentPresenceChanged(Tp::Presence)), this, SIGNAL(accountPresenceChanged()));
}
FastForwardImporterConfig::FastForwardImporterConfig( QWidget *parent )
    : DatabaseImporterConfig( parent )
{
    QWidget *gridHolder = new QWidget( this );

    QGridLayout *databaseLayout = new QGridLayout( gridHolder );

    QLabel *connectionLabel = new QLabel( i18n("Connection"), gridHolder );
    m_connectionCombo = new QComboBox( gridHolder );
    m_connectionCombo->insertItem( 0, "SQLite", FastForwardImporter::SQLite );
    m_connectionCombo->insertItem( 1, "MySQL", FastForwardImporter::MySQL );
    m_connectionCombo->insertItem( 2, "PostgreSQL", FastForwardImporter::PostgreSQL );

    m_databaseLocationLabel = new QLabel( i18n("Database Location"), gridHolder );
    m_databaseLocationInput = new QLineEdit( gridHolder );
    QCompleter *completer = new QCompleter( this );
    completer->setModel( new QDirModel( completer ) );
    m_databaseLocationInput->setCompleter( completer );
    m_databaseLocationInput->setText( QDir::homePath() + "/.kde/share/apps/amarok/collection.db" );
    m_databaseLocationLabel->setBuddy( m_databaseLocationInput );

    m_usernameLabel = new QLabel( i18n("Username"), gridHolder );
    m_usernameInput = new QLineEdit( gridHolder );
    m_usernameLabel->setBuddy( m_usernameInput );

    m_passwordLabel = new QLabel( i18n("Password"), gridHolder );
    m_passwordInput = new QLineEdit( gridHolder );
    m_passwordInput->setEchoMode( QLineEdit::Password );
    m_passwordLabel->setBuddy( m_passwordInput );

    m_databaseLabel = new QLabel( i18n("Database Name"), gridHolder );
    m_databaseInput = new QLineEdit( gridHolder );
    m_databaseLabel->setBuddy( m_databaseInput );

    m_hostnameLabel = new QLabel( i18n("Hostname"), gridHolder );
    m_hostnameInput = new QLineEdit( gridHolder );
    m_hostnameInput->setText( "localhost" );
    m_hostnameLabel->setBuddy( m_hostnameInput );

    databaseLayout->addWidget( connectionLabel, 0, 0 );
    databaseLayout->addWidget( m_connectionCombo, 0, 1 );

    databaseLayout->addWidget( m_usernameLabel, 1, 0 );
    databaseLayout->addWidget( m_usernameInput, 1, 1 );
    databaseLayout->addWidget( m_passwordLabel, 2, 0 );
    databaseLayout->addWidget( m_passwordInput, 2, 1 );
    
    databaseLayout->addWidget( m_databaseLabel, 3, 0 );
    databaseLayout->addWidget( m_databaseInput, 3, 1 );
    databaseLayout->addWidget( m_hostnameLabel, 4, 0 );
    databaseLayout->addWidget( m_hostnameInput, 4, 1 );

    databaseLayout->addWidget( m_databaseLocationLabel, 5, 0 );
    databaseLayout->addWidget( m_databaseLocationInput, 5, 1 );

    gridHolder->setLayout( databaseLayout );

    connect( m_connectionCombo, SIGNAL( currentIndexChanged(int) ), SLOT( connectionChanged(int) ) );
    connectionChanged( m_connectionCombo->currentIndex() ); // Make sure we sync the UI as appropriate

    m_importArtworkCheck = new QCheckBox( i18n("Import downloaded artwork"), this );
    m_importArtworkCheck->setChecked( true );
    
    const QString oldCoverPath = Amarok::saveLocation( "albumcovers/large/" ).replace("kde4", "kde");

    QWidget *artworkDirHolder = new QWidget( this );

    QGridLayout *artworkDirLayout = new QGridLayout( artworkDirHolder );

    QLabel *artworkDirLabel = new QLabel( i18n("Artwork directory"), artworkDirHolder );
    m_importArtworkDirInput = new QLineEdit( artworkDirHolder );
    m_importArtworkDirInput->setText( oldCoverPath );

    artworkDirLayout->addWidget( artworkDirLabel, 0, 0 );
    artworkDirLayout->addWidget( m_importArtworkDirInput, 0, 1 );

    artworkDirHolder->setLayout( artworkDirLayout );

    connect( m_importArtworkCheck, SIGNAL( stateChanged(int) ), SLOT( importArtworkChanged(int) ) );

    QWidget *spacer = new QWidget( this );
    spacer->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
}