From ff83c22b6d70c7df3d4f661bde100b84f3a7ed4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Thu, 8 Mar 2018 16:53:01 +0100 Subject: [PATCH] qt: Fix "Hide future errors" Fix #19726 --- modules/gui/qt/dialogs/errors.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/gui/qt/dialogs/errors.cpp b/modules/gui/qt/dialogs/errors.cpp index ddbc065531..900aeb12cd 100644 --- a/modules/gui/qt/dialogs/errors.cpp +++ b/modules/gui/qt/dialogs/errors.cpp @@ -52,6 +52,7 @@ ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf ) messages->setReadOnly( true ); messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); stopShowing = new QCheckBox( qtr( "Hide future errors" ) ); + stopShowing->setChecked( var_InheritInteger( p_intf, "qt-error-dialogs" ) != 0 ); layout->addWidget( messages, 0, 0, 1, 3 ); layout->addWidget( stopShowing, 1, 0 ); @@ -74,14 +75,14 @@ void ErrorsDialog::addError( const QString& title, const QString& text ) void ErrorsDialog::add( bool error, const QString& title, const QString& text ) { - if( stopShowing->isChecked() ) return; messages->textCursor().movePosition( QTextCursor::End ); messages->setTextColor( error ? "red" : "yellow" ); messages->insertPlainText( title + QString( ":\n" ) ); messages->setTextColor( "black" ); messages->insertPlainText( text + QString( "\n" ) ); messages->ensureCursorVisible(); - show(); + if ( var_InheritInteger( p_intf, "qt-error-dialogs" ) != 0 ) + show(); } void ErrorsDialog::close() @@ -98,6 +99,6 @@ void ErrorsDialog::dontShow() { if( stopShowing->isChecked() ) { - config_PutInt( "qt-show-errors", 0 ); + config_PutInt( "qt-error-dialogs", 0 ); } } -- 2.11.4.GIT