Fix Bug 359018 - Pressing cancel does not undo changes made to "Empty local wastebin...
[kdepim.git] / storageservicemanager / storageserviceconfiguredialog.cpp
blob128c9f2a6fa0e5c19a3c1dfc0299fd327ee39b43
1 /*
2 Copyright (c) 2014-2015 Montel Laurent <montel@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
21 #include "storageserviceconfiguredialog.h"
22 #include "PimCommon/ConfigureImmutableWidgetUtils"
23 #include "PimCommon/StorageServiceConfigureWidget"
24 #include "storageservicemanagerglobalconfig.h"
26 #include <KLocalizedString>
27 #include <KSharedConfig>
29 #include <QCheckBox>
30 #include <QLayout>
32 StorageServiceConfigureDialog::StorageServiceConfigureDialog(QWidget *parent)
33 : PimCommon::StorageServiceConfigureDialog(parent)
35 mCloseWallet = new QCheckBox(i18n("Close wallet when close application"));
36 mCloseWallet->setObjectName(QStringLiteral("closewallet"));
37 addExtraWidget(mCloseWallet);
38 loadSettings();
41 StorageServiceConfigureDialog::~StorageServiceConfigureDialog()
45 void StorageServiceConfigureDialog::loadSettings()
47 PimCommon::ConfigureImmutableWidgetUtils::loadWidget(mStorageServiceConfigureWidget->downloadFolder(), StorageServiceManagerGlobalConfig::self()->downloadDirectoryItem());
48 PimCommon::ConfigureImmutableWidgetUtils::loadWidget(mCloseWallet, StorageServiceManagerGlobalConfig::self()->closeWalletItem());
51 void StorageServiceConfigureDialog::writeSettings()
53 PimCommon::ConfigureImmutableWidgetUtils::saveUrlRequester(mStorageServiceConfigureWidget->downloadFolder(), StorageServiceManagerGlobalConfig::self()->downloadDirectoryItem());
54 PimCommon::ConfigureImmutableWidgetUtils::saveCheckBox(mCloseWallet, StorageServiceManagerGlobalConfig::self()->closeWalletItem());
56 StorageServiceManagerGlobalConfig::self()->save();