33
33
#include < QDesktopWidget>
34
34
#include < QDialog>
35
35
#include < QDir>
36
+ #include < QDockWidget>
36
37
#include < QEvent>
37
38
#include < QFile>
38
39
#include < QFileInfo>
@@ -214,7 +215,7 @@ static void buildSupportedVectorFileFilter_(QString & fileFilters);
214
215
static void setTitleBarText_ ( QWidget & qgisApp )
215
216
{
216
217
QString caption = QgisApp::tr (" Quantum GIS - " );
217
- caption += QString (" %1 ('%2') " ).arg (QGis::qgisVersion). arg (QGis::qgisReleaseName ) + " " ;
218
+ caption += QString (" %1 " ).arg (QGis::qgisVersion) + " " ;
218
219
219
220
if ( QgsProject::instance ()->title ().isEmpty () )
220
221
{
@@ -305,7 +306,8 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
305
306
: QMainWindow(parent,fl),
306
307
mSplash(splash)
307
308
{
308
- setupUi (this );
309
+ // setupUi(this);
310
+ resize (640 , 480 );
309
311
310
312
mSplash ->showMessage (tr (" Checking database" ), Qt::AlignHCenter | Qt::AlignBottom);
311
313
qApp->processEvents ();
@@ -327,8 +329,8 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
327
329
setTheme (mThemeName );
328
330
updateRecentProjectPaths ();
329
331
createCanvas ();
330
- createOverview ();
331
332
createLegend ();
333
+ createOverview ();
332
334
createMapTips ();
333
335
334
336
mComposer = new QgsComposer (this ); // Map composer
@@ -378,7 +380,7 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
378
380
379
381
// now build raster file filter
380
382
QgsRasterLayer::buildSupportedRasterFileFilter ( mRasterFileFilter );
381
-
383
+ /*
382
384
// Set the background colour for toolbox and overview as they default to
383
385
// white instead of the window color
384
386
QPalette myPalette = toolBox->palette();
@@ -389,7 +391,7 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
389
391
myPalette.setColor(QPalette::Button, myPalette.window().color());
390
392
mMapLegend->setPalette(myPalette);
391
393
//and for overview control this is done in createOverView method
392
-
394
+ */
393
395
// Do this last in the ctor to ensure that all members are instantiated properly
394
396
setupConnections ();
395
397
//
@@ -493,12 +495,12 @@ void QgisApp::readSettings()
493
495
494
496
// Add the recently accessed project file paths to the File menu
495
497
mRecentProjectPaths = settings.readListEntry (" /UI/recentProjectsList" );
496
-
498
+ /*
497
499
// Set the behaviour when the map splitters are resized
498
500
bool splitterRedraw = settings.value("/qgis/splitterRedraw", true).toBool();
499
501
canvasLegendSplit->setOpaqueResize(splitterRedraw);
500
502
legendOverviewSplit->setOpaqueResize(splitterRedraw);
501
- }
503
+ */ }
502
504
503
505
504
506
// ////////////////////////////////////////////////////////////////////
@@ -1314,10 +1316,11 @@ void QgisApp::createCanvas()
1314
1316
mMapCanvas = new QgsMapCanvas (this , " theMapCanvas" );
1315
1317
mMapCanvas ->setWhatsThis (tr (" Map canvas. This is where raster and vector layers are displayed when added to the map" ));
1316
1318
1317
- mMapCanvas ->setMinimumWidth (10 );
1318
- QVBoxLayout *myCanvasLayout = new QVBoxLayout;
1319
- myCanvasLayout->addWidget (mMapCanvas );
1320
- tabWidget->widget (0 )->setLayout (myCanvasLayout);
1319
+ // mMapCanvas->setMinimumWidth(10);
1320
+ // QVBoxLayout *myCanvasLayout = new QVBoxLayout;
1321
+ // myCanvasLayout->addWidget(mMapCanvas);
1322
+ // tabWidget->widget(0)->setLayout(myCanvasLayout);
1323
+ setCentralWidget (mMapCanvas );
1321
1324
// set the focus to the map canvas
1322
1325
mMapCanvas ->setFocus ();
1323
1326
@@ -1367,10 +1370,16 @@ void QgisApp::createOverview()
1367
1370
QBitmap overviewPanBmpMask = QBitmap::fromData (QSize (16 , 16 ), pan_mask_bits);
1368
1371
mOverviewMapCursor = new QCursor (overviewPanBmp, overviewPanBmpMask, 5 , 5 );
1369
1372
overviewCanvas->setCursor (*mOverviewMapCursor );
1370
- QVBoxLayout *myOverviewLayout = new QVBoxLayout;
1371
- myOverviewLayout->addWidget (overviewCanvas);
1372
- overviewFrame->setLayout (myOverviewLayout);
1373
-
1373
+ // QVBoxLayout *myOverviewLayout = new QVBoxLayout;
1374
+ // myOverviewLayout->addWidget(overviewCanvas);
1375
+ // overviewFrame->setLayout(myOverviewLayout);
1376
+ mOverviewDock = new QDockWidget (tr (" Overview" ), this );
1377
+ mOverviewDock ->setObjectName (" Overview" );
1378
+ mOverviewDock ->setAllowedAreas (Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
1379
+ mOverviewDock ->setWidget (overviewCanvas);
1380
+ addDockWidget (Qt::LeftDockWidgetArea, mOverviewDock );
1381
+ mViewMenu ->addAction (mOverviewDock ->toggleViewAction ());
1382
+
1374
1383
mMapCanvas ->setOverview (overviewCanvas);
1375
1384
1376
1385
// moved here to set anti aliasing to both map canvas and overview
@@ -1395,9 +1404,16 @@ void QgisApp::createLegend()
1395
1404
mMapLegend ->setToggleEditingAction (mActionToggleEditing );
1396
1405
1397
1406
mMapLegend ->setWhatsThis (tr (" Map legend that displays all the layers currently on the map canvas. Click on the check box to turn a layer on or off. Double click on a layer in the legend to customize its appearance and set other properties." ));
1398
- QVBoxLayout *myLegendLayout = new QVBoxLayout;
1399
- myLegendLayout->addWidget (mMapLegend );
1400
- toolBox->widget (0 )->setLayout (myLegendLayout);
1407
+ // QVBoxLayout *myLegendLayout = new QVBoxLayout;
1408
+ // myLegendLayout->addWidget(mMapLegend);
1409
+ // toolBox->widget(0)->setLayout(myLegendLayout);
1410
+ mLegendDock = new QDockWidget (tr (" Legend" ), this );
1411
+ mLegendDock ->setObjectName (" Legend" );
1412
+ mLegendDock ->setAllowedAreas (Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
1413
+ // mLegendDock->setFeatures(mLegendDock->features() & ~QDockWidget::DockWidgetClosable);
1414
+ mLegendDock ->setWidget (mMapLegend );
1415
+ addDockWidget (Qt::LeftDockWidgetArea, mLegendDock );
1416
+ mViewMenu ->addAction (mLegendDock ->toggleViewAction ());
1401
1417
return ;
1402
1418
}
1403
1419
@@ -1503,8 +1519,8 @@ void QgisApp::saveWindowState()
1503
1519
1504
1520
// store window geometry
1505
1521
settings.setValue (" /UI/geometry" , saveGeometry ());
1506
- settings.setValue (" /UI/canvasSplitterState" , canvasLegendSplit->saveState ());
1507
- settings.setValue (" /UI/legendSplitterState" , legendOverviewSplit->saveState ());
1522
+ // settings.setValue("/UI/canvasSplitterState", canvasLegendSplit->saveState());
1523
+ // settings.setValue("/UI/legendSplitterState", legendOverviewSplit->saveState());
1508
1524
}
1509
1525
1510
1526
void QgisApp::restoreWindowState ()
@@ -1516,8 +1532,8 @@ void QgisApp::restoreWindowState()
1516
1532
1517
1533
// restore window geometry
1518
1534
restoreGeometry (settings.value (" /UI/geometry" ).toByteArray ());
1519
- canvasLegendSplit->restoreState (settings.value (" /UI/canvasSplitterState" ).toByteArray ());
1520
- legendOverviewSplit->restoreState (settings.value (" /UI/legendSplitterState" ).toByteArray ());
1535
+ // canvasLegendSplit->restoreState(settings.value("/UI/canvasSplitterState").toByteArray());
1536
+ // legendOverviewSplit->restoreState(settings.value("/UI/legendSplitterState").toByteArray());
1521
1537
}
1522
1538
// /////////// END OF GUI SETUP ROUTINES ///////////////
1523
1539
@@ -1527,33 +1543,27 @@ void QgisApp::about()
1527
1543
if (!abt) {
1528
1544
QApplication::setOverrideCursor (Qt::WaitCursor);
1529
1545
abt = new QgsAbout ();
1530
- QString versionString = tr (" Version " );
1531
- versionString += QGis::qgisVersion;
1532
- versionString += " (" ;
1533
- versionString += QGis::qgisSvnVersion;
1534
- versionString += " )" ;
1546
+ QString versionString = tr (" You are using QGIS version %1 built against code revision %2." )
1547
+ .arg (QGis::qgisVersion)
1548
+ .arg (QGis::qgisSvnVersion);
1535
1549
#ifdef HAVE_POSTGRESQL
1536
1550
1537
- versionString += tr (" with PostgreSQL support" );
1551
+ versionString += tr (" This copy of QGIS has been built with PostgreSQL support. " );
1538
1552
#else
1539
1553
1540
- versionString += tr (" (no PostgreSQL support) " );
1554
+ versionString += tr (" This copy of QGIS has been built without PostgreSQL support. " );
1541
1555
#endif
1542
- versionString += tr (" \n Compiled against Qt " ) + QT_VERSION_STR
1543
- + tr (" , running against Qt " ) + qVersion ();
1556
+ versionString += tr (" \n This binary was compiled against Qt %1,"
1557
+ " and is currently running against Qt %2" )
1558
+ .arg (QT_VERSION_STR)
1559
+ .arg (qVersion ());
1544
1560
1545
1561
#ifdef WIN32
1546
1562
// special version stuff for windows (if required)
1547
1563
// versionString += "\nThis is a Windows preview release - not for production use";
1548
1564
#endif
1549
1565
1550
1566
abt->setVersion (versionString);
1551
- QString urls = " <p align=\" center\" >" +
1552
- tr (" Quantum GIS is licensed under the GNU General Public License" ) +
1553
- " </p><p align=\" center\" >" +
1554
- tr (" http://www.gnu.org/licenses" ) +
1555
- " </p>" ;
1556
- abt->setURLs (urls);
1557
1567
QString whatsNew = " <html><body>" + tr (" Version" ) + " " ;
1558
1568
whatsNew += QGis::qgisVersion;
1559
1569
whatsNew += " <h3>" + tr (" New features" ) + " </h3>" +
@@ -1589,9 +1599,6 @@ void QgisApp::about()
1589
1599
1590
1600
abt->setWhatsNew (whatsNew);
1591
1601
1592
- // add the available plugins to the list
1593
- QString providerInfo = " <b>" + tr (" Available Data Provider Plugins" ) + " </b><br>" ;
1594
- abt->setPluginInfo (providerInfo + QgsProviderRegistry::instance ()->pluginList (true ));
1595
1602
QApplication::restoreOverrideCursor ();
1596
1603
}
1597
1604
abt->show ();
@@ -4264,9 +4271,9 @@ void QgisApp::options()
4264
4271
double zoomFactor = mySettings.value (" /qgis/zoom_factor" , 2 ).toDouble ();
4265
4272
mMapCanvas ->setWheelAction ((QgsMapCanvas::WheelAction) action, zoomFactor);
4266
4273
4267
- bool splitterRedraw = mySettings.value (" /qgis/splitterRedraw" , true ).toBool ();
4268
- canvasLegendSplit->setOpaqueResize (splitterRedraw);
4269
- legendOverviewSplit->setOpaqueResize (splitterRedraw);
4274
+ // bool splitterRedraw = mySettings.value("/qgis/splitterRedraw", true).toBool();
4275
+ // canvasLegendSplit->setOpaqueResize(splitterRedraw);
4276
+ // legendOverviewSplit->setOpaqueResize(splitterRedraw);
4270
4277
}
4271
4278
}
4272
4279
0 commit comments