90 changes: 46 additions & 44 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions doc/msvc.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
==Building with Microsoft Visual Studio==

This section describes how to build QGIS using Visual Studio on Windows. This
is currently also who the binary QGIS packages are made (earlier versions used
is currently also how the binary QGIS packages are made (earlier versions used
MinGW).

This section describes the setup required to allow Visual Studio to be used to
Expand Down Expand Up @@ -56,6 +56,7 @@ For the QGIS build you need to install following packages from OSGeo4W (select
- libspatialindex-devel
- python-qscintilla


This will also select packages the above packages depend on.

Additionally QGIS also needs the include file ``unistd.h``, which normally
Expand Down Expand Up @@ -105,8 +106,8 @@ git clone git://github.com/qgis/Quantum-GIS.git
Create a 'build' directory somewhere. This will be where all the build output
will be generated.

Now run ``cmake-gui`` and in the //Where is the source code:// box, browse to
the top level QGIS directory.
Now run ``cmake-gui`` (still from ``cmd``) and in the //Where is the source code://
box, browse to the top level QGIS directory.

In the //Where to build the binaries:// box, browse to the 'build' directory you
created.
Expand Down
7,404 changes: 4,374 additions & 3,030 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

47,405 changes: 47,405 additions & 0 deletions i18n/qgis_eu_ES.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions i18n/qgis_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16111,22 +16111,22 @@ Les classes existantes doivent-elles être effacées avant la classification ?</
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="74"/>
<source>Title Font...</source>
<translation>Police du tite...</translation>
<translation>Police du titre...</translation>
</message>
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="81"/>
<source>Group Font...</source>
<translation>Groupe de police...</translation>
<translation>Police des groupes...</translation>
</message>
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="88"/>
<source>Layer Font...</source>
<translation>Police de la couche...</translation>
<translation>Police des couches...</translation>
</message>
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="95"/>
<source>Item Font...</source>
<translation>Police de l&apos;objet...</translation>
<translation>Police des objets...</translation>
</message>
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="102"/>
Expand Down Expand Up @@ -16182,7 +16182,7 @@ Les classes existantes doivent-elles être effacées avant la classification ?</
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="205"/>
<source>Wrap text on</source>
<translation>Retour à la ligne activé</translation>
<translation>Activer le retour à la ligne après</translation>
</message>
<message>
<location filename="../src/ui/qgscomposerlegendwidgetbase.ui" line="240"/>
Expand Down
7,302 changes: 4,452 additions & 2,850 deletions i18n/qgis_gl_ES.ts

Large diffs are not rendered by default.

1,092 changes: 549 additions & 543 deletions i18n/qgis_it.ts

Large diffs are not rendered by default.

1,842 changes: 930 additions & 912 deletions i18n/qgis_pt_PT.ts

Large diffs are not rendered by default.

9,735 changes: 5,015 additions & 4,720 deletions i18n/qgis_sv.ts

Large diffs are not rendered by default.

46,668 changes: 46,668 additions & 0 deletions i18n/qgis_sw.ts

Large diffs are not rendered by default.

7,579 changes: 4,376 additions & 3,203 deletions i18n/qgis_uk.ts

Large diffs are not rendered by default.

Binary file added images/console/iconCodepadConsole.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/console/iconHideToolConsole.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/console/imgHelpConsole.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/console/imgHelpMenu.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/developers/essen-2012.jpg
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/flags/eu_ES.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/flags/sw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions images/images.qrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<RCC>
<qresource prefix="/images">
<file>developers/lyon-2012.jpg</file>
<file>icons/qgis-icon-16x16.png</file>
<file alias="last-hackfest.jpg">developers/essen-2012.jpg</file>
<file>icons/qgis-icon-60x60.png</file>
<file>north_arrows/gpsarrow2.svg</file>
<file>north_arrows/gpsarrow.svg</file>
Expand All @@ -20,6 +20,7 @@
<file>themes/default/join_miter.png</file>
<file>themes/default/join_round.png</file>
<file>themes/default/join_style.svg</file>
<file>themes/default/mActionAdd.png</file>
<file>themes/default/mActionAddAllToOverview.png</file>
<file>themes/default/mActionAddArrow.png</file>
<file>themes/default/mActionAddBasicShape.png</file>
Expand All @@ -45,6 +46,8 @@
<file>themes/default/mActionAnnotation.png</file>
<file>themes/default/mActionArrowDown.png</file>
<file>themes/default/mActionArrowUp.png</file>
<file>themes/default/mActionArrowLeft.png</file>
<file>themes/default/mActionArrowRight.png</file>
<file>themes/default/mActionCalculateField.png</file>
<file>themes/default/mActionCaptureLine.png</file>
<file>themes/default/mActionCapturePoint.png</file>
Expand Down Expand Up @@ -76,6 +79,7 @@
<file>themes/default/mActionFileSaveAs.png</file>
<file>themes/default/mActionFileSave.png</file>
<file>themes/default/mActionFileSmall.png</file>
<file>themes/default/mActionFilter.png</file>
<file>themes/default/mActionFolder.png</file>
<file>themes/default/mActionFormAnnotation.png</file>
<file>themes/default/mActionFromSelectedFeature.png</file>
Expand Down Expand Up @@ -126,6 +130,7 @@
<file>themes/default/mActionPropertyItem.png</file>
<file>themes/default/mActionQgisHomePage.png</file>
<file>themes/default/mActionRaiseItems.png</file>
<file>themes/default/mActionRefresh.png</file>
<file>themes/default/mActionRedo.png</file>
<file>themes/default/mActionRemoveAllFromOverview.png</file>
<file>themes/default/mActionRemoveLayer.png</file>
Expand All @@ -138,6 +143,7 @@
<file>themes/default/mActionSaveAsPDF.png</file>
<file>themes/default/mActionSaveAsSVG.png</file>
<file>themes/default/mActionSaveEdits.png</file>
<file>themes/default/mActionSaveAllEdits.png</file>
<file>themes/default/mActionSaveMapAsImage.png</file>
<file>themes/default/mActionScaleBar.png</file>
<file>themes/default/mActionSelectedToTop.png</file>
Expand All @@ -148,6 +154,8 @@
<file>themes/default/mActionSelectPolygon.svg</file>
<file>themes/default/mActionSelectRadius.png</file>
<file>themes/default/mActionSelectRectangle.png</file>
<file>themes/default/mActionSignPlus.png</file>
<file>themes/default/mActionSignMinus.png</file>
<file>themes/default/mActionShowAllLayers.png</file>
<file>themes/default/mActionShowBookmarks.png</file>
<file>themes/default/mActionShowHideLabels.svg</file>
Expand All @@ -156,6 +164,7 @@
<file>themes/default/mActionSimplify.png</file>
<file>themes/default/mActionSplitFeatures.png</file>
<file>themes/default/mActionSplitFeatures.svg</file>
<file>themes/default/mActionSum.png</file>
<file>themes/default/mActionTextAnnotation.png</file>
<file>themes/default/mActionToggleEditing.png</file>
<file>themes/default/mActionUndo.png</file>
Expand All @@ -172,9 +181,11 @@
<file>themes/default/mIconClose.png</file>
<file>themes/default/mIconCollapse.png</file>
<file>themes/default/mIconConnect.png</file>
<file>themes/default/mIconClear.png</file>
<file>themes/default/mIconDbSchema.png</file>
<file>themes/default/mIconDelete.png</file>
<file>themes/default/mIconEditable.png</file>
<file>themes/default/mIconEditableEdits.png</file>
<file>themes/default/mIconExpand.png</file>
<file>themes/default/mIconFavourites.png</file>
<file>themes/default/mIconFirst.png</file>
Expand Down Expand Up @@ -341,6 +352,7 @@
<file>themes/gis/mActionSaveAsPDF.png</file>
<file>themes/gis/mActionSaveAsSVG.png</file>
<file>themes/gis/mActionSaveEdits.png</file>
<file>themes/gis/mActionSaveAllEdits.png</file>
<file>themes/gis/mActionSaveMapAsImage.png</file>
<file>themes/gis/mActionScaleBar.png</file>
<file>themes/gis/mActionSelectedToTop.png</file>
Expand Down Expand Up @@ -373,6 +385,7 @@
<file>themes/gis/mActionZoomToSelected.png</file>
<file>themes/gis/mIconClose.png</file>
<file>themes/gis/mIconEditable.png</file>
<file>themes/gis/mIconEditableEdits.png</file>
<file>themes/gis/mIconLineLayer.png</file>
<file>themes/gis/mIconPointLayer.png</file>
<file>themes/gis/mIconPolygonLayer.png</file>
Expand Down Expand Up @@ -478,9 +491,15 @@
<file>console/iconQtCoreConsole.png</file>
<file>console/iconQtGuiConsole.png</file>
<file>console/iconRunConsole.png</file>
<file>console/iconAboutConsole.png</file>
<file>console/iconAboutConsole.png</file>
<file>console/iconCodepadConsole.png</file>
<file>console/imgHelpConsole.png</file>
<file>console/imgHelpMenu.png</file>
<file>console/iconHideToolConsole.png</file>
<file>flags/sr_Cyrl.png</file>
<file>flags/sr_Latn.png</file>
<file>flags/sw.png</file>
<file>flags/eu_ES.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
Binary file modified images/splash/splash.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 modified images/splash/splash.xcf.bz2
Binary file not shown.
Binary file added images/themes/default/mActionAdd.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/mActionArrowLeft.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/mActionArrowRight.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/mActionFilter.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/mActionRefresh.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/mActionSaveAllEdits.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/mActionSignMinus.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/mActionSignPlus.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/mActionSum.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/mIconClear.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/mIconEditableEdits.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/mActionSaveAllEdits.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/mIconEditableEdits.png
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 mac/cmake/0qgis.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ IF (@OSX_HAVE_LOADERPATH@)
GET_INSTALL_NAME ("${QFWDIR}/${QL}.framework/${QL}" ${QL}.framework QQ)
SET (QFW_CHG "${QQ}")
UPDATEQGISPATHS ("${QFW_CHG}" ${QL})
# change id of the framework
IF (NOT @QGIS_MACAPP_INSTALL_DEV@)
EXECUTE_PROCESS(COMMAND install_name_tool -id "${ATEXECUTABLE}/${QGIS_FW_SUBDIR}/${QL}.framework/${QL}" "${QFWDIR}/${QL}.framework/${QL}")
ENDIF ()
ENDFOREACH (QL)
ENDIF (@OSX_HAVE_LOADERPATH@)
2 changes: 1 addition & 1 deletion ms-windows/osgeo4w/package-nightly.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ REM * (at your option) any later version. *
REM * *
REM ***************************************************************************
@echo off
set GRASS_VERSION=6.4.2
set GRASS_VERSION=6.4.3RC1

set BUILDDIR=%CD%\build
REM set BUILDDIR=%TEMP%\qgis_unstable
Expand Down
2 changes: 1 addition & 1 deletion ms-windows/osgeo4w/package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ REM * (at your option) any later version. *
REM * *
REM ***************************************************************************
@echo off
set GRASS_VERSION=6.4.2
set GRASS_VERSION=6.4.3RC1

set BUILDDIR=%CD%\build
REM set BUILDDIR=%TEMP%\qgis_unstable
Expand Down
2 changes: 1 addition & 1 deletion ms-windows/osgeo4w/postinstall-common.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
%OSGEO4W_ROOT%\apps\@package@\crssync
"%OSGEO4W_ROOT%"\apps\@package@\crssync
2 changes: 1 addition & 1 deletion ms-windows/osgeo4w/postinstall-dev.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ set OSGEO4W_ROOT=%O4W_ROOT%
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
%OSGEO4W_ROOT%\apps\@package@\crssync
"%OSGEO4W_ROOT%"\apps\@package@\crssync
4 changes: 2 additions & 2 deletions ms-windows/osgeo4w/preremove-desktop.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
del "%OSGEO4W_STARTMENU%\Quantum GIS (@version@).lnk"
del "%OSGEO4W_STARTMENU%\Quantum GIS Desktop (@version@).lnk"
del "%OSGEO4W_STARTMENU%\Quantum GIS Browser (@version@).lnk"
del "%ALLUSERSPROFILE%\Desktop\Quantum GIS (@version@).lnk"
del "%ALLUSERSPROFILE%\Desktop\Quantum GIS Desktop (@version@).lnk"
del "%ALLUSERSPROFILE%\Desktop\Quantum GIS Browser (@version@).lnk"
del "%OSGEO4W_ROOT%"\bin\@package@.bat
del "%OSGEO4W_ROOT%"\bin\@package@-browser.bat
Expand Down
6 changes: 6 additions & 0 deletions postinstall/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# for included scripts that set policies
INSTALL (CODE "cmake_policy(SET CMP0011 NEW)")

CONFIGURE_FILE("PostInstall.cmake.in" "PostInstall.cmake" @ONLY)
INSTALL(SCRIPT "${CMAKE_BINARY_DIR}/postinstall/PostInstall.cmake")
9 changes: 9 additions & 0 deletions postinstall/PostInstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# kill boolean warnings
CMAKE_POLICY(SET CMP0012 NEW)

IF(@WITH_PY_COMPILE@)
MESSAGE(STATUS "Byte-compiling core Python utilities and plugins...")
# exclude Python 3 modules in PyQt4.uic package
EXECUTE_PROCESS(COMMAND @PYTHON_EXECUTABLE@ -m compileall -q -x ".*uic.port_v3.*" "@CMAKE_INSTALL_PREFIX@/@QGIS_DATA_DIR@/python")
ENDIF(@WITH_PY_COMPILE@)
139 changes: 70 additions & 69 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,37 @@ IF (WITH_INTERNAL_SPATIALITE)
ENDIF (WITH_INTERNAL_SPATIALITE)

SET (QGIS_PYTHON_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/qgis)
FILE (MAKE_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})

INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_PATH}
${SIP_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTNETWORK_INCLUDE_DIR}
${QT_QTSVG_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QWT_INCLUDE_DIR}

