summaryrefslogtreecommitdiffstats
path: root/kipi-plugins/mpegencoder/kshowdebuggingoutput.cpp
blob: cd343d03eca13ec352c01e888e57b370abc0f92c (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
//////////////////////////////////////////////////////////////////////////////
//
//    KSHOWDEBUGGINGOUTPUT.CPP
//
//    Copyright (C) 2003 Gilles CAULIER <caulier dot gilles at gmail dot com>
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    This program 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 General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
//
//////////////////////////////////////////////////////////////////////////////

// Local includes.

#include "kshowdebuggingoutput.h"

namespace KIPIMPEGEncoderPlugin
{

/////////////////////////////////////////////////////////////////////////////////////////////

KShowDebuggingOutput::KShowDebuggingOutput(TQString Messages, TQString Header, TQString Foot, TQWidget* tqparent )
  : KDialog( tqparent, "debugViewDialog", true )
{
  setCaption( i18n("Debugging Output") );

  okButton = new TQPushButton( i18n("&OK"), this );
  ClipBoardCopy = new TQPushButton( i18n("Copy to Clip&board"), this );
  debugView = new TQTextView( this );
  grid = new TQGridLayout( this );

  grid->addMultiCellWidget( debugView, 0, 0, 0, 2 );
  grid->addWidget( okButton, 1, 1 );
  grid->addWidget( ClipBoardCopy, 1, 2 );
  grid->setSpacing( spacingHint() );
  grid->setMargin( marginHint() );
  grid->setColStretch( 0, 1 );

  connect( okButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(accept()) );
  connect( ClipBoardCopy, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotCopyToCliboard()) );

  // add the debugging output

  debugView->append( Header );
  debugView->append( "-----------------------------------------------\n" );
  debugView->append( Messages );
  debugView->append( "-----------------------------------------------\n" );
  debugView->append( Foot );
  
  resize( 600, 300 );
}


/////////////////////////////////////////////////////////////////////////////////////////////

KShowDebuggingOutput::~KShowDebuggingOutput()
{
}


/////////////////////////////////////////////////////////////////////////////////////////////

void KShowDebuggingOutput::slotCopyToCliboard( void )
{
  debugView->selectAll(TRUE);
  debugView->copy();
  debugView->selectAll(FALSE);
}

}  // NameSpace KIPIMPEGEncoderPlugin

#include "kshowdebuggingoutput.moc"