Skip to content

Commit ba15c14

Browse files
author
timlinux
committed
Numerous changes in GUI HIG revision:
- use buttonbox instead of free roaming buttons - All labels updated for consistency - improve alignment and layouts for unique vale, cont col, etc in vector props - use style sheets in vect and raster properties and update these reports so they are visually consistent with each other - In qgsabout clean up layout and also show addition info relating to qt db and image plugins in providers tab (which will be renamed) Please note this work is ongoing and not the final product yet. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8431 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b6ee23c commit ba15c14

30 files changed

+2078
-2139
lines changed

images/images.qrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<RCC>
2+
<qresource prefix="/images" >
3+
<file>icons/qgis-icon-16x16.png</file>
4+
<file>icons/qgis-icon-60x60.png</file>
5+
</qresource>
6+
</RCC>

src/app/CMakeLists.txt

+4-6
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ ENDIF (PYTHON_FOUND)
216216
IF (WIN32)
217217
# 'WIN32' removes console, which is Bad when debugging
218218
IF (CMAKE_BUILD_TYPE MATCHES Debug)
219-
ADD_EXECUTABLE(qgis ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS})
219+
ADD_EXECUTABLE(qgis ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
220220
ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
221-
ADD_EXECUTABLE(qgis WIN32 ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS})
221+
ADD_EXECUTABLE(qgis WIN32 ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
222222
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
223223
ELSE (WIN32)
224-
ADD_EXECUTABLE(qgis ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS})
224+
ADD_EXECUTABLE(qgis ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
225225
ENDIF (WIN32)
226226

227227
TARGET_LINK_LIBRARIES(qgis
@@ -230,16 +230,14 @@ TARGET_LINK_LIBRARIES(qgis
230230
${QT_QTXML_LIBRARY}
231231
${QT_QTSVG_LIBRARY}
232232
${QT_QTNETWORK_LIBRARY}
233+
${QT_QTSQL_LIBRARY}
233234
#should only be needed for win
234235
${QT_QTMAIN_LIBRARY}
235236
qgis_core
236237
qgis_gui
237238
)
238239
IF (${QTVERSION} STRLESS "4.3.0")
239240
TARGET_LINK_LIBRARIES(qgis ${QT_QT3SUPPORT_LIBRARY} )
240-
IF (APPLE)
241-
TARGET_LINK_LIBRARIES(qgis ${QT_QTSQL_LIBRARY} )
242-
ENDIF (APPLE)
243241
ENDIF (${QTVERSION} STRLESS "4.3.0")
244242

245243
IF (APPLE)

src/app/qgisapp.cpp

+50-43
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <QDesktopWidget>
3434
#include <QDialog>
3535
#include <QDir>
36+
#include <QDockWidget>
3637
#include <QEvent>
3738
#include <QFile>
3839
#include <QFileInfo>
@@ -214,7 +215,7 @@ static void buildSupportedVectorFileFilter_(QString & fileFilters);
214215
static void setTitleBarText_( QWidget & qgisApp )
215216
{
216217
QString caption = QgisApp::tr("Quantum GIS - ");
217-
caption += QString("%1 ('%2') ").arg(QGis::qgisVersion).arg(QGis::qgisReleaseName) + " ";
218+
caption += QString("%1 ").arg(QGis::qgisVersion) + " ";
218219

219220
if ( QgsProject::instance()->title().isEmpty() )
220221
{
@@ -305,7 +306,8 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
305306
: QMainWindow(parent,fl),
306307
mSplash(splash)
307308
{
308-
setupUi(this);
309+
// setupUi(this);
310+
resize(640, 480);
309311

310312
mSplash->showMessage(tr("Checking database"), Qt::AlignHCenter | Qt::AlignBottom);
311313
qApp->processEvents();
@@ -327,8 +329,8 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
327329
setTheme(mThemeName);
328330
updateRecentProjectPaths();
329331
createCanvas();
330-
createOverview();
331332
createLegend();
333+
createOverview();
332334
createMapTips();
333335

334336
mComposer = new QgsComposer(this); // Map composer
@@ -378,7 +380,7 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
378380

379381
// now build raster file filter
380382
QgsRasterLayer::buildSupportedRasterFileFilter( mRasterFileFilter );
381-
383+
/*
382384
// Set the background colour for toolbox and overview as they default to
383385
// white instead of the window color
384386
QPalette myPalette = toolBox->palette();
@@ -389,7 +391,7 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
389391
myPalette.setColor(QPalette::Button, myPalette.window().color());
390392
mMapLegend->setPalette(myPalette);
391393
//and for overview control this is done in createOverView method
392-
394+
*/
393395
// Do this last in the ctor to ensure that all members are instantiated properly
394396
setupConnections();
395397
//
@@ -493,12 +495,12 @@ void QgisApp::readSettings()
493495

494496
// Add the recently accessed project file paths to the File menu
495497
mRecentProjectPaths = settings.readListEntry("/UI/recentProjectsList");
496-
498+
/*
497499
// Set the behaviour when the map splitters are resized
498500
bool splitterRedraw = settings.value("/qgis/splitterRedraw", true).toBool();
499501
canvasLegendSplit->setOpaqueResize(splitterRedraw);
500502
legendOverviewSplit->setOpaqueResize(splitterRedraw);
501-
}
503+
*/}
502504

503505

504506
//////////////////////////////////////////////////////////////////////
@@ -1314,10 +1316,11 @@ void QgisApp::createCanvas()
13141316
mMapCanvas = new QgsMapCanvas(this, "theMapCanvas" );
13151317
mMapCanvas->setWhatsThis(tr("Map canvas. This is where raster and vector layers are displayed when added to the map"));
13161318

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);
13211324
// set the focus to the map canvas
13221325
mMapCanvas->setFocus();
13231326

@@ -1367,10 +1370,16 @@ void QgisApp::createOverview()
13671370
QBitmap overviewPanBmpMask = QBitmap::fromData(QSize(16, 16), pan_mask_bits);
13681371
mOverviewMapCursor = new QCursor(overviewPanBmp, overviewPanBmpMask, 5, 5);
13691372
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+
13741383
mMapCanvas->setOverview(overviewCanvas);
13751384

13761385
// moved here to set anti aliasing to both map canvas and overview
@@ -1395,9 +1404,16 @@ void QgisApp::createLegend()
13951404
mMapLegend->setToggleEditingAction(mActionToggleEditing);
13961405

13971406
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());
14011417
return;
14021418
}
14031419

@@ -1503,8 +1519,8 @@ void QgisApp::saveWindowState()
15031519

15041520
// store window geometry
15051521
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());
15081524
}
15091525

