Skip to content
Permalink
Browse files
Merge pull request #2310 from slarosa/ml_icon
[log message] changing the message log icon in order to warning the user when a log message has been received
  • Loading branch information
NathanW2 committed Sep 13, 2015
2 parents e186331 + 0c58f9c commit be0185aa4cad319e7110cb7947ed9e5660912fc1
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 2 deletions.
@@ -394,6 +394,8 @@
<file>themes/default/mIconZip.png</file>
<file>themes/default/mIconZoom.svg</file>
<file>themes/default/mMapserverExport.png</file>
<file>themes/default/mMessageLog.svg</file>
<file>themes/default/mMessageLogRead.svg</file>
<file>themes/default/north_arrow.png</file>
<file>themes/default/pie-chart.png</file>
<file>themes/default/plugin.png</file>
@@ -504,7 +506,6 @@
<file>themes/default/cadtools/parallel.png</file>
<file>themes/default/cadtools/perpendicular.png</file>
<file>themes/default/mIconSuccess.png</file>
<file>themes/default/bubble.svg</file>
<file>themes/default/mIconClear.png</file>
<file>flags/zh.png</file>
<file>themes/default/mIconPaintEffects.svg</file>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
@@ -705,6 +705,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mLogDock->hide();
connect( mMessageButton, SIGNAL( toggled( bool ) ), mLogDock, SLOT( setVisible( bool ) ) );
connect( mLogDock, SIGNAL( visibilityChanged( bool ) ), mMessageButton, SLOT( setChecked( bool ) ) );
connect( QgsMessageLog::instance(), SIGNAL( messageReceived( bool ) ), this, SLOT( toggleLogMessageIcon( bool ) ) );
connect( mMessageButton, SIGNAL( toggled( bool ) ), this, SLOT( toggleLogMessageIcon( bool ) ) );
mVectorLayerTools = new QgsGuiVectorLayerTools();

// Init the editor widget types
@@ -2009,7 +2011,7 @@ void QgisApp::createStatusBar()

mMessageButton = new QToolButton( statusBar() );
mMessageButton->setAutoRaise( true );
mMessageButton->setIcon( QgsApplication::getThemeIcon( "bubble.svg" ) );
mMessageButton->setIcon( QgsApplication::getThemeIcon( "/mMessageLogRead.svg" ) );
mMessageButton->setToolTip( tr( "Messages" ) );
mMessageButton->setWhatsThis( tr( "Messages" ) );
mMessageButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
@@ -2539,6 +2541,18 @@ QgsMessageBar* QgisApp::messageBar()
return mInfoBar;
}

void QgisApp::toggleLogMessageIcon( bool hasLogMessage )
{
if ( hasLogMessage && !mLogDock->isVisible() )
{
mMessageButton->setIcon( QgsApplication::getThemeIcon( "/mMessageLog.svg" ) );
}
else
{
mMessageButton->setIcon( QgsApplication::getThemeIcon( "/mMessageLogRead.svg" ) );
}
}

void QgisApp::addUserInputWidget( QWidget *widget )
{
mUserInputDockWidget->addUserInputWidget( widget );
@@ -1041,6 +1041,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! map layers changed
void showMapCanvas();

//! change log message icon in statusbar
void toggleLogMessageIcon( bool hasLogMessage );

/** Called when some layer's editing mode was toggled on/off */
void layerEditStateChanged();

@@ -50,6 +50,10 @@ void QgsMessageLog::logMessage( QString message, QString tag, QgsMessageLog::Mes
void QgsMessageLog::emitMessage( QString message, QString tag, QgsMessageLog::MessageLevel level )
{
emit messageReceived( message, tag, level );
if ( level != QgsMessageLog::INFO )
{
emit messageReceived( true );
}
}

QgsMessageLogConsole::QgsMessageLogConsole()
@@ -48,6 +48,8 @@ class CORE_EXPORT QgsMessageLog : public QObject
signals:
void messageReceived( QString message, QString tag, QgsMessageLog::MessageLevel level );

void messageReceived( bool received );

private:
QgsMessageLog();

0 comments on commit be0185a

Please sign in to comment.