185,758 changes: 98,807 additions & 86,951 deletions ChangeLog

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
QGIS
Building QGIS from source - step by step
Saturday July 27, 2013
Tuesday September 10, 2013


Last Updated: Saturday July 27, 2013
Last Change : Saturday July 27, 2013
Last Updated: Tuesday September 10, 2013
Last Change : Tuesday September 10, 2013


1. Introduction
Expand Down Expand Up @@ -210,8 +210,8 @@ applications is used in all cases:
Use the simple command line dialog that appears after running each of the
above commands to select the Qt4 version of the relevant applications.

/!\ Note: For python language bindings SIP >= 4.8 and PyQt4 >= 4.1 is required! Some stable GNU/Linux
distributions (e.g. Debian or SuSE) only provide SIP < 4.8 and PyQt4 < 4.1. To include support for python
/!\ Note: For python language bindings SIP >= 4.5 and PyQt4 >= 4.1 is required! Some stable GNU/Linux
distributions (e.g. Debian or SuSE) only provide SIP < 4.5 and PyQt4 < 4.1. To include support for python
language bindings you may need to build and install those packages from source.


Expand Down
287 changes: 177 additions & 110 deletions NEWS

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ daily GIS data viewing and editing needs. QGIS supports a number of raster
and vector data formats, with new support easily added using the plugin
architecture.

QGIS is released under the GNU Public License (GPL) Version 3. Developing
QGIS is released under the GNU Public License (GPL) Version 2. Developing
QGIS under this license means that you can (if you want to) inspect and
modify the source code and guarantees that you, our happy user will always
have access to a GIS program that is free of cost and can be freely
Expand Down
7 changes: 4 additions & 3 deletions cmake/FindPythonLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

INCLUDE(CMakeFindFrameworks)

if(EXISTS PYTHON_LIBRARY)
if(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}")
# Already in cache, be silent
set(PYTHONLIBRARY_FOUND TRUE)
else(EXISTS PYTHON_LIBRARY)
else(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}")

set(_custom_python_fw FALSE)
if(APPLE AND PYTHON_CUSTOM_FRAMEWORK)
Expand Down Expand Up @@ -69,6 +69,7 @@ else(EXISTS PYTHON_LIBRARY)
STRING(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR})
endif(WIN32)
FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH)
set(PYTHON_INCLUDE_PATH ${PYTHON_INCLUDE_PATH} CACHE FILEPATH "Directory holding the python.h include file" FORCE)
set(PYTHONLIBRARY_FOUND TRUE)
endif(python_config)

Expand Down Expand Up @@ -109,4 +110,4 @@ else(EXISTS PYTHON_LIBRARY)
endif(PYTHONLIBRARY_FIND_REQUIRED)
endif(PYTHONLIBRARY_FOUND)

endif (EXISTS PYTHON_LIBRARY)
endif (EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}")
4 changes: 2 additions & 2 deletions cmake/FindQtMobility.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INCLUDE(FindQt4)
#INCLUDE(FindQt4)

set(MOBILITY_CONFIG_MKSPECS_FILE "")
IF(EXISTS "${QT_MKSPECS_DIR}/features/mobilityconfig.prf")
Expand All @@ -15,7 +15,7 @@ macro(export_component component)
STRING(TOUPPER ${component} _COMPONENT)
SET(QT_MOBILITY_${_COMPONENT}_FOUND 1)
SET(QT_MOBILITY_${_COMPONENT}_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/Qt${component})
SET(QT_MOBILITY_${_COMPONENT}_LIBRARY Qt${component})
SET(QT_MOBILITY_${_COMPONENT}_LIBRARY ${QT_LIBRARY_DIR}/libQt${component}.so)
ADD_DEFINITIONS(-DHAVE_QT_MOBILITY_${_COMPONENT})
ENDIF()
ENDIF()
Expand Down
93 changes: 92 additions & 1 deletion doc/news.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Change history for the QGIS Project

%! target : html
%! style : style.css
%! Options : --toc --toc-level 2 --enum-title --css-sugar --css-inside
%! Options : --toc --toc-level 1 --enum-title --css-sugar --css-inside
%! preproc : TUT_URL https://qgis.org
%! PostProc(html): '(?i)(<pre>)' '<div class="code">\1'
%! PostProc(html): '(?i)(</pre>)' '\1</div>'
Expand Down Expand Up @@ -38,6 +38,97 @@ Change history for the QGIS Project
Last Updated: %%date(%A %B %d, %Y)
Last Change : %%mtime(%A %B %d, %Y)

= Whats new in Version 2.0.1 'Dufour'? =

This is a small bugfix release to address the missing copyright / credits for
our new splash screen and to update supporting documentation. The spanish
translation was also updated.

= Whats new in Version 2.0.0 'Dufour'? =

This is a new major release. Building on the foundation of
QGIS 1.x.x releases, QGIS Dufour introduces many new features,
improvements and bug fixes. Here is a summary of some of the
key new features.

