Showing with 544 additions and 1,176 deletions.
  1. +20 −3 CMakeLists.txt
  2. +3 −0 images/images.qrc
  3. BIN images/themes/classic/mActionTouch.png
  4. BIN images/themes/default/mActionTouch.png
  5. BIN images/themes/gis/mActionTouch.png
  6. +1 −0 ms-windows/python_plugins.nsh
  7. +11 −4 python/plugins/fTools/tools/doDefineProj.py
  8. +78 −21 src/app/qgisapp.cpp
  9. +23 −4 src/app/qgisapp.h
  10. +1 −0 src/app/qgsattributetabledialog.cpp
  11. +3 −0 src/app/qgsmaptooloffsetcurve.cpp
  12. +7 −1 src/app/qgsoptions.cpp
  13. +4 −0 src/app/qgspluginregistry.cpp
  14. +7 −1 src/core/qgsvectorlayer.cpp
  15. +14 −0 src/gui/CMakeLists.txt
  16. +25 −0 src/gui/qgsmapcanvas.cpp
  17. +9 −0 src/gui/qgsmapcanvas.h
  18. +7 −0 src/gui/qgsmaptool.cpp
  19. +9 −0 src/gui/qgsmaptool.h
  20. +129 −0 src/gui/qgsmaptooltouch.cpp
  21. +62 −0 src/gui/qgsmaptooltouch.h
  22. +0 −2 src/mapserver/CMakeLists.txt
  23. +21 −46 src/mapserver/qgssldparser.cpp
  24. +2 −2 src/mapserver/qgssldparser.h
  25. +0 −131 src/mapserver/qgssldrenderer.cpp
  26. +0 −71 src/mapserver/qgssldrenderer.h
  27. +0 −786 src/mapserver/qgssldrule.cpp
  28. +0 −91 src/mapserver/qgssldrule.h
  29. +3 −2 src/plugins/compass/compass.cpp
  30. +8 −0 src/providers/grass/qgsgrass.cpp
  31. +28 −6 src/providers/grass/qgsgrassprovider.cpp
  32. +1 −0 src/providers/grass/qgsgrassprovider.h
  33. +42 −0 src/providers/mssql/qgsmssqlprovider.cpp
  34. +0 −1 src/providers/postgres/qgspgtablemodel.cpp
  35. +16 −0 src/ui/qgisapp.ui
  36. +7 −0 src/ui/qgsattributetabledialog.ui
  37. +0 −1 src/ui/qgsfieldcalculatorbase.ui
  38. +1 −1 src/ui/qgsnewogrconnectionbase.ui
  39. +1 −1 src/ui/qgsprojectpropertiesbase.ui
  40. +1 −1 src/ui/qgsvectorlayerpropertiesbase.ui
23 changes: 20 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,30 @@ IF (ANDROID)
ELSE (ANDROID)
SET (DEFAULT_WITH_QTMOBILITY FALSE)
ENDIF (ANDROID)
SET (WITH_QTMOBILITY ${DEFAULT_WITH_QTMOBILITY} CACHE BOOL "Determines QtMobility related code should be build (for example internal GPS)")
SET (WITH_QTMOBILITY ${DEFAULT_WITH_QTMOBILITY} CACHE BOOL "Determines if QtMobility related code should be build (for example internal GPS)")
IF (WITH_QTMOBILITY)
FIND_PACKAGE(QtMobility 1.1.0)
ENDIF (WITH_QTMOBILITY)

IF (ANDROID)
SET (DEFAULT_WITH_TOUCH TRUE)
ELSE (ANDROID)
SET (DEFAULT_WITH_TOUCH FALSE)
ENDIF (ANDROID)
#Add a touch mode if Qt has Qt Gestures (starting from 4.6)
IF ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
SET (WITH_TOUCH ${DEFAULT_WITH_TOUCH} CACHE BOOL "Determines if touch interface related code should be build")
ELSE ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
SET (WITH_TOUCH FALSE)
ENDIF ( (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 5) OR QT_VERSION_MAJOR GREATER 4 )
IF (WITH_TOUCH)
ADD_DEFINITIONS(-DHAVE_TOUCH)
MESSAGE (STATUS "Touch support enabled")
ELSE (WITH_TOUCH)
MESSAGE (STATUS "Touch support disabled")
ENDIF (WITH_TOUCH)


SET (WITH_GLOBE FALSE CACHE BOOL "Determines whether Globe plugin should be built")
IF (WITH_GLOBE)
SET(QT_USE_QTOPENGL 1)
Expand Down Expand Up @@ -472,9 +491,7 @@ LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src/core ${CMAKE_BINARY_DIR}/src/gui)

