1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 2000 David Faure <faure@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
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 |
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #include "kabstractdebugdialog.h" |
21 | #include <kconfig.h> |
22 | #include <kpushbutton.h> |
23 | #include <QCheckBox> |
24 | #include <QLayout> |
25 | #include <klocale.h> |
26 | #include <kstandardguiitem.h> |
27 | #include <ktoolinvocation.h> |
28 | |
29 | KAbstractDebugDialog::KAbstractDebugDialog(QWidget *parent) |
30 | : KDialog(parent) |
31 | { |
32 | pConfig = new KConfig( "kdebugrc" , KConfig::NoGlobals ); |
33 | } |
34 | |
35 | KAbstractDebugDialog::~KAbstractDebugDialog() |
36 | { |
37 | delete pConfig; |
38 | } |
39 | |
40 | void KAbstractDebugDialog::buildButtons() |
41 | { |
42 | setButtons(KDialog::Help | KDialog::Ok | KDialog::Apply | KDialog::Cancel); |
43 | |
44 | connect(this, SIGNAL(helpClicked()), SLOT( slotShowHelp() )); |
45 | connect(this, SIGNAL(okClicked()), SLOT( accept() )); |
46 | connect(this, SIGNAL(applyClicked()), SLOT( slotApply() )); |
47 | connect(this, SIGNAL(cancelClicked()), SLOT( reject() )); |
48 | } |
49 | |
50 | void KAbstractDebugDialog::slotShowHelp() |
51 | { |
52 | KToolInvocation::invokeHelp(); |
53 | } |
54 | |
55 | void KAbstractDebugDialog::slotApply() |
56 | { |
57 | save(); |
58 | pConfig->sync(); |
59 | } |
60 | |
61 | void KAbstractDebugDialog::save() |
62 | { |
63 | doSave(); |
64 | KConfigGroup topGroup(pConfig, QString()); |
65 | topGroup.writeEntry("DisableAll" , m_disableAll->isChecked()); |
66 | } |
67 | |
68 | void KAbstractDebugDialog::load() |
69 | { |
70 | doLoad(); |
71 | KConfigGroup topGroup(pConfig, QString()); |
72 | m_disableAll->setChecked(topGroup.readEntry("DisableAll" , false)); |
73 | } |
74 | |
75 | #include "kabstractdebugdialog.moc" |
76 | |