- We have updated out icon theme to use the 'GIS' theme which introduces
an improved level of consistency and professionalism to the QGIS user
interface.
- The new symbol layer overview uses a clear, tree-structured layout
which allows for easy and fast access to all symbol layers.
- QGIS 2.0 now includes Oracle Spatial support.
- With the new data defined properties, it is possible to control symbol
type, size, color, rotation, and many other properties through feature
attributes.
- You can now place html elements onto your map.
- Having nicely aligned map items is critical to making nice printed
maps. Auto snapping lines have been added to allow for easy composer
object alignment by simply dragging an object close to another.
- Sometimes you need to align objects a curtain distance on the composer.
With the new manual snapping lines you are able to add manual snap lines
which allow for better align objects using a common alignment. Simply
drag from the top or side ruler to add new guide line.
- Ever needed to generate a map series? Of course you have. The composer
now includes built in map series generation using the atlas feature.
Coverage layers can be points, lines, polygons, and the current feature
attribute data is available in labels for on the fly value replacement.
- A single composer window can now contain more then one page.
- The composer label item in 1.8 was quite limited and only allowed a single
token $CURRENT_DATE to be used. In 2.0 full expression support has been
added too greater power and control of the final labels.
- The map frame now contains the ability to show the extents of another
map and will update when moved. Using this with the atlas generation
feature now core in the composer allows for some slick map generation.
Overview frame style uses the same styling as a normal map polygon
object so your creativity is never restricted.
- Layer blending makes it possible to combine layers in new and exciting
ways. While in older versions, all you could do was to make the layer
transparent, you can now choose between much more advanced options such as
"multiply", "darken only", and many more. Blending can be used in the
normal map view as well as in print composer.
- HTML support has been added map composer label item to give you even
more control over your final maps. HTML labels support full css styles
sheets, html, and even javascript if you are that way inclined.
- The labelling system has been totally overhauled - it now includes many
new features such as drop shadows, 'highway shields', many more data bound
options, and various performance enhancements. We are slowly doing away
with the 'old labels' system, although you will still find that
functionality available for this release, you should expect that it will
disappear in a follow up release.
- The full power of normal label and rule expressions can now be used for
label properties. Nearly every property can be defined with an expression
or field value giving you more control over the label result. Expressions
can refer to a field (e.g. set the font size to the value of the field
'font') or can include more complex logic. Examples of bindable
properties include: Font, Size, Style and Buffer size.
- With the expression engine being used more and more though out QGIS to
allow for things like expression based labels and symbol, many more
functions have been added to the expression builder and are all accessible
though the expression builder. All functions include comprehensive help
and usage guides for ease of use.
- If the expression engine doesn't have the function that you need. Not to
worry. New functions can be added via a plugin using a simple Python API.
- The Python API has been revamped to allow for a more cleaner, more
pythonic, programming experience. The QGIS 2.0 API uses SIP V2 which
removes the messy toString(), toInt() logic that was needed when working
with values. Types are now converted into native Python types making for a
much nicer API. Attributes access is now done on the feature itself using
a simple key lookup, no more index lookup and attribute maps.
**Note:** Most plugins written for QGIS < 1.x will need to be
ported to work correctly in QGIS 2.x. Please consult
http://hub.qgis.org/wiki/quantum-gis/Python_plugin_API_changes_from_18_to_20
for more details.
- The raster data provider system has been completely overhauled. One of
the best new features stemming from this work is the ability to 'Layer ->
Save As...' to save any raster layer as a new layer. In the process you
can clip, resample, and reproject the layer to a new Coordinate Reference
System. You can also save a raster layer as a rendered image so if you for
example have single band raster that you have applied a colour palette to,
you can save the rendered layer out to a georeferenced RGB layer.
- There are many, many more new features in QGIS 2.0 - we invite
you to explore the software and discover them all!


= Whats new in Version 1.8.0 'Lisboa'? =

This is a new feature release. Building on the foundation of
Expand Down
2 changes: 1 addition & 1 deletion images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@
<file>themes/default/mActionSignMinus.png</file>
<file>themes/default/mActionSignPlus.png</file>
<file>themes/default/mActionSimplify.png</file>
<file>themes/default/mActionSplitFeatures.png</file>
<file>themes/default/mActionSplitFeatures.svg</file>
<file>themes/default/mActionSplitParts.svg</file>
<file>themes/default/mActionSum.png</file>
<file>themes/default/mActionTextAnnotation.png</file>
<file>themes/default/mActionToggleEditing.png</file>
Expand Down
Binary file removed images/themes/default/mActionSplitFeatures.png
Binary file not shown.
790 changes: 790 additions & 0 deletions images/themes/default/mActionSplitParts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
)

IF(NOT ANDROID)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ANDROID)
ENDIF(NOT ANDROID)

IF(NOT WITH_TOUCH)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_TOUCH)
ENDIF(NOT WITH_TOUCH)
Expand Down
2 changes: 2 additions & 0 deletions python/core/composer/qgscomposerscalebar.sip
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ class QgsComposerScaleBar: QgsComposerItem

/**Returns the x - positions of the segment borders (in item coordinates) and the width
of the segment*/
%If (!ANDROID)
void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;
%End

/**Sets box size suitable to content*/
void adjustBoxSize();
Expand Down
2 changes: 2 additions & 0 deletions python/core/gps/qgsqtlocationconnection.sip
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ class QgsQtLocationConnection: QgsGPSConnection
/**Called when the position updated.*/
// void positionUpdated( const QGeoPositionInfo &info );

%If (!ANDROID)
/**Called when the number of satellites in view is updated.*/
void satellitesInViewUpdated( const QList<QGeoSatelliteInfo>& satellites );

/**Called when the number of satellites in use is updated.*/
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );
%End
};
%End
6 changes: 6 additions & 0 deletions python/core/qgsapplication.sip
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%Feature ANDROID

class QgsApplication : QApplication
{
Expand Down Expand Up @@ -294,6 +295,11 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
* @note added in 2.0 */
static void applyGdalSkippedDrivers();


%If(ANDROID)
bool x11EventFilter ( XEvent * event );
%End

signals:
// void preNotify( QObject * receiver, QEvent * event, bool * done );
};
4 changes: 3 additions & 1 deletion python/core/qgsclipper.sip
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ class QgsClipper
// feature in x and y. The shapeOpen parameter determines whether
// the function treats the points as a closed shape (polygon), or as
// an open shape (linestring).

