mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
- 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
This commit is contained in:
parent
1227f22d40
commit
68eefe01ec
@ -102,11 +102,16 @@ void QgsGeorefPluginGui::on_pbnEnterWorldCoords_clicked() {
|
|||||||
// check if there already is a world file
|
// check if there already is a world file
|
||||||
if (!worldfile.isEmpty()) {
|
if (!worldfile.isEmpty()) {
|
||||||
if (QFile::exists(worldfile)) {
|
if (QFile::exists(worldfile)) {
|
||||||
QMessageBox::critical(this, tr("Error"),
|
int r = QMessageBox::question(this, tr("World file exists"),
|
||||||
tr("<p>The selected file already seems to have a ")+
|
tr("<p>The selected file already seems to have a ")+
|
||||||
tr("world file! If you want to replace it with a ")+
|
tr("world file! Do you want to replace it with the ")+
|
||||||
tr("new world file, remove the old one first.</p>"));
|
tr("new world file?</p>"),
|
||||||
|
QMessageBox::Yes|QMessageBox::Default,
|
||||||
|
QMessageBox::No|QMessageBox::Escape);
|
||||||
|
if (r == QMessageBox::No)
|
||||||
return;
|
return;
|
||||||
|
else
|
||||||
|
QFile::remove(worldfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,17 +437,17 @@ void QgsPointDialog::deleteDataPoint(QgsPoint& coords)
|
|||||||
std::vector<QgsGeorefDataPoint*>::iterator it = mPoints.begin();
|
std::vector<QgsGeorefDataPoint*>::iterator it = mPoints.begin();
|
||||||
|
|
||||||
double maxDistSqr = (5 * mCanvas->mupp())*(5 * mCanvas->mupp());
|
double maxDistSqr = (5 * mCanvas->mupp())*(5 * mCanvas->mupp());
|
||||||
//#ifdef QGISDEBUG
|
#ifdef QGISDEBUG
|
||||||
std::cout << "deleteDataPoint! maxDistSqr: " << maxDistSqr << std::endl;
|
std::cout << "deleteDataPoint! maxDistSqr: " << maxDistSqr << std::endl;
|
||||||
//#endif
|
#endif
|
||||||
for ( ; it != mPoints.end(); it++)
|
for ( ; it != mPoints.end(); it++)
|
||||||
{
|
{
|
||||||
QgsGeorefDataPoint* pt = *it;
|
QgsGeorefDataPoint* pt = *it;
|
||||||
double x = pt->pixelCoords().x() - coords.x();
|
double x = pt->pixelCoords().x() - coords.x();
|
||||||
double y = pt->pixelCoords().y() - coords.y();
|
double y = pt->pixelCoords().y() - coords.y();
|
||||||
//#ifdef QGISDEBUG
|
#ifdef QGISDEBUG
|
||||||
std::cout << "deleteDataPoint! test: " << (x*x+y*y) << std::endl;
|
std::cout << "deleteDataPoint! test: " << (x*x+y*y) << std::endl;
|
||||||
//#endif
|
#endif
|
||||||
if ((x*x + y*y) < maxDistSqr)
|
if ((x*x + y*y) < maxDistSqr)
|
||||||
{
|
{
|
||||||
mPoints.erase(it);
|
mPoints.erase(it);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user