diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-11-27 10:39:33 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-11-29 00:09:11 +0100 |
commit | 8d873c915fd5fae554b1656715157cb5a87cbaf1 (patch) | |
tree | a6dc0acbc7f55b632fb565524a8c2facc0563751 /src/settings | |
parent | GCI Task : Don't open useless tabs or windows for actions in the new tab page (diff) | |
download | rekonq-8d873c915fd5fae554b1656715157cb5a87cbaf1.tar.xz |
Add settings for fixed download path
Diffstat (limited to 'src/settings')
-rw-r--r-- | src/settings/generalwidget.cpp | 12 | ||||
-rw-r--r-- | src/settings/settings_general.ui | 71 |
2 files changed, 78 insertions, 5 deletions
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/> |