Skip to content

Commit

Permalink
Georeferencer: disable OK button in map coordinates dialog if no coor…
Browse files Browse the repository at this point in the history
…dinates are entered.

git-svn-id: http://svn.osgeo.org/qgis/trunk@7052 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 27, 2007
1 parent 45bd37c commit b62b845
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/georeferencer/mapcoordsdialog.cpp
Expand Up @@ -22,6 +22,10 @@ MapCoordsDialog::MapCoordsDialog(const QgsPoint& pixelCoords, QgsMapCanvas* qgis
mToolEmitPoint = new QgsMapToolEmitPoint(qgisCanvas);
mToolEmitPoint->setButton(btnPointFromCanvas);
connect(mToolEmitPoint, SIGNAL(gotPoint(QgsPoint&,Qt::MouseButton)), this, SLOT(setXY(QgsPoint&)));

connect(leXCoord, SIGNAL(textChanged(const QString&)), this, SLOT(updateOK()));
connect(leYCoord, SIGNAL(textChanged(const QString&)), this, SLOT(updateOK()));
updateOK();
}


Expand All @@ -30,6 +34,11 @@ MapCoordsDialog::~MapCoordsDialog() {
delete mToolEmitPoint;
}

void MapCoordsDialog::updateOK()
{
bool enable = (leXCoord->text().size() != 0 && leYCoord->text().size() != 0);
buttonOk->setEnabled(enable);
}

void MapCoordsDialog::on_buttonOk_clicked() {
QgsPoint mapCoords(leXCoord->text().toDouble(), leYCoord->text().toDouble());
Expand Down
1 change: 1 addition & 0 deletions src/plugins/georeferencer/mapcoordsdialog.h
Expand Up @@ -36,6 +36,7 @@ public slots:
void on_btnPointFromCanvas_clicked();

void setXY(QgsPoint &);
void updateOK();

private:

Expand Down

0 comments on commit b62b845

Please sign in to comment.