Skip to content
Permalink
Browse files
- Provide the user with the option of deleting an existing world file
  (rather than just telling that they need to do so)
- Re-instate some more debugging #ifdef's


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5756 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 2, 2006
1 parent 85079e1 commit 07a3d8ab93b99741ca4de9ce3f55dd458580ca4b
Showing with 14 additions and 9 deletions.
  1. +10 −5 src/plugins/georeferencer/plugingui.cpp
  2. +4 −4 src/plugins/georeferencer/qgspointdialog.cpp
@@ -102,11 +102,16 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {
// check if there already is a world file
if (!worldfile.isEmpty()) {
if (QFile::exists(worldfile)) {
QMessageBox::critical(this, tr("Error"),
tr("<p>The selected file already seems to have a ")+
tr("world file! If you want to replace it with a ")+
tr("new world file, remove the old one first.</p>"));
return;
int r = QMessageBox::question(this, tr("World file exists"),
tr("<p>The selected file already seems to have a ")+
tr("world file! Do you want to replace it with the ")+
tr("new world file?</p>"),
QMessageBox::Yes|QMessageBox::Default,
QMessageBox::No|QMessageBox::Escape);
if (r == QMessageBox::No)
return;
else
QFile::remove(worldfile);
}
}

@@ -437,17 +437,17 @@ void QgsPointDialog::deleteDataPoint(QgsPoint& coords)
std::vector<QgsGeorefDataPoint*>::iterator it = mPoints.begin();

double maxDistSqr = (5 * mCanvas->mupp())*(5 * mCanvas->mupp());
//#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cout << "deleteDataPoint! maxDistSqr: " << maxDistSqr << std::endl;
//#endif
#endif
for ( ; it != mPoints.end(); it++)
{
QgsGeorefDataPoint* pt = *it;
double x = pt->pixelCoords().x() - coords.x();
double y = pt->pixelCoords().y() - coords.y();
//#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cout << "deleteDataPoint! test: " << (x*x+y*y) << std::endl;
//#endif
#endif
if ((x*x + y*y) < maxDistSqr)
{
mPoints.erase(it);

0 comments on commit 07a3d8a

Please sign in to comment.