Skip to content

Commit

Permalink
Multiple changes:
Browse files Browse the repository at this point in the history
 - 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@8533 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed May 28, 2008
1 parent 410cb17 commit 52b8b28
Show file tree
Hide file tree
Showing 33 changed files with 1,495 additions and 1,933 deletions.
1 change: 0 additions & 1 deletion mac/2-release-extra-qt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ popd

strip -x ${FRAMEWORKPREFIX}/QtGui.framework/Versions/4/QtGui
strip -x ${FRAMEWORKPREFIX}/QtCore.framework/Versions/4/QtCore
strip -x ${FRAMEWORKPREFIX}/Qt3Support.framework/Versions/4/Qt3Support
strip -x ${FRAMEWORKPREFIX}/QtSql.framework/Versions/4/QtSql
strip -x ${FRAMEWORKPREFIX}/QtSvg.framework/Versions/4/QtSvg
strip -x ${FRAMEWORKPREFIX}/QtXml.framework/Versions/4/QtXml
Expand Down
3 changes: 3 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ FILE(GLOB GUI_SIP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/gui/*.sip")
# Extract GDAL library path and name for configure.py.in
STRING(REGEX REPLACE "^(.*)/.*$" "\\1" GDAL_LIB_PATH ${GDAL_LIBRARY})
STRING(REGEX REPLACE "^.*/(lib)?(.*)\\.[^.]+$" "\\2" GDAL_LIB_NAME ${GDAL_LIBRARY})
# Extract GEOS library path and name for configure.py.in
STRING(REGEX REPLACE "^(.*)/.*$" "\\1" GEOS_LIB_PATH ${GEOS_LIBRARY})
STRING(REGEX REPLACE "^.*/(lib)?(.*)\\.[^.]+$" "\\2" GEOS_LIB_NAME ${GEOS_LIBRARY})

# Step 1: during configuration
# create file configure.py from configure.py.in
Expand Down
7 changes: 6 additions & 1 deletion python/configure.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ build_path = '@CMAKE_BINARY_DIR@'
python_path = src_path + '/python'
gdal_inc_dir = '@GDAL_INCLUDE_DIR@'
geos_inc_dir = '@GEOS_INCLUDE_DIR@'
geos_library = '@GEOS_LIB_NAME@'
geos_library_path = '@GEOS_LIB_PATH@'
gdal_library = '@GDAL_LIB_NAME@'
gdal_library_path = '@GDAL_LIB_PATH@'

qt_libs = ["QtCore","QtGui","QtNetwork","QtSvg","QtXml"]
if sys.platform == 'darwin':
qt_libs.append("Qt3Support")
qt_libs.append("QtSql")
# possibility of universal build of bindings
osx_archs = '@CMAKE_OSX_ARCHITECTURES@'
Expand Down Expand Up @@ -126,9 +127,13 @@ makefile_gui = sipconfig.ModuleMakefile(
# common settings for both core and gui libs
for mk in [ makefile_core, makefile_gui ]:
mk.extra_libs = ["qgis_core"]
if geos_library!="":
mk.extra_libs.append(geos_library)
if gdal_library!="":
mk.extra_libs.append(gdal_library)
mk.extra_lib_dirs = [build_path+"/src/core"+intdir]
if geos_library_path!="":
mk.extra_lib_dirs.append(geos_library_path)
if gdal_library_path!="":
mk.extra_lib_dirs.append(gdal_library_path)
mk.extra_include_dirs = [src_path+"/src/core",
Expand Down
4 changes: 4 additions & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class QgisInterface : QObject
virtual void removeToolBarIcon(QAction *qAction) = 0;
//! Add toolbar with specified name
virtual QToolBar* addToolBar(QString name)=0 /Factory/;
/** Get the file toolbar - intended for use with plugins which
* add a new file type handler.
*/
virtual QToolBar * fileToolBar()=0;

// TODO: is this deprecated in favour of QgsContextHelp?
/** Open a url in the users browser. By default the QGIS doc directory is used
Expand Down
20 changes: 13 additions & 7 deletions src/app/legend/qgslegendlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QPainter>
#include <QSettings>

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


//create an item for each classification field (only one for most renderers)
if(renderer->needsAttributes())
QSettings settings;
if (settings.value("/qgis/showLegendClassifiers",false).toBool())
{
QgsAttributeList classfieldlist = renderer->classificationAttributes();
const QgsFieldMap& fields = layer->getDataProvider()->fields();
for(QgsAttributeList::iterator it = classfieldlist.begin(); it!=classfieldlist.end(); ++it)
if(renderer->needsAttributes())
{
const QgsField& theField = fields[*it];
QString classfieldname = theField.name();
itemList.push_front(std::make_pair(classfieldname, QPixmap()));
QgsAttributeList classfieldlist = renderer->classificationAttributes();
const QgsFieldMap& fields = layer->getDataProvider()->fields();
for(QgsAttributeList::iterator it = classfieldlist.begin(); it!=classfieldlist.end(); ++it)
{
const QgsField& theField = fields[*it];
QString classfieldname = theField.name();
itemList.push_front(std::make_pair(classfieldname, QPixmap()));
}
}
}

Expand Down
50 changes: 27 additions & 23 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@
#include <QPrinter>
#include <QProcess>
#include <QProgressBar>
#include <QRegExp>
#include <QRegExpValidator>
#include <QSettings>
#include <QSplashScreen>
#include <QStatusBar>
#include <QStringList>
#include <QTcpSocket>
#include <QTextStream>
#include <QTimer>
#include <QToolButton>
#include <QVBoxLayout>
#include <QWhatsThis>
#include <QtGlobal>
#include <QRegExp>
#include <QRegExpValidator>
#include <QTimer>
//
// Mac OS X Includes
// Must include before GEOS 3 due to unqualified use of 'Point'
Expand Down Expand Up @@ -359,7 +359,6 @@ static void customSrsValidation_(QgsSpatialRefSys* srs)

mSplash->showMessage(tr("Starting Python"), Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();

// try to load python support
QLibrary pythonlib("qgispython");
// It's necessary to set these two load hints, otherwise Python library won't work correctly
Expand Down Expand Up @@ -586,10 +585,10 @@ void QgisApp::createActions()
//
// Layer Menu Related Items
//
mActionAddNonDbLayer= new QAction(QIcon(myIconPath+"/mActionAddNonDbLayer.png"), tr("Add a Vector Layer..."), this);
mActionAddNonDbLayer->setShortcut(tr("V","Add a Vector Layer"));
mActionAddNonDbLayer->setStatusTip(tr("Add a Vector Layer"));
connect(mActionAddNonDbLayer, SIGNAL(triggered()), this, SLOT(addVectorLayer()));
mActionAddOgrLayer= new QAction(QIcon(myIconPath+"/mActionAddOgrLayer.png"), tr("Add a Vector Layer..."), this);
mActionAddOgrLayer->setShortcut(tr("V","Add a Vector Layer"));
mActionAddOgrLayer->setStatusTip(tr("Add a Vector Layer"));
connect(mActionAddOgrLayer, SIGNAL(triggered()), this, SLOT(addVectorLayer()));
//
mActionAddRasterLayer= new QAction(QIcon(myIconPath+"/mActionAddRasterLayer.png"), tr("Add a Raster Layer..."), this);
mActionAddRasterLayer->setShortcut(tr("R","Add a Raster Layer"));
Expand Down Expand Up @@ -990,7 +989,7 @@ void QgisApp::createMenus()
//
// Layers Menu
mLayerMenu = menuBar()->addMenu(tr("&Layer"));
mLayerMenu->addAction(mActionAddNonDbLayer);
mLayerMenu->addAction(mActionAddOgrLayer);
mLayerMenu->addAction(mActionAddRasterLayer);
#ifdef HAVE_POSTGRESQL
mLayerMenu->addAction(mActionAddLayer);
Expand Down Expand Up @@ -1058,30 +1057,23 @@ void QgisApp::createToolBars()
mFileToolBar->addAction(mActionFileSaveAs);
mFileToolBar->addAction(mActionFileOpen);
mFileToolBar->addAction(mActionFilePrint);
mFileToolBar->addAction(mActionAddOgrLayer);
mFileToolBar->addAction(mActionAddRasterLayer);
#ifdef HAVE_POSTGRESQL
mFileToolBar->addAction(mActionAddLayer);
#endif
mFileToolBar->addAction(mActionAddWmsLayer);
//
// Layer Toolbar
mLayerToolBar = addToolBar(tr("Manage Layers"));
mLayerToolBar->setIconSize(myIconSize);
mLayerToolBar->setObjectName("LayerToolBar");
mLayerToolBar->addAction(mActionAddNonDbLayer);
mLayerToolBar->addAction(mActionAddRasterLayer);
#ifdef HAVE_POSTGRESQL
mLayerToolBar->addAction(mActionAddLayer);
#endif
mLayerToolBar->addAction(mActionAddWmsLayer);
mLayerToolBar->addAction(mActionNewVectorLayer);
mLayerToolBar->addAction(mActionRemoveLayer);
mLayerToolBar->addAction(mActionInOverview);
mLayerToolBar->addAction(mActionShowAllLayers);
mLayerToolBar->addAction(mActionHideAllLayers);
//
// Help Toolbar
mHelpToolBar = addToolBar(tr("Help"));
mHelpToolBar->setIconSize(myIconSize);
mHelpToolBar->setObjectName("Help");
mHelpToolBar->addAction(mActionHelpContents);
mHelpToolBar->addAction(QWhatsThis::createAction());
//
// Digitizing Toolbar
mDigitizeToolBar = addToolBar(tr("Digitizing"));
mDigitizeToolBar->setIconSize(myIconSize);
Expand Down Expand Up @@ -1132,6 +1124,13 @@ void QgisApp::createToolBars()
mPluginToolBar = addToolBar(tr("Plugins"));
mPluginToolBar->setIconSize(myIconSize);
mPluginToolBar->setObjectName("Plugins");
//
// Help Toolbar
mHelpToolBar = addToolBar(tr("Help"));
mHelpToolBar->setIconSize(myIconSize);
mHelpToolBar->setObjectName("Help");
mHelpToolBar->addAction(mActionHelpContents);
mHelpToolBar->addAction(QWhatsThis::createAction());

//Add the menu for toolbar visibility here
//because createPopupMenu() would return 0
Expand Down Expand Up @@ -1288,7 +1287,7 @@ void QgisApp::setTheme(QString theThemeName)
mActionExportMapServer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionExportMapServer.png")));
*/
mActionFileExit->setIconSet(QIcon(QPixmap(myIconPath + "/mActionFileExit.png")));
mActionAddNonDbLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddNonDbLayer.png")));
mActionAddOgrLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddOgrLayer.png")));
mActionAddRasterLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddRasterLayer.png")));
mActionAddLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionAddLayer.png")));
mActionRemoveLayer->setIconSet(QIcon(QPixmap(myIconPath + "/mActionRemoveLayer.png")));
Expand Down Expand Up @@ -3355,6 +3354,11 @@ void QgisApp::stopRendering()
}
}

QToolBar * QgisApp::fileToolBar()
{
return mFileToolBar;
}

//reimplements method from base (gui) class
void QgisApp::hideAllLayers()
{
Expand Down
29 changes: 18 additions & 11 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@
#ifndef QGISAPP_H
#define QGISAPP_H

class QRect;
class QStringList;
class QActionGroup;
class QCheckBox;
class QCursor;
class QLabel;
class QLineEdit;
class QProgressBar;
class QFileInfo;
class QSettings;
class QTcpSocket;
class QCheckBox;
class QToolButton;
class QKeyEvent;
class QLabel;
class QLineEdit;
class QMenu;
class QPixmap;
class QProgressBar;
class QPushButton;
class QRect;
class QSettings;
class QSplashScreen;
class QStringList;
class QToolButton;
class QTcpSocket;
class QValidator;
class QActionGroup;

class QgisAppInterface;
class QgsClipboard;
Expand All @@ -56,6 +56,7 @@ class QgsRect;
class QgsVectorLayer;

#include <QMainWindow>
#include <QToolBar>
#include <QAbstractSocket>

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

/** Get a reference to the file toolbar. Mainly intended
* to be used by plugins that want to specifically add
* an icon into the file toolbar for consistency e.g.
* addWFS and GPS plugins.
*/
QToolBar * fileToolBar();
signals:
/** emitted when a key is pressed and we want non widget sublasses to be able
to pick up on this (e.g. maplayer) */
Expand Down Expand Up @@ -470,7 +477,7 @@ public slots:
QAction *mActionSaveMapAsImage;
QAction *mActionExportMapServer;
QAction *mActionFileExit;
QAction *mActionAddNonDbLayer;
QAction *mActionAddOgrLayer;
QAction *mActionAddRasterLayer;
QAction *mActionAddLayer;
QAction *mActionRemoveLayer;
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ QToolBar* QgisAppInterface::addToolBar(QString name)
{
return qgis->addToolBar(name);
}
QToolBar * QgisAppInterface::fileToolBar()
{
return qgis->fileToolBar();
}
void QgisAppInterface::openURL(QString url, bool useQgisDocDirectory)
{
qgis->openURL(url, useQgisDocDirectory);
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgisappinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class QgisAppInterface : public QgisInterface
void removeToolBarIcon(QAction *qAction);
//! Add toolbar with specified name
QToolBar* addToolBar(QString name);
/** Get the file toolbar - intended for use with plugins which
* add a new file type handler.
*/
QToolBar * fileToolBar();

/** Open a url in the users browser. By default the QGIS doc directory is used
* as the base for the URL. To open a URL that is not relative to the installed
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgsdelattrdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
QgsDelAttrDialog::QgsDelAttrDialog(QHeaderView* header): QDialog()
{
setupUi(this);
QObject::connect(mOkButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
QObject::connect(mCancelButton, SIGNAL(clicked(bool)), this, SLOT(reject()));

//insert attribute names into the QListView
if(header)
Expand Down
15 changes: 0 additions & 15 deletions src/app/qgslabeldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,12 @@ QgsLabelDialog::QgsLabelDialog ( QgsLabel *label, QWidget *parent )

init();

connect( sliderFontTransparency, SIGNAL(sliderMoved(int)),
spinFontTransparency, SLOT(setValue(int)) );
connect( spinFontTransparency, SIGNAL(valueChanged(int)),
sliderFontTransparency, SLOT(setValue(int)) );
connect( sliderAngle, SIGNAL(valueChanged(int)),
spinAngle, SLOT(setValue(int)) );
connect( spinAngle, SIGNAL(valueChanged(int)),
sliderAngle, SLOT(setValue(int)) );
connect( sliderBufferTransparency, SIGNAL(sliderMoved(int)),
spinBufferTransparency, SLOT(setValue(int)) );
connect( spinBufferTransparency, SIGNAL(valueChanged(int)),
sliderBufferTransparency, SLOT(setValue(int)) );
connect( btnDefaultFont, SIGNAL(clicked()),
this, SLOT(changeFont()) );
connect( pbnDefaultBufferColor_2, SIGNAL(clicked()),
this, SLOT(changeBufferColor()) );
connect( pbnDefaultFontColor, SIGNAL(clicked()),
this, SLOT(changeFontColor()) );
//added by Tim to force scrolling of tab bar on Mac
tabWidget2->setElideMode(Qt::ElideNone);
tabWidget2->setUsesScrollButtons(true);
}


Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ QgsOptions::QgsOptions(QWidget *parent, Qt::WFlags fl) :
// but the checkbox is true to use QPixmap
chkUseQPixmap->setChecked(!(settings.value("/qgis/use_qimage_to_render", true).toBool()));
chkAddedVisibility->setChecked(settings.value("/qgis/new_layers_visible",true).toBool());
cbxLegendClassifiers->setChecked(settings.value("/qgis/showLegendClassifiers",false).toBool());
cbxHideSplash->setChecked(settings.value("/qgis/hideSplash",false).toBool());

//set the colour for selections
Expand Down Expand Up @@ -246,6 +247,7 @@ void QgsOptions::saveOptions()
{
QSettings settings;
settings.writeEntry("/Map/identifyRadius", spinBoxIdentifyValue->value());
settings.writeEntry("/qgis/showLegendClassifiers",cbxLegendClassifiers->isChecked());
settings.writeEntry("/qgis/hideSplash",cbxHideSplash->isChecked());
settings.writeEntry("/qgis/new_layers_visible",chkAddedVisibility->isChecked());
settings.writeEntry("/qgis/enable_anti_aliasing",chkAntiAliasing->isChecked());
Expand Down
Loading

0 comments on commit 52b8b28

Please sign in to comment.