Beispiel #1
0
CRLView::CRLView( QWidget* parent, const char* name, bool modal )
  : QDialog( parent, name, modal ), _process(0)
{
  QVBoxLayout* topLayout = new QVBoxLayout( this, 10, 4 );

  topLayout->addWidget( new QLabel( i18n("CRL cache dump:"), this ) );

  _textView = new QTextEdit( this );
  _textView->setFont( KGlobalSettings::fixedFont() );
  _textView->setTextFormat( QTextEdit::LogText );
  topLayout->addWidget( _textView );

  QHBoxLayout* hbLayout = new QHBoxLayout( topLayout );

  _updateButton = new KPushButton( i18n("&Update"), this );
  _closeButton = new KPushButton( KStdGuiItem::close(), this );

  hbLayout->addWidget( _updateButton );
  hbLayout->addStretch();
  hbLayout->addWidget( _closeButton );

  // connections:
  connect( _updateButton, SIGNAL( clicked() ),
	   this, SLOT( slotUpdateView() ) );
  connect( _closeButton, SIGNAL( clicked() ),
	   this, SLOT( close() ) );

  resize( _textView->fontMetrics().width( 'M' ) * 80,
	  _textView->fontMetrics().lineSpacing() * 25 );

  _timer = new QTimer( this );
  connect( _timer, SIGNAL(timeout()), SLOT(slotAppendBuffer()) );
}
CRLView::CRLView( QWidget* parent )
  : QDialog( parent ), _process(0)
{
  QVBoxLayout* topLayout = new QVBoxLayout( this );
  topLayout->setSpacing( 4 );
  topLayout->setMargin( 10 );

  topLayout->addWidget( new QLabel( i18n("CRL cache dump:"), this ) );

  _textView = new QTextEdit( this );
  _textView->setFont( KGlobalSettings::fixedFont() );
  _textView->setReadOnly(true);
  topLayout->addWidget( _textView );

  QHBoxLayout* hbLayout = new QHBoxLayout();
  topLayout->addItem( hbLayout );

  _updateButton = new KPushButton( i18n("&Update"), this );
  _closeButton = new KPushButton( KStandardGuiItem::close(), this );

  hbLayout->addWidget( _updateButton );
  hbLayout->addStretch();
  hbLayout->addWidget( _closeButton );

  // connections:
  connect( _updateButton, SIGNAL(clicked()),
	   this, SLOT(slotUpdateView()) );
  connect( _closeButton, SIGNAL(clicked()),
	   this, SLOT(close()) );

  resize( _textView->fontMetrics().width( 'M' ) * 80,
	  _textView->fontMetrics().lineSpacing() * 25 );

  _timer = new QTimer( this );
  connect( _timer, SIGNAL(timeout()), SLOT(slotAppendBuffer()) );
}