typo found by Andrey Cherepanov
[kdepim.git] / akonadi / resources / mbox / configdialog.cpp
blobe106bdb6ed3efb4586f62e9358ec87d1d426471c
1 /*
2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
3 Copyright (c) 2009 Bertjan Broeksema <b.broeksema@kdemail.net>
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
21 #include "configdialog.h"
22 #include "settings.h"
24 #include <kconfigdialogmanager.h>
25 #include <kstandarddirs.h>
26 #include <kurlrequester.h>
28 ConfigDialog::ConfigDialog(QWidget * parent) :
29 KDialog( parent )
31 ui.setupUi( mainWidget() );
32 mManager = new KConfigDialogManager( this, Settings::self() );
33 mManager->updateWidgets();
34 ui.kcfg_File->setUrl( KUrl( Settings::self()->file() ) );
36 checkAvailableLockMethods();
38 connect( this, SIGNAL(okClicked()), SLOT(save()) );
41 void ConfigDialog::checkAvailableLockMethods()
43 // FIXME: I guess this whole checking makes only sense on linux machines.
45 // Check for procmail lock method.
46 if (KStandardDirs::findExe("lockfile") == QString()) {
47 ui.procmail->setEnabled(false);
48 if (ui.procmail->isChecked()) // Select another lock method if necessary
49 ui.mutt_dotlock->setChecked(true);
52 // Check for mutt lock method.
53 if (KStandardDirs::findExe("mutt_dotlock") == QString()) {
54 ui.mutt_dotlock->setEnabled(false);
55 ui.mutt_dotlock_privileged->setEnabled(false);
56 if (ui.mutt_dotlock->isChecked() || ui.mutt_dotlock_privileged->isChecked())
58 if (ui.procmail->isEnabled())
59 ui.procmail->setChecked(true);
60 else
61 ui.fcntl->setChecked(true);
65 // FIXME: I assume fcntl is available on *nix machines. Maybe some kind of
66 // (compile time) check is needed here.
69 void ConfigDialog::save()
71 mManager->updateSettings();
72 Settings::self()->setFile( ui.kcfg_File->url().path() );
73 Settings::self()->writeConfig();
76 #include "configdialog.moc"