X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fgui%2Fqt4%2Fdialogs%2Ferrors.cpp;h=d8c785eb73a2fffe93e915c1780e003a11757e73;hb=8b524cb8b23f4acfb96c6a07b404c73615e5e6c2;hp=da2fa61af1b0032487e56408d0e62965f2b7d1e6;hpb=f4e4ec78c05a8eaceb2b8424d1ccf503e2b58ec2;p=vlc diff --git a/modules/gui/qt4/dialogs/errors.cpp b/modules/gui/qt4/dialogs/errors.cpp index da2fa61af1..d8c785eb73 100644 --- a/modules/gui/qt4/dialogs/errors.cpp +++ b/modules/gui/qt4/dialogs/errors.cpp @@ -1,15 +1,16 @@ /***************************************************************************** * errors.cpp : Errors **************************************************************************** - * Copyright (C) 2006 the VideoLAN team - * $Id: Errors.cpp 16024 2006-07-13 13:51:05Z xtophe $ + * Copyright ( C ) 2006 the VideoLAN team + * $Id$ * * Authors: Clément Stenac + * Jean-Baptiste Kempf * * 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. + * ( 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 @@ -20,40 +21,48 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include "dialogs/errors.hpp" -#include "qt4.hpp" #include #include #include #include +#include #include ErrorsDialog *ErrorsDialog::instance = NULL; -ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) +ErrorsDialog::ErrorsDialog( QWidget *parent, intf_thread_t *_p_intf ) + : QVLCDialog( parent, _p_intf ) { setWindowTitle( qtr( "Errors" ) ); - resize( 500 , 200 ); + resize( 500 , 300 ); setWindowModality( Qt::ApplicationModal ); QGridLayout *layout = new QGridLayout( this ); - 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 ); - stopShowing = new QCheckBox( qtr( "Don't show further errors") ); + stopShowing = new QCheckBox( qtr( "Hide future errors" ) ); 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( closeButton, close() ); + CONNECT( buttonBox, accepted(), this, close() ); BUTTONACT( clearButton, clear() ); BUTTONACT( stopShowing, dontShow() ); } @@ -73,7 +82,7 @@ void ErrorsDialog::add( bool error, QString title, QString text ) if( stopShowing->isChecked() ) return; messages->textCursor().movePosition( QTextCursor::End ); messages->setTextColor( error ? "red" : "yellow" ); - messages->insertPlainText( title + QString( ":\n" )); + messages->insertPlainText( title + QString( ":\n" ) ); messages->setTextColor( "black" ); messages->insertPlainText( text + QString( "\n" ) ); messages->ensureCursorVisible();