%If (!ANDROID)
static void trimFeature( QVector<double>& x,
QVector<double>& y,
bool shapeOpen );

%End
static void trimPolygon( QPolygonF& pts, const QgsRectangle& clipRect );

/**Reads a polyline from WKB and clips it to clipExtent
Expand Down
1 change: 1 addition & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ class QgisInterface : QObject
virtual QAction *actionDeleteSelected() = 0;
virtual QAction *actionMoveFeature() = 0;
virtual QAction *actionSplitFeatures() = 0;
virtual QAction *actionSplitParts() = 0;
virtual QAction *actionAddRing() = 0;
virtual QAction *actionAddPart() = 0;
virtual QAction *actionSimplifyFeature() = 0;
Expand Down
2 changes: 1 addition & 1 deletion python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def reloadProjectMacros():

from qgis.core import QgsProject
code, ok = QgsProject.instance().readEntry("Macros", "/pythonCode")
if not ok or code.isEmpty():
if not ok or not code or code == '':
return

# create a new empty python module
Expand Down
15 changes: 15 additions & 0 deletions scripts/create_changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
# Convert git log to GNU-style ChangeLog file.
# (C) Chris
if test -d ".git"; then
git log --date-order --date=short | \
sed -e '/^commit.*$/d' | \
awk '/^Author/ {sub(/\\$/,""); getline t; print $0 t; next}; 1' | \
sed -e 's/^Author: //g' | \
sed -e 's/>Date: \([0-9]*-[0-9]*-[0-9]*\)/>\t\1/g' | \
sed -e 's/^\(.*\) \(\)\t\(.*\)/\3 \1 \2/g' > ChangeLog
exit 0
else
echo "No git repository present."
exit 1
fi
2 changes: 2 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ SET(QGIS_APP_SRCS
qgsmaptoolselectutils.cpp
qgsmaptoolsimplify.cpp
qgsmaptoolsplitfeatures.cpp
qgsmaptoolsplitparts.cpp
qgsmaptoolsvgannotation.cpp
qgsmaptooltextannotation.cpp
qgsmaptoolvertexedit.cpp
Expand Down Expand Up @@ -226,6 +227,7 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolselectrectangle.h
qgsmaptoolsimplify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolsplitparts.h
qgsmaptoolvertexedit.h

nodetool/qgsmaptoolnodetool.h
Expand Down
6 changes: 6 additions & 0 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
{
connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument& ) ), this, SLOT( writeXML( QDomDocument& ) ) );
}

#if defined(ANDROID)
// fix for Qt Ministro hiding app's menubar in favor of native Android menus
menuBar()->setNativeMenuBar( false );
menuBar()->setVisible( true );
#endif
}

QgsComposer::~QgsComposer()
Expand Down
6 changes: 6 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,12 @@ int main( int argc, char *argv[] )
delete mypSplash;

qgis->completeInitialization();

#if defined(ANDROID)
// fix for Qt Ministro hiding app's menubar in favor of native Android menus
qgis->menuBar()->setNativeMenuBar( false );
qgis->menuBar()->setVisible( true );
#endif

int retval = myApp.exec();
delete qgis;
Expand Down
45 changes: 45 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
#include "qgsmaptoolreshape.h"
#include "qgsmaptoolrotatepointsymbols.h"
#include "qgsmaptoolsplitfeatures.h"
#include "qgsmaptoolsplitparts.h"
#include "qgsmaptooltextannotation.h"
#include "qgsmaptoolvertexedit.h"
#include "qgsmaptoolzoom.h"
Expand Down Expand Up @@ -738,6 +739,10 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
// should come after fileNewBlank to ensure project is properly set up to receive any data source files
QgsApplication::setFileOpenEventReceiver( this );

#ifdef ANDROID
toggleFullScreen();
#endif

} // QgisApp ctor

QgisApp::QgisApp( )
Expand Down Expand Up @@ -802,6 +807,7 @@ QgisApp::~QgisApp()
delete mMapTools.mShowHideLabels;
delete mMapTools.mSimplifyFeature;
delete mMapTools.mSplitFeatures;
delete mMapTools.mSplitParts;
delete mMapTools.mSvgAnnotation;
delete mMapTools.mTextAnnotation;

Expand Down Expand Up @@ -959,6 +965,7 @@ void QgisApp::createActions()

connect( mActionReshapeFeatures, SIGNAL( triggered() ), this, SLOT( reshapeFeatures() ) );
connect( mActionSplitFeatures, SIGNAL( triggered() ), this, SLOT( splitFeatures() ) );
connect( mActionSplitParts, SIGNAL( triggered() ), this, SLOT( splitParts() ) );
connect( mActionDeleteSelected, SIGNAL( triggered() ), this, SLOT( deleteSelected() ) );
connect( mActionAddRing, SIGNAL( triggered() ), this, SLOT( addRing() ) );
connect( mActionAddPart, SIGNAL( triggered() ), this, SLOT( addPart() ) );
Expand Down Expand Up @@ -1229,6 +1236,7 @@ void QgisApp::createActionGroups()
#endif
mMapToolGroup->addAction( mActionReshapeFeatures );
mMapToolGroup->addAction( mActionSplitFeatures );
mMapToolGroup->addAction( mActionSplitParts );
mMapToolGroup->addAction( mActionDeleteSelected );
mMapToolGroup->addAction( mActionAddRing );
mMapToolGroup->addAction( mActionAddPart );
Expand Down Expand Up @@ -1770,6 +1778,7 @@ void QgisApp::setTheme( QString theThemeName )
mActionRotateFeature->setIcon( QgsApplication::getThemeIcon( "/mActionRotateFeature.png" ) );
mActionReshapeFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionReshape.png" ) );
mActionSplitFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionSplitFeatures.svg" ) );
mActionSplitParts->setIcon( QgsApplication::getThemeIcon( "/mActionSplitParts.svg" ) );
mActionDeleteSelected->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.svg" ) );
mActionNodeTool->setIcon( QgsApplication::getThemeIcon( "/mActionNodeTool.png" ) );
mActionSimplifyFeature->setIcon( QgsApplication::getThemeIcon( "/mActionSimplify.png" ) );
Expand Down Expand Up @@ -1993,6 +2002,8 @@ void QgisApp::createCanvasTools()
mMapTools.mReshapeFeatures->setAction( mActionReshapeFeatures );
mMapTools.mSplitFeatures = new QgsMapToolSplitFeatures( mMapCanvas );
mMapTools.mSplitFeatures->setAction( mActionSplitFeatures );
mMapTools.mSplitParts = new QgsMapToolSplitParts( mMapCanvas );
mMapTools.mSplitParts->setAction( mActionSplitParts );
mMapTools.mSelect = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelect->setAction( mActionSelect );
mMapTools.mSelectRectangle = new QgsMapToolSelectRectangle( mMapCanvas );
Expand Down Expand Up @@ -5365,6 +5376,11 @@ void QgisApp::splitFeatures()
mMapCanvas->setMapTool( mMapTools.mSplitFeatures );
}

void QgisApp::splitParts()
{
mMapCanvas->setMapTool( mMapTools.mSplitParts );
}

void QgisApp::reshapeFeatures()
{
mMapCanvas->setMapTool( mMapTools.mReshapeFeatures );
Expand Down Expand Up @@ -8253,6 +8269,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionReshapeFeatures->setEnabled( false );
mActionOffsetCurve->setEnabled( false );
mActionSplitFeatures->setEnabled( false );
mActionSplitParts->setEnabled( false );
mActionMergeFeatures->setEnabled( false );
mActionMergeFeatureAttributes->setEnabled( false );
mActionRotatePointSymbols->setEnabled( false );
Expand Down Expand Up @@ -8380,6 +8397,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionAddRing->setEnabled( false );
mActionReshapeFeatures->setEnabled( false );
mActionSplitFeatures->setEnabled( false );
mActionSplitParts->setEnabled( false );
mActionSimplifyFeature->setEnabled( false );
mActionDeleteRing->setEnabled( false );
mActionRotatePointSymbols->setEnabled( false );
Expand All @@ -8401,6 +8419,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )

mActionReshapeFeatures->setEnabled( isEditable && canAddFeatures );
mActionSplitFeatures->setEnabled( isEditable && canAddFeatures );
mActionSplitParts->setEnabled( isEditable && canAddFeatures );
mActionSimplifyFeature->setEnabled( isEditable && canAddFeatures );
mActionOffsetCurve->setEnabled( isEditable && canAddFeatures && canChangeAttributes );

Expand All @@ -8414,6 +8433,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionAddRing->setEnabled( isEditable && canAddFeatures );
mActionReshapeFeatures->setEnabled( isEditable && canAddFeatures );
mActionSplitFeatures->setEnabled( isEditable && canAddFeatures );
mActionSplitParts->setEnabled( isEditable && canAddFeatures );
mActionSimplifyFeature->setEnabled( isEditable && canAddFeatures );
mActionDeleteRing->setEnabled( isEditable && canAddFeatures );
mActionOffsetCurve->setEnabled( false );
Expand Down Expand Up @@ -8498,6 +8518,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionSimplifyFeature->setEnabled( false );
mActionReshapeFeatures->setEnabled( false );
mActionSplitFeatures->setEnabled( false );
mActionSplitParts->setEnabled( false );
mActionLabeling->setEnabled( false );

//NOTE: This check does not really add any protection, as it is called on load not on layer select/activate
Expand Down Expand Up @@ -8851,6 +8872,30 @@ bool QgisApp::addRasterLayers( QStringList const &theFileNameQStringList, bool g
//
///////////////////////////////////////////////////////////////////

#ifdef ANDROID
void QgisApp::keyReleaseEvent(QKeyEvent *event)
{
static bool accepted=true;
if (event->key()==Qt::Key_Close)
{
// do something useful here
int ret = QMessageBox::question(this, tr("Exit QGIS"),
tr("Do you really want to quit QGIS?"),
QMessageBox::Yes | QMessageBox::No);
switch(ret)
{
case QMessageBox::Yes:
this->close();
break;

case QMessageBox::No:
break;
}
event->setAccepted(accepted); // dont't close my Top Level Widget !
accepted=false;// close the app next time when the user press back button
}
}
#endif

void QgisApp::keyPressEvent( QKeyEvent * e )
{
Expand Down
9 changes: 9 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionMoveFeature() { return mActionMoveFeature; }
QAction *actionRotateFeature() { return mActionRotateFeature;}
QAction *actionSplitFeatures() { return mActionSplitFeatures; }
QAction *actionSplitParts() { return mActionSplitParts; }
QAction *actionAddRing() { return mActionAddRing; }
QAction *actionAddPart() { return mActionAddPart; }
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
Expand Down Expand Up @@ -622,6 +623,11 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! reimplements widget keyPress event so we can check if cancel was pressed
virtual void keyPressEvent( QKeyEvent * event );

#ifdef ANDROID
//! reimplements widget keyReleaseEvent event so we can check if back was pressed
virtual void keyReleaseEvent( QKeyEvent * event );
#endif

#ifdef Q_OS_WIN
//! reimplements context menu event
virtual void contextMenuEvent( QContextMenuEvent *event );
Expand Down Expand Up @@ -914,6 +920,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void reshapeFeatures();
//! activates the split features tool
void splitFeatures();
//! activates the split parts tool
void splitParts();
//! activates the add ring tool
void addRing();
//! activates the add part tool
Expand Down Expand Up @@ -1327,6 +1335,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool* mOffsetCurve;
QgsMapTool* mReshapeFeatures;
QgsMapTool* mSplitFeatures;
QgsMapTool* mSplitParts;
QgsMapTool* mSelect;
QgsMapTool* mSelectRectangle;
QgsMapTool* mSelectPolygon;
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ QAction *QgisAppInterface::actionAddFeature() { return qgis->actionAddFeature();
QAction *QgisAppInterface::actionDeleteSelected() { return qgis->actionDeleteSelected(); }
QAction *QgisAppInterface::actionMoveFeature() { return qgis->actionMoveFeature(); }
QAction *QgisAppInterface::actionSplitFeatures() { return qgis->actionSplitFeatures(); }
QAction *QgisAppInterface::actionSplitParts() { return qgis->actionSplitParts(); }
QAction *QgisAppInterface::actionAddRing() { return qgis->actionAddRing(); }
QAction *QgisAppInterface::actionAddPart() { return qgis->actionAddPart(); }
QAction *QgisAppInterface::actionSimplifyFeature() { return qgis->actionSimplifyFeature(); }
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
virtual QAction *actionDeleteSelected();
virtual QAction *actionMoveFeature();
virtual QAction *actionSplitFeatures();
virtual QAction *actionSplitParts();
virtual QAction *actionAddRing();
virtual QAction *actionAddPart();
virtual QAction *actionSimplifyFeature();
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolshowhidelabels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ void QgsMapToolShowHideLabels::showHideLabels( QMouseEvent * e )
labelChanged = true;
}
}
vlayer->endEditCommand();

if ( labelChanged )
{
vlayer->endEditCommand();
mCanvas->refresh();
}
else
Expand Down
119 changes: 119 additions & 0 deletions src/app/qgsmaptoolsplitparts.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/***************************************************************************
qgsmaptoolsplitparts.h
---------------------
begin : April 2013
copyright : (C) 2013 Denis Rouzaud
email : denis.rouzaud@gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgisapp.h"
#include "qgsmessagebar.h"
#include "qgsmapcanvas.h"
#include "qgsproject.h"
#include "qgsmaptoolsplitparts.h"
#include "qgsvectorlayer.h"

#include <QMouseEvent>

QgsMapToolSplitParts::QgsMapToolSplitParts( QgsMapCanvas* canvas ): QgsMapToolCapture( canvas, QgsMapToolCapture::CaptureLine )
{

}

QgsMapToolSplitParts::~QgsMapToolSplitParts()
{

}

void QgsMapToolSplitParts::canvasReleaseEvent( QMouseEvent * e )
{
//check if we operate on a vector layer
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );

if ( !vlayer )
{
notifyNotVectorLayer();
return;
}

if ( !vlayer->isEditable() )
{
notifyNotEditableLayer();
return;
}

//add point to list and to rubber band
if ( e->button() == Qt::LeftButton )
{
int error = addVertex( e->pos() );
if ( error == 1 )
{
//current layer is not a vector layer
return;
}
else if ( error == 2 )
{
//problem with coordinate transformation
QgisApp::instance()->messageBar()->pushMessage(
tr( "Coordinate transform error" ),
tr( "Cannot transform the point to the layers coordinate system" ),
QgsMessageBar::INFO,
QgisApp::instance()->messageTimeout() );
return;
}

startCapturing();
}
else if ( e->button() == Qt::RightButton )
{
deleteTempRubberBand();

//bring up dialog if a split was not possible (polygon) or only done once (line)
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
vlayer->beginEditCommand( tr( "Parts split" ) );
int returnCode = vlayer->splitParts( points(), topologicalEditing );
vlayer->endEditCommand();
if ( returnCode == 4 )
{
QgisApp::instance()->messageBar()->pushMessage(
tr( "No part split done" ),
tr( "If there are selected parts, the split tool only applies to the selected ones. If you like to split all parts under the split line, clear the selection" ),
QgsMessageBar::WARNING,
QgisApp::instance()->messageTimeout() );
}
else if ( returnCode == 3 )
{
QgisApp::instance()->messageBar()->pushMessage(
tr( "No part split done" ),
tr( "Cut edges detected. Make sure the line splits parts into multiple parts." ),
QgsMessageBar::WARNING,
QgisApp::instance()->messageTimeout() );
}
else if ( returnCode == 7 )
{
QgisApp::instance()->messageBar()->pushMessage(
tr( "No part split done" ),
tr( "The geometry is invalid. Please repair before trying to split it." ) ,
QgsMessageBar::WARNING,
QgisApp::instance()->messageTimeout() );
}
else if ( returnCode != 0 )
{
//several intersections but only one split (most likely line)
QgisApp::instance()->messageBar()->pushMessage(
tr( "Split error" ),
tr( "An error occured during feature splitting" ),
QgsMessageBar::WARNING,
QgisApp::instance()->messageTimeout() );
}

stopCapturing();
}
}
31 changes: 31 additions & 0 deletions src/app/qgsmaptoolsplitparts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/***************************************************************************
qgsmaptoolsplitparts.h
---------------------
begin : April 2013
copyright : (C) 2013 Denis Rouzaud
email : denis.rouzaud@gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSMAPTOOLSPLITPARTS_H
#define QGSMAPTOOLSPLITPARTS_H

#include "qgsmaptoolcapture.h"

/**A map tool that draws a line and splits the parts cut by the line*/
class QgsMapToolSplitParts: public QgsMapToolCapture
{
Q_OBJECT
public:
QgsMapToolSplitParts( QgsMapCanvas* canvas );
virtual ~QgsMapToolSplitParts();
void canvasReleaseEvent( QMouseEvent * e );
};

