Skip to content

Commit 2130b02

Browse files
committedMay 13, 2012
[FEATURE] WMTS
1 parent 27fc1d0 commit 2130b02

18 files changed

+2450
-860
lines changed
 

‎scripts/prepare-commit.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ fi
3333

3434
# save original changes
3535
if [ -d .svn ]; then
36-
REV=$(svn info | sed -ne "s/Revision: //p")
37-
svn diff >r$REV.diff
36+
REV=r$(svn info | sed -ne "s/Revision: //p")
37+
svn diff >rev-$REV.diff
3838
elif [ -d .git ]; then
39-
REV=$(git svn info | sed -ne "s/Revision: //p")
40-
git diff >r$REV.diff
39+
REV=$(git log -n1 --pretty=%H)
40+
git diff >sha-$REV.diff
4141
fi
4242

4343
ASTYLEDIFF=astyle.r$REV.diff

‎src/app/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ SET(QGIS_APP_SRCS
8585
qgssinglesymboldialog.cpp
8686
qgssnappingdialog.cpp
8787
qgsundowidget.cpp
88-
qgstilescalewidget.cpp
8988
qgstipgui.cpp
9089
qgstipfactory.cpp
9190
qgsuniquevaluedialog.cpp
@@ -212,7 +211,6 @@ SET (QGIS_APP_MOC_HDRS
212211
qgssnappingdialog.h
213212
qgssponsors.h
214213
qgstextannotationdialog.h
215-
qgstilescalewidget.h
216214
qgstipgui.h
217215
qgstipfactory.h
218216
qgsundowidget.h

‎src/app/qgisapp.cpp

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@
155155
#include "qgssnappingdialog.h"
156156
#include "qgssponsors.h"
157157
#include "qgstextannotationitem.h"
158-
#include "qgstilescalewidget.h"
159158
#include "qgstipgui.h"
160159
#include "qgsundowidget.h"
161160
#include "qgsvectordataprovider.h"
@@ -375,7 +374,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
375374
, mSplash( splash )
376375
, mShowProjectionTab( false )
377376
, mPythonUtils( NULL )
378-
, mpTileScaleWidget( NULL )
379377
#ifdef Q_OS_WIN
380378
, mSkipNextContextMenuEvent( 0 )
381379
#endif
@@ -577,6 +575,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
577575
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
578576
QgsApplication::setFileOpenEventReceiver( this );
579577

578+
QgsProviderRegistry::instance()->registerGuis( this );
579+
580580
// update windows
581581
qApp->processEvents();
582582

@@ -694,11 +694,6 @@ void QgisApp::readSettings()
694694
// Add the recently accessed project file paths to the File menu
695695
mRecentProjectPaths = settings.value( "/UI/recentProjectsList" ).toStringList();
696696

697-
// Restore state of tile scale widget
698-
if ( settings.value( "/UI/tileScaleEnabled", false ).toBool() )
699-
{
700-
showTileScale();
701-
}
702697
// Restore state of GPS Tracker
703698
if ( settings.value( "/gps/widgetEnabled", false ).toBool() )
704699
{
@@ -800,7 +795,6 @@ void QgisApp::createActions()
800795
connect( mActionRemoveLayer, SIGNAL( triggered() ), this, SLOT( removeLayer() ) );
801796
connect( mActionSetLayerCRS, SIGNAL( triggered() ), this, SLOT( setLayerCRS() ) );
802797
connect( mActionSetProjectCRSFromLayer, SIGNAL( triggered() ), this, SLOT( setProjectCRSFromLayer() ) );
803-
connect( mActionTileScale, SIGNAL( triggered() ), this, SLOT( showTileScale() ) );
804798
connect( mActionGpsTool, SIGNAL( triggered() ), this, SLOT( showGpsTool() ) );
805799
connect( mActionLayerProperties, SIGNAL( triggered() ), this, SLOT( layerProperties() ) );
806800
connect( mActionLayerSubsetString, SIGNAL( triggered() ), this, SLOT( layerSubsetString() ) );
@@ -1850,17 +1844,6 @@ void QgisApp::saveWindowState()
18501844
// store window geometry
18511845
settings.setValue( "/UI/geometry", saveGeometry() );
18521846

1853-
// Persist state of tile scale slider
1854-
if ( mpTileScaleWidget )
1855-
{
1856-
settings.setValue( "/UI/tileScaleEnabled", true );
1857-
delete mpTileScaleWidget;
1858-
}
1859-
else
1860-
{
1861-
settings.setValue( "/UI/tileScaleEnabled", false );
1862-
}
1863-
18641847
// Persist state of GPS Tracker
18651848
if ( mpGpsWidget )
18661849
{
@@ -4503,32 +4486,6 @@ void QgisApp::showGpsTool()
45034486
}
45044487
}
45054488

4506-
void QgisApp::showTileScale()
4507-
{
4508-
if ( !mpTileScaleWidget )
4509-
{
4510-
mpTileScaleWidget = new QgsTileScaleWidget( mMapCanvas );
4511-
//create the dock widget
4512-
mpTileScaleDock = new QDockWidget( tr( "Tile scale" ), this );
4513-
mpTileScaleDock->setObjectName( "TileScale" );
4514-
mpTileScaleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
4515-
addDockWidget( Qt::RightDockWidgetArea, mpTileScaleDock );
4516-
// add to the Panel submenu
4517-
mPanelMenu->addAction( mpTileScaleDock->toggleViewAction() );
4518-
// now add our widget to the dock - ownership of the widget is passed to the dock
4519-
mpTileScaleDock->setWidget( mpTileScaleWidget );
4520-
mpTileScaleDock->show();
4521-
4522-
connect( mMapLegend, SIGNAL( currentLayerChanged( QgsMapLayer* ) ),
4523-
mpTileScaleWidget, SLOT( layerChanged( QgsMapLayer* ) ) );
4524-
4525-
}
4526-
else
4527-
{
4528-
mpTileScaleDock->setVisible( mpTileScaleDock->isHidden() );
4529-
}
4530-
}
4531-
45324489
void QgisApp::zoomToLayerExtent()
45334490
{
45344491
mMapLegend->legendLayerZoom();

‎src/app/qgisapp.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class QgsRasterLayer;
5959
class QgsRectangle;
6060
class QgsUndoWidget;
6161
class QgsVectorLayer;
62-
class QgsTileScaleWidget;
6362

6463
class QDomDocument;
6564
class QNetworkReply;
@@ -277,7 +276,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
277276
QAction *actionRemoveLayer() { return mActionRemoveLayer; }
278277
QAction *actionSetLayerCRS() { return mActionSetLayerCRS; }
279278
QAction *actionSetProjectCRSFromLayer() { return mActionSetProjectCRSFromLayer; }
280-
QAction *actionTileScale() { return mActionTileScale; }
281279
QAction *actionGpsTool() { return mActionGpsTool; }
282280
QAction *actionLayerProperties() { return mActionLayerProperties; }
283281
QAction *actionLayerSubsetString() { return mActionLayerSubsetString; }
@@ -487,8 +485,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
487485
void setProjectCRSFromLayer();
488486
//! Show GPS tool
489487
void showGpsTool();
490-
//! Show tile scale slider
491-
void showTileScale();
492488
//! zoom to extent of layer
493489
void zoomToLayerExtent();
494490
//! zoom to actual size of raster layer
@@ -904,7 +900,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
904900
// docks ------------------------------------------
905901
QDockWidget *mLegendDock;
906902
QDockWidget *mOverviewDock;
907-
QDockWidget *mpTileScaleDock;
908903
QDockWidget *mpGpsDock;
909904

910905

@@ -1063,9 +1058,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
10631058

10641059
QgsSnappingDialog* mSnappingDialog;
10651060

1066-
//! Persistent tile scale slider
1067-
QgsTileScaleWidget * mpTileScaleWidget;
1068-
10691061
int mLastComposerId;
10701062

10711063
#ifdef Q_OS_WIN

‎src/core/qgscoordinatereferencesystem.cpp

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

129129
bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( QString theCrs )
130130
{
131-
QRegExp re( "(user|custom|qgis):(\\d+)", Qt::CaseInsensitive );
132-
if ( re.exactMatch( theCrs ) && createFromSrsId( re.cap( 2 ).toInt() ) )
131+
QRegExp re( "urn:ogc:def:crs:([^:]+).+([^:]+)", Qt::CaseInsensitive );
132+
if ( re.exactMatch( theCrs ) )
133133
{
134-
return true;
134+
theCrs = re.cap( 1 ) + ":" + re.cap( 2 );
135+
}
136+
else
137+
{
138+
re.setPattern( "(user|custom|qgis):(\\d+)" );
139+
if ( re.exactMatch( theCrs ) && createFromSrsId( re.cap( 2 ).toInt() ) )
140+
{
141+
return true;
142+
}
135143
}
136144

137145
if ( loadFromDb( QgsApplication::srsDbFilePath(), "lower(auth_name||':'||auth_id)", theCrs.toLower() ) )
138146
return true;
139147

140-
if ( theCrs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 )
148+
if ( theCrs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 ||
149+
theCrs.compare( "OGC:CRS84", Qt::CaseInsensitive ) == 0 )
141150
{
142151
createFromSrsId( GEOCRS_ID );
143152
return true;

‎src/core/qgsproviderregistry.h

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

129+
void registerGuis( QWidget *widget );
130+
129131
private:
130132

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

‎src/gui/qgsmapcanvas.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
8484
, mPainting( false )
8585
, mAntiAliasing( false )
8686
{
87+
setObjectName( name );
8788
//disable the update that leads to the resize crash
8889
if ( viewport() )
8990
{

‎src/providers/wms/CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
2-
SET (WMS_SRCS qgswmsprovider.cpp)
3-
SET (WMS_MOC_HDRS qgswmsprovider.h)
1+
SET (WMS_SRCS
2+
qgswmsprovider.cpp
3+
qgswmssourceselect.cpp
4+
qgswmsconnection.cpp
5+
qgswmsdataitems.cpp
6+
qgstilescalewidget.cpp
7+
qgswmtsdimensions.cpp
8+
)
9+
SET (WMS_MOC_HDRS
10+
qgswmsprovider.h
11+
qgswmssourceselect.h
12+
qgswmsconnection.h
13+
qgswmsdataitems.h
14+
qgstilescalewidget.h
15+
qgswmtsdimensions.h
16+
)
417

518
QT4_WRAP_CPP (WMS_MOC_SRCS ${WMS_MOC_HDRS})
619

0 commit comments

Comments
 (0)
Please sign in to comment.