Skip to content

Commit 018a047

Browse files
committed
[FEATURE] WMTS
1 parent db1c3d9 commit 018a047

19 files changed

+1897
-1001
lines changed

scripts/prepare-commit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ fi
3434
# save original changes
3535
if [ -d .svn ]; then
3636
REV=r$(svn info | sed -ne "s/Revision: //p")
37-
svn diff >$REV.diff
37+
svn diff >rev-$REV.diff
3838
elif [ -d .git ]; then
3939
REV=$(git log -n1 --pretty=%H)
40-
git diff >$REV.diff
40+
git diff >sha-$REV.diff
4141
fi
4242

4343
ASTYLEDIFF=astyle.$REV.diff

src/app/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ SET(QGIS_APP_SRCS
9595
qgssinglesymboldialog.cpp
9696
qgssnappingdialog.cpp
9797
qgsundowidget.cpp
98-
qgstilescalewidget.cpp
9998
qgstipgui.cpp
10099
qgstipfactory.cpp
101100
qgsuniquevaluedialog.cpp
@@ -232,7 +231,6 @@ SET (QGIS_APP_MOC_HDRS
232231
qgssnappingdialog.h
233232
qgssponsors.h
234233
qgstextannotationdialog.h
235-
qgstilescalewidget.h
236234
qgstipgui.h
237235
qgstipfactory.h
238236
qgsundowidget.h

src/app/qgisapp.cpp

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
#include "qgssnappingdialog.h"
165165
#include "qgssponsors.h"
166166
#include "qgstextannotationitem.h"
167-
#include "qgstilescalewidget.h"
168167
#include "qgstipgui.h"
169168
#include "qgsundowidget.h"
170169
#include "qgsvectordataprovider.h"
@@ -403,7 +402,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
403402
, mSplash( splash )
404403
, mShowProjectionTab( false )
405404
, mPythonUtils( NULL )
406-
, mpTileScaleWidget( NULL )
407405
#ifdef Q_OS_WIN
408406
, mSkipNextContextMenuEvent( 0 )
409407
#endif
@@ -651,6 +649,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
651649
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
652650
QgsApplication::setFileOpenEventReceiver( this );
653651

652+
QgsProviderRegistry::instance()->registerGuis( this );
653+
654654
// update windows
655655
qApp->processEvents();
656656

@@ -788,12 +788,6 @@ void QgisApp::readSettings()
788788

789789
// Add the recently accessed project file paths to the File menu
790790
mRecentProjectPaths = settings.value( "/UI/recentProjectsList" ).toStringList();
791-
792-
// Restore state of tile scale widget
793-
if ( settings.value( "/UI/tileScaleEnabled", false ).toBool() )
794-
{
795-
showTileScale();
796-
}
797791
}
798792

799793

@@ -899,7 +893,6 @@ void QgisApp::createActions()
899893
connect( mActionRemoveLayer, SIGNAL( triggered() ), this, SLOT( removeLayer() ) );
900894
connect( mActionSetLayerCRS, SIGNAL( triggered() ), this, SLOT( setLayerCRS() ) );
901895
connect( mActionSetProjectCRSFromLayer, SIGNAL( triggered() ), this, SLOT( setProjectCRSFromLayer() ) );
902-
connect( mActionTileScale, SIGNAL( triggered() ), this, SLOT( showTileScale() ) );
903896
connect( mActionLayerProperties, SIGNAL( triggered() ), this, SLOT( layerProperties() ) );
904897
connect( mActionLayerSubsetString, SIGNAL( triggered() ), this, SLOT( layerSubsetString() ) );
905898
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( isInOverview() ) );
@@ -2072,17 +2065,6 @@ void QgisApp::saveWindowState()
20722065
// store window geometry
20732066
settings.setValue( "/UI/geometry", saveGeometry() );
20742067

2075-
// Persist state of tile scale slider
2076-
if ( mpTileScaleWidget )
2077-
{
2078-
settings.setValue( "/UI/tileScaleEnabled", true );
2079-
delete mpTileScaleWidget;
2080-
}
2081-
else
2082-
{
2083-
settings.setValue( "/UI/tileScaleEnabled", false );
2084-
}
2085-
20862068
QgsPluginRegistry::instance()->unloadAll();
20872069
}
20882070

