Skip to content
Permalink
Browse files

Merge r6396 from 0.8 branch to head

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6397 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Jan 6, 2007
1 parent ff59567 commit 06624772341b5166d69e0db303b8daa814c2c877
Showing with 23 additions and 2 deletions.
  1. +16 −2 src/gui/qgsmeasure.cpp
  2. +7 −0 src/gui/qgsmeasure.h
@@ -78,8 +78,7 @@ void QgsMeasure::activate()
mRightMouseClicked = false;

// ensure that we have correct settings
mCalc->setDefaultEllipsoid();
mCalc->setProjectAsSourceSRS();
updateProjection();

QSettings settings;
int myRed = settings.value("/qgis/default_measure_color_red", 180).toInt();
@@ -104,6 +103,7 @@ void QgsMeasure::activate()
"system using the <tt>Settings:Project Properties</tt> menu."),
QMessageBox::Ok,
QMessageBox::NoButton);
mWrongProjectProjection = true;
}
}

@@ -131,6 +131,7 @@ QgsMeasure::~QgsMeasure()

void QgsMeasure::restart(void )
{
updateProjection();
mPoints.resize(0);
// Set one cell row where to update current distance
// If measuring area, the table doesn't get shown
@@ -150,6 +151,7 @@ void QgsMeasure::restart(void )
mRubberBand->setColor(QColor(myRed, myGreen, myBlue));

mRightMouseClicked = false;
mWrongProjectProjection = false;
}

void QgsMeasure::addPoint(QgsPoint &point)
@@ -158,6 +160,12 @@ void QgsMeasure::addPoint(QgsPoint &point)
std::cout << "QgsMeasure::addPoint" << point.x() << ", " << point.y() << std::endl;
#endif

if (mWrongProjectProjection)
{
updateProjection();
mWrongProjectProjection = false;
}

// don't add points with the same coordinates
if (mPoints.size() > 0 && point == mPoints[0])
return;
@@ -338,6 +346,12 @@ void QgsMeasure::updateUi()

}

void QgsMeasure::updateProjection()
{
mCalc->setDefaultEllipsoid();
mCalc->setProjectAsSourceSRS();
}

//////////////////////////

void QgsMeasure::canvasPressEvent(QMouseEvent * e)
@@ -105,6 +105,9 @@ public slots:
//! shows/hides table, shows correct units
void updateUi();

//! updates the projections we're using
void updateProjection();

QgsMapCanvas *mMapCanvas;

//! distance/area calculator
@@ -125,6 +128,10 @@ public slots:

//! indicates whether we've just done a right mouse click
bool mRightMouseClicked;

//! indicates whether we've recently warned the user about having the wrong
// project projection
bool mWrongProjectProjection;
};

#endif

0 comments on commit 0662477

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