From 5a4dd15429c74861dfe341f5eb1b25f5bc20a1fc Mon Sep 17 00:00:00 2001 From: timlinux Date: Sun, 16 May 2004 21:30:40 +0000 Subject: [PATCH] Remeber state of =show= checkbox git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1417 c8812cc2-4d05-0410-92ff-de0c093fc19c --- plugins/north_arrow/plugin.cpp | 10 ++++++---- plugins/north_arrow/plugin.h | 2 +- plugins/north_arrow/plugingui.cpp | 9 ++++----- plugins/north_arrow/plugingui.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/plugins/north_arrow/plugin.cpp b/plugins/north_arrow/plugin.cpp index 7e76d8cc9ef..924d3538645 100644 --- a/plugins/north_arrow/plugin.cpp +++ b/plugins/north_arrow/plugin.cpp @@ -119,10 +119,11 @@ void Plugin::run() //overides function byt the same name created in .ui myPluginGui->setRotation(mRotationInt); myPluginGui->setPlacement(mPlacement); + myPluginGui->setEnabled(mEnable); //listen for when the layer has been made so we can draw it connect(myPluginGui, SIGNAL(rotationChanged(int)), this, SLOT(rotationChanged(int))); connect(myPluginGui, SIGNAL(changePlacement(QString)), this, SLOT(setPlacement(QString))); - connect(myPluginGui, SIGNAL(enableNorthArrow(bool)), this, SLOT(setEnable(bool))); + connect(myPluginGui, SIGNAL(enableNorthArrow(bool)), this, SLOT(setEnabled(bool))); myPluginGui->show(); } @@ -190,9 +191,10 @@ if (mEnable) { #ifdef QGISDEBUG std::cout << "Rendering n-arrow at bottom left: x = " << xShift - << " y = " << myHeight-(myQPixmap.height()-yShift) << std::endl; + << " y = " << myHeight-(myQPixmap.height()-yShift) + << "Rotation : " << mRotationInt << std::endl; #endif - myQPainter.drawPixmap(xShift,myHeight-(myQPixmap.height()-yShift),myQPixmap); + myQPainter.drawPixmap(xShift,myHeight-(myQPixmap.height()+yShift),myQPixmap); } else if (mPlacement==tr("Top Right")) { @@ -263,7 +265,7 @@ void Plugin::setPlacement(QString theQString) mPlacement = theQString; } -void Plugin::setEnable(bool theBool) +void Plugin::setEnabled(bool theBool) { mEnable = theBool; } diff --git a/plugins/north_arrow/plugin.h b/plugins/north_arrow/plugin.h index d18a0cf6bbc..7787bc8ad2c 100644 --- a/plugins/north_arrow/plugin.h +++ b/plugins/north_arrow/plugin.h @@ -64,7 +64,7 @@ class Plugin:public QObject, public QgisPlugin //! set north arrow placement void setPlacement(QString); //! enable or disable north arrow - void setEnable(bool); + void setEnabled(bool); private: diff --git a/plugins/north_arrow/plugingui.cpp b/plugins/north_arrow/plugingui.cpp index ef716ee6168..2f09ecda6cd 100644 --- a/plugins/north_arrow/plugingui.cpp +++ b/plugins/north_arrow/plugingui.cpp @@ -71,11 +71,10 @@ void PluginGui::setPlacement(QString thePlacementQString) cboPlacement->setCurrentText(tr(thePlacementQString)); } -//void PluginGui::setEnable(bool theBool) -//{ -// enableNorthArrow(theBool); -// cboxShow->isChecked(theBool); -//} +void PluginGui::setEnabled(bool theBool) +{ + cboxShow->setChecked(theBool); +} //overides function byt the same name created in .ui diff --git a/plugins/north_arrow/plugingui.h b/plugins/north_arrow/plugingui.h index aba9a963825..8066247c1e0 100644 --- a/plugins/north_arrow/plugingui.h +++ b/plugins/north_arrow/plugingui.h @@ -42,7 +42,7 @@ signals: public slots: void setRotation(int); void setPlacement(QString thePlacementQString); - //void setEnable(bool); + void setEnabled(bool); private slots: //overides function byt the same name created in .ui