#############################################################
# create qgsversion.h

FIND_FILE(GIT_MARKER index PATHS ${CMAKE_SOURCE_DIR}/.git)

IF (GIT_MARKER)
FIND_PROGRAM(GIT git PATHS c:/cygwin/bin)
IF(GIT)
Expand Down
3 changes: 3 additions & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@
<file>themes/gis/mIconMssql.png</file>
<file>themes/gis/mIconConnect.png</file>
<file>themes/gis/mIconDbSchema.png</file>
<file>themes/gis/mActionTouch.png</file>
<file>themes/default/mActionAddMssqlLayer.png</file>
<file>themes/default/mActionTouch.png</file>
<file>themes/classic/mActionTouch.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
Binary file added images/themes/classic/mActionTouch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/mActionTouch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/gis/mActionTouch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ms-windows/python_plugins.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

WriteRegStr HKEY_CURRENT_USER "Software\QuantumGIS\QGIS\PythonPlugins" "plugin_installer" "true"
WriteRegStr HKEY_CURRENT_USER "Software\QuantumGIS\QGIS\PythonPlugins" "fTools" "true"
WriteRegStr HKEY_CURRENT_USER "Software\QuantumGIS\QGIS\PythonPlugins" "GdalTools" "true"
WriteRegStr HKEY_CURRENT_USER "Software\QuantumGIS\QGIS\PythonPlugins" "mapserver_export" "true"

############################### reg2nsis end #################################
15 changes: 11 additions & 4 deletions python/plugins/fTools/tools/doDefineProj.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ def updateProj1(self, layerName):
self.inRef.clear()
tempLayer = ftools_utils.getVectorLayerByName(layerName)
crs = tempLayer.dataProvider().crs()
self.inRef.insert(crs.authid() + " - " + crs.description())
if crs.isValid():
self.inRef.insert(crs.authid() + " - " + crs.description())
else:
self.inRef.insert( self.tr( "Missing or invalid CRS" ) )

def updateProj2(self, layerName):
self.outRef.clear()
tempLayer = ftools_utils.getVectorLayerByName(layerName)
crs = tempLayer.dataProvider().crs()
self.outRef.insert(crs.authid() + " - " + crs.description())
if crs.isValid():
self.outRef.insert(crs.authid() + " - " + crs.description())
else:
self.outRef.insert( self.tr( "Missing or invalid CRS" ) )

def accept(self):
self.buttonOk.setEnabled( False )
Expand All @@ -90,8 +96,9 @@ def accept(self):
else:
srsDefine = QgsCoordinateReferenceSystem()
if self.rdoProjection.isChecked():
outProj = self.txtProjection.text()
srsDefine.createFromProj4(outProj)
outProj = self.txtProjection.text().split( " - " )[ 0 ]
#srsDefine.createFromProj4(outProj)
srsDefine.createFromString(outProj)
else:
destLayer = ftools_utils.getVectorLayerByName(self.cmbLayer.currentText())
srsDefine = destLayer.crs()
Expand Down
99 changes: 78 additions & 21 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ extern "C"
#include <windows.h>
#endif

#ifdef HAVE_TOUCH
#include "qgsmaptooltouch.h"
#endif

class QTreeWidgetItem;


Expand Down Expand Up @@ -317,14 +321,24 @@ static QgsMessageOutput *messageOutputViewer_()
return new QgsMessageViewer( QgisApp::instance() );
}

static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
{
QgisApp::instance()->emitCustomSrsValidation( srs );
}

void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
{
emit customSrsValidation( srs );
}

/**
* This function contains forced validation of CRS used in QGIS.
* There are 3 options depending on the settings:
* - ask for CRS using projection selecter
* - use project's CRS
* - use predefined global CRS
*/
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
{
static QString authid = QString::null;
QSettings mySettings;
Expand Down Expand Up @@ -510,6 +524,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
QgsMessageLog::logMessage( tr( "QGIS starting..." ) );

// set QGIS specific srs validation
connect( this, SIGNAL( customSrsValidation( QgsCoordinateReferenceSystem * ) ),
this, SLOT( validateSrs( QgsCoordinateReferenceSystem * ) ) );
QgsCoordinateReferenceSystem::setCustomSrsValidation( customSrsValidation_ );

// set graphical message output
Expand Down Expand Up @@ -626,7 +642,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
QgsApplication::setFileOpenEventReceiver( this );

#ifdef ANDROID
#ifdef HAVE_TOUCH
//add reacting to long click in android
grabGesture( Qt::TapAndHoldGesture );
#endif
Expand All @@ -646,6 +662,9 @@ QgisApp::~QgisApp()
delete mMapTools.mZoomIn;
delete mMapTools.mZoomOut;
delete mMapTools.mPan;
#ifdef HAVE_TOUCH
delete mMapTools.mTouch;
#endif
delete mMapTools.mIdentify;
delete mMapTools.mFeatureAction;
delete mMapTools.mMeasureDist;
Expand Down Expand Up @@ -741,8 +760,8 @@ bool QgisApp::event( QEvent * event )
openFile( foe->file() );
done = true;
}
#ifdef ANDROID
else if ( event->type() == QEvent::Gesture )
#ifdef HAVE_TOUCH
else if (event->type() == QEvent::Gesture )
{
done = gestureEvent( static_cast<QGestureEvent*>( event ) );
}
Expand Down Expand Up @@ -820,6 +839,9 @@ void QgisApp::createActions()

