Skip to content

Commit 07a3d8a

Browse files
author
g_j_m
committed
- 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
1 parent 85079e1 commit 07a3d8a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/plugins/georeferencer/plugingui.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,16 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {
102102
// check if there already is a world file
103103
if (!worldfile.isEmpty()) {
104104
if (QFile::exists(worldfile)) {
105-
QMessageBox::critical(this, tr("Error"),
106-
tr("<p>The selected file already seems to have a ")+
107-
tr("world file! If you want to replace it with a ")+
108-
tr("new world file, remove the old one first.</p>"));
109-
return;
105+
int r = QMessageBox::question(this, tr("World file exists"),
106+
tr("<p>The selected file already seems to have a ")+
107+
tr("world file! Do you want to replace it with the ")+
108+
tr("new world file?</p>"),
109+
QMessageBox::Yes|QMessageBox::Default,
110+
QMessageBox::No|QMessageBox::Escape);
111+
if (r == QMessageBox::No)
112+
return;
113+
else
114+
QFile::remove(worldfile);
110115
}
111116
}
112117

src/plugins/georeferencer/qgspointdialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,17 +437,17 @@ void QgsPointDialog::deleteDataPoint(QgsPoint& coords)
437437
std::vector<QgsGeorefDataPoint*>::iterator it = mPoints.begin();
438438

439439
double maxDistSqr = (5 * mCanvas->mupp())*(5 * mCanvas->mupp());
440-
//#ifdef QGISDEBUG
440+
#ifdef QGISDEBUG
441441
std::cout << "deleteDataPoint! maxDistSqr: " << maxDistSqr << std::endl;
442-
//#endif
442+
#endif
443443
for ( ; it != mPoints.end(); it++)
444444
{
445445
QgsGeorefDataPoint* pt = *it;
446446
double x = pt->pixelCoords().x() - coords.x();
447447
double y = pt->pixelCoords().y() - coords.y();
448-
//#ifdef QGISDEBUG
448+
#ifdef QGISDEBUG
449449
std::cout << "deleteDataPoint! test: " << (x*x+y*y) << std::endl;
450-
//#endif
450+
#endif
451451
if ((x*x + y*y) < maxDistSqr)
452452
{
453453
mPoints.erase(it);

0 commit comments

Comments
 (0)