#endif
8 changes: 6 additions & 2 deletions src/core/gps/qgsqtlocationconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
*/
void positionUpdated( const QGeoPositionInfo &info );

/**Called when the number of satellites in view is updated.*/
/**Called when the number of satellites in view is updated.
* @note not available in python binding
*/
void satellitesInViewUpdated( const QList<QGeoSatelliteInfo>& satellites );

/**Called when the number of satellites in use is updated.*/
/**Called when the number of satellites in use is updated.
* @note not available in python binding
*/
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );

private:
Expand Down
6 changes: 6 additions & 0 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ void QgsApplication::init( QString customConfigPath )
{
#if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
setPrefixPath( applicationDirPath(), true );
#elif defined(ANDROID)
// this is "/data/data/org.qgis.qgis" in android
QDir myDir( QDir::homePath() );
myDir.cdUp();
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
#else
QDir myDir( applicationDirPath() );
myDir.cdUp();
Expand Down
12 changes: 12 additions & 0 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
* Extends QApplication to provide access to QGIS specific resources such
* as theme paths, database paths etc.
*/

#ifdef ANDROID
typedef void XEvent;
#endif

class CORE_EXPORT QgsApplication: public QApplication
{
Q_OBJECT
Expand Down Expand Up @@ -274,6 +279,13 @@ class CORE_EXPORT QgsApplication: public QApplication
* @note added in 2.0 */
static void applyGdalSkippedDrivers();

#ifdef ANDROID
//dummy method to workaround sip generation issue issue
bool x11EventFilter ( XEvent * event ){
return 0;
}
#endif

signals:
//! @note not available in python bindings
void preNotify( QObject * receiver, QEvent * event, bool * done );
Expand Down
65 changes: 42 additions & 23 deletions src/core/qgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2935,25 +2935,6 @@ int QgsGeometry::addPart( const QList<QgsPoint> &points )
return 2;
}

if ( !isMultipart() && !convertToMultiType() )
{
QgsDebugMsg( "could not convert to multipart" );
return 1;
}

//create geos geometry from wkb if not already there
if ( mDirtyGeos )
{
exportWkbToGeos();
}

if ( !mGeos )
{
QgsDebugMsg( "GEOS geometry not available!" );
return 4;
}

int geosType = GEOSGeomTypeId( mGeos );
GEOSGeometry *newPart = 0;

switch ( geomType )
Expand Down Expand Up @@ -2996,6 +2977,39 @@ int QgsGeometry::addPart( const QList<QgsPoint> &points )
return 2;
}