15101526
void QgisApp::restoreWindowState()
@@ -1516,8 +1532,8 @@ void QgisApp::restoreWindowState()
15161532

15171533
// restore window geometry
15181534
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());
15211537
}
15221538
///////////// END OF GUI SETUP ROUTINES ///////////////
15231539

@@ -1527,33 +1543,27 @@ void QgisApp::about()
15271543
if (!abt) {
15281544
QApplication::setOverrideCursor(Qt::WaitCursor);
15291545
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);
15351549
#ifdef HAVE_POSTGRESQL
15361550

1537-
versionString += tr(" with PostgreSQL support");
1551+
versionString += tr(" This copy of QGIS has been built with PostgreSQL support.");
15381552
#else
15391553

1540-
versionString += tr(" (no PostgreSQL support)");
1554+
versionString += tr(" This copy of QGIS has been built without PostgreSQL support.");
15411555
#endif
1542-
versionString += tr("\nCompiled against Qt ") + QT_VERSION_STR
1543-
+ tr(", running against Qt ") + qVersion();
1556+
versionString += tr("\nThis binary was compiled against Qt %1,"
1557+
"and is currently running against Qt %2")
1558+
.arg(QT_VERSION_STR)
1559+
.arg(qVersion());
15441560

15451561
#ifdef WIN32
15461562
// special version stuff for windows (if required)
15471563
// versionString += "\nThis is a Windows preview release - not for production use";
15481564
#endif
15491565

15501566
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);
15571567
QString whatsNew = "<html><body>" + tr("Version") + " ";
15581568
whatsNew += QGis::qgisVersion;
15591569
whatsNew += "<h3>" + tr("New features") + "</h3>" +
@@ -1589,9 +1599,6 @@ void QgisApp::about()
15891599

15901600
abt->setWhatsNew(whatsNew);
15911601

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));
15951602
QApplication::restoreOverrideCursor();
15961603
}
15971604
abt->show();
@@ -4264,9 +4271,9 @@ void QgisApp::options()
42644271
double zoomFactor = mySettings.value("/qgis/zoom_factor", 2).toDouble();
42654272
mMapCanvas->setWheelAction((QgsMapCanvas::WheelAction) action, zoomFactor);
42664273

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);
42704277
}
42714278
}
42724279

src/app/qgisapp.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class QMenu;
3535
class QPixmap;
3636
class QSplashScreen;
3737
class QValidator;
38+
class QActionGroup;
3839

3940
class QgisAppInterface;
4041
class QgsClipboard;
@@ -52,7 +53,6 @@ class QgsRasterLayer;
5253
class QgsRect;
5354
class QgsVectorLayer;
5455

55-
#include <ui_qgisappbase.h>
5656
#include <QMainWindow>
5757
#include <QAbstractSocket>
5858

@@ -62,7 +62,7 @@ class QgsVectorLayer;
6262
/*! \class QgisApp
6363
* \brief Main window for the Qgis application
6464
*/
65-
class QgisApp : public QMainWindow, public Ui::QgisAppBase
65+
class QgisApp : public QMainWindow
6666
{
6767
Q_OBJECT;
6868
public:
@@ -535,7 +535,10 @@ public slots:
535535
QMenu *mSettingsMenu;
536536
QMenu *mHelpMenu;
537537

538-
class Tools
538+
QDockWidget *mLegendDock;
539+
QDockWidget *mOverviewDock;
540+
541+
class Tools
539542
{
540543
public:
541544
QgsMapTool* mZoomIn;

src/app/qgisappinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ QWidget * QgisAppInterface::getMainWindow()
133133

134134
QToolBox* QgisAppInterface::getToolBox()
135135
{
136-
return qgis->toolBox;
136+
return NULL;
137137
}
138138

139139
void QgisAppInterface::refreshLegend(QgsMapLayer *l)

0 commit comments

Comments
 (0)