// View Menu Items

#ifdef HAVE_TOUCH
connect( mActionTouch, SIGNAL( triggered() ), this, SLOT( touch() ) );
#endif
connect( mActionPan, SIGNAL( triggered() ), this, SLOT( pan() ) );
connect( mActionPanToSelected, SIGNAL( triggered() ), this, SLOT( panToSelected() ) );
connect( mActionZoomIn, SIGNAL( triggered() ), this, SLOT( zoomIn() ) );
Expand Down Expand Up @@ -1009,6 +1031,9 @@ void QgisApp::createActionGroups()
//
// Map Tool Group
mMapToolGroup = new QActionGroup( this );
#ifdef HAVE_TOUCH
mMapToolGroup->addAction( mActionTouch );
#endif
mMapToolGroup->addAction( mActionPan );
mMapToolGroup->addAction( mActionZoomIn );
mMapToolGroup->addAction( mActionZoomOut );
Expand Down Expand Up @@ -1520,6 +1545,9 @@ void QgisApp::setTheme( QString theThemeName )
mActionZoomOut->setIcon( getThemeIcon( "/mActionZoomOut.png" ) );
mActionZoomFullExtent->setIcon( getThemeIcon( "/mActionZoomFullExtent.png" ) );
mActionZoomToSelected->setIcon( getThemeIcon( "/mActionZoomToSelected.png" ) );
#ifdef HAVE_TOUCH
mActionTouch->setIcon( getThemeIcon( "/mActionTouch.png" ) );
#endif
mActionPan->setIcon( getThemeIcon( "/mActionPan.png" ) );
mActionZoomLast->setIcon( getThemeIcon( "/mActionZoomLast.png" ) );
mActionZoomNext->setIcon( getThemeIcon( "/mActionZoomNext.png" ) );
Expand Down Expand Up @@ -1652,6 +1680,10 @@ void QgisApp::createCanvasTools()
mMapTools.mZoomOut->setAction( mActionZoomOut );
mMapTools.mPan = new QgsMapToolPan( mMapCanvas );
mMapTools.mPan->setAction( mActionPan );
#ifdef HAVE_TOUCH
mMapTools.mTouch = new QgsMapToolTouch( mMapCanvas );
mMapTools.mTouch->setAction( mActionTouch );
#endif
mMapTools.mIdentify = new QgsMapToolIdentify( mMapCanvas );
mMapTools.mIdentify->setAction( mActionIdentify );
mMapTools.mFeatureAction = new QgsMapToolFeatureAction( mMapCanvas );
Expand Down Expand Up @@ -1717,6 +1749,9 @@ void QgisApp::createCanvasTools()
mMapTools.mChangeLabelProperties->setAction( mActionChangeLabelProperties );
//ensure that non edit tool is initialised or we will get crashes in some situations
mNonEditMapTool = mMapTools.mPan;
//#ifdef HAVE_TOUCH
// mNonEditMapTool = mMapTools.mTouch;
//#endif
}

void QgisApp::createOverview()
Expand Down Expand Up @@ -2269,10 +2304,11 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
// present a dialog to choose GDAL raster sublayers
void QgisApp::askUserForGDALSublayers( QgsRasterLayer *layer )
{
if ( !layer || layer->subLayers().size() < 1 )
if ( !layer )
return;

QStringList sublayers = layer->subLayers();

QgsDebugMsg( "sublayers:\n " + sublayers.join( " \n" ) + "\n" );

// if promptLayers=Load all, load all sublayers without prompting
Expand All @@ -2297,7 +2333,16 @@ void QgisApp::askUserForGDALSublayers( QgsRasterLayer *layer )

if ( chooseSublayersDialog.exec() )
{
loadGDALSublayers( layer->source(), chooseSublayersDialog.getSelection() );
foreach( QString path, chooseSublayersDialog.getSelection() )
{
QString name = path;
name.replace( layer->source(), QFileInfo( layer->source() ).completeBaseName() );
QgsRasterLayer *rlayer = new QgsRasterLayer( path, name );
if ( rlayer && rlayer->isValid() )
{
addRasterLayer( rlayer );
}
}
}
}

