KDELibs4Support

kabstractdebugdialog.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <[email protected]>
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 #include <qdesktopservices.h>
29 #include <QUrl>
30 
31 KAbstractDebugDialog::KAbstractDebugDialog(QWidget *parent)
32  : KDialog(parent)
33 {
34  pConfig = new KConfig( "kdebugrc", KConfig::NoGlobals );
35 }
36 
37 KAbstractDebugDialog::~KAbstractDebugDialog()
38 {
39  delete pConfig;
40 }
41 
42 void KAbstractDebugDialog::buildButtons()
43 {
45 
46  connect(this, SIGNAL(helpClicked()), SLOT(slotShowHelp()));
47  connect(this, SIGNAL(okClicked()), SLOT(accept()));
48  connect(this, SIGNAL(applyClicked()), SLOT(slotApply()));
49  connect(this, SIGNAL(cancelClicked()), SLOT(reject()));
50 }
51 
52 void KAbstractDebugDialog::slotShowHelp()
53 {
55 }
56 
57 void KAbstractDebugDialog::slotApply()
58 {
59  save();
60  pConfig->sync();
61 }
62 
63 void KAbstractDebugDialog::save()
64 {
65  doSave();
66  KConfigGroup topGroup(pConfig, QString());
67  topGroup.writeEntry("DisableAll", m_disableAll->isChecked());
68 }
69 
70 void KAbstractDebugDialog::load()
71 {
72  doLoad();
73  KConfigGroup topGroup(pConfig, QString());
74  m_disableAll->setChecked(topGroup.readEntry("DisableAll", false));
75 }
76 
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected) ...
Definition: kdialog.h:143
A dialog base class with standard buttons and predefined layouts.
Definition: kdialog.h:128
const QList< QKeySequence > & save()
Show Apply button.
Definition: kdialog.h:141
Show Help button. (this button will run the help set with setHelp)
Definition: kdialog.h:138
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted) ...
Definition: kdialog.h:140
bool openUrl(const QUrl &url)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 13 2020 22:58:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.