Skip to content

Commit

Permalink
use 'close' on last tab of message log viewer to clear it
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 6, 2017
1 parent 906259b commit ab859c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/qgsmessagelogviewer.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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.