From 728c3cd887662922ee2db802bd91c9a3a1d032ac Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 18 Dec 2008 01:28:37 +0100 Subject: Adjusted download directory requester --- src/settings.cpp | 8 +++++--- src/settings.ui | 33 ++++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index 355799bd..895a22d9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -33,6 +33,7 @@ // KDE Includes #include #include +#include // Qt Includes #include @@ -49,6 +50,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) setWindowTitle( i18n("Setting rekonq..") ); setButtons( KDialog::Ok | KDialog::Close | KDialog::Apply ); + kurlrequester->setMode( KFile::Directory ); setModal(true); connect(this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) ); @@ -79,7 +81,7 @@ void SettingsDialog::loadDefaults() m_fixedFont = QFont(fixedFontFamily, fixedFontSize); fixedLabel->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() )); - downloadsLocation->setText(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); + kurlrequester->setUrl( KUrl( "~" ) ); // QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) ); enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled)); enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled)); @@ -109,7 +111,7 @@ void SettingsDialog::loadFromSettings() expireHistory->setCurrentIndex(idx); QString downloadDirectory = group1.readEntry( QString("downloadDirectory") , QString() ); - downloadsLocation->setText(downloadDirectory); + kurlrequester->setUrl( KUrl(downloadDirectory) ); openLinksIn->setCurrentIndex( group1.readEntry( QString("openLinksIn"), openLinksIn->currentIndex() ) ); @@ -185,7 +187,7 @@ void SettingsDialog::saveToSettings() group1.writeEntry(QString("home"), homeLineEdit->text() ); group1.writeEntry(QString("openLinksIn"), openLinksIn->currentIndex() ); - group1.writeEntry(QString("downloadDirectory"), downloadsLocation->text() ); + group1.writeEntry(QString("downloadDirectory"), kurlrequester->url().path() ); int historyExpire = expireHistory->currentIndex(); int idx = -1; diff --git a/src/settings.ui b/src/settings.ui index 38c5ff13..31945906 100644 --- a/src/settings.ui +++ b/src/settings.ui @@ -33,17 +33,17 @@ - + - + Set to current page - + Qt::Horizontal @@ -66,7 +66,7 @@ - + @@ -110,9 +110,6 @@ - - - @@ -123,7 +120,7 @@ - + @@ -137,7 +134,7 @@ - + Qt::Vertical @@ -150,6 +147,9 @@ + + + @@ -476,8 +476,7 @@ - - + @@ -501,6 +500,18 @@ + + + KLineEdit + QLineEdit +
klineedit.h
+
+ + KUrlRequester + QFrame +
kurlrequester.h
+
+
-- cgit v1.2.1