File tree Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Original file line number Diff line number Diff line change 23
23
#include " qgsmaptopixel.h"
24
24
#include " qgsproject.h"
25
25
#include " qgscursors.h"
26
+ #include " qgsmessagebar.h"
27
+ #include " qgisapp.h"
28
+
26
29
#include < QCursor>
27
- #include < QMessageBox>
28
30
#include < QSettings>
29
31
#include < QPixmap>
30
32
@@ -40,23 +42,9 @@ QgsMapToolVertexEdit::~QgsMapToolVertexEdit()
40
42
41
43
void QgsMapToolVertexEdit::displaySnapToleranceWarning ()
42
44
{
43
- QSettings myQSettings;
44
- QString myQSettingsLabel = " /UI/displaySnapWarning" ;
45
- bool displaySnapWarning = myQSettings.value ( myQSettingsLabel, true ).toBool ();
46
-
47
- if ( displaySnapWarning )
48
- {
49
- QgsMessageViewer* m = new QgsMessageViewer ( 0 );
50
- m->setWindowTitle ( tr ( " Snap tolerance" ) );
51
- m->setCheckBoxText ( tr ( " Don't show this message again" ) );
52
- m->setCheckBoxVisible ( true );
53
- m->setCheckBoxQSettingsLabel ( myQSettingsLabel );
54
- m->setMessageAsHtml ( " <p>" +
55
- tr ( " Could not snap segment." ) +
56
- " </p><p>" +
57
- tr ( " Have you set the tolerance in "
58
- " Settings > Project Properties > General?" ) +
59
- " </p>" );
60
- m->exec ();
61
- }
45
+ QgisApp::instance ()->messageBar ()->pushMessage (
46
+ tr ( " Snap tolerance" ),
47
+ tr ( " Could not snap segment. Have you set the tolerance in Settings > Snapping Options?" ),
48
+ QgsMessageBar::INFO,
49
+ QgisApp::instance ()->messageTimeout () );
62
50
}
You can’t perform that action at this time.
0 commit comments