@@ -87,16 +87,14 @@ void CoordinateCapture::initGui()
87
87
88
88
setSourceCrs (); // set up the source CRS
89
89
mTransform .setDestCRS ( mCrs ); // set the CRS in the transform
90
- mUserCrsDisplayPrecision = ( mCrs .mapUnits () == QGis::Degrees ) ? 8 : 3 ; // precision depends on CRS units
90
+ mUserCrsDisplayPrecision = ( mCrs .mapUnits () == QGis::Degrees ) ? 3 : 5 ; // precision depends on CRS units
91
91
92
92
// Create the action for tool
93
93
mQActionPointer = new QAction ( QIcon ( " :/coordinatecapture/coordinate_capture.png" ), tr ( " Coordinate Capture" ), this );
94
94
// Set the what's this text
95
95
mQActionPointer ->setWhatsThis ( tr ( " Click on the map to view coordinates and capture to clipboard." ) );
96
96
// Connect the action to the run
97
97
connect ( mQActionPointer , SIGNAL ( triggered () ), this , SLOT ( run () ) );
98
- // Add the icon to the toolbar
99
- mQGisIface ->addToolBarIcon ( mQActionPointer );
100
98
mQGisIface ->addPluginToMenu ( tr ( " &Coordinate Capture" ), mQActionPointer );
101
99
102
100
// create our map tool
@@ -138,12 +136,21 @@ void CoordinateCapture::initGui()
138
136
mpTrackMouseButton->setChecked ( false );
139
137
mpTrackMouseButton->setIcon ( QIcon ( " :/coordinatecapture/tracking.png" ) );
140
138
139
+ // Create the action for tool
140
+ mpCaptureButton = new QPushButton ( mypWidget );
141
+ mpCaptureButton->setText ( tr ( " Start capture" ) );
142
+ mpCaptureButton->setToolTip ( tr ( " Click to enable coordinate capture" ) );
143
+ mpCaptureButton->setIcon ( QIcon ( " :/coordinatecapture/coordinatecapture/coordinate_capture.png" ));
144
+ mpCaptureButton->setWhatsThis ( tr ( " Click on the map to view coordinates and capture to clipboard." ) );
145
+ connect ( mpCaptureButton, SIGNAL ( clicked () ), this , SLOT ( run () ) );
146
+
141
147
mypLayout->addWidget ( mypUserCrsToolButton, 0 , 0 );
142
148
mypLayout->addWidget ( mpUserCrsEdit, 0 , 1 );
143
149
mypLayout->addWidget ( mypCRSLabel, 1 , 0 );
144
150
mypLayout->addWidget ( mpCanvasEdit, 1 , 1 );
145
151
mypLayout->addWidget ( mpTrackMouseButton, 2 , 0 );
146
152
mypLayout->addWidget ( mypCopyButton, 2 , 1 );
153
+ mypLayout->addWidget ( mpCaptureButton, 3 , 1 );
147
154
148
155
149
156
// create the dock widget
@@ -171,14 +178,14 @@ void CoordinateCapture::setCRS()
171
178
{
172
179
mCrs .createFromSrsId ( mySelector.selectedCrsId () );
173
180
mTransform .setDestCRS ( mCrs );
174
- mUserCrsDisplayPrecision = ( mCrs .mapUnits () == QGis::Degrees ) ? 8 : 3 ; // precision depends on CRS units
181
+ mUserCrsDisplayPrecision = ( mCrs .mapUnits () == QGis::Degrees ) ? 3 : 5 ; // precision depends on CRS units
175
182
}
176
183
}
177
184
178
185
void CoordinateCapture::setSourceCrs ()
179
186
{
180
187
mTransform .setSourceCrs ( mQGisIface ->mapCanvas ()->mapRenderer ()->destinationSrs () );
181
- mCanvasDisplayPrecision = ( mQGisIface ->mapCanvas ()->mapRenderer ()->destinationSrs ().mapUnits () == QGis::Degrees ) ? 8 : 3 ; // for the map canvas coordinate display
188
+ mCanvasDisplayPrecision = ( mQGisIface ->mapCanvas ()->mapRenderer ()->destinationSrs ().mapUnits () == QGis::Degrees ) ? 3 : 5 ; // for the map canvas coordinate display
182
189
}
183
190
184
191
void CoordinateCapture::mouseClicked ( QgsPoint thePoint )
@@ -245,7 +252,7 @@ void CoordinateCapture::unload()
245
252
{
246
253
// remove the GUI
247
254
mQGisIface ->removePluginMenu ( " &Coordinate Capture" , mQActionPointer );
248
- mQGisIface ->removeToolBarIcon ( mQActionPointer );
255
+ // mQGisIface->removeToolBarIcon( mQActionPointer );
249
256
mpMapTool->deactivate ();
250
257
delete mpMapTool;
251
258
delete mpDockWidget;
0 commit comments