return addPart( newPart );
}

int QgsGeometry::addPart( QgsGeometry * newPart )
{
const GEOSGeometry * geosPart = newPart->asGeos();
return addPart( GEOSGeom_clone( geosPart ) );
}

int QgsGeometry::addPart( GEOSGeometry * newPart )
{
QGis::GeometryType geomType = type();

if ( !isMultipart() && !convertToMultiType() )
{
QgsDebugMsg( "could not convert to multipart" );
return 1;
}

//create geos geometry from wkb if not already there
if ( mDirtyGeos )
{
exportWkbToGeos();
}

if ( !mGeos )
{
QgsDebugMsg( "GEOS geometry not available!" );
return 4;
}

int geosType = GEOSGeomTypeId( mGeos );

Q_ASSERT( newPart );

try
Expand Down Expand Up @@ -3023,8 +3037,8 @@ int QgsGeometry::addPart( const QList<QgsPoint> &points )
{
const GEOSGeometry *partN = GEOSGetGeometryN( mGeos, i );

if ( geomType == QGis::Polygon && !GEOSDisjoint( partN, newPart ) )
//bail out if new polygon is not disjoint with existing ones
if ( geomType == QGis::Polygon && GEOSOverlaps( partN, newPart ) )
//bail out if new polygon overlaps with existing ones
break;

parts << GEOSGeom_clone( partN );
Expand All @@ -3036,11 +3050,16 @@ int QgsGeometry::addPart( const QList<QgsPoint> &points )
for ( int i = 0; i < parts.size(); i++ )
GEOSGeom_destroy( parts[i] );

QgsDebugMsg( "new polygon part not disjoint" );
QgsDebugMsg( "new polygon part overlaps" );
return 3;
}

parts << newPart;
int nPartGeoms = GEOSGetNumGeometries( newPart );
for( int i = 0; i < nPartGeoms; ++i )
{
parts << GEOSGeom_clone( GEOSGetGeometryN( newPart, i ) );
}
GEOSGeom_destroy( newPart );

GEOSGeom_destroy( mGeos );

Expand Down
10 changes: 10 additions & 0 deletions src/core/qgsgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@ class CORE_EXPORT QgsGeometry
not disjoint with existing polygons of the feature*/
int addPart( const QList<QgsPoint> &points );

/**Adds a new island polygon to a multipolygon feature
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
not disjoint with existing polygons of the feature*/
int addPart( GEOSGeometry *newPart );

/**Adds a new island polygon to a multipolygon feature
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
not disjoint with existing polygons of the feature*/
int addPart( QgsGeometry *newPart );

/**Translate this geometry by dx, dy
@return 0 in case of success*/
int translate( double dx, double dy );
Expand Down
9 changes: 5 additions & 4 deletions src/core/qgsmaplayerregistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,18 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
//! protected constructor
QgsMapLayerRegistry( QObject * parent = 0 );

/** debugging member
invoked when a connect() is made to this object
*/
void connectNotify( const char * signal );

private:

static QgsMapLayerRegistry* mInstance;

QMap<QString, QgsMapLayer*> mMapLayers;
QSet<QgsMapLayer*> mOwnedLayers;

/** debugging member
invoked when a connect() is made to this object
*/
void connectNotify( const char * signal );


}; // class QgsMapLayerRegistry
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,15 @@ int QgsVectorLayer::translateFeature( QgsFeatureId featureId, double dx, double
return utils.translateFeature( featureId, dx, dy );
}

