File: boabstractdebugdialog.cpp

package info (click to toggle)
boson 0.13-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 12,992 kB
  • ctags: 29,287
  • sloc: cpp: 203,902; ansic: 9,959; makefile: 75; sh: 64; sed: 47
file content (70 lines) | stat: -rw-r--r-- 2,419 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*  This file is part of the Boson game. It was originally 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., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include "boabstractdebugdialog.h"
#include <kconfig.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <kapplication.h>
#include <klocale.h>

BoAbstractDebugDialog::BoAbstractDebugDialog( QWidget *parent, const char *name, bool modal )
    : KDialog( parent, name, modal )
{
    pConfig = new KConfig( "bodebugrc" );
}

BoAbstractDebugDialog::~BoAbstractDebugDialog()
{
    delete pConfig;
}

void BoAbstractDebugDialog::buildButtons( QVBoxLayout * topLayout )
{
  QHBoxLayout *hbox = new QHBoxLayout( KDialog::spacingHint() );
  topLayout->addLayout( hbox );
  pHelpButton = new QPushButton( i18n("&Help"), this );
  hbox->addWidget( pHelpButton );
  hbox->addStretch(10);
  pOKButton = new QPushButton( i18n("&OK"), this );
  hbox->addWidget( pOKButton );
  pCancelButton = new QPushButton( i18n("&Cancel"), this );
  hbox->addWidget( pCancelButton );

  int w1 = pHelpButton->sizeHint().width();
  int w2 = pOKButton->sizeHint().width();
  int w3 = pCancelButton->sizeHint().width();
  int w4 = QMAX( w1, QMAX( w2, w3 ) );

  pHelpButton->setFixedWidth( w4 );
  pOKButton->setFixedWidth( w4 );
  pCancelButton->setFixedWidth( w4 );

  connect( pHelpButton, SIGNAL( clicked() ), SLOT( slotShowHelp() ) );
  connect( pOKButton, SIGNAL( clicked() ), SLOT( accept() ) );
  connect( pCancelButton, SIGNAL( clicked() ), SLOT( reject() ) );
}

void BoAbstractDebugDialog::slotShowHelp()
{
  if (kapp)
    kapp->invokeHTMLHelp( "kdelibs/kdebug/index.html" );
}

#include "boabstractdebugdialog.moc"