../src/core
../src/core/pal
../src/core/composer
../src/core/diagram
../src/core/gps
../src/core/gps/qextserialport
../src/core/raster
../src/core/renderer
../src/core/symbology
../src/core/symbology-ng

../src/gui/raster
../src/gui/attributetable

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${PYTHON_INCLUDE_PATH}
${SIP_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTNETWORK_INCLUDE_DIR}
${QT_QTSVG_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QWT_INCLUDE_DIR}
${QEXTSERIALPORT_INCLUDE_DIR}

../src/core
../src/core/pal
../src/core/composer
../src/core/diagram
../src/core/gps
../src/core/raster
../src/core/renderer
../src/core/symbology
../src/core/symbology-ng

../src/gui/raster
../src/gui/attributetable

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
)

IF(NOT WITH_TOUCH)
Expand Down Expand Up @@ -79,11 +80,11 @@ ADD_SIP_PYTHON_MODULE(qgis.core core/core.sip qgis_core)

# additional gui includes
INCLUDE_DIRECTORIES(
../src/gui
../src/gui/symbology-ng
../src/plugins
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
../src/gui
../src/gui/symbology-ng
../src/plugins
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/ui
)

# gui module
Expand All @@ -94,22 +95,22 @@ ADD_SIP_PYTHON_MODULE(qgis.gui gui/gui.sip qgis_core qgis_gui)

# additional analysis includes
INCLUDE_DIRECTORIES(
../src/analysis/vector
../src/analysis/raster
../src/analysis/network
../src/analysis/interpolation
${CMAKE_BINARY_DIR}/src/analysis/vector
${CMAKE_BINARY_DIR}/src/analysis/network
${CMAKE_BINARY_DIR}/src/analysis/raster
${CMAKE_BINARY_DIR}/src/analysis/interpolation
../src/analysis/vector
../src/analysis/raster
../src/analysis/network
../src/analysis/interpolation
${CMAKE_BINARY_DIR}/src/analysis/vector
${CMAKE_BINARY_DIR}/src/analysis/network
${CMAKE_BINARY_DIR}/src/analysis/raster
${CMAKE_BINARY_DIR}/src/analysis/interpolation
)

# analysis module
FILE(GLOB sip_files_analysis
analysis/*.sip
analysis/raster/*.sip
analysis/vector/*.sip
analysis/interpolation/*.sip
analysis/*.sip
analysis/raster/*.sip
analysis/vector/*.sip
analysis/interpolation/*.sip
)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_analysis})
SET(SIP_EXTRA_OPTIONS ${PYQT4_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.analysis.api)
Expand Down Expand Up @@ -139,33 +140,33 @@ IF(WITH_QSCIAPI)
INSTALL(FILES ${QGIS_PYTHON_API_FILE} DESTINATION "${QGIS_DATA_DIR}/python/qsci_apis")
ENDIF(WITH_QSCIAPI)

ADD_CUSTOM_TARGET(compile_python_files ALL)
# Plugin utilities files to copy to staging or install
SET(PY_FILES
__init__.py
utils.py
)

ADD_SUBDIRECTORY(console_help)
ADD_CUSTOM_TARGET(pyutils ALL)
INSTALL(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}")

ADD_CUSTOM_COMMAND(TARGET compile_python_files
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${QGIS_PYTHON_OUTPUT_DIRECTORY}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# stage to output to make available when QGIS is run from build directory
FOREACH(pyfile ${PY_FILES} ${PYUI_FILES})
ADD_CUSTOM_COMMAND(TARGET pyutils
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
)
ENDFOREACH(pyfile)

ADD_SUBDIRECTORY(console)

FILE(GLOB UI_FILES *.ui)
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES})
ADD_CUSTOM_TARGET(console ALL DEPENDS ${PYUI_FILES})
INSTALL(FILES ${PYUI_FILES} DESTINATION ${QGIS_PYTHON_DIR})

FOREACH(file __init__.py utils.py console.py console_sci.py console_help.py console_settings.py)
ADD_CUSTOM_COMMAND(TARGET compile_python_files
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${QGIS_PYTHON_OUTPUT_DIRECTORY}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${file}
# Byte-compile staged PyQGIS utilities
IF(WITH_PY_COMPILE)
ADD_CUSTOM_TARGET(pycompile_pyutils ALL
COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY}/qgis"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
COMMENT "Byte-compiling staged PyQGIS utility modules..."
DEPENDS pyutils
)
ENDFOREACH(file)

PYTHON_INSTALL(__init__.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(utils.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_sci.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_help.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_settings.py ${QGIS_PYTHON_DIR})
ENDIF(WITH_PY_COMPILE)
30 changes: 30 additions & 0 deletions python/console/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ADD_SUBDIRECTORY(console_help)

SET(PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)
SET(QGIS_PYTHON_DIR ${PYTHON_SITE_PACKAGES_DIR}/qgis)

# PyQGIS console files to copy to staging or install
SET(PY_CONSOLE_FILES
console.py
console_sci.py
console_help.py
console_settings.py
console_output.py
)

FILE(GLOB UI_FILES *.ui)
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES}) # returns absolute paths
ADD_CUSTOM_TARGET(pyconsole ALL DEPENDS ${PYUI_FILES})

# stage to output to make available when QGIS is run from build directory
FOREACH(pyfile ${PY_CONSOLE_FILES} ${PYUI_FILES})
ADD_CUSTOM_COMMAND(TARGET pyconsole
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
)
ENDFOREACH(pyfile)

INSTALL(FILES ${PY_CONSOLE_FILES} ${PYUI_FILES} DESTINATION "${QGIS_PYTHON_DIR}")

101 changes: 57 additions & 44 deletions python/console.py → python/console/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from PyQt4.QtGui import *
from qgis.utils import iface
from console_sci import PythonEdit
from console_output import EditorOutput
from console_help import HelpDialog
from console_settings import optionsDialog

Expand Down Expand Up @@ -58,26 +59,12 @@ def console_displayhook(obj):
global _console_output
_console_output = obj

class QgisOutputCatcher:
def __init__(self):
self.data = ''
def write(self, stuff):
self.data += stuff
def get_and_clean_data(self):
tmp = self.data
self.data = ''
return tmp
def flush(self):
pass

sys.stdout = QgisOutputCatcher()

class PythonConsole(QDockWidget):
def __init__(self, parent=None):
QDockWidget.__init__(self, parent)
self.setObjectName("PythonConsole")
self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
#self.setAllowedAreas(Qt.BottomDockWidgetArea)
#self.setAllowedAreas(Qt.BottomDockWidgetArea)

self.console = PythonConsoleWidget(self)
self.setWidget( self.console )
Expand All @@ -92,35 +79,42 @@ def activate(self):
self.raise_()
QDockWidget.setFocus(self)

def closeEvent(self, event):
self.console.edit.writeHistoryFile()
QWidget.closeEvent(self, event)

class PythonConsoleWidget(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))

self.widgetButton = QWidget()
#self.widgetEditors = QWidget()

self.options = optionsDialog(self)

self.helpDlg = HelpDialog(self)

self.splitter = QSplitter(self)
self.splitter.setOrientation(Qt.Vertical)
self.splitter.setHandleWidth(3)
self.splitter.setChildrenCollapsible(False)

self.toolBar = QToolBar()
self.toolBar.setEnabled(True)
#self.toolBar.setFont(font)
self.toolBar.setFocusPolicy(Qt.NoFocus)
self.toolBar.setContextMenuPolicy(Qt.DefaultContextMenu)
self.toolBar.setLayoutDirection(Qt.LeftToRight)
self.toolBar.setIconSize(QSize(24, 24))
self.toolBar.setOrientation(Qt.Vertical)
self.toolBar.setMovable(True)
self.toolBar.setFloatable(True)
#self.toolBar.setAllowedAreas(Qt.LeftToolBarArea)
#self.toolBar.setAllowedAreas(Qt.RightToolBarArea)
#self.toolBar.setObjectName(_fromUtf8("toolMappa"))

self.b = QVBoxLayout(self.widgetButton)
self.e = QHBoxLayout(self)
self.b = QGridLayout(self.widgetButton)
self.f = QGridLayout(self)

self.e.setMargin(0)
self.e.setSpacing(0)
self.f.setMargin(0)
self.f.setSpacing(0)
self.b.setMargin(0)
self.b.setSpacing(0)

## Action for Clear button
clearBt = QCoreApplication.translate("PythonConsole", "Clear console")
Expand Down Expand Up @@ -267,13 +261,36 @@ def __init__(self, parent=None):
sM.setPopupMode(QToolButton.InstantPopup)

self.b.addWidget(self.toolBar)
self.edit = PythonEdit()
self.setFocusProxy( self.edit )
self.edit = PythonEdit(self)
self.textEditOut = EditorOutput(self)

self.setFocusProxy(self.edit)

sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.widgetButton.sizePolicy().hasHeightForWidth())
self.widgetButton.setSizePolicy(sizePolicy)

self.splitter.addWidget(self.textEditOut)
self.splitter.addWidget(self.edit)

self.e.addWidget(self.widgetButton)
self.e.addWidget(self.edit)

self.clearButton.triggered.connect(self.edit.clearConsole)
sizes = self.splitter.sizes()
self.splitter.setSizes(sizes)

self.f.addWidget(self.widgetButton, 0, 0)
self.f.addWidget(self.splitter, 0, 1)

sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.textEditOut.sizePolicy().hasHeightForWidth())
self.textEditOut.setSizePolicy(sizePolicy)

self.textEditOut.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.edit.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)

self.clearButton.triggered.connect(self.textEditOut.clearConsole)
self.optionsButton.triggered.connect(self.openSettings)
self.loadIfaceButton.triggered.connect(self.iface)
self.loadSextanteButton.triggered.connect(self.sextante)
Expand All @@ -283,18 +300,18 @@ def __init__(self, parent=None):
self.openFileButton.triggered.connect(self.openScriptFile)
self.saveFileButton.triggered.connect(self.saveScriptFile)
self.helpButton.triggered.connect(self.openHelp)
QObject.connect(self.options.buttonBox, SIGNAL("accepted()"),
QObject.connect(self.options.buttonBox, SIGNAL("accepted()"),
self.prefChanged)

def sextante(self):
self.edit.commandConsole('sextante')

def iface(self):
self.edit.commandConsole('iface')

def qtCore(self):
self.edit.commandConsole('qtCore')

def qtGui(self):
self.edit.commandConsole('qtGui')

Expand Down Expand Up @@ -326,7 +343,7 @@ def saveScriptFile(self):
if not filename.endswith(".py"):
fName += ".py"
sF = open(fName,'w')
listText = self.edit.getTextFromEditor()
listText = self.textEditOut.getTextFromEditor()
is_first_line = True
for s in listText:
if s[0:3] in (">>>", "..."):
Expand All @@ -339,19 +356,15 @@ def saveScriptFile(self):
sF.close()

def openHelp(self):
dlg = HelpDialog()
dlg.exec_()
self.helpDlg.show()
self.helpDlg.activateWindow()

def openSettings(self):
#options = optionsDialog()
self.options.exec_()

def prefChanged(self):
self.edit.refreshLexerProperties()

def closeEvent(self, event):
self.edit.writeHistoryFile()
QWidget.closeEvent(self, event)
self.textEditOut.refreshLexerProperties()

if __name__ == '__main__':
a = QApplication(sys.argv)
Expand Down
46 changes: 13 additions & 33 deletions python/console_help.py → python/console/console_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,32 @@
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

from PyQt4 import QtCore, QtGui, QtWebKit
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ui_console_help import Ui_Help
from qgis.core import QgsApplication
import os

class HelpDialog(QtGui.QDialog):
class HelpDialog(QDialog, Ui_Help):
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setupUi(self)

def __init__(self):
QtGui.QDialog.__init__(self)
self.setModal(True)
self.setupUi()

def setupUi(self):
self.setMaximumSize(500, 300)
self.webView = QtWebKit.QWebView()
self.setWindowTitle(QCoreApplication.translate("PythonConsole","Help Python Console"))
self.verticalLayout= QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.verticalLayout.addWidget(self.webView)
self.closeButton = QtGui.QPushButton()
self.closeButton.setText("Close")
self.closeButton.setMaximumWidth(150)
self.horizontalLayout= QtGui.QHBoxLayout()
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.addStretch(1000)
self.horizontalLayout.addWidget(self.closeButton)
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
self.verticalLayout.addLayout(self.horizontalLayout)
self.setLayout(self.verticalLayout)
self.setMaximumSize(530, 300)

qgisDataDir = QgsApplication.pkgDataPath()
listFile = os.listdir(qgisDataDir + "/python/console_help/i18n")
listFile = os.listdir(qgisDataDir + "/python/console/console_help/i18n")
localeFullName = QSettings().value( "locale/userLocale", QVariant( "" ) ).toString()
locale = "en_US"
for i in listFile:
lang = i[0:5]
if localeFullName in (lang[0:2], lang):
locale = lang
filename = qgisDataDir + "/python/console_help/help.htm? \

filename = qgisDataDir + "/python/console/console_help/help.htm? \
lang=" + locale \
+ "&pkgDir=" + qgisDataDir

url = QtCore.QUrl(filename)
self.webView.load(url)

def closeWindow(self):
self.close()
url = QUrl(filename)
self.webView.load(url)
82 changes: 82 additions & 0 deletions python/console/console_help.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Help</class>
<widget class="QDialog" name="Help">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>555</width>
<height>363</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QWebView" name="webView">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Help</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>259</x>
<y>310</y>
</hint>
<hint type="destinationlabel">
<x>259</x>
<y>163</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FILE(GLOB HTML_FILES *.htm)
FILE(GLOB I18N_FILES i18n/*.properties)
FILE(GLOB JS_FILES js/*.js)

INSTALL(FILES ${HTML_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console_help)
INSTALL(FILES ${I18N_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console_help/i18n)
INSTALL(FILES ${JS_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console_help/js)
INSTALL(FILES ${HTML_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console/console_help)
INSTALL(FILES ${I18N_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console/console_help/i18n)
INSTALL(FILES ${JS_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console/console_help/js)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "httpqrc://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="httpqrc://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Help Python Console</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Expand All @@ -8,18 +8,29 @@

<style>
body{
font-family: verdana,arial,helvetica,sans-serif;
/*font-family:Verdana,Geneva,sans-serif;*/
font-family: 'Trebuchet MS', sans-serif;
font-size : 12px;
}
#header{
background: #cccccc;
background: #f6f6f6;
border-bottom: 3px solid #000;
width: 100%;
}
#headerTool td{
background: #f6f6f6;
/*width: 100%;*/
}
._titleP {
padding: 5px;
font-size: 15px;
font-weight: bold;
color: #000;
}
._title {
font-size: 20px;
font-weight: bold;
color: #000;
}
</style>
</head>
<body>
Expand All @@ -29,22 +40,45 @@
<img src="qrc:/images/console/imgHelpDialog.png" />
</td>
<td>
<h2 id="headerTitle">Python Console for QGIS</h2>
<span id="headerTitle" class="_title">Python Console for QGIS</span>
</td>
</tr>
</table>
<table>
<tr>
<td>
<p align="justify">
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
<br><br>
<span id="headerSubjectMain">To access Quantum GIS environment from this console
use qgis.utils.iface object (instance of QgisInterface class).
To import the class QgisInterface can also use the dedicated
button on the toolbar on the left.</span>
</p>
</td>
</tr>
<tr>
<td><img src="qrc:/images/console/imgHelpConsole.png" /></td>
</tr>
<tr>
<td>
<p align="justify">
<span id="headerSubjectA">The console is splitted in two main panes, output and input areas.
Both are resizable by using the horizontal splitter.
Output area pane is a widget read-only which shows the commands output.
You can drag and drop or copy text into input area (no matter if selected text contains >>> or ...).
Use 'Share on codepad' from contextual menu for sharing snippets code.
The context menu looks like the image below.</span><br><br>
<img src="qrc:/images/console/imgHelpMenu.png"><br>
<span id="headerSubjectB">Input area pane is the interactive python shell for input commands.</span>
</p>
</td>
</tr>
</table>
<p align="justify">
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
<br><br>
<span id="headerSubjectMain">To access Quantum GIS environment from this console
use qgis.utils.iface object (instance of QgisInterface class).
To import the class QgisInterface can also use the dedicated
button on the toolbar on the left.</span>
</p>
<table id="header">
<tr>
<td>
<h4 id="features">Features</h4>
<span id="features" class="_titleP">Features</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -86,7 +120,7 @@ <h4 id="features">Features</h4>
<table id="header">
<tr>
<td>
<h4 id="toolbar">Toolbar</h4>
<span id="toolbar" class="_titleP">Toolbar</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -139,17 +173,6 @@ <h4 id="toolbar">Toolbar</h4>
<td colspan="2"><span id="toolbarRun">Run command (like Enter key pressed)</span></td>
</tr>
</table>
<br>
<table id="header">
<tr>
<td>
<h4 id="thanks">Acknowledgments</h4>
</td>
</tr>
</table>
<p>
<span id="thanksText">Thanks to Larry Shaffer who provided the API files.</span>
</p>
</body>
<script type="text/javascript">
var parameter = window.location.search.replace( "?", "" );
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ i18n_dict = {
use qgis.utils.iface object (instance of QgisInterface class). \
To import the class QgisInterface can also use the dedicated \
button on the toolbar on the left.",
"header.subject.A" : "The console is splitted in two main panes, output and input areas. \
Both are resizable by using the horizontal splitter. \
Output area pane is a widget read-only which shows the commands output. \
You can drag and drop or copy text into input area \
(no matter if selected text contains >>> or ...). \
Use 'Share on codepad' from contextual menu for sharing snippets code. \
The context menu looks like the image below.",
"header.subject.B" : "Input area pane is the interactive python shell for input commands.",
"features" : "Features",
"features.title" : "Auto-completion and highlighting syntax for the following APIs:",
"features.a" : "CTRL+SPACE to view the auto-completion list.",
Expand All @@ -28,7 +36,5 @@ i18n_dict = {
"toolbar.script.save" : "Tool to save a python script",
"toolbar.settings" : "Settings",
"toolbar.help" : "Help",
"toolbar.run" : "Run command (like Enter key pressed)",
"thanks" : "Acknowledgments",
"thanks.text" : "Thanks to Larry Shaffer who provided the API files."
"toolbar.run" : "Run command (like Enter key pressed)"
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ i18n_dict = {
usa l'oggetto qgis.utils.iface (istanza della classe QgisInterface). \
Per importare la classe QgisInterface puoi usare anche il bottone dedicato che si trova \
sulla toolbar.",
"header.subject.A" : "La console è divisa in due riquadri principali, uno per i comandi di input l'altro per \
quelli di output. Entrambi possono essere ridimensionate. \
L'area di output non è editabile, visualizza solo l'output del comando \
eseguito nella shell. \
È possibile fare il drag&drop o copiare il testo direttamente nell'area di input \
(il prompt >>> o ... viene filtrato automaticamente). \
Usa 'Share on codepad' dal menu contestuale per condividere pezzi di codice. \
Il menu contestuale si presenta come l'immagine sotto.",
"header.subject.B" : "L'area di input è la shell interrattiva di Python.",
"features" : "Funzionalità",
"features.title" : "Completamento automatico ed evidenziazione della sintassi per le seguenti APIs:",
"features.a" : "CTRL+SPACE per visualizzare la lista per l'autocompletamento di classi e metodi.",
"features.b" : "CTRL+ALT+SPACE per visualizzare la lista della cronologia dei comandi.",
"features.c" : "Possibilità di salvare la cronologia dei comandi digitando '_save' o semplicemente chiudendo il widget. \
"features.c" : "Possibilità di salvare la cronologia dei comandi digitando '_save' o semplicemente chiudendo il widget. \
La cronologia verrà salvata all'interno del file ~/.qgis/console_history.txt",
"features.d" : "Possibilità di cancellare la storia dei comandi digitando '_clear'. \
La cronologia verrà cancellata dal file ~/.qgis/console_history.txt",
"features.e" : "Possibilità di cancellare completamente la cronologia dei comandi digitando '_clearAll'. \
La cronologia verrà cancellata sia dal file che dalla memoria temporanea.",
"features.d" : "Possibilità di cancellare la storia dei comandi digitando '_clear'. \
La cronologia verrà cancellata dal file ~/.qgis/console_history.txt",
"features.e" : "Possibilità di cancellare completamente la cronologia dei comandi digitando '_clearAll'. \
La cronologia verrà cancellata sia dal file che dalla memoria temporanea.",
"features.api.doc" : "Apri la documentazione completa sulle API di QuantumGIS digitando '_api'.",
"features.pyqgis.doc" : "Apri il Cookbook PyQGIS digitando '_pyqgis'.",
"toolbar" : "Toolbar",
Expand All @@ -28,7 +37,5 @@ i18n_dict = {
"toolbar.script.save" : "Strumento per salvare uno script python sul disco",
"toolbar.settings" : "Impostazioni",
"toolbar.help" : "Aiuto",
"toolbar.run" : "Esegui comando (simile al tasto <Invio>)",
"thanks" : "Ringraziamenti",
"thanks.text" : "Grazie a Larry Shaffer per aver fornito i file con le API."
"toolbar.run" : "Esegui comando (simile al tasto <Invio>)"
};
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
$.i18n.setDictionary(i18n_dict);

$('h2#headerTitle').text($.i18n._('header.title'));
$('span#headerTitle').text($.i18n._('header.title'));
$('span#headerSubject').text($.i18n._('header.subject'));
$('span#headerSubjectMain').text($.i18n._('header.subject.main'));
$('h4#features').text($.i18n._('features'));
$('span#headerSubjectA').text($.i18n._('header.subject.A'));
$('span#headerSubjectB').text($.i18n._('header.subject.B'));
$('span#features').text($.i18n._('features'));
$('span#featuresTitle').text($.i18n._('features.title'));
$('span#featuresA').text($.i18n._('features.a'));
$('span#featuresB').text($.i18n._('features.b'));
Expand All @@ -12,7 +14,7 @@ $('span#featuresD').text($.i18n._('features.d'));
$('span#featuresE').text($.i18n._('features.e'));
$('span#featuresLoadAPI').text($.i18n._('features.api.doc'));
$('span#featuresLoadCookBook').text($.i18n._('features.pyqgis.doc'));
$('h4#toolbar').text($.i18n._('toolbar'));
$('span#toolbar').text($.i18n._('toolbar'));
$('span#toolbarTitle').text($.i18n._('toolbar.title'));
$('span#toolbarClear').text($.i18n._('toolbar.clear'));
$('span#toolbarIfaceClass').text($.i18n._('toolbar.iface'));
Expand All @@ -24,5 +26,3 @@ $('span#toolbarScriptSave').text($.i18n._('toolbar.script.save'));
$('span#toolbarHelp').text($.i18n._('toolbar.help'));
$('span#toolbarSettings').text($.i18n._('toolbar.settings'));
$('span#toolbarRun').text($.i18n._('toolbar.run'));
$('h4#thanks').text($.i18n._('thanks'));
$('span#thanksText').text($.i18n._('thanks.text'));
267 changes: 267 additions & 0 deletions python/console/console_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
# -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Conosle for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) 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. *
* *
***************************************************************************/
Some portions of code were taken from https://code.google.com/p/pydee/
"""

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.Qsci import (QsciScintilla,
QsciScintillaBase,
QsciLexerPython)
import sys

class writeOut:
def __init__(self, edit, out=None, style=None):
"""
This class allow to write stdout and stderr
"""
self.outputArea = edit
self.out = None
self.style = style

def write(self, m):
if self.style == "traceback":
self.outputArea.SendScintilla(QsciScintilla.SCI_SETSTYLING, len(m), 1)
self.outputArea.append(m)
self.outputArea.SendScintilla(QsciScintilla.SCI_SETSTYLING, len(m), 1)
else:
self.outputArea.append(m)
self.move_cursor_to_end()

if self.out:
self.out.write(m)

def move_cursor_to_end(self):
"""Move cursor to end of text"""
line, index = self.get_end_pos()
self.outputArea.setCursorPosition(line, index)
self.outputArea.ensureCursorVisible()
self.outputArea.ensureLineVisible(line)

def get_end_pos(self):
"""Return (line, index) position of the last character"""
line = self.outputArea.lines() - 1
return (line, self.outputArea.text(line).length())

def flush(self):
pass

class EditorOutput(QsciScintilla):
def __init__(self, parent=None):
#QsciScintilla.__init__(self, parent)
super(EditorOutput,self).__init__(parent)
self.parent = parent
self.edit = self.parent.edit

# Enable non-ascii chars for editor
self.setUtf8(True)

sys.stdout = writeOut(self, sys.stdout)
sys.stderr = writeOut(self, sys.stderr, "traceback")

self.insertInitText()
self.setLexers()
self.setReadOnly(True)

# Set the default font
font = QFont()
font.setFamily('Courier')
font.setFixedPitch(True)
font.setPointSize(10)
self.setFont(font)
self.setMarginsFont(font)
# Margin 0 is used for line numbers
#fm = QFontMetrics(font)
self.setMarginsFont(font)
self.setMarginWidth(1, "00000")
self.setMarginLineNumbers(1, True)
self.setMarginsForegroundColor(QColor("#3E3EE3"))
self.setMarginsBackgroundColor(QColor("#f9f9f9"))
self.setCaretLineVisible(True)
self.setCaretLineBackgroundColor(QColor("#fcf3ed"))

self.setMinimumHeight(120)

# Folding
#self.setFolding(QsciScintilla.BoxedTreeFoldStyle)
#self.setFoldMarginColors(QColor("#99CC66"),QColor("#333300"))
#self.setWrapMode(QsciScintilla.WrapCharacter)

## Edge Mode
#self.setEdgeMode(QsciScintilla.EdgeLine)
#self.setEdgeColumn(80)
#self.setEdgeColor(QColor("#FF0000"))

self.setWrapMode(QsciScintilla.WrapCharacter)
self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)

self.runShortcut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_E), self)
self.runShortcut.activated.connect(self.enteredSelected)
# Reimplemeted copy action to prevent paste prompt (>>>,...) in command view
self.copyShortcut = QShortcut(QKeySequence.Copy, self)
self.copyShortcut.activated.connect(self.copy)
self.selectAllShortcut = QShortcut(QKeySequence.SelectAll, self)
self.selectAllShortcut.activated.connect(self.selectAll)

def insertInitText(self):
txtInit = QCoreApplication.translate("PythonConsole",
"## To access Quantum GIS environment from this console\n"
"## use qgis.utils.iface object (instance of QgisInterface class). Read help for more info.\n\n")
initText = self.setText(txtInit)

def refreshLexerProperties(self):
self.setLexers()

def setLexers(self):
self.lexer = QsciLexerPython()

settings = QSettings()
loadFont = settings.value("pythonConsole/fontfamilytext", "Monospace").toString()
fontSize = settings.value("pythonConsole/fontsize", 10).toInt()[0]
font = QFont(loadFont)
font.setFixedPitch(True)
font.setPointSize(fontSize)

self.lexer.setDefaultFont(font)
self.lexer.setColor(Qt.red, 1)
self.lexer.setColor(Qt.darkGreen, 5)
self.lexer.setColor(Qt.darkBlue, 15)
self.lexer.setFont(font, 1)
self.lexer.setFont(font, 2)
self.lexer.setFont(font, 3)
self.lexer.setFont(font, 4)

self.setLexer(self.lexer)

def getTextFromEditor(self):
text = self.text()
textList = text.split("\n")
return textList

def clearConsole(self):
#self.SendScintilla(QsciScintilla.SCI_CLEARALL)
self.setText('')
self.insertInitText()
self.edit.setFocus()

def contextMenuEvent(self, e):
menu = QMenu(self)
iconRun = QIcon(":/images/console/iconRunConsole.png")
iconPastebin = QIcon(":/images/console/iconCodepadConsole.png")
iconClear = QIcon(":/images/console/iconClearConsole.png")
iconHideTool = QIcon(":/images/console/iconHideToolConsole.png")
hideToolBar = menu.addAction(iconHideTool,
"Hide/Show Toolbar",
self.hideToolBar)
menu.addSeparator()
runAction = menu.addAction(iconRun,
"Enter Selected",
self.enteredSelected,
QKeySequence(Qt.CTRL + Qt.Key_E))
clearAction = menu.addAction(iconClear,
"Clear console",
self.clearConsole)
menu.addSeparator()
copyAction = menu.addAction("Copy",
self.copy,
QKeySequence.Copy)
pastebinAction = menu.addAction(iconPastebin,
"Share on codepad",
self.pastebin)
menu.addSeparator()
selectAllAction = menu.addAction("Select All",
self.selectAll,
QKeySequence.SelectAll)
runAction.setEnabled(False)
clearAction.setEnabled(False)
copyAction.setEnabled(False)
pastebinAction.setEnabled(False)
selectAllAction.setEnabled(False)
if self.hasSelectedText():
runAction.setEnabled(True)
copyAction.setEnabled(True)
pastebinAction.setEnabled(True)
if not self.text(3) == '':
selectAllAction.setEnabled(True)
clearAction.setEnabled(True)
action = menu.exec_(self.mapToGlobal(e.pos()))

def hideToolBar(self):
tB = self.parent.toolBar
tB.hide() if tB.isVisible() else tB.show()
self.edit.setFocus()

def copy(self):
"""Copy text to clipboard... or keyboard interrupt"""
if self.hasSelectedText():
text = unicode(self.selectedText())
text = text.replace('>>> ', '').replace('... ', '').strip() # removing prompts
QApplication.clipboard().setText(text)
else:
self.emit(SIGNAL("keyboard_interrupt()"))

def enteredSelected(self):
cmd = self.selectedText()
self.edit.insertFromDropPaste(cmd)
self.edit.entered()

def keyPressEvent(self, e):
# empty text indicates possible shortcut key sequence so stay in output
txt = e.text()
if txt.length() and txt >= " ":
self.edit.append(txt)
self.edit.move_cursor_to_end()
self.edit.setFocus()
e.ignore()
else:
# possible shortcut key sequence, accept it
e.accept()

def pastebin(self):
import urllib2, urllib
listText = self.selectedText().split('\n')
getCmd = []
for strLine in listText:
if strLine != "":
#if s[0:3] in (">>>", "..."):
# filter for special command (_save,_clear) and comment
if strLine[4] != "_" and strLine[:2] != "##":
strLine.replace(">>> ", "").replace("... ", "")
getCmd.append(unicode(strLine))
pasteText= u"\n".join(getCmd)
url = 'http://codepad.org'
values = {'lang' : 'Python',
'code' : pasteText,
'submit':'Submit'}
try:
response = urllib2.urlopen(url, urllib.urlencode(values))
url = response.read()
for href in url.split("</a>"):
if "Link:" in href:
ind=href.index('Link:')
found = href[ind+5:]
for i in found.split('">'):
if '<a href=' in i:
link = i.replace('<a href="',"").strip()
if link:
QApplication.clipboard().setText(link)
print "## URL copied to clipboard ##"
except urllib2.URLError, e:
print "## Connection error ##"
print "## " + str(e.args) + " ##"
228 changes: 107 additions & 121 deletions python/console_sci.py → python/console/console_sci.py

Large diffs are not rendered by default.

36 changes: 16 additions & 20 deletions python/console_settings.py → python/console/console_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,21 @@ def __init__(self, parent):
self.parent = parent
self.setupUi(self)
#self.show()

self.listPath = []

self.restoreSettings()
self.initialCheck()
self.fontConfig()

self.lineEdit.setReadOnly(True)
self.tabWidget.setTabText(0, QCoreApplication.translate("PythonConsole", "General"))
self.tabWidget.setTabIcon(0, QIcon(":/images/themes/default/propertyicons/general.png"))
self.tabWidget.setTabText(1, QCoreApplication.translate("PythonConsole", "About"))
self.tabWidget.setTabIcon(1, QIcon(":/images/console/iconAboutConsole.png"))


self.addAPIpath.setIcon(QIcon(":/images/themes/default/symbologyAdd.png"))
self.addAPIpath.setToolTip(QCoreApplication.translate("PythonConsole", "Add API path"))
self.removeAPIpath.setIcon(QIcon(":/images/themes/default/symbologyRemove.png"))
self.removeAPIpath.setToolTip(QCoreApplication.translate("PythonConsole", "Remove API path"))
self.connect( self.preloadAPI,

self.connect( self.preloadAPI,
SIGNAL("stateChanged(int)"), self.initialCheck)
self.connect(self.browseButton,
SIGNAL("clicked()"), self.loadAPIFile)
Expand All @@ -64,7 +60,7 @@ def initialCheck(self):
self.enableDisable(False)
else:
self.enableDisable(True)

def enableDisable(self, value):
self.tableWidget.setEnabled(value)
self.lineEdit.setEnabled(value)
Expand All @@ -78,10 +74,10 @@ def loadAPIFile(self):
fileAPI = QFileDialog.getOpenFileName(
self, "Open API File", lastDirPath, "API file (*.api)")
self.lineEdit.setText(fileAPI)

lastDirPath = QFileInfo(fileAPI).path()
settings.setValue("pythonConsole/lastDirAPIPath", QVariant(fileAPI))

def accept(self):
if not self.preloadAPI.isChecked():
if self.tableWidget.rowCount() == 0:
Expand All @@ -91,7 +87,7 @@ def accept(self):
self.saveSettings()
self.listPath = []
QDialog.accept( self )

def addAPI(self):
if self.lineEdit.text() == "":
return
Expand All @@ -114,17 +110,17 @@ def addAPI(self):

def removeAPI(self):
listItemSel = self.tableWidget.selectedIndexes()
#row = self.tableWidget.currentRow()
#row = self.tableWidget.currentRow()
for indx in listItemSel:
self.tableWidget.removeRow(indx.row())

def fontConfig(self):
#fontFamily = ['Courier','Monospace','Aurulent Sans','Bitstream Vera Serif']
#for i in range(0, len(fontFamily)):
#self.comboBox.addItem(fontFamily[i])
settings = QSettings()
self.fontComboBox.setCurrentIndex(settings.value("pythonConsole/fontfamilyindex").toInt()[0])

def saveSettings(self):
settings = QSettings()
settings.setValue("pythonConsole/preloadAPI", QVariant(self.preloadAPI.isChecked()))
Expand All @@ -138,11 +134,11 @@ def saveSettings(self):
self.listPath.append(text)
settings.setValue("pythonConsole/fontsize", QVariant(fontSize))
settings.setValue("pythonConsole/userAPI", QVariant(self.listPath))

def restoreSettings(self):
settings = QSettings()
self.spinBox.setValue(settings.value("pythonConsole/fontsize").toInt()[0])
self.preloadAPI.setChecked(settings.value( "pythonConsole/preloadAPI" ).toBool())
self.preloadAPI.setChecked(settings.value("pythonConsole/preloadAPI", True).toBool())
itemTable = settings.value("pythonConsole/userAPI").toStringList()
for i in range(len(itemTable)):
self.tableWidget.insertRow(i)
Expand All @@ -156,6 +152,6 @@ def restoreSettings(self):
self.tableWidget.horizontalHeader().show()
self.tableWidget.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
#self.comboBox.setCurrentIndex(settings.value("pythonConsole/fontfamilyindex").toInt()[0])

def reject( self ):
QDialog.reject( self )
272 changes: 272 additions & 0 deletions python/console/console_settings.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>411</width>
<height>352</height>
</rect>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox">
<property name="minimumSize">
<size>
<width>51</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>51</width>
<height>26</height>
</size>
</property>
<property name="minimum">
<number>6</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>API file</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item>
<widget class="QPushButton" name="browseButton">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectItems</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerItem</enum>
</property>
<property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="rowCount">
<number>0</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="addAPIpath">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeAPIpath">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item row="6" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="preloadAPI">
<property name="text">
<string>Use preloaded API file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<zorder>buttonBox</zorder>
<zorder>verticalSpacer_2</zorder>
<zorder>preloadAPI</zorder>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
297 changes: 0 additions & 297 deletions python/console_settings.ui

This file was deleted.

61 changes: 44 additions & 17 deletions python/core/conversions.sip
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ template <TYPE>

if (*sipIsErr)
{
sipReleaseInstance(t, sipClass_TYPE, state);
sipReleaseMappedType(t, qvector_qgspoint, state);
delete ql;
return 0;
}
ql->append(*t);
sipReleaseInstance(t, sipClass_TYPE, state);
sipReleaseMappedType(t, qvector_qgspoint, state);
}

*sipCppPtr = ql;
Expand Down Expand Up @@ -185,12 +185,12 @@ template <TYPE>

if (*sipIsErr)
{
sipReleaseInstance(t, sipClass_TYPE, state);
sipReleaseMappedType(t, qvector_qgspoint, state);
delete ql;
return 0;
}
ql->append(*t);
sipReleaseInstance(t, sipClass_TYPE, state);
sipReleaseMappedType(t, qvector_qgspoint, state);
}

*sipCppPtr = ql;
Expand Down Expand Up @@ -261,12 +261,12 @@ template <TYPE>

if (*sipIsErr)
{
sipReleaseInstance(t, sipClass_TYPE, state);
sipReleaseMappedType(t, qlist_type, state);
delete ql;
return 0;
}
ql->append(*t);
sipReleaseInstance(t, sipClass_TYPE, state);
sipReleaseMappedType(t, qlist_type, state);
}

*sipCppPtr = ql;
Expand Down Expand Up @@ -571,38 +571,63 @@ template<TYPE>

%ConvertToTypeCode
PyObject *kobj, *tobj, *kobj2, *tobj2;
Py_ssize_t i = 0;

//TODO: it works using SIP
#if (SIP_VERSION >= 0x041200)
const sipMappedType* qmap2 = sipFindMappedType("QMap<int, TYPE>");
#endif

// Check the type if that is all that is required.
if (sipIsErr == NULL)
{
if (!PyDict_Check(sipPy))
return 0;

Py_ssize_t i = 0;
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
{
if (!PyDict_Check(tobj))
return 0;

#if (SIP_VERSION >= 0x041200)
if (!sipCanConvertToMappedType(tobj, qmap2, SIP_NOT_NONE))
return 0;
#else
Py_ssize_t j = 0;
while (PyDict_Next(tobj, &j, &kobj2, &tobj2))
{
if (!sipCanConvertToInstance(tobj2, sipClass_TYPE, SIP_NOT_NONE))
return 0;
}

#endif
}
return 1;
}

QMap<qint64, QMap<int, TYPE> > *qm = new QMap<qint64, QMap<int, TYPE> >;


Py_ssize_t i = 0;
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
{
qint64 k = PyLong_AsLongLong(kobj);

#if (SIP_VERSION >= 0x041200)
// TODO: search for the minimum SIP version this code works on, it works
// on SIP 4.13.3 (GS). See #else to know why the version check is needed.

int state;

TYPE* t = reinterpret_cast<TYPE*>(sipConvertToMappedType(tobj, qmap2, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));

if (*sipIsErr)
{
sipReleaseMappedType(t, qmap2, state);
delete qm;
return 0;
}

qm.insert(k, *t);
sipReleaseMappedType(t, qmap2, state);
#else
// using sipConvertToMappedType to convert directly to QMap<int, TYPE> doesn't work
// and ends with a segfault

Expand All @@ -614,19 +639,20 @@ template<TYPE>
int k2 = PyInt_AsLong(kobj2);
int state;

TYPE* fa = reinterpret_cast<TYPE*>(sipConvertToInstance(tobj2, sipClass_TYPE, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));
TYPE* t2 = reinterpret_cast<TYPE*>(sipConvertToInstance(tobj2, sipClass_TYPE, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));

if (*sipIsErr)
{
sipReleaseInstance(tobj2, sipClass_TYPE, state);
sipReleaseInstance(t2, sipClass_TYPE, state);
delete qm;
return 0;
}

qm2.insert(k2, *fa);
sipReleaseInstance(tobj2, sipClass_TYPE, state);
qm2.insert(k2, *t2);
sipReleaseInstance(t2, sipClass_TYPE, state);
}
qm->insert(k, qm2);
#endif
}

*sipCppPtr = qm;
Expand Down Expand Up @@ -703,16 +729,17 @@ template<TYPE>
{
int state;
qint64 k = PyLong_AsLongLong(kobj);
QgsGeometry * fa = reinterpret_cast<QgsGeometry*>(sipConvertToInstance(tobj, sipClass_QgsGeometry, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));
QgsGeometry * t = reinterpret_cast<QgsGeometry*>(sipConvertToInstance(tobj, sipClass_QgsGeometry, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));

if (*sipIsErr)
{
sipReleaseInstance(tobj, sipClass_QgsGeometry, state);
sipReleaseInstance(t, sipClass_QgsGeometry, state);
delete qm;
return 0;
}

qm->insert(k, *fa);
qm->insert(k, *t);
sipReleaseInstance(t, sipClass_QgsGeometry, state);
}

*sipCppPtr = qm;
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgscredentials.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ class QgsCredentials
//! virtual destructor
virtual ~QgsCredentials();

bool get( QString realm, QString &username, QString &password, QString message = QString::null );
bool get( QString realm, QString &username /In,Out/, QString &password /In,Out/, QString message = QString::null );
void put( QString realm, QString username, QString password );

//! retrieves instance
static QgsCredentials *instance();

protected:
//! request a password
virtual bool request( QString realm, QString &username, QString &password, QString message = QString::null ) = 0;
virtual bool request( QString realm, QString &username /In,Out/, QString &password /In,Out/, QString message = QString::null ) = 0;

//! register instance
void setInstance( QgsCredentials *theInstance );
Expand All @@ -37,5 +37,5 @@ class QgsCredentialsConsole : QObject, QgsCredentials
void destroyed();

protected:
virtual bool request( QString realm, QString &username, QString &password, QString message = QString::null );
virtual bool request( QString realm, QString &username /In,Out/, QString &password /In,Out/, QString message = QString::null );
};
42 changes: 25 additions & 17 deletions python/core/qgsexpression.sip
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class QgsExpression
//! (used by internal functions)
QgsDistanceArea* geomCalculator();

//! Sets the geometry calculator used in evaluation of expressions,
// instead of the default.
void setGeomCalculator( QgsDistanceArea& calc );

/** This function currently replaces each expression between [% and %]
in the string with the result of its evaluation on the feature
passed as argument.
Expand Down Expand Up @@ -117,29 +121,33 @@ class QgsExpression
// static const char* BinaryOgcOperatorText[];
// static const char* UnaryOgcOperatorText[];

struct FunctionDef /NoDefaultCtors/
class Function
{
//FunctionDef( QString fnname, int params, FcnEval fcn, QString group, QString helpText = QString(), bool usesGeometry = false );
/** The name of the function. */
QString mName;
/** The number of parameters this function takes. */
int mParams;
/** Pointer to function. */
//FcnEval mFcn;
/** Does this function use a geometry object. */
bool mUsesGeometry;
/** The group the function belongs to. */
QString mGroup;
/** The help text for the function. */
QString mHelpText;
public:
Function( QString fnname, int params, QString group, QString helpText = QString(), bool usesGeometry = false );
/** The name of the function. */
QString name();
/** The number of parameters this function takes. */
int params();
/** Does this function use a geometry object. */
bool usesgeometry();
/** The group the function belongs to. */
QString group();
/** The help text for the function. */
QString helptext();

virtual QVariant func(const QVariantList& values, QgsFeature* f, QgsExpression* parent) = 0;
};

static const QList<QgsExpression::FunctionDef> &BuiltinFunctions();
static const QList<QgsExpression::Function *> &Functions();

static bool registerFunction(Function* function);
static bool unregisterFunction(QString name);

// tells whether the identifier is a name of existing function
static bool isFunctionName( QString name );

// return index of the function in BuiltinFunctions array
// return index of the function in Functions array
static int functionIndex( QString name );

/** Returns the number of functions defined in the parser
Expand All @@ -150,7 +158,7 @@ class QgsExpression
/**
* Returns a list of special Column definitions
*/
static QList<QgsExpression::FunctionDef> specialColumns();
static QList<QgsExpression::Function *> specialColumns();

//! return quoted column reference (in double quotes)
static QString quotedColumnRef( QString name );
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsmaprenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class QgsLabelingEngineInterface
//! called when starting rendering of a layer
//! @note: this method was added in version 1.6
virtual int prepareLayer( QgsVectorLayer* layer, QSet<int>& attrIndices, QgsRenderContext& ctx ) = 0;
//! returns PAL layer settings for a registered layer
//! @note: this method was added in version 1.9
virtual QgsPalLayerSettings& layer( const QString& layerName ) = 0;
//! adds a diagram layer to the labeling engine
virtual int addDiagramLayer( QgsVectorLayer* layer, QgsDiagramLayerSettings* s );
//! called for every feature
Expand Down
22 changes: 21 additions & 1 deletion python/core/qgspallabeling.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class QgsPalLayerSettings
ShowAll // show upside down for all labels, including dynamic ones
};

enum DirectionSymbols
{
SymbolLeftRight, // place direction symbols on left/right of label
SymbolAbove, // place direction symbols on above label
SymbolBelow // place direction symbols on below label
};

enum MultiLineAlign
{
MultiLeft = 0,
Expand Down Expand Up @@ -64,6 +71,7 @@ class QgsPalLayerSettings
MaxScale,
FontTransp,
BufferTransp,
AlwaysShow,
PropertyCount, // keep last entry
};

Expand Down Expand Up @@ -116,11 +124,23 @@ class QgsPalLayerSettings
bool displayAll; // if true, all features will be labelled even though overlaps occur
bool mergeLines;
double minFeatureSize; // minimum feature size to be labelled (in mm)
// Adds '<' or '>' to the label string pointing to the direction of the line / polygon ring
bool limitNumLabels; // whether to limit the number of labels to be drawn
int maxNumLabels; // maximum number of labels to be drawn
// Adds '<' or '>', or user-defined symbol to the label string pointing to the
// direction of the line / polygon ring
// Works only if Placement == Line
bool addDirectionSymbol;
QString leftDirectionSymbol;
QString rightDirectionSymbol;
bool reverseDirectionSymbol;
DirectionSymbols placeDirectionSymbol; // whether to place left/right, above or below label
unsigned int upsidedownLabels; // whether, or how, to show upsidedown labels
double maxCurvedCharAngleIn; // maximum angle between inside curved label characters (defaults to 20.0, range 20.0 to 60.0)
double maxCurvedCharAngleOut; // maximum angle between outside curved label characters (defaults to -20.0, range -20.0 to -95.0)
bool fontSizeInMapUnits; //true if font size is in map units (otherwise in points)
bool fontLimitPixelSize; // true is label should be limited by fontMinPixelSize/fontMaxPixelSize
int fontMinPixelSize; // minimum pixel size for showing rendered map unit labels (1 - 1000)
int fontMaxPixelSize; // maximum pixel size for showing rendered map unit labels (1 - 10000)
bool bufferSizeInMapUnits; //true if buffer is in map units (otherwise in mm)
bool labelOffsetInMapUnits; //true if label offset is in map units (otherwise in mm)
bool distInMapUnits; //true if distance is in map units (otherwise in mm)
Expand Down
15 changes: 8 additions & 7 deletions python/core/qgsvectorfilewriter.sip
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class QgsVectorFileWriter
const QString& driverName = "ESRI Shapefile",
bool onlySelected = false,
QString *errorMessage = 0,
const QStringList &datasourceOptions = QStringList(),
const QStringList &layerOptions = QStringList(),
bool skipAttributeCreation = false, // added in 1.7
QString *newFilename = 0
const QStringList &datasourceOptions = QStringList(), // added in 1.6
const QStringList &layerOptions = QStringList(), // added in 1.6
bool skipAttributeCreation = false, // added in 1.6
QString *newFilename = 0 // added in 1.9
);

/** create shapefile and initialize it */
Expand All @@ -61,9 +61,10 @@ class QgsVectorFileWriter
QGis::WkbType geometryType,
const QgsCoordinateReferenceSystem* srs,
const QString& driverName = "ESRI Shapefile",
const QStringList &datasourceOptions = QStringList(),
const QStringList &layerOptions = QStringList(),
QString *newFilename = 0 );
const QStringList &datasourceOptions = QStringList(), // added in 1.6
const QStringList &layerOptions = QStringList(), // added in 1.6
QString *newFilename = 0 // added in 1.9
);

/**Returns map with format filter string as key and OGR format key as value*/
static QMap< QString, QString> supportedFiltersAndFormats();
Expand Down
13 changes: 13 additions & 0 deletions python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ class QgsVectorLayer : QgsMapLayer
UuidGenerator, /* uuid generator - readonly and automatically intialized @added in 1.9 */
};

enum EditorLayout
{
GeneratedLayout,
TabLayout,
UiFileLayout,
};

struct RangeData
{
RangeData();
Expand Down Expand Up @@ -569,6 +576,12 @@ class QgsVectorLayer : QgsMapLayer
/**set edit type*/
void setEditType( int idx, EditType edit );

/**get editor layout**/
EditorLayout editorLayout();

/**set editor layout*/
void setEditorLayout( EditorLayout layout );

/** set string representing 'true' for a checkbox (added in 1.4) */
void setCheckedState( int idx, QString checked, QString notChecked );

Expand Down
25 changes: 0 additions & 25 deletions python/core/raster/qgsrasterdataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,6 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
/* It makes no sense to set input on provider */
bool setInput( QgsRasterInterface* input );

/**
* Add the list of WMS layer names to be rendered by this server
*/
virtual void addLayers( const QStringList & layers,
const QStringList & styles = QStringList() ) = 0;

//! get raster image encodings supported by (e.g.) the WMS Server, expressed as MIME types
virtual QStringList supportedImageEncodings() = 0;

/**
* Get the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
*/
virtual QString imageEncoding() const = 0;

/**
* Set the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
*/
virtual void setImageEncoding( const QString & mimeType ) = 0;

/**
* Set the image projection (in WMS CRS format) used in the transfer from (e.g.) the WMS server
*/
virtual void setImageCrs( const QString & crs ) = 0;


// TODO: Document this better.
/** \brief Renders the layer as an image
*/
Expand Down
4 changes: 0 additions & 4 deletions python/core/raster/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ class QgsRasterLayer : QgsMapLayer
/** [ data provider interface ] Set the data provider */
void setDataProvider( const QString & provider );

static QLibrary* loadProviderLibrary( QString theProviderKey );
static QgsRasterDataProvider* loadProvider( QString theProviderKey, QString theDataSource = 0 );


/** \brief Accessor for blue band name mapping */
QString blueBandName() const;

Expand Down
6 changes: 2 additions & 4 deletions python/core/raster/qgsrasterrenderer.sip
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

class QgsRasterRenderer : QgsRasterInterface
{
%TypeHeaderCode
Expand Down Expand Up @@ -46,15 +47,12 @@ class QgsRasterRenderer : QgsRasterInterface
void setOpacity( double opacity );
double opacity() const;

void setRasterTransparency( QgsRasterTransparency* t );
void setRasterTransparency( QgsRasterTransparency* t /Transfer/);
const QgsRasterTransparency* rasterTransparency() const;

void setAlphaBand( int band );
int alphaBand() const;

void setInvertColor( bool invert );
bool invertColor() const;

/**Get symbology items if provided by renderer*/
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;

Expand Down
4 changes: 2 additions & 2 deletions python/core/raster/qgsrastertransparency.sip
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class QgsRasterTransparency
void initializeTransparentPixelList( double, double, double );

/** \brief Accessor for transparentSingleValuePixelList */
void setTransparentSingleValuePixelList( QList<QgsRasterTransparency::TransparentSingleValuePixel> );
void setTransparentSingleValuePixelList( QList<QgsRasterTransparency::TransparentSingleValuePixel> /Transfer/);

/** \brief Accessor for transparentThreeValuePixelList */
void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::TransparentThreeValuePixel> );
void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::TransparentThreeValuePixel> /Transfer/);

/** \brief Returns the transparency value for a single value Pixel */
int alphaValue( double, int theGlobalTransparency = 255 ) const;
Expand Down
12 changes: 0 additions & 12 deletions python/core/symbology-ng/qgsmarkersymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ class QgsSvgMarkerSymbolLayerV2 : QgsMarkerSymbolLayerV2
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayerV2* createFromSld( QDomElement &element ) /Factory/;

//! Return a list of all available svg files
static QStringList listSvgFiles();

//! Return a list of svg files at the specified directory
static QStringList listSvgFilesAt( QString directory );

//! Get symbol's path from its name
static QString symbolNameToPath( QString name );

//! Get symbols's name from its path
static QString symbolPathToName( QString path );

// implemented from base classes

QString layerType() const;
Expand Down
2 changes: 2 additions & 0 deletions python/core/symbology-ng/qgsrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class QgsFeatureRendererV2
SymbolLevels = 1, // rendering with symbol levels (i.e. implements symbols(), symbolForFeature())
RotationField = 2, // rotate symbols by attribute value
MoreSymbolsPerFeature = 4 // may use more than one symbol to render a feature: symbolsForFeature() will return them
Filter = 8, // features may be filtered, i.e. some features may not be rendered (categorized, rule based ...)
ScaleDependent = 16 // dependends on scale if feature will be rendered (rule based )
};

//! returns bitwise OR-ed capabilities of the renderer
Expand Down
5 changes: 3 additions & 2 deletions python/core/symbology-ng/qgssvgcache.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsSvgCacheEntry
/**A cache for images / pictures derived from svg files. This class supports parameter replacement in svg files
according to the svg params specification (http://www.w3.org/TR/2009/WD-SVGParamPrimer-20090616/). Supported are
the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. <circle fill="param(fill-color red)" stroke="param(pen-color black)" stroke-width="param(outline-width 1)"*/
class QgsSvgCache
class QgsSvgCache : QObject
{
%TypeHeaderCode
#include <qgssvgcache.h>
Expand All @@ -56,7 +56,8 @@ class QgsSvgCache
double& defaultOutlineWidth ) const;

protected:
QgsSvgCache();
//! protected constructor
QgsSvgCache( QObject* parent = 0 );

/**Creates new cache entry and returns pointer to it*/
QgsSvgCacheEntry* insertSVG( const QString& file, int size, const QColor& fill, const QColor& outline, double outlineWidth,
Expand Down
12 changes: 12 additions & 0 deletions python/core/symbology-ng/qgssymbollayerv2utils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,16 @@ class QgsSymbolLayerV2Utils
static void sortVariantList( QList<QVariant>& list, Qt::SortOrder order );
/**Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point*/
static QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance );

//! Return a list of all available svg files
static QStringList listSvgFiles();

//! Return a list of svg files at the specified directory
static QStringList listSvgFilesAt( QString directory );

//! Get symbol's path from its name
static QString symbolNameToPath( QString name );

//! Get symbols's name from its path
static QString symbolPathToName( QString path );
};
37 changes: 18 additions & 19 deletions python/core/symbology-ng/qgsvectorcolorrampv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,25 @@ class QgsVectorColorRampV2

};

struct QgsGradientStop
{
double offset;
QColor color;
QgsGradientStop( double o, const QColor& c );
};

typedef QList<QgsGradientStop> QgsGradientStopsList;

class QgsVectorGradientColorRampV2 : QgsVectorColorRampV2
{
%TypeHeaderCode
#include <qgsvectorcolorrampv2.h>
%End
public:
QgsVectorGradientColorRampV2( QColor color1 = DEFAULT_GRADIENT_COLOR1,
QColor color2 = DEFAULT_GRADIENT_COLOR2 );
QColor color2 = QColor(0,255,0),
bool discrete = false,
QgsGradientStopsList stops = QgsGradientStopsList() );

static QgsVectorColorRampV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;

Expand All @@ -51,10 +62,11 @@ class QgsVectorGradientColorRampV2 : QgsVectorColorRampV2
void setColor1( QColor color );
void setColor2( QColor color );

typedef QMap<double, QColor> StopsMap;
bool isDiscrete() const;
void setDiscrete( bool discrete );

void setStops( const StopsMap& stops );
const StopsMap& stops() const;
void setStops( const QgsGradientStopsList& stops );
const QgsGradientStopsList& stops() const;
};

class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2
Expand Down Expand Up @@ -144,29 +156,15 @@ class QgsCptCityColorRampV2
QgsCptCityColorRampV2( QString schemeName, QStringList variantList,
QString variantName = QString(), bool doLoadFile = true );


enum GradientType
{
Discrete, //discrete stops, e.g. Color Brewer
Continuous, //continuous, e.g. QgsVectorColorRampV2
ContinuousMulti //continuous with 2 values in intermediate stops
};
typedef QList< QPair < double, QColor > > GradientList;


static QgsVectorColorRampV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;

virtual QColor color( double value ) const;

virtual QString type() const;

virtual QgsVectorColorRampV2* clone() const /Factory/;
void copy( const QgsCptCityColorRampV2* other );

virtual QgsStringMap properties() const;

int count() const;

QString schemeName() const;
QString variantName() const;
QStringList variantList() const;
Expand All @@ -178,7 +176,8 @@ class QgsCptCityColorRampV2
void setName( QString schemeName, QString variantName = "", QStringList variantList = QStringList() );

void loadPalette();
GradientType gradientType() const;
bool hasMultiStops() const;
int count() const;

QString fileName() const;
bool loadFile();
Expand Down
1 change: 1 addition & 0 deletions python/gui/gui.sip
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
%Include qgsexpressionhighlighter.sip
%Include qgsfieldvalidator.sip
%Include qgsfiledropedit.sip
%Include qgsfilterlineedit.sip
%Include qgsformannotationitem.sip
%Include qgsgenericprojectionselector.sip
%Include qgshtmlannotationitem.sip
Expand Down
10 changes: 10 additions & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,21 @@ class QgisInterface : QObject
virtual QAction *actionAddPgLayer() = 0;
virtual QAction *actionAddWmsLayer() = 0;
virtual QAction *actionLayerSeparator1() = 0 /Deprecated/;
/** @note added in 1.9 */
virtual QAction *actionCopyLayerStyle() = 0;
/** @note added in 1.9 */
virtual QAction *actionPasteLayerStyle() = 0;
virtual QAction *actionOpenTable() = 0;
virtual QAction *actionToggleEditing() = 0;
/** @note added in 1.9 */
virtual QAction *actionSaveEdits() = 0;
/** @note added in 1.9 */
virtual QAction *actionSaveAllEdits() = 0;
virtual QAction *actionLayerSaveAs() = 0;
virtual QAction *actionLayerSelectionSaveAs() = 0;
virtual QAction *actionRemoveLayer() = 0;
/** @note added in 1.9 */
virtual QAction *actionDuplicateLayer() = 0;
virtual QAction *actionLayerProperties() = 0;
virtual QAction *actionLayerSeparator2() = 0 /Deprecated/;
virtual QAction *actionAddToOverview() = 0;
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgscredentialdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ class QgsCredentialDialog : QDialog, QgsCredentials
~QgsCredentialDialog();

protected:
virtual bool request( QString realm, QString &username, QString &password, QString message = QString::null );
virtual bool request( QString realm, QString &username /In,Out/, QString &password /In,Out/, QString message = QString::null );
};
5 changes: 5 additions & 0 deletions python/gui/qgsexpressionbuilderdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class QgsExpressionBuilderDialog : QDialog

QString expressionText();

/** Sets geometry calculator used in distance/area calculations.
* @note added in version 2.0
*/
void setGeomCalculator( const QgsDistanceArea & da );

protected:
/**
* Handle closing of the window
Expand Down
5 changes: 5 additions & 0 deletions python/gui/qgsexpressionbuilderwidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ class QgsExpressionBuilderWidget : QWidget

void loadFieldNames( QMap<int, QgsField> fields );

/** Sets geometry calculator used in distance/area calculations.
* @note added in version 2.0
*/
void setGeomCalculator( const QgsDistanceArea & da );

/** Gets the expression string that has been set in the expression area.
* @returns The expression as a string. */
QString expressionText();
Expand Down
15 changes: 15 additions & 0 deletions python/gui/qgsfilterlineedit.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

/** LineEdit with builtin clear button
*/
class QgsFilterLineEdit : QLineEdit
{
%TypeHeaderCode
#include <qgsfilterlineedit.h>
%End

public:
QgsFilterLineEdit( QWidget* parent = 0 );

protected:
void resizeEvent( QResizeEvent * );
};
7 changes: 6 additions & 1 deletion python/gui/qgslegendinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ class QgsLegendInterface : QObject
//! Return the relationship between groups and layers in the legend
virtual QList< QPair< QString, QList<QString> > > groupLayerRelationship();

//! Return all layers in the project in legend order
//! Returns the currently selected layers of QgsLegendLayers.
//! @param inDrawOrder return layers in drawing order (added in 1.9)
//! @returns list of layers, else an empty list
virtual QList<QgsMapLayer *> selectedLayers( bool inDrawOrder = false ) const = 0;

//! Return all layers in the project in drawing order
//! @note added in 1.5
virtual QList< QgsMapLayer * > layers() const = 0;

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmapoverviewcanvas.sip
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class QgsMapOverviewCanvas : QWidget

void enableAntiAliasing( bool flag );

void updateFullExtent( const QgsRectangle& rect );
void updateFullExtent();

public slots:

Expand Down
8 changes: 8 additions & 0 deletions python/gui/qgsmessagebar.sip
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class QgsMessageBar: QFrame
static QWidget* createMessage( const QString &title, const QString &text, const QIcon &icon, QWidget *parent = 0 ) /Factory/;

signals:
//! emitted when a message widget is added to the bar
void widgetAdded( QWidget *widget );

//! emitted when a widget was removed from the bar
void widgetRemoved( QWidget *widget );

Expand All @@ -41,4 +44,9 @@ class QgsMessageBar: QFrame
* @return true if the widget was removed, false otherwise
*/
bool popWidget();

/*! remove all items from the bar's widget list
* @return true if all items were removed, false otherwise
*/
bool clearWidgets();
};
6 changes: 4 additions & 2 deletions python/gui/qgsrubberband.sip
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ class QgsRubberBand: QgsMapCanvasItem
%End

public:
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon = false );
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, QGis::GeometryType geometryType = QGis::Line );
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon );
~QgsRubberBand();

void setColor( const QColor & color );
void setWidth( int width );

void reset( bool isPolygon = false );
void reset( QGis::GeometryType geometryType = QGis::Line );
void reset( bool isPolygon );

//! Add point to rubberband and update canvas
//! If adding more points consider using update=false for better performance
Expand Down
12 changes: 2 additions & 10 deletions python/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class QgsCategorizedSymbolRendererV2Widget : QgsRendererV2Widget
void changeCategorizedSymbol();
void categoryColumnChanged();
void categoriesDoubleClicked( const QModelIndex & idx );
void addCategory();
void addCategories();
void deleteCategory();
void deleteCategories();
void deleteAllCategories();
void changeCurrentValue( QStandardItem * item );

void rotationFieldChanged( QString fldName );
void sizeScaleFieldChanged( QString fldName );
Expand All @@ -39,19 +39,11 @@ class QgsCategorizedSymbolRendererV2Widget : QgsRendererV2Widget
//! populate column combo
void populateColumns();

void addCategory( const QgsRendererCategoryV2& cat );

//! return row index for the currently selected category (-1 if on no selection)
int currentCategoryRow();

//! return key for the currently selected category
QVariant currentCategory();

void changeCategorySymbol();

QList<QgsSymbolV2*> selectedSymbols();
void refreshSymbolView();

protected slots:
void addCategory();
};
Loading