Skip to content

Commit 44f36c1

Browse files
author
timlinux
committed
Multiple changes:
- added a call to get the file toolbar so that plugins providing 'add layer' type functionality can place their icons into the file toolbar along with other add layer icons. - cleaned up the vector props ui so that action panel fills all available space, and that label settings dont use tabs but a property pane style ui. - added an option to qgsoptions to enable / disable legend classification attributes list - fix issue with detailed item delegate not being selectable in win - updated style sheet so that system colour scheme is used for 'glossy' highlight - fixed formatting issues in vector metadata list - fixed python build error on mac where geos was not being linked to - added grass list view to grass toolbox git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8533 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3ed9e21 commit 44f36c1

33 files changed

+1495
-1933
lines changed

mac/2-release-extra-qt.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ popd
147147

148148
strip -x ${FRAMEWORKPREFIX}/QtGui.framework/Versions/4/QtGui
149149
strip -x ${FRAMEWORKPREFIX}/QtCore.framework/Versions/4/QtCore
150-
strip -x ${FRAMEWORKPREFIX}/Qt3Support.framework/Versions/4/Qt3Support
151150
strip -x ${FRAMEWORKPREFIX}/QtSql.framework/Versions/4/QtSql
152151
strip -x ${FRAMEWORKPREFIX}/QtSvg.framework/Versions/4/QtSvg
153152
strip -x ${FRAMEWORKPREFIX}/QtXml.framework/Versions/4/QtXml