int QgsVectorLayer::splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing )
{
if ( !mEditBuffer || !mDataProvider )
return -1;

QgsVectorLayerEditUtils utils( this );
return utils.splitParts( splitLine, topologicalEditing );
}

int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing )
{
if ( !mEditBuffer || !mDataProvider )
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,15 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
@return 0 in case of success*/
int translateFeature( QgsFeatureId featureId, double dx, double dy );

/**Splits parts cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
* @return
* 0 in case of success,
* 4 if there is a selection but no feature split
*/
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );

/**Splits features cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
Expand Down
127 changes: 127 additions & 0 deletions src/core/qgsvectorlayereditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qgsvectordataprovider.h"
#include "qgsgeometrycache.h"
#include "qgsvectorlayereditbuffer.h"
#include "qgslogger.h"

#include <limits>

Expand Down Expand Up @@ -295,6 +296,132 @@ int QgsVectorLayerEditUtils::splitFeatures( const QList<QgsPoint>& splitLine, bo
return returnCode;
}

int QgsVectorLayerEditUtils::splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing )
{
if ( !L->hasGeometryType() )
return 4;

double xMin, yMin, xMax, yMax;
QgsRectangle bBox; //bounding box of the split line
int returnCode = 0;
int splitFunctionReturn; //return code of QgsGeometry::splitGeometry
int numberOfSplittedParts = 0;

QgsFeatureList featureList;
const QgsFeatureIds selectedIds = L->selectedFeaturesIds();

if ( selectedIds.size() > 0 ) //consider only the selected features if there is a selection
{
featureList = L->selectedFeatures();
}
else //else consider all the feature that intersect the bounding box of the split line
{
if ( boundingBoxFromPointList( splitLine, xMin, yMin, xMax, yMax ) == 0 )
{
bBox.setXMinimum( xMin ); bBox.setYMinimum( yMin );
bBox.setXMaximum( xMax ); bBox.setYMaximum( yMax );
}
else
{
return 1;
}

if ( bBox.isEmpty() )
{
//if the bbox is a line, try to make a square out of it
if ( bBox.width() == 0.0 && bBox.height() > 0 )
{
bBox.setXMinimum( bBox.xMinimum() - bBox.height() / 2 );
bBox.setXMaximum( bBox.xMaximum() + bBox.height() / 2 );
}
else if ( bBox.height() == 0.0 && bBox.width() > 0 )
{
bBox.setYMinimum( bBox.yMinimum() - bBox.width() / 2 );
bBox.setYMaximum( bBox.yMaximum() + bBox.width() / 2 );
}
else
{
return 2;
}
}

QgsFeatureIterator fit = L->getFeatures( QgsFeatureRequest().setFilterRect( bBox ).setFlags( QgsFeatureRequest::ExactIntersect ) );

QgsFeature f;
while ( fit.nextFeature( f ) )
featureList << QgsFeature( f );
}

int addPartRet;
foreach ( const QgsFeature& feat, featureList )
{
QList<QgsGeometry*> newGeometries;
QList<QgsPoint> topologyTestPoints;
splitFunctionReturn = feat.geometry()->splitGeometry( splitLine, newGeometries, topologicalEditing, topologyTestPoints );
if ( splitFunctionReturn == 0 )
{
//add new parts
for ( int i = 0; i < newGeometries.size(); ++i )
{
addPartRet = feat.geometry()->addPart( newGeometries.at( i ) );
if ( addPartRet != 0 )
break;
}

// For test only: Exception already thrown here...
// feat.geometry()->asWkb();

if ( addPartRet == 0 )
{
L->editBuffer()->changeGeometry( feat.id(), feat.geometry() );
}
else
{
// Test addPartRet
switch ( addPartRet )
{
case 1:
QgsDebugMsg( "Not a multipolygon" );
break;

case 2:
QgsDebugMsg( "Not a valid geometry" );
break;

case 3:
QgsDebugMsg( "New polygon ring" );
break;
}
}
L->editBuffer()->changeGeometry( feat.id(), feat.geometry() );

if ( topologicalEditing )
{
QList<QgsPoint>::const_iterator topol_it = topologyTestPoints.constBegin();
for ( ; topol_it != topologyTestPoints.constEnd(); ++topol_it )
{
addTopologicalPoints( *topol_it );
}
}
++numberOfSplittedParts;
}
else if ( splitFunctionReturn > 1 ) //1 means no split but also no error
{
returnCode = splitFunctionReturn;
}

qDeleteAll( newGeometries );
}

if ( numberOfSplittedParts == 0 && selectedIds.size() > 0 && returnCode == 0)
{
//There is a selection but no feature has been split.
//Maybe user forgot that only the selected features are split
returnCode = 4;
}

return returnCode;
}


int QgsVectorLayerEditUtils::addTopologicalPoints( QgsGeometry* geom )
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgsvectorlayereditutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ class CORE_EXPORT QgsVectorLayerEditUtils
@return 0 in case of success*/
int translateFeature( QgsFeatureId featureId, double dx, double dy );