@@ -4854,32 +4836,6 @@ void QgisApp::setProjectCRSFromLayer()
48544836
mMapCanvas->refresh();
48554837
}
48564838

4857-
void QgisApp::showTileScale()
4858-
{
4859-
if ( !mpTileScaleWidget )
4860-
{
4861-
mpTileScaleWidget = new QgsTileScaleWidget( mMapCanvas );
4862-
//create the dock widget
4863-
mpTileScaleDock = new QDockWidget( tr( "Tile scale" ), this );
4864-
mpTileScaleDock->setObjectName( "TileScale" );
4865-
mpTileScaleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
4866-
addDockWidget( Qt::RightDockWidgetArea, mpTileScaleDock );
4867-
// add to the Panel submenu
4868-
mPanelMenu->addAction( mpTileScaleDock->toggleViewAction() );
4869-
// now add our widget to the dock - ownership of the widget is passed to the dock
4870-
mpTileScaleDock->setWidget( mpTileScaleWidget );
4871-
mpTileScaleDock->show();
4872-
4873-
connect( mMapLegend, SIGNAL( currentLayerChanged( QgsMapLayer* ) ),
4874-
mpTileScaleWidget, SLOT( layerChanged( QgsMapLayer* ) ) );
4875-
4876-
}
4877-
else
4878-
{
4879-
mpTileScaleDock->setVisible( mpTileScaleDock->isHidden() );
4880-
}
4881-
}
4882-
48834839
void QgisApp::zoomToLayerExtent()
48844840
{
48854841
mMapLegend->legendLayerZoom();

src/app/qgisapp.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class QgsRasterLayer;
5858
class QgsRectangle;
5959
class QgsUndoWidget;
6060
class QgsVectorLayer;
61-
class QgsTileScaleWidget;
6261

6362
class QDomDocument;
6463
class QNetworkReply;
@@ -289,7 +288,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
289288
QAction *actionRemoveLayer() { return mActionRemoveLayer; }
290289
QAction *actionSetLayerCRS() { return mActionSetLayerCRS; }
291290
QAction *actionSetProjectCRSFromLayer() { return mActionSetProjectCRSFromLayer; }
292-
QAction *actionTileScale() { return mActionTileScale; }
293291
QAction *actionLayerProperties() { return mActionLayerProperties; }
294292
QAction *actionLayerSubsetString() { return mActionLayerSubsetString; }
295293
QAction *actionAddToOverview() { return mActionAddToOverview; }
@@ -544,8 +542,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
544542
void setLayerCRS();
545543
//! Assign layer CRS to project
546544
void setProjectCRSFromLayer();
547-
//! Show tile scale slider
548-
void showTileScale();
549545
//! zoom to extent of layer
550546
void zoomToLayerExtent();
551547
//! zoom to actual size of raster layer
@@ -1005,7 +1001,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
10051001
QDockWidget *mLegendDock;
10061002
QDockWidget *mLayerOrderDock;
10071003
QDockWidget *mOverviewDock;
1008-
QDockWidget *mpTileScaleDock;
10091004
QDockWidget *mpGpsDock;
10101005
QDockWidget *mLogDock;
10111006

@@ -1173,9 +1168,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
11731168

11741169
QgsSnappingDialog* mSnappingDialog;
11751170

1176-
//! Persistent tile scale slider
1177-
QgsTileScaleWidget * mpTileScaleWidget;
1178-
11791171
QgsDecorationCopyright* mDecorationCopyright;
11801172
QgsDecorationNorthArrow* mDecorationNorthArrow;
11811173
QgsDecorationScaleBar* mDecorationScaleBar;

src/core/qgscoordinatereferencesystem.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,25 @@ bool QgsCoordinateReferenceSystem::createFromString( const QString theDefinition
133133

134134
bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( QString theCrs )
135135
{
136-
QRegExp re( "(user|custom|qgis):(\\d+)", Qt::CaseInsensitive );
137-
if ( re.exactMatch( theCrs ) && createFromSrsId( re.cap( 2 ).toInt() ) )
136+
QRegExp re( "urn:ogc:def:crs:([^:]+).+([^:]+)", Qt::CaseInsensitive );
137+
if ( re.exactMatch( theCrs ) )
138138
{
139-
return true;
139+
theCrs = re.cap( 1 ) + ":" + re.cap( 2 );
140+
}
141+
else
142+
{
143+
re.setPattern( "(user|custom|qgis):(\\d+)" );
144+
if ( re.exactMatch( theCrs ) && createFromSrsId( re.cap( 2 ).toInt() ) )
145+
{
146+
return true;
147+
}
140148
}
141149

142150
if ( loadFromDb( QgsApplication::srsDbFilePath(), "lower(auth_name||':'||auth_id)", theCrs.toLower() ) )
143151
return true;
144152

145-
if ( theCrs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 )
153+
if ( theCrs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 ||
154+
theCrs.compare( "OGC:CRS84", Qt::CaseInsensitive ) == 0 )
146155
{
147156
createFromSrsId( GEOCRS_ID );
148157
return true;

src/core/qgsproviderregistry.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,20 +436,15 @@ typedef QWidget * selectFactoryFunction_t( QWidget * parent, Qt::WFlags fl );
436436
QWidget* QgsProviderRegistry::selectWidget( const QString & providerKey,
437437
QWidget * parent, Qt::WFlags fl )
438438
{
439-
QLibrary *myLib = providerLibrary( providerKey );
440-
if ( !myLib )
441-
return 0;
442-
443439
selectFactoryFunction_t * selectFactory =
444-
( selectFactoryFunction_t * ) cast_to_fptr( myLib->resolve( "selectWidget" ) );
440+
( selectFactoryFunction_t * ) cast_to_fptr( function( providerKey, "selectWidget" ) );
445441

446442
if ( !selectFactory )
447443
return 0;
448444

449445
return selectFactory( parent, fl );
450446
}
451447

452-
453448
void * QgsProviderRegistry::function( QString const & providerKey,
454449
QString const & functionName )
455450
{
@@ -489,6 +484,21 @@ QLibrary *QgsProviderRegistry::providerLibrary( QString const & providerKey ) co
489484
return 0;
490485
}
491486

487+
void QgsProviderRegistry::registerGuis( QWidget *parent )
488+
{
489+
typedef void registerGui_function( QWidget * parent );
490+
491+
foreach( const QString &provider, providerList() )
492+
{
493+
registerGui_function *registerGui = ( registerGui_function * ) cast_to_fptr( function( provider, "registerGui" ) );
494+
495+
if ( !registerGui )
496+
continue;
497+
498+
registerGui( parent );
499+
}
500+
}
501+
492502
QString QgsProviderRegistry::fileVectorFilters() const
493503
{
494504
return mVectorFileFilters;

src/core/qgsproviderregistry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ class CORE_EXPORT QgsProviderRegistry
140140
/** type for data provider metadata associative container */
141141
typedef std::map<QString, QgsProviderMetadata*> Providers;
142142

143+
void registerGuis( QWidget *widget );
144+
143145
private:
144146

145147
/** ctor private since instance() creates it */

src/gui/qgsmapcanvas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
8383
, mPainting( false )
8484
, mAntiAliasing( false )
8585
{
86-
Q_UNUSED( name );
86+
setObjectName( name );
8787
//disable the update that leads to the resize crash
8888
if ( viewport() )
8989
{

src/providers/wms/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ SET (WMS_SRCS
44
qgswmssourceselect.cpp
55
qgswmsconnection.cpp
66
qgswmsdataitems.cpp
7+
qgstilescalewidget.cpp
8+
qgswmtsdimensions.cpp
79
)
810
SET (WMS_MOC_HDRS
911
qgswmsprovider.h
1012
qgswmssourceselect.h
1113
qgswmsconnection.h
1214
qgswmsdataitems.h
15+
qgstilescalewidget.h
16+
qgswmtsdimensions.h
1317
)
1418

1519
QT4_WRAP_CPP (WMS_MOC_SRCS ${WMS_MOC_HDRS})

0 commit comments

Comments
 (0)