Commit 37136365 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

qt: Fix "Hide future errors"

Fix #19726

(cherry picked from commit ff83c22b)
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent bc7a4dd1
......@@ -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( p_intf, "qt-show-errors", 0 );
config_PutInt( p_intf, "qt-error-dialogs", 0 );
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment