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
@@ -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>
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generated by IcoMoon.io -->

<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="32"
height="32"
viewBox="0 0 32 32"
id="svg3033"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="mMessageLog.svg">
<metadata
id="metadata3041">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3039" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="717"
id="namedview3037"
showgrid="false"
inkscape:zoom="5.9551649"
inkscape:cx="-27.493136"
inkscape:cy="19.658629"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="1"
inkscape:current-layer="svg3033" />
<path
d="M 16,2 C 7.163,2 -2.1655273e-8,7.82 -2.1655273e-8,15 -2.1655273e-8,22.18 7.163,28 16,28 c 0.849,0 1.682,-0.054 2.495,-0.158 3.437,3.437 7.539,4.053 11.505,4.144 V 31.145 C 27.858,30.096 26,28.184 26,26 26,25.695 26.024,25.396 26.068,25.103 29.687,22.72 32,19.079 32,15 32,7.82 24.837,2 16,2 z"
id="path3035"
inkscape:connector-curvature="0"
style="fill:#666666;stroke:none" />
<g
id="g3821"
transform="translate(0.32078538,0.15286392)">
<path
transform="matrix(1.2569963,0,0,1.2760417,14.371833,1.9363579)"
d="m -3.0278292,9.9146566 c 0,1.0820274 -0.8904466,1.9591834 -1.9888682,1.9591834 -1.0984216,0 -1.9888682,-0.877156 -1.9888682,-1.9591834 0,-1.0820272 0.8904466,-1.9591837 1.9888682,-1.9591837 1.0984216,0 1.9888682,0.8771565 1.9888682,1.9591837 z"
sodipodi:ry="1.9591837"
sodipodi:rx="1.9888682"
sodipodi:cy="9.9146566"
sodipodi:cx="-5.0166974"
id="path3756"
style="fill:#ffffff;fill-opacity:1;stroke:none"
sodipodi:type="arc" />
<path
transform="matrix(1.2569963,0,0,1.2760417,21.94558,1.9363579)"
d="m -3.0278292,9.9146566 c 0,1.0820274 -0.8904466,1.9591834 -1.9888682,1.9591834 -1.0984216,0 -1.9888682,-0.877156 -1.9888682,-1.9591834 0,-1.0820272 0.8904466,-1.9591837 1.9888682,-1.9591837 1.0984216,0 1.9888682,0.8771565 1.9888682,1.9591837 z"
sodipodi:ry="1.9591837"
sodipodi:rx="1.9888682"
sodipodi:cy="9.9146566"
sodipodi:cx="-5.0166974"
id="path3756-3"
style="fill:#ffffff;fill-opacity:1;stroke:none"
sodipodi:type="arc" />
<path
transform="matrix(1.2569963,0,0,1.2760417,29.519328,1.9363579)"
d="m -3.0278292,9.9146566 c 0,1.0820274 -0.8904466,1.9591834 -1.9888682,1.9591834 -1.0984216,0 -1.9888682,-0.877156 -1.9888682,-1.9591834 0,-1.0820272 0.8904466,-1.9591837 1.9888682,-1.9591837 1.0984216,0 1.9888682,0.8771565 1.9888682,1.9591837 z"
sodipodi:ry="1.9591837"
sodipodi:rx="1.9888682"
sodipodi:cy="9.9146566"
sodipodi:cx="-5.0166974"
id="path3756-7"
style="fill:#ffffff;fill-opacity:1;stroke:none"
sodipodi:type="arc" />
</g>
</svg>
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.
You can’t perform that action at this time.