summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rekonq.kcfg6
-rw-r--r--src/settings/generalwidget.cpp12
-rw-r--r--src/settings/settings_general.ui71
3 files changed, 84 insertions, 5 deletions
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index 227c6b10..78a0e6a0 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -67,6 +67,12 @@
<entry name="useNewTabPage" type="Bool">
<default>false</default>
</entry>
+ <entry name="downloadPath" type="Url">
+ <default code="true">KGlobalSettings::downloadPath()</default>
+ </entry>
+ <entry name="askDownloadPath" type="Bool">
+ <default>false</default>
+ </entry>
<entry name="kgetDownload" type="Bool">
<default>false</default>
</entry>
diff --git a/src/settings/generalwidget.cpp b/src/settings/generalwidget.cpp
index fee6b841..cdadbd81 100644
--- a/src/settings/generalwidget.cpp
+++ b/src/settings/generalwidget.cpp
@@ -38,6 +38,8 @@
//KDE Includes
#include <kstandarddirs.h>
+#include <KUrlRequester>
+
GeneralWidget::GeneralWidget(QWidget *parent)
: QWidget(parent)
@@ -58,11 +60,21 @@ GeneralWidget::GeneralWidget(QWidget *parent)
connect(doNotTrackCheckBox, SIGNAL(clicked()), this, SLOT(hasChanged()));
connect(kcfg_homePage, SIGNAL(editingFinished()), this, SLOT(fixHomePageURL()));
+
+ kcfg_downloadPath->setMode(KFile::Directory);
+
+ askDownloadYes->setChecked(ReKonfig::askDownloadPath());
+ askDownloadNo->setChecked(!ReKonfig::askDownloadPath());
+
+ kcfg_downloadPath->setEnabled(!ReKonfig::askDownloadPath());
+ connect(askDownloadNo, SIGNAL(toggled(bool)), kcfg_downloadPath, SLOT(setEnabled(bool)));
}
void GeneralWidget::save()
{
+ ReKonfig::setAskDownloadPath(askDownloadYes->isChecked());
+
KConfigGroup cg = KConfigGroup(KSharedConfig::openConfig("kioslaverc", KConfig::NoGlobals), QString());
cg.writeEntry("DoNotTrack", doNotTrackCheckBox->isChecked());
cg.sync();
diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui
index 3f7c0675..7e250c47 100644
--- a/src/settings/settings_general.ui
+++ b/src/settings/settings_general.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>464</width>
- <height>462</height>
+ <width>480</width>
+ <height>571</height>
</rect>
</property>
<property name="windowTitle">
@@ -19,8 +19,8 @@
<property name="title">
<string>Startup</string>
</property>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@@ -45,7 +45,7 @@
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item>
<widget class="KComboBox" name="kcfg_startupBehaviour">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -155,6 +155,62 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QRadioButton" name="askDownloadNo">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Save files to:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KUrlRequester" name="kcfg_downloadPath">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="askDownloadYes">
+ <property name="text">
+ <string>Always ask me where to save files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<widget class="QCheckBox" name="kcfg_kgetDownload">
<property name="text">
<string>Use KGet for downloading files</string>
@@ -230,6 +286,11 @@
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
+ <customwidget>
+ <class>KUrlRequester</class>
+ <extends>QFrame</extends>
+ <header>kurlrequester.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>