/** Splits parts cut by the given line
* @param splitLine line that splits the layer feature parts
* @param topologicalEditing true if topological editing is enabled
* @return
* 0 in case of success,
* 4 if there is a selection but no feature split
*/
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );

/** Splits features cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgisinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ class GUI_EXPORT QgisInterface : public QObject
virtual QAction *actionDeleteSelected() = 0;
virtual QAction *actionMoveFeature() = 0;
virtual QAction *actionSplitFeatures() = 0;
virtual QAction *actionSplitParts() = 0;
virtual QAction *actionAddRing() = 0;
virtual QAction *actionAddPart() = 0;
virtual QAction *actionSimplifyFeature() = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsattributedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ class GUI_EXPORT QgsAttributeDialog : public QObject

void dialogDestroyed();

private:
protected:
bool eventFilter( QObject *obj, QEvent *event );

private:
QDialog *mDialog;
QString mSettingsPath;
// Used to sync multiple widgets for the same field
Expand Down
10 changes: 5 additions & 5 deletions src/gui/qgsmapcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
/// Handle pattern for implementation object
std::auto_ptr<CanvasProperties> mCanvasProperties;

/**debugging member
invoked when a connect() is made to this object
*/
void connectNotify( const char * signal );

private slots:
void crsTransformEnabled( bool );

