Skip to content
Permalink
Browse files
message log status bar icon:
- hide by default
- show when new messages arrive while log is closed
- hide when message log is opened
  • Loading branch information
jef-n committed Feb 16, 2012
1 parent 6b07241 commit 822f3247d6659e7316bb9309741d3bf0d78d841d
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/qgsmessagelogviewer.cpp
@@ -58,6 +58,7 @@ QgsMessageLogViewer::QgsMessageLogViewer( QStatusBar *statusBar, QWidget *parent
mButton->setIcon( icon( "/mIconWarn.png" ) );
mButton->setToolTip( tr( "No messages." ) );
mButton->setCheckable( true );
mButton->hide();
connect( mButton, SIGNAL( toggled( bool ) ), this, SLOT( buttonToggled( bool ) ) );
statusBar->addPermanentWidget( mButton, 0 );
}
@@ -82,6 +83,7 @@ void QgsMessageLogViewer::showEvent( QShowEvent * )
if ( mButton )
{
mButton->setChecked( true );
mButton->hide();
}
}

@@ -102,8 +104,9 @@ void QgsMessageLogViewer::logMessage( QString message, QString tag, int level )
{
mButton->setToolTip( tr( "%1 message(s) logged." ).arg( mCount++ ) );

if ( mButton && !isVisible() )
if ( !isVisible() )
{
mButton->show();
QToolTip::showText( mButton->mapToGlobal( QPoint( 0, 0 ) ), mButton->toolTip() );
}

0 comments on commit 822f324

Please sign in to comment.