Skip to content

Commit 798d17b

Browse files
committedMay 29, 2013
fix #4103
1 parent cca0003 commit 798d17b

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed
 

‎src/app/qgsmaptoolvertexedit.cpp

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#include "qgsmaptopixel.h"
2424
#include "qgsproject.h"
2525
#include "qgscursors.h"
26+
#include "qgsmessagebar.h"
27+
#include "qgisapp.h"
28+
2629
#include <QCursor>
27-
#include <QMessageBox>
2830
#include <QSettings>
2931
#include <QPixmap>
3032

@@ -40,23 +42,9 @@ QgsMapToolVertexEdit::~QgsMapToolVertexEdit()
4042

4143
void QgsMapToolVertexEdit::displaySnapToleranceWarning()
4244
{
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() );
6250
}

0 commit comments

Comments
 (0)
Please sign in to comment.