Expand Down Expand Up @@ -459,11 +464,6 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
the last entry in case a lot of resize events arrive in short time*/
QList< QPair<int, int> > mResizeQueue;

/**debugging member
invoked when a connect() is made to this object
*/
void connectNotify( const char * signal );

//! current layer in legend
QgsMapLayer* mCurrentLayer;

Expand Down
10 changes: 10 additions & 0 deletions src/gui/qgsmessagelogviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ QgsMessageLogViewer::QgsMessageLogViewer( QStatusBar *statusBar, QWidget *parent
mButton->setMaximumWidth( 20 );
mButton->setMaximumHeight( 20 );
mButton->setIcon( icon( "/mIconWarn.png" ) );
#ifndef ANDROID
mButton->setToolTip( tr( "No messages." ) );
#endif
mButton->setCheckable( true );
mButton->hide();
connect( mButton, SIGNAL( toggled( bool ) ), this, SLOT( buttonToggled( bool ) ) );
Expand Down Expand Up @@ -108,7 +110,11 @@ void QgsMessageLogViewer::buttonDestroyed()

void QgsMessageLogViewer::logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level )
{
#ifdef ANDROID
mCount++;
#else
mButton->setToolTip( tr( "%1 message(s) logged." ).arg( mCount++ ) );
#endif

if ( !isVisible() && level > QgsMessageLog::INFO )
{
Expand Down Expand Up @@ -163,7 +169,11 @@ void QgsMessageLogViewer::closeTab( int index )
{
mCount -= w->rowCount();
if ( mButton )
#ifdef ANDROID
mCount++;
#else
mButton->setToolTip( tr( "%1 message(s) logged." ).arg( mCount++ ) );
#endif
}
tabWidget->removeTab( index );
}
3 changes: 2 additions & 1 deletion src/gui/qgsmessagelogviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV
public slots:
void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );

private:
protected:
void showEvent( QShowEvent * );
void hideEvent( QHideEvent * );

private:
QToolButton *mButton;
int mCount;

Expand Down
16 changes: 15 additions & 1 deletion src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
<addaction name="mActionReshapeFeatures"/>
<addaction name="mActionOffsetCurve"/>
<addaction name="mActionSplitFeatures"/>
<addaction name="mActionSplitParts"/>
<addaction name="mActionMergeFeatures"/>
<addaction name="mActionMergeFeatureAttributes"/>
<addaction name="mActionNodeTool"/>
Expand Down Expand Up @@ -342,6 +343,7 @@
<addaction name="mActionReshapeFeatures"/>
<addaction name="mActionOffsetCurve"/>
<addaction name="mActionSplitFeatures"/>
<addaction name="mActionSplitParts"/>
<addaction name="mActionMergeFeatures"/>
<addaction name="mActionMergeFeatureAttributes"/>
<addaction name="mActionRotatePointSymbols"/>
Expand Down Expand Up @@ -679,12 +681,24 @@
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionSplitFeatures.png</normaloff>:/images/themes/default/mActionSplitFeatures.png</iconset>
<normaloff>:/images/themes/default/mActionSplitFeatures.svg</normaloff>:/images/themes/default/mActionSplitFeatures.svg</iconset>
</property>
<property name="text">
<string>Split Features</string>
</property>
</action>
<action name="mActionSplitParts">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionSplitFeatures.svg</normaloff>:/images/themes/default/mActionSplitFeatures.svg</iconset>
</property>
<property name="text">
<string>Split Parts</string>
</property>
</action>
<action name="mActionDeleteSelected">
<property name="icon">
<iconset resource="../../images/images.qrc">
Expand Down