|
14 | 14 | ***************************************************************************/
|
15 | 15 |
|
16 | 16 | #include "qgsmaptooledit.h"
|
| 17 | +#include "qgisapp.h" |
| 18 | +#include "qgsapplication.h" |
| 19 | +#include "qgsmessagebar.h" |
17 | 20 | #include "qgsproject.h"
|
18 | 21 | #include "qgsmapcanvas.h"
|
19 | 22 | #include "qgsrubberband.h"
|
@@ -119,4 +122,22 @@ int QgsMapToolEdit::addTopologicalPoints( const QList<QgsPoint>& geom )
|
119 | 122 | return 0;
|
120 | 123 | }
|
121 | 124 |
|
| 125 | +void QgsMapToolEdit::notifyNotVectorLayer() |
| 126 | +{ |
| 127 | + QWidget* msg = QgsMessageBar::createMessage( |
| 128 | + QObject::tr( "No active vector layer: " ), |
| 129 | + QObject::tr( "Choose a vector layer in the legend" ) , |
| 130 | + QgsApplication::getThemeIcon( "/mIconInfo.png" ), |
| 131 | + QgisApp::instance()->messageBar() ); |
| 132 | + QgisApp::instance()->messageBar()->pushWidget( msg, QgsMessageBar::WARNING, 5 ); |
| 133 | +} |
122 | 134 |
|
| 135 | +void QgsMapToolEdit::notifyNotEditableLayer() |
| 136 | +{ |
| 137 | + QWidget* msg = QgsMessageBar::createMessage( |
| 138 | + QObject::tr( "Layer not editable: " ), |
| 139 | + QObject::tr( "Use 'Toggle Editing' to make it editable" ) , |
| 140 | + QgsApplication::getThemeIcon( "/mIconInfo.png" ), |
| 141 | + QgisApp::instance()->messageBar() ); |
| 142 | + QgisApp::instance()->messageBar()->pushWidget( msg, QgsMessageBar::WARNING, 5 ); |
| 143 | +} |
0 commit comments