Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- 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@5756 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 2, 2006
1 parent 1227f22 commit 68eefe0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
15 changes: 10 additions & 5 deletions src/plugins/georeferencer/plugingui.cpp
Expand Up @@ -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);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/georeferencer/qgspointdialog.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 68eefe0

Please sign in to comment.