Skip to content

Commit

Permalink
message log status bar icon:
Browse files Browse the repository at this point in the history
- 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 822f324
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/qgsmessagelogviewer.cpp
Expand Up @@ -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 );
}
Expand All @@ -82,6 +83,7 @@ void QgsMessageLogViewer::showEvent( QShowEvent * )
if ( mButton )
{
mButton->setChecked( true );
mButton->hide();
}
}

Expand All @@ -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() );
}

Expand Down

0 comments on commit 822f324

Please sign in to comment.