/*****************************************************************************
* errors.cpp : Errors
****************************************************************************
/*****************************************************************************
* errors.cpp : Errors
****************************************************************************
*
* 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
*
* 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
- QPushButton *closeButton = new QPushButton(qtr("&Close"));
- QPushButton *clearButton = new QPushButton(qtr("&Clear"));
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox;
+ QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
+ QPushButton *clearButton = new QPushButton( qtr( "&Clear" ) );
+ buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
+ buttonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
+
messages = new QTextEdit();
messages->setReadOnly( true );
messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
messages = new QTextEdit();
messages->setReadOnly( true );
messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
layout->addWidget( messages, 0, 0, 1, 3 );
layout->addWidget( stopShowing, 1, 0 );
layout->addItem( new QSpacerItem( 200, 20, QSizePolicy::Expanding ), 2,0 );
layout->addWidget( messages, 0, 0, 1, 3 );
layout->addWidget( stopShowing, 1, 0 );
layout->addItem( new QSpacerItem( 200, 20, QSizePolicy::Expanding ), 2,0 );
- layout->addWidget( clearButton, 2, 1 );
- layout->addWidget( closeButton, 2, 2 );
+ layout->addWidget( buttonBox, 2, 2 );
BUTTONACT( clearButton, clear() );
BUTTONACT( stopShowing, dontShow() );
}
BUTTONACT( clearButton, clear() );
BUTTONACT( stopShowing, dontShow() );
}
if( stopShowing->isChecked() ) return;
messages->textCursor().movePosition( QTextCursor::End );
messages->setTextColor( error ? "red" : "yellow" );
if( stopShowing->isChecked() ) return;
messages->textCursor().movePosition( QTextCursor::End );
messages->setTextColor( error ? "red" : "yellow" );
messages->setTextColor( "black" );
messages->insertPlainText( text + QString( "\n" ) );
messages->ensureCursorVisible();
messages->setTextColor( "black" );
messages->insertPlainText( text + QString( "\n" ) );
messages->ensureCursorVisible();