Skip to content
Permalink
Browse files

use 'close' on last tab of message log viewer to clear it

  • Loading branch information
jef-n committed Dec 6, 2017
1 parent 906259b commit ab859c9bdf8a529df9805ff54e7250921a74d877
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/gui/qgsmessagelogviewer.cpp
@@ -71,7 +71,6 @@ void QgsMessageLogViewer::logMessage( const QString &message, const QString &tag
w->setReadOnly( true );
tabWidget->addTab( w, cleanedTag );
tabWidget->setCurrentIndex( tabWidget->count() - 1 );
tabWidget->setTabsClosable( true );
}

QString levelString;
@@ -101,6 +100,8 @@ void QgsMessageLogViewer::logMessage( const QString &message, const QString &tag

void QgsMessageLogViewer::closeTab( int index )
{
tabWidget->removeTab( index );
tabWidget->setTabsClosable( tabWidget->count() > 1 );
if ( tabWidget->count() == 1 )
qobject_cast<QPlainTextEdit *>( tabWidget->widget( 0 ) )->clear();
else
tabWidget->removeTab( index );
}

0 comments on commit ab859c9

Please sign in to comment.
You can’t perform that action at this time.