Skip to content
Permalink
Browse files

Merge pull request #1736 from mbernasocchi/QgsMessageBar-SUCCESS

added QgsMessageBar::SUCCESS
  • Loading branch information
3nids committed Dec 15, 2014
2 parents fc00baf + dbc801f commit 86527b6beb3dcee931c7a1a3202bd08fb9f72183
@@ -476,6 +476,7 @@
<file>themes/default/cadtools/lock.png</file>
<file>themes/default/cadtools/parallel.png</file>
<file>themes/default/cadtools/perpendicular.png</file>
<file>themes/default/mIconSuccess.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Binary file not shown.
@@ -10,6 +10,7 @@ class QgsMessageBar: QFrame
INFO,
WARNING,
CRITICAL,
SUCCESS
};

QgsMessageBar( QWidget *parent = 0 );
@@ -24,7 +25,7 @@ class QgsMessageBar: QFrame
/*! display a widget as a message on the bar after hiding the currently visible one
* and putting it in a stack.
* @param widget message widget to display
* @param level is QgsMessageBar::INFO, WARNING or CRITICAL
* @param level is QgsMessageBar::INFO, WARNING, CRITICAL or SUCCESS
* @param duration timeout duration of message in seconds, 0 value indicates no timeout
*/
QgsMessageBarItem *pushWidget( QWidget *widget /Transfer/, MessageLevel level = INFO, int duration = 0 );
@@ -48,7 +48,8 @@ class GUI_EXPORT QgsMessageBar: public QFrame
{
INFO = 0,
WARNING = 1,
CRITICAL = 2
CRITICAL = 2,
SUCCESS = 3
};

QgsMessageBar( QWidget *parent = 0 );
@@ -63,7 +64,7 @@ class GUI_EXPORT QgsMessageBar: public QFrame
/*! display a widget as a message on the bar after hiding the currently visible one
* and putting it in a stack.
* @param widget message widget to display
* @param level is QgsMessageBar::INFO, WARNING or CRITICAL
* @param level is QgsMessageBar::INFO, WARNING, CRITICAL or SUCCESS
* @param duration timeout duration of message in seconds, 0 value indicates no timeout
*/
QgsMessageBarItem *pushWidget( QWidget *widget, MessageLevel level = INFO, int duration = 0 );
@@ -111,6 +111,9 @@ void QgsMessageBarItem::writeContent()
case QgsMessageBar::WARNING:
msgIcon = QString( "/mIconWarn.png" );
break;
case QgsMessageBar::SUCCESS:
msgIcon = QString( "/mIconSuccess.png" );
break;
default:
break;
}
@@ -167,7 +170,12 @@ void QgsMessageBarItem::writeContent()
}

// STYLESHEET
if ( mLevel >= QgsMessageBar::CRITICAL )
if ( mLevel == QgsMessageBar::SUCCESS )
{
mStyleSheet = "QgsMessageBar { background-color: #dff0d8; border: 1px solid #8e998a; } "
"QLabel,QTextEdit { color: black; } ";
}
else if ( mLevel == QgsMessageBar::CRITICAL )
{
mStyleSheet = "QgsMessageBar { background-color: #d65253; border: 1px solid #9b3d3d; } "
"QLabel,QTextEdit { color: white; } ";
@@ -177,7 +185,7 @@ void QgsMessageBarItem::writeContent()
mStyleSheet = "QgsMessageBar { background-color: #ffc800; border: 1px solid #e0aa00; } "
"QLabel,QTextEdit { color: black; } ";
}
else if ( mLevel <= QgsMessageBar::INFO )
else if ( mLevel == QgsMessageBar::INFO )
{
mStyleSheet = "QgsMessageBar { background-color: #e7f5fe; border: 1px solid #b9cfe4; } "
"QLabel,QTextEdit { color: #2554a1; } ";

0 comments on commit 86527b6

Please sign in to comment.
You can’t perform that action at this time.