You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.8 KiB
86 lines
2.8 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
Copyright (C) 2000 David Faure <faure@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
12 years ago
|
#include "kabstractdebugdialog.h"
|
||
12 years ago
|
#include <tdeconfig.h>
|
||
15 years ago
|
#include <kpushbutton.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
#include <kstdguiitem.h>
|
||
|
|
||
14 years ago
|
KAbstractDebugDialog::KAbstractDebugDialog( TQWidget *parent, const char *name, bool modal )
|
||
15 years ago
|
: KDialog( parent, name, modal )
|
||
|
{
|
||
12 years ago
|
pConfig = new TDEConfig( "kdebugrc" );
|
||
15 years ago
|
}
|
||
|
|
||
|
KAbstractDebugDialog::~KAbstractDebugDialog()
|
||
|
{
|
||
|
delete pConfig;
|
||
|
}
|
||
|
|
||
14 years ago
|
void KAbstractDebugDialog::buildButtons( TQVBoxLayout * topLayout )
|
||
15 years ago
|
{
|
||
14 years ago
|
TQHBoxLayout *hbox = new TQHBoxLayout( KDialog::spacingHint() );
|
||
15 years ago
|
topLayout->addLayout( hbox );
|
||
|
pHelpButton = new KPushButton( KStdGuiItem::help(), this );
|
||
|
hbox->addWidget( pHelpButton );
|
||
|
hbox->addStretch(10);
|
||
14 years ago
|
TQSpacerItem *spacer = new TQSpacerItem(40, 0);
|
||
15 years ago
|
hbox->addItem(spacer);
|
||
|
pOKButton = new KPushButton( KStdGuiItem::ok(), this );
|
||
|
hbox->addWidget( pOKButton );
|
||
|
pApplyButton = new KPushButton( KStdGuiItem::apply(), this );
|
||
|
hbox->addWidget( pApplyButton );
|
||
|
pCancelButton = new KPushButton( KStdGuiItem::cancel(), this );
|
||
|
hbox->addWidget( pCancelButton );
|
||
|
|
||
13 years ago
|
int w1 = pHelpButton->sizeHint().width();
|
||
|
int w2 = pOKButton->sizeHint().width();
|
||
|
int w3 = pCancelButton->sizeHint().width();
|
||
11 years ago
|
int w4 = TQMAX( w1, TQMAX( w2, w3 ) );
|
||
13 years ago
|
int w5 = pApplyButton->sizeHint().width();
|
||
11 years ago
|
w4 = TQMAX(w4, w5);
|
||
15 years ago
|
|
||
|
pHelpButton->setFixedWidth( w4 );
|
||
|
pOKButton->setFixedWidth( w4 );
|
||
|
pApplyButton->setFixedWidth( w4 );
|
||
|
pCancelButton->setFixedWidth( w4 );
|
||
|
|
||
14 years ago
|
connect( pHelpButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotShowHelp() ) );
|
||
|
connect( pOKButton, TQT_SIGNAL( clicked() ), TQT_SLOT( accept() ) );
|
||
|
connect( pApplyButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotApply() ) );
|
||
|
connect( pCancelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) );
|
||
15 years ago
|
}
|
||
|
|
||
|
void KAbstractDebugDialog::slotShowHelp()
|
||
|
{
|
||
|
if (kapp)
|
||
|
kapp->invokeHelp();
|
||
|
}
|
||
|
|
||
|
void KAbstractDebugDialog::slotApply()
|
||
|
{
|
||
|
save();
|
||
|
pConfig->sync();
|
||
|
}
|
||
|
|
||
12 years ago
|
#include "kabstractdebugdialog.moc"
|