diff options
-rw-r--r-- | src/settings.cpp | 8 | ||||
-rw-r--r-- | 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 <KConfig> #include <KFontDialog> +#include <KUrl> // Qt Includes #include <QtGui> @@ -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 @@ </property> </widget> </item> - <item row="0" column="1" colspan="2" > + <item row="0" column="2" colspan="2" > <widget class="KLineEdit" name="homeLineEdit" /> </item> - <item row="1" column="1" > + <item row="1" column="2" > <widget class="QPushButton" name="setHomeToCurrentPageButton" > <property name="text" > <string>Set to current page</string> </property> </widget> </item> - <item row="1" column="2" > + <item row="1" column="3" > <spacer name="horizontalSpacer" > <property name="orientation" > <enum>Qt::Horizontal</enum> @@ -66,7 +66,7 @@ </property> </widget> </item> - <item row="2" column="1" colspan="2" > + <item row="2" column="2" colspan="2" > <widget class="QComboBox" name="expireHistory" > <item> <property name="text" > @@ -110,9 +110,6 @@ </property> </widget> </item> - <item row="3" column="1" colspan="2" > - <widget class="KLineEdit" name="downloadsLocation" /> - </item> <item row="4" column="0" > <widget class="QLabel" name="label_8" > <property name="text" > @@ -123,7 +120,7 @@ </property> </widget> </item> - <item row="4" column="1" colspan="2" > + <item row="4" column="2" colspan="2" > <widget class="QComboBox" name="openLinksIn" > <item> <property name="text" > @@ -137,7 +134,7 @@ </item> </widget> </item> - <item row="5" column="1" colspan="2" > + <item row="5" column="2" colspan="2" > <spacer> <property name="orientation" > <enum>Qt::Vertical</enum> @@ -150,6 +147,9 @@ </property> </spacer> </item> + <item row="3" column="2" colspan="2" > + <widget class="KUrlRequester" name="kurlrequester" /> + </item> </layout> </widget> <widget class="QWidget" name="tab_3" > @@ -476,8 +476,7 @@ </widget> </item> <item row="4" column="1" colspan="2" > - <widget class="KLineEdit" name="proxyPassword" > - </widget> + <widget class="KLineEdit" name="proxyPassword" /> </item> <item row="5" column="0" > <spacer name="verticalSpacer_2" > @@ -501,6 +500,18 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + <customwidget> + <class>KUrlRequester</class> + <extends>QFrame</extends> + <header>kurlrequester.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> |