Expand All @@ -2310,9 +2355,11 @@ bool QgisApp::shouldAskUserForGDALSublayers( QgsRasterLayer *layer )

QSettings settings;
int promptLayers = settings.value( "/qgis/promptForRasterSublayers", 1 ).toInt();
// 0 = always -> always ask (if there are existing sublayers)
// 1 = if needed -> ask if layer has no bands, but has sublayers
// 2 = never

// return true if promptLayers=Always or if promptLayers!=Never and there are no bands
return promptLayers == 0 || ( promptLayers != 2 && layer->bandCount() == 0 );
return promptLayers == 0 || ( promptLayers == 1 && layer->bandCount() == 0 );
}

// This method will load with GDAL the layers in parameter.
Expand Down Expand Up @@ -2729,6 +2776,10 @@ void QgisApp::fileNew( bool thePromptToSaveFlag )
// set the initial map tool
mMapCanvas->setMapTool( mMapTools.mPan );
mNonEditMapTool = mMapTools.mPan; // signals are not yet setup to catch this
#ifdef HAVE_TOUCH
mMapCanvas->setMapTool( mMapTools.mTouch );
mNonEditMapTool = mMapTools.mTouch; // signals are not yet setup to catch this
#endif
} // QgisApp::fileNew(bool thePromptToSaveFlag)


Expand Down Expand Up @@ -2818,11 +2869,7 @@ void QgisApp::fileOpen()
deletePrintComposers();
removeAnnotationItems();
// clear out any stuff from previous project

//avoid multiple canvas redraws during loading of project files
bool bkRenderFlag = mMapCanvas->renderFlag();
mMapCanvas->setRenderFlag( false );

mMapCanvas->freeze( true );
removeAllLayers();

QgsProject::instance()->setFileName( fullPath );
Expand All @@ -2832,7 +2879,8 @@ void QgisApp::fileOpen()
QMessageBox::critical( this,
tr( "QGIS Project Read Error" ),
QgsProject::instance()->error() );
mMapCanvas->setRenderFlag( bkRenderFlag );
mMapCanvas->freeze( false );
mMapCanvas->refresh();
return;
}

Expand All @@ -2844,7 +2892,8 @@ void QgisApp::fileOpen()
// add this to the list of recently used project files
saveRecentProjectPath( fullPath, settings );

mMapCanvas->setRenderFlag( bkRenderFlag );
mMapCanvas->freeze( false );
mMapCanvas->refresh();
}

} // QgisApp::fileOpen
Expand All @@ -2856,8 +2905,7 @@ void QgisApp::fileOpen()
*/
bool QgisApp::addProject( QString projectFile )
{
bool bkRenderFlag = mMapCanvas->renderFlag();
mMapCanvas->setRenderFlag( false );
mMapCanvas->freeze( true );

QApplication::setOverrideCursor( Qt::WaitCursor );

Expand All @@ -2875,7 +2923,8 @@ bool QgisApp::addProject( QString projectFile )

QApplication::restoreOverrideCursor();

mMapCanvas->setRenderFlag( bkRenderFlag );
mMapCanvas->freeze( false );
mMapCanvas->refresh();
return false;
}

Expand Down Expand Up @@ -2911,7 +2960,8 @@ bool QgisApp::addProject( QString projectFile )

QApplication::restoreOverrideCursor();

mMapCanvas->setRenderFlag( bkRenderFlag );
mMapCanvas->freeze( false );
mMapCanvas->refresh();
return true;
} // QgisApp::addProject(QString projectFile)

Expand Down Expand Up @@ -3359,6 +3409,13 @@ void QgisApp::pan()
mMapCanvas->setMapTool( mMapTools.mPan );
}

#ifdef HAVE_TOUCH
void QgisApp::touch()
{
mMapCanvas->setMapTool( mMapTools.mTouch );
}
#endif

void QgisApp::zoomFull()
{
mMapCanvas->zoomToFullExtent();
Expand Down Expand Up @@ -7066,8 +7123,8 @@ QMenu* QgisApp::createPopupMenu()
return menu;
}

#ifdef ANDROID
bool QgisApp::gestureEvent( QGestureEvent *event )
#ifdef HAVE_TOUCH
bool QgisApp::gestureEvent(QGestureEvent *event)
{
if ( QGesture *tapAndHold = event->gesture( Qt::TapAndHoldGesture ) )
{
Expand Down
Loading