@@ -1068,15 +1068,15 @@ void QgisApp::createToolBars()
1068
1068
mDigitizeToolBar ->addAction (mActionCapturePolygon );
1069
1069
mDigitizeToolBar ->addAction (mActionAddRing );
1070
1070
mDigitizeToolBar ->addAction (mActionAddIsland );
1071
- mDigitizeToolBar ->addAction (mActionMoveFeature );
1072
- mDigitizeToolBar ->addAction (mActionSplitFeatures );
1073
1071
mDigitizeToolBar ->addAction (mActionDeleteSelected );
1074
- mDigitizeToolBar ->addAction (mActionAddVertex );
1075
- mDigitizeToolBar ->addAction (mActionDeleteVertex );
1076
- mDigitizeToolBar ->addAction (mActionMoveVertex );
1077
1072
mDigitizeToolBar ->addAction (mActionEditCut );
1078
1073
mDigitizeToolBar ->addAction (mActionEditCopy );
1079
1074
mDigitizeToolBar ->addAction (mActionEditPaste );
1075
+ mDigitizeToolBar ->addAction (mActionSplitFeatures );
1076
+ mDigitizeToolBar ->addAction (mActionMoveFeature );
1077
+ mDigitizeToolBar ->addAction (mActionMoveVertex );
1078
+ mDigitizeToolBar ->addAction (mActionAddVertex );
1079
+ mDigitizeToolBar ->addAction (mActionDeleteVertex );
1080
1080
//
1081
1081
// Map Navigation Toolbar
1082
1082
mMapNavToolBar = addToolBar (tr (" Map Navigation" ));
@@ -1126,29 +1126,23 @@ void QgisApp::createStatusBar()
1126
1126
// Add a panel to the status bar for the scale, coords and progress
1127
1127
// And also rendering suppression checkbox
1128
1128
//
1129
-
1130
-
1131
-
1132
1129
mProgressBar = new QProgressBar (statusBar ());
1133
1130
mProgressBar ->setMaximumWidth (100 );
1134
1131
mProgressBar ->hide ();
1135
- mProgressBar ->setWhatsThis (tr (" Progress bar that displays the status of rendering layers and other time-intensive operations" ));
1132
+ mProgressBar ->setWhatsThis (tr (" Progress bar that displays the status"
1133
+ " of rendering layers and other time-intensive operations" ));
1136
1134
statusBar ()->addWidget (mProgressBar , 1 ,true );
1137
1135
// Bumped the font up one point size since 8 was too
1138
1136
// small on some platforms. A point size of 9 still provides
1139
1137
// plenty of display space on 1024x768 resolutions
1140
1138
QFont myFont ( " Arial" , 9 );
1141
1139
1142
- mStopRenderButton = new QPushButton (tr (" Stop rendering" ), statusBar ());
1143
- #ifdef Q_WS_MAC // MH: disable the button on Mac for now to avoid problems with resizing
1144
- mStopRenderButton ->setEnabled (false );
1145
- #endif // Q_WS_MAC
1146
- statusBar ()->addWidget (mStopRenderButton , 0 , true );
1147
1140
1148
1141
statusBar ()->setFont (myFont);
1149
1142
mScaleLabel = new QLabel (QString (),statusBar ());
1150
1143
mScaleLabel ->setFont (myFont);
1151
1144
mScaleLabel ->setMinimumWidth (10 );
1145
+ mScaleLabel ->setMaximumHeight (20 );
1152
1146
mScaleLabel ->setMargin (3 );
1153
1147
mScaleLabel ->setAlignment (Qt::AlignCenter);
1154
1148
mScaleLabel ->setFrameStyle (QFrame::NoFrame);
@@ -1160,6 +1154,7 @@ void QgisApp::createStatusBar()
1160
1154
mScaleEdit ->setFont (myFont);
1161
1155
mScaleEdit ->setMinimumWidth (10 );
1162
1156
mScaleEdit ->setMaximumWidth (100 );
1157
+ mScaleEdit ->setMaximumHeight (20 );
1163
1158
mScaleEdit ->setMargin (0 );
1164
1159
mScaleEdit ->setAlignment (Qt::AlignLeft);
1165
1160
QRegExp validator (" \\ d+\\ .?\\ d*:\\ d+\\ .?\\ d*" );
@@ -1173,17 +1168,31 @@ void QgisApp::createStatusBar()
1173
1168
// coords status bar widget
1174
1169
mCoordsLabel = new QLabel (QString (), statusBar ());
1175
1170
mCoordsLabel ->setMinimumWidth (10 );
1171
+ mCoordsLabel ->setMaximumHeight (20 );
1176
1172
mCoordsLabel ->setFont (myFont);
1177
1173
mCoordsLabel ->setMargin (3 );
1178
1174
mCoordsLabel ->setAlignment (Qt::AlignCenter);
1179
- mCoordsLabel ->setWhatsThis (tr (" Shows the map coordinates at the current cursor position. The display is continuously updated as the mouse is moved." ));
1175
+ mCoordsLabel ->setWhatsThis (tr (" Shows the map coordinates at the"
1176
+ " current cursor position. The display is continuously updated "
1177
+ " as the mouse is moved." ));
1180
1178
mCoordsLabel ->setToolTip (tr (" Map coordinates at mouse cursor position" ));
1181
1179
statusBar ()->addWidget (mCoordsLabel , 0 , true );
1180
+ // stop rendering status bar widget
1181
+ mStopRenderButton = new QToolButton ( statusBar () );
1182
+ mStopRenderButton ->setMaximumWidth (20 );
1183
+ mStopRenderButton ->setMaximumHeight (20 );
1184
+ // #ifdef Q_WS_MAC //MH: disable the button on Mac for now to avoid problems with resizing
1185
+ mStopRenderButton ->setEnabled (false );
1186
+ // #endif //Q_WS_MAC
1187
+ statusBar ()->addWidget (mStopRenderButton , 0 , true );
1182
1188
// render suppression status bar widget
1183
1189
mRenderSuppressionCBox = new QCheckBox (tr (" Render" ),statusBar ());
1184
1190
mRenderSuppressionCBox ->setChecked (true );
1185
1191
mRenderSuppressionCBox ->setFont (myFont);
1186
- mRenderSuppressionCBox ->setWhatsThis (tr (" When checked, the map layers are rendered in response to map navigation commands and other events. When not checked, no rendering is done. This allows you to add a large number of layers and symbolize them before rendering." ));
1192
+ mRenderSuppressionCBox ->setWhatsThis (tr (" When checked, the map layers "
1193
+ " are rendered in response to map navigation commands and other "
1194
+ " events. When not checked, no rendering is done. This allows you "
1195
+ " to add a large number of layers and symbolize them before rendering." ));
1187
1196
mRenderSuppressionCBox ->setToolTip (tr (" Toggle map rendering" ) );
1188
1197
statusBar ()->addWidget (mRenderSuppressionCBox ,0 ,true );
1189
1198
// On the fly projection status bar icon
@@ -1203,11 +1212,13 @@ void QgisApp::createStatusBar()
1203
1212
{
1204
1213
QMessageBox::critical (this , tr (" Resource Location Error" ),
1205
1214
tr (" Error reading icon resources from: \n %1\n Quitting..." ).arg (myIconPath));
1206
-
1207
1215
exit (0 );
1208
1216
}
1209
- mOnTheFlyProjectionStatusButton ->setWhatsThis (tr (" This icon shows whether on the fly projection is enabled or not. Click the icon to bring up the project properties dialog to alter this behaviour." ));
1210
- mOnTheFlyProjectionStatusButton ->setToolTip (tr (" Projection status - Click to open projection dialog" ));
1217
+ mOnTheFlyProjectionStatusButton ->setWhatsThis (tr (" This icon shows whether "
1218
+ " on the fly projection is enabled or not. Click the icon to bring up "
1219
+ " the project properties dialog to alter this behaviour." ));
1220
+ mOnTheFlyProjectionStatusButton ->setToolTip (tr (" Projection status - Click "
1221
+ " to open projection dialog" ));
1211
1222
connect (mOnTheFlyProjectionStatusButton , SIGNAL (clicked ()),
1212
1223
this , SLOT (projectPropertiesProjections ()));// bring up the project props dialog when clicked
1213
1224
statusBar ()->addWidget (mOnTheFlyProjectionStatusButton ,0 ,true );
@@ -1305,7 +1316,6 @@ void QgisApp::setupConnections()
1305
1316
mMapLegend , SLOT (removeAll ()));
1306
1317
connect (QgsMapLayerRegistry::instance (), SIGNAL (layerWasAdded (QgsMapLayer*)),
1307
1318
mMapLegend , SLOT (addLayer (QgsMapLayer *)));
1308
-
1309
1319
connect (mMapLegend , SIGNAL (currentLayerChanged (QgsMapLayer*)),
1310
1320
this , SLOT (activateDeactivateLayerRelatedActions (QgsMapLayer*)));
1311
1321
@@ -1321,6 +1331,9 @@ void QgisApp::setupConnections()
1321
1331
connect (mMapCanvas , SIGNAL (scaleChanged (double )), this , SLOT (updateMouseCoordinatePrecision ()));
1322
1332
1323
1333
connect (mRenderSuppressionCBox , SIGNAL (toggled (bool )), mMapCanvas , SLOT (setRenderFlag (bool )));
1334
+ //
1335
+ // Do we really need this ??? - its already connected to the esc key...TS
1336
+ //
1324
1337
connect (mStopRenderButton , SIGNAL (clicked ()), this , SLOT (stopRendering ()));
1325
1338
1326
1339
// Connect warning dialog from project reading
@@ -1332,7 +1345,8 @@ void QgisApp::createCanvas()
1332
1345
{
1333
1346
// "theMapCanvas" used to find this canonical instance later
1334
1347
mMapCanvas = new QgsMapCanvas (this , " theMapCanvas" );
1335
- mMapCanvas ->setWhatsThis (tr (" Map canvas. This is where raster and vector layers are displayed when added to the map" ));
1348
+ mMapCanvas ->setWhatsThis (tr (" Map canvas. This is where raster and vector"
1349
+ " layers are displayed when added to the map" ));
1336
1350
1337
1351
// mMapCanvas->setMinimumWidth(10);
1338
1352
// QVBoxLayout *myCanvasLayout = new QVBoxLayout;
@@ -1631,6 +1645,7 @@ void QgisApp::restoreSessionPlugins(QString thePluginDirString)
1631
1645
{
1632
1646
QSettings mySettings;
1633
1647
1648
+ QgsApplication::showSettings ();
1634
1649
QgsDebugMsg (" \n\n *************************************************" );
1635
1650
QgsDebugMsg (" Restoring plugins from last session " + thePluginDirString);
1636
1651
@@ -3304,17 +3319,17 @@ void QgisApp::toggleFullScreen()
3304
3319
void QgisApp::stopRendering ()
3305
3320
{
3306
3321
if (mMapCanvas )
3322
+ {
3323
+ QgsMapRender* mypMapRender = mMapCanvas ->mapRender ();
3324
+ if (mypMapRender)
3307
3325
{
3308
- QgsMapRender* mapRender = mMapCanvas ->mapRender ();
3309
- if (mapRender)
3310
- {
3311
- QgsRenderContext* renderContext = mapRender->renderContext ();
3312
- if (renderContext)
3313
- {
3314
- renderContext->setRenderingStopped (true );
3315
- }
3316
- }
3326
+ QgsRenderContext* mypRenderContext = mypMapRender->renderContext ();
3327
+ if (mypRenderContext)
3328
+ {
3329
+ mypRenderContext->setRenderingStopped (true );
3330
+ }
3317
3331
}
3332
+ }
3318
3333
}
3319
3334
3320
3335
// reimplements method from base (gui) class
@@ -5340,27 +5355,16 @@ void QgisApp::keyPressEvent ( QKeyEvent * e )
5340
5355
// commented out for now. [gsherman]
5341
5356
// std::cout << e->text().toLocal8Bit().data() << " (keypress recevied)" << std::endl;
5342
5357
emit keyPressed (e);
5343
-
5358
+
5344
5359
// cancel rendering progress with esc key
5345
5360
if (e->key () == Qt::Key_Escape)
5346
- {
5347
- if (mMapCanvas )
5348
- {
5349
- QgsMapRender* theMapRender = mMapCanvas ->mapRender ();
5350
- if (theMapRender)
5351
- {
5352
- QgsRenderContext* theRenderContext = theMapRender->renderContext ();
5353
- if (theRenderContext)
5354
- {
5355
- theRenderContext->setRenderingStopped (true );
5356
- }
5357
- }
5358
- }
5359
- }
5361
+ {
5362
+ stopRendering ();
5363
+ }
5360
5364
else
5361
- {
5362
- e->ignore ();
5363
- }
5365
+ {
5366
+ e->ignore ();
5367
+ }
5364
5368
}
5365
5369
5366
5370
// Debug hook - used to output diagnostic messages when evoked (usually from the menu)
0 commit comments