python/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ FILE(GLOB GUI_SIP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/gui/*.sip")
3939
# Extract GDAL library path and name for configure.py.in
4040
STRING(REGEX REPLACE "^(.*)/.*$" "\\1" GDAL_LIB_PATH ${GDAL_LIBRARY})
4141
STRING(REGEX REPLACE "^.*/(lib)?(.*)\\.[^.]+$" "\\2" GDAL_LIB_NAME ${GDAL_LIBRARY})
42+
# Extract GEOS library path and name for configure.py.in
43+
STRING(REGEX REPLACE "^(.*)/.*$" "\\1" GEOS_LIB_PATH ${GEOS_LIBRARY})
44+
STRING(REGEX REPLACE "^.*/(lib)?(.*)\\.[^.]+$" "\\2" GEOS_LIB_NAME ${GEOS_LIBRARY})
4245

4346
# Step 1: during configuration
4447
# create file configure.py from configure.py.in

python/configure.py.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ build_path = '@CMAKE_BINARY_DIR@'
99
python_path = src_path + '/python'
1010
gdal_inc_dir = '@GDAL_INCLUDE_DIR@'
1111
geos_inc_dir = '@GEOS_INCLUDE_DIR@'
12+
geos_library = '@GEOS_LIB_NAME@'
13+
geos_library_path = '@GEOS_LIB_PATH@'
1214
gdal_library = '@GDAL_LIB_NAME@'
1315
gdal_library_path = '@GDAL_LIB_PATH@'
1416

1517
qt_libs = ["QtCore","QtGui","QtNetwork","QtSvg","QtXml"]
1618
if sys.platform == 'darwin':
17-
qt_libs.append("Qt3Support")
1819
qt_libs.append("QtSql")
1920
# possibility of universal build of bindings
2021
osx_archs = '@CMAKE_OSX_ARCHITECTURES@'
@@ -126,9 +127,13 @@ makefile_gui = sipconfig.ModuleMakefile(
126127
# common settings for both core and gui libs
127128
for mk in [ makefile_core, makefile_gui ]:
128129
mk.extra_libs = ["qgis_core"]
130+
if geos_library!="":
131+
mk.extra_libs.append(geos_library)
129132
if gdal_library!="":
130133
mk.extra_libs.append(gdal_library)
131134
mk.extra_lib_dirs = [build_path+"/src/core"+intdir]
135+
if geos_library_path!="":
136+
mk.extra_lib_dirs.append(geos_library_path)
132137
if gdal_library_path!="":
133138
mk.extra_lib_dirs.append(gdal_library_path)
134139
mk.extra_include_dirs = [src_path+"/src/core",

python/gui/qgisinterface.sip

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class QgisInterface : QObject
5454
virtual void removeToolBarIcon(QAction *qAction) = 0;
5555
//! Add toolbar with specified name
5656
virtual QToolBar* addToolBar(QString name)=0 /Factory/;
57+
/** Get the file toolbar - intended for use with plugins which
58+
* add a new file type handler.
59+
*/
60+
virtual QToolBar * fileToolBar()=0;
5761

5862
// TODO: is this deprecated in favour of QgsContextHelp?
5963
/** Open a url in the users browser. By default the QGIS doc directory is used

src/app/legend/qgslegendlayer.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <QMenu>
4343
#include <QMessageBox>
4444
#include <QPainter>
45+
#include <QSettings>
4546

4647
QgsLegendLayer::QgsLegendLayer(QTreeWidgetItem* parent,QString name)
4748
: QgsLegendItem(parent, name)
@@ -365,16 +366,21 @@ void QgsLegendLayer::vectorLayerSymbology(const QgsVectorLayer* layer, double wi
365366
itemList.push_back(std::make_pair(values, pix));
366367
}
367368

369+
368370
//create an item for each classification field (only one for most renderers)
369-
if(renderer->needsAttributes())
371+
QSettings settings;
372+
if (settings.value("/qgis/showLegendClassifiers",false).toBool())
370373
{
371-
QgsAttributeList classfieldlist = renderer->classificationAttributes();
372-
const QgsFieldMap& fields = layer->getDataProvider()->fields();
373-
for(QgsAttributeList::iterator it = classfieldlist.begin(); it!=classfieldlist.end(); ++it)
374+
if(renderer->needsAttributes())
374375
{
375-
const QgsField& theField = fields[*it];
376-
QString classfieldname = theField.name();
377-
itemList.push_front(std::make_pair(classfieldname, QPixmap()));
376+
QgsAttributeList classfieldlist = renderer->classificationAttributes();
377+
const QgsFieldMap& fields = layer->getDataProvider()->fields();
378+
for(QgsAttributeList::iterator it = classfieldlist.begin(); it!=classfieldlist.end(); ++it)
379+
{
380+
const QgsField& theField = fields[*it];
381+
QString classfieldname = theField.name();
382+
itemList.push_front(std::make_pair(classfieldname, QPixmap()));
383+
}
378384
}
379385
}
380386

src/app/qgisapp.cpp

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
#include <QPrinter>
5353
#include <QProcess>
5454
#include <QProgressBar>
55+
#include <QRegExp>
56+
#include <QRegExpValidator>
5557
#include <QSettings>
5658
#include <QSplashScreen>
5759
#include <QStatusBar>
5860
#include <QStringList>
5961
#include <QTcpSocket>
6062
#include <QTextStream>
63+
#include <QTimer>
6164
#include <QToolButton>
6265
#include <QVBoxLayout>
6366
#include <QWhatsThis>
6467
#include <QtGlobal>
65-
#include <QRegExp>
66-
#include <QRegExpValidator>
67-
#include <QTimer>
6868
//
6969
// Mac OS X Includes
7070
// Must include before GEOS 3 due to unqualified use of 'Point'
@@ -359,7 +359,6 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)
359359

360360
mSplash->showMessage(tr("Starting Python"), Qt::AlignHCenter | Qt::AlignBottom);
361361
qApp->processEvents();
362-
363362
// try to load python support
364363
QLibrary pythonlib("qgispython");
365364
// It's necessary to set these two load hints, otherwise Python library won't work correctly
@@ -586,10 +585,10 @@ void QgisApp::createActions()
586585
//
587586
// Layer Menu Related Items
588587
//
589-
mActionAddNonDbLayer= new QAction(QIcon(myIconPath+"/mActionAddNonDbLayer.png"), tr("Add a Vector Layer..."), this);
590-
mActionAddNonDbLayer->setShortcut(tr("V","Add a Vector Layer"));
591-
mActionAddNonDbLayer->setStatusTip(tr("Add a Vector Layer"));
592-
connect(mActionAddNonDbLayer, SIGNAL(triggered()), this, SLOT(addVectorLayer()));
588+
mActionAddOgrLayer= new QAction(QIcon(myIconPath+"/mActionAddOgrLayer.png"), tr("Add a Vector Layer..."), this);
589+
mActionAddOgrLayer->setShortcut(tr("V","Add a Vector Layer"));
590+
mActionAddOgrLayer->setStatusTip(tr("Add a Vector Layer"));
591+
connect(mActionAddOgrLayer, SIGNAL(triggered()), this, SLOT(addVectorLayer()));
593592
//
594593
mActionAddRasterLayer= new QAction(QIcon(myIconPath+"/mActionAddRasterLayer.png"), tr("Add a Raster Layer..."), this);
595594
mActionAddRasterLayer->setShortcut(tr("R","Add a Raster Layer"));
@@ -990,7 +989,7 @@ void QgisApp::createMenus()
990989
//
991990
// Layers Menu
992991
mLayerMenu = menuBar()->addMenu(tr("&Layer"));
993-
mLayerMenu->addAction(mActionAddNonDbLayer);
992+
mLayerMenu->addAction(mActionAddOgrLayer);
994993
mLayerMenu->addAction(mActionAddRasterLayer);
995994
#ifdef HAVE_POSTGRESQL
996995
mLayerMenu->addAction(mActionAddLayer);
@@ -1058,30 +1057,23 @@ void QgisApp::createToolBars()
10581057
mFileToolBar->addAction(mActionFileSaveAs);
10591058
mFileToolBar->addAction(mActionFileOpen);
10601059
mFileToolBar->addAction(mActionFilePrint);
1060+
mFileToolBar->addAction(mActionAddOgrLayer);
1061+
mFileToolBar->addAction(mActionAddRasterLayer);
1062+
#ifdef HAVE_POSTGRESQL
1063+
mFileToolBar->addAction(mActionAddLayer);
1064+
#endif
1065+
mFileToolBar->addAction(mActionAddWmsLayer);
10611066
//
10621067
// Layer Toolbar
10631068
mLayerToolBar = addToolBar(tr("Manage Layers"));
10641069
mLayerToolBar->setIconSize(myIconSize);
10651070
mLayerToolBar->setObjectName("LayerToolBar");
1066-
mLayerToolBar->addAction(mActionAddNonDbLayer);
1067-
mLayerToolBar->addAction(mActionAddRasterLayer);
1068-
#ifdef HAVE_POSTGRESQL
1069-
mLayerToolBar->addAction(mActionAddLayer);
1070-
#endif
1071-
mLayerToolBar->addAction(mActionAddWmsLayer);
10721071
mLayerToolBar->addAction(mActionNewVectorLayer);
10731072
mLayerToolBar->addAction(mActionRemoveLayer);
10741073
mLayerToolBar->addAction(mActionInOverview);
10751074
mLayerToolBar->addAction(mActionShowAllLayers);
10761075
mLayerToolBar->addAction(mActionHideAllLayers);
10771076
//
1078-
// Help Toolbar
1079-
mHelpToolBar = addToolBar(tr("Help"));
1080-
mHelpToolBar->setIconSize(myIconSize);
1081-
mHelpToolBar->setObjectName("Help");
1082-
mHelpToolBar->addAction(mActionHelpContents);
1083-
mHelpToolBar->addAction(QWhatsThis::createAction());
1084-
//
10851077
// Digitizing Toolbar
10861078
mDigitizeToolBar = addToolBar(tr("Digitizing"));
10871079
mDigitizeToolBar->setIconSize(myIconSize);
@@ -1132,6 +1124,13 @@ void QgisApp::createToolBars()
11321124
mPluginToolBar = addToolBar(tr("Plugins"));
11331125
mPluginToolBar->setIconSize(myIconSize);
11341126
mPluginToolBar->setObjectName("Plugins");
1127+
//
1128+
// Help Toolbar
1129+
mHelpToolBar = addToolBar(tr("Help"));
1130+
mHelpToolBar->setIconSize(myIconSize);
1131+
mHelpToolBar->setObjectName("Help");
1132+
mHelpToolBar->addAction(mActionHelpContents);
1133+
mHelpToolBar->addAction(QWhatsThis::createAction());
11351134

11361135
//Add the menu for toolbar visibility here
11371136
//because createPopupMenu() would return 0
@@ -1288,7 +1287,7 @@ void QgisApp::setTheme(QString theThemeName)
12881287
mActionExportMapServer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionExportMapServer.png")));
12891288
*/
12901289
mActionFileExit->setIconSet(QIcon(QPixmap(myIconPath + "/mActionFileExit.png")));
1291-
mActionAddNonDbLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddNonDbLayer.png")));
1290+
mActionAddOgrLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddOgrLayer.png")));
12921291
mActionAddRasterLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddRasterLayer.png")));
12931292
mActionAddLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddLayer.png")));
12941293
mActionRemoveLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionRemoveLayer.png")));
@@ -3355,6 +3354,11 @@ void QgisApp::stopRendering()
33553354
}
33563355
}
33573356

3357+
QToolBar * QgisApp::fileToolBar()
3358+
{
3359+
return mFileToolBar;
3360+
}
3361+
33583362
//reimplements method from base (gui) class
33593363
void QgisApp::hideAllLayers()
33603364
{

src/app/qgisapp.h

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919
#ifndef QGISAPP_H
2020
#define QGISAPP_H
2121

22-
class QRect;
23-
class QStringList;
22+
class QActionGroup;
23+
class QCheckBox;
2424
class QCursor;
25-
class QLabel;
26-
class QLineEdit;
27-
class QProgressBar;
2825
class QFileInfo;
29-
class QSettings;
30-
class QTcpSocket;
31-
class QCheckBox;
32-
class QToolButton;
3326
class QKeyEvent;
27+
class QLabel;
28+
class QLineEdit;
3429
class QMenu;
3530
class QPixmap;
31+
class QProgressBar;
3632
class QPushButton;
33+
class QRect;
34+
class QSettings;
3735
class QSplashScreen;
36+
class QStringList;
37+
class QToolButton;
38+
class QTcpSocket;
3839
class QValidator;
39-
class QActionGroup;
4040

4141
class QgisAppInterface;
4242
class QgsClipboard;
@@ -56,6 +56,7 @@ class QgsRect;
5656
class QgsVectorLayer;
5757

5858
#include <QMainWindow>
59+
#include <QToolBar>
5960
#include <QAbstractSocket>
6061

6162
#include "qgsconfig.h"
@@ -381,6 +382,12 @@ public slots:
381382
//! Stops rendering of the main map
382383
void stopRendering();
383384

385+
/** Get a reference to the file toolbar. Mainly intended
386+
* to be used by plugins that want to specifically add
387+
* an icon into the file toolbar for consistency e.g.
388+
* addWFS and GPS plugins.
389+
*/
390+
QToolBar * fileToolBar();
384391
signals:
385392
/** emitted when a key is pressed and we want non widget sublasses to be able
386393
to pick up on this (e.g. maplayer) */
@@ -470,7 +477,7 @@ public slots:
470477
QAction *mActionSaveMapAsImage;
471478
QAction *mActionExportMapServer;
472479
QAction *mActionFileExit;
473-
QAction *mActionAddNonDbLayer;
480+
QAction *mActionAddOgrLayer;
474481
QAction *mActionAddRasterLayer;
475482
QAction *mActionAddLayer;
476483
QAction *mActionRemoveLayer;

src/app/qgisappinterface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ QToolBar* QgisAppInterface::addToolBar(QString name)
116116
{
117117
return qgis->addToolBar(name);
118118
}
119+
QToolBar * QgisAppInterface::fileToolBar()
120+
{
121+
return qgis->fileToolBar();
122+
}
119123
void QgisAppInterface::openURL(QString url, bool useQgisDocDirectory)
120124
{
121125
qgis->openURL(url, useQgisDocDirectory);

src/app/qgisappinterface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class QgisAppInterface : public QgisInterface
6969
void removeToolBarIcon(QAction *qAction);
7070
//! Add toolbar with specified name
7171
QToolBar* addToolBar(QString name);
72+
/** Get the file toolbar - intended for use with plugins which
73+
* add a new file type handler.
74+
*/
75+
QToolBar * fileToolBar();
7276

7377
/** Open a url in the users browser. By default the QGIS doc directory is used
7478
* as the base for the URL. To open a URL that is not relative to the installed

src/app/qgsdelattrdialog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
QgsDelAttrDialog::QgsDelAttrDialog(QHeaderView* header): QDialog()
2323
{
2424
setupUi(this);
25-
QObject::connect(mOkButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
26-
QObject::connect(mCancelButton, SIGNAL(clicked(bool)), this, SLOT(reject()));
2725

2826
//insert attribute names into the QListView
2927
if(header)

0 commit comments

Comments
 (0)