1 /* This file is part of the KDE libraries
2 Copyright (C) 2000 David Faure <faure@kde.org>
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.
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.
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.
20 #include "kabstractdebugdialog.h"
22 #include <kpushbutton.h>
24 #include <kapplication.h>
26 #include <kstandardguiitem.h>
27 #include <ktoolinvocation.h>
29 KAbstractDebugDialog::KAbstractDebugDialog( QWidget
*parent
, const char *name
, bool modal
)
34 pConfig
= new KConfig( "kdebugrc", KConfig::NoGlobals
);
37 KAbstractDebugDialog::~KAbstractDebugDialog()
42 void KAbstractDebugDialog::buildButtons( QVBoxLayout
* topLayout
)
44 QHBoxLayout
*hbox
= new QHBoxLayout();
45 hbox
->setSpacing( KDialog::spacingHint() );
46 topLayout
->addLayout( hbox
);
47 pHelpButton
= new KPushButton( KStandardGuiItem::help() );
48 hbox
->addWidget( pHelpButton
);
50 QSpacerItem
*spacer
= new QSpacerItem(40, 0);
51 hbox
->addItem(spacer
);
52 pOKButton
= new KPushButton( KStandardGuiItem::ok() );
53 hbox
->addWidget( pOKButton
);
54 pApplyButton
= new KPushButton( KStandardGuiItem::apply() );
55 hbox
->addWidget( pApplyButton
);
56 pCancelButton
= new KPushButton( KStandardGuiItem::cancel() );
57 hbox
->addWidget( pCancelButton
);
59 int w1
= pHelpButton
->sizeHint().width();
60 int w2
= pOKButton
->sizeHint().width();
61 int w3
= pCancelButton
->sizeHint().width();
62 int w4
= qMax( w1
, qMax( w2
, w3
) );
63 int w5
= pApplyButton
->sizeHint().width();
66 pHelpButton
->setFixedWidth( w4
);
67 pOKButton
->setFixedWidth( w4
);
68 pApplyButton
->setFixedWidth( w4
);
69 pCancelButton
->setFixedWidth( w4
);
71 connect( pHelpButton
, SIGNAL( clicked() ), SLOT( slotShowHelp() ) );
72 connect( pOKButton
, SIGNAL( clicked() ), SLOT( accept() ) );
73 connect( pApplyButton
, SIGNAL( clicked() ), SLOT( slotApply() ) );
74 connect( pCancelButton
, SIGNAL( clicked() ), SLOT( reject() ) );
77 void KAbstractDebugDialog::slotShowHelp()
80 KToolInvocation::invokeHelp();
83 void KAbstractDebugDialog::slotApply()
89 #include "kabstractdebugdialog.moc"