235 changes: 154 additions & 81 deletions CHANGELOG

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "7")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_VERSION_PATCH "2")
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
SET(RELEASE_NAME "Wroclaw")
SET(PROJECT_VERSION ${COMPLETE_VERSION})
Expand Down
156 changes: 83 additions & 73 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Quantum GIS (QGIS)
Building QGIS from source - step by step
Sunday August 07, 2011
Sunday November 06, 2011


Last Updated: Sunday August 07, 2011
Last Change : Tuesday June 28, 2011
Last Updated: Sunday November 06, 2011
Last Change : Sunday November 06, 2011


1. Introduction
Expand Down Expand Up @@ -81,9 +81,9 @@ Following a summary of the required dependencies for building:

Required build tools:

- CMake >= 2.6.0
- CMake >= 2.6.2
- Flex
- Bison
- Bison >= 2.4

Required build deps:

Expand Down Expand Up @@ -320,10 +320,10 @@ Install them using dpkg. E.g.:
3.9. A practical case: Building QGIS and GRASS from source on Ubuntu with ECW and MrSID formats support
=======================================================================================================

The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If you want
to use different versions of the software (gdal, grass, qgis), just make the
necessary adjustments to the following code. This guide assumes that you don't have
installed any previous version of gdal, grass and qgis.
The following procedure has been tested on Ubuntu 8.04, 8.10 and 9.04 32bit. If
you want to use different versions of the software (gdal, grass, qgis), just
make the necessary adjustments to the following code. This guide assumes that
you don't have installed any previous version of gdal, grass and qgis.


3.9.1. Step 1: install base packages
Expand All @@ -343,7 +343,7 @@ Go to the ERDAS web site http://www.erdas.com/ and follow the links
then download the "'Image Compression SDK Source Code 3.3'" (you'll need to make a registration
and accept a license).

Uncompress the arquive in a proper location (this guide assumes
Uncompress the archive in a proper location (this guide assumes
that all the downloaded source code will be placed in the user home)
and the enter the newly created folder

Expand Down Expand Up @@ -438,23 +438,32 @@ leave the folder
Before downloading and compile GRASS source code you need to install a few
other libraries and programs. We can do this through apt

sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev debhelper dpatch libtiff4-dev \
tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev libfreetype6-dev autoconf2.13 autotools-dev \
libgdal1-dev proj libjpeg62-dev libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake \
python-dev python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev libxmu6 \
libqt4-dev libgsl0-dev python-qt4 swig python-wxversion python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev \
tk8.4-dev tk8.4 libfftw3-dev libfftw3-3
sudo apt-get install flex bison libreadline5-dev libncurses5-dev lesstif2-dev \
debhelper dpatch libtiff4-dev tcl8.4-dev tk8.4-dev fftw-dev xlibmesa-gl-dev \
libfreetype6-dev autoconf2.13 autotools-dev libgdal1-dev proj libjpeg62-dev \
libpng12-dev libpq-dev unixodbc-dev doxygen fakeroot cmake python-dev \
python-qt4-common python-qt4-dev python-sip4 python2.5-dev sip4 libglew1.5-dev \
libxmu6 \ libqt4-dev libgsl0-dev python-qt4 swig python-wxversion \
python-wxgtk2.8 libwxgtk2.8-0 libwxbase2.8-0 tcl8.4-dev tk8.4-dev tk8.4 \
libfftw3-dev libfftw3-3

At this point we can get the GRASS source code: you may want to download it
through svn or maybe you want just to download the latest available source code arquive.
For example the GRASS 6.4rc4 is available at http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz
through svn or maybe you want just to download the latest available source code
archive. For example the GRASS 6.4rc4 is available at
http://grass.itc.it/grass64/source/grass-6.4.0RC4.tar.gz

Uncompress the arquive, enter the newly created folder and run configure with a few specific parameters
Uncompress the archive, enter the newly created folder and run configure with a few specific parameters

CFLAGS="-fexceptions" ./configure --with-tcltk-includes=/usr/include/tcl8.4 --with-proj-share=/usr/share/proj --with-gdal=/usr/local/bin/gdal-config \
CFLAGS="-fexceptions" ./configure \
--with-tcltk-includes=/usr/include/tcl8.4 \
--with-proj-share=/usr/share/proj \
--with-gdal=/usr/local/bin/gdal-config \
--with-python=/usr/bin/python2.5-config

The additional gcc option -fexceptions is necessary to enable exceptions support in GRASS libraries. It is currently the only way to avoid QGIS crashes if a fatal error happens in GRASS library. See also http://trac.osgeo.org/grass/ticket/869
The additional gcc option -fexceptions is necessary to enable exceptions
support in GRASS libraries. It is currently the only way to avoid QGIS crashes
if a fatal error happens in GRASS library. See also
http://trac.osgeo.org/grass/ticket/869

Then as usual (it will take a while)

Expand All @@ -474,31 +483,21 @@ may want to give it a try
grass64 -wxpython


3.9.6. Step 6: compile and install QGIS
3.9.6. Step 6: Compile and install QGIS
=======================================

As for GRASS you can obtain the QGIS source code from different sources,
for instance from svn or just by downloading one of the source code arquives available
at http://www.qgis.org/download/sources.html
As for GRASS you can obtain the QGIS source code from different sources as described
in section 2 above. Once you have the sources, create a build directory in them:

For example download the QGIS 1.1.0 source code here http://download.osgeo.org/qgis/src/qgis_1.1.0.tar.gz

uncompress the arquive and enter the newly created folder

cd /qgis_1.1.0
cd Quantum-GIS
mkdir build
cd build

then run ccmake

ccmake .

press the "c" key, then when the option list will appear we need to manually
configure the "GRASS_PREFIX" parameter. Scroll down until the "GRASS_PREFIX" will appear,
press enter and manually set it to

/usr/local/grass-6.4.0RC4

then press enter again.
ccmake ..

Press the "c" key to do an initial configure.
Press the "c" again and the option "Press [g] to generate and exit" will appear.
Press the "g" key to generate and exit.

Expand Down Expand Up @@ -620,13 +619,9 @@ installed in the default locations):
@cmd

Start the batch file and on the command prompt checkout the QGIS source from
svn to the source directory qgis-trunk:

svn co https://svn.osgeo.org/qgis/trunk/qgis qgis-trunk
git to the source directory Quantum-GIS:

or using git-svn (from the git shell):

git svn clone --username $USER --revision 15611:HEAD https://svn.osgeo.org/qgis/trunk/qgis
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.
Expand Down Expand Up @@ -1153,9 +1148,9 @@ In this approach I will try to avoid as much as possible building dependencies
from source and rather use frameworks wherever possible.

The base system here is Mac OS X 10.4 (Tiger), with a single architecture
build. Included are notes for building on Mac OS X 10.5 (Leopard) and 10.6
(Snow Leopard). Make sure to read each section completely before typing
the first command you see.
build. Included are notes for building on Mac OS X 10.5 (Leopard), 10.6
(Snow Leopard) and 10.7 (Lion).
Make sure to read each section completely before typing the first command you see.

General note on Terminal usage: When I say "cd" to a folder in a Terminal,
it means type "cd " (without the quotes, make sure to type a space after) and
Expand Down Expand Up @@ -1186,10 +1181,12 @@ You need a minimum of Qt-4.4.0. I suggest getting the latest. There is no need
for the full Qt SDK, so save yourself some download time and get the frameworks
only.

Snow Leopard note: If you are building on Snow Leopard, you will need to
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
Snow Leopard+ note: If you are building on Snow Leopard+, you will need to
decide between 32-bit support in the older Qt Carbon branch, or 64-bit
support in the Qt Cocoa branch. Appropriate installers are available for both
as of Qt-4.5.2. Qt 4.6+ is recommended for Cocoa.
as of Qt-4.5.2, though they stopped making Carbon packages at Qt 4.7.4.
Qt 4.6+ is recommended for Cocoa.
Starting with Lion, Carbon may not work properly, if at all.

PPC note: The readymade Qt Cocoa installers don't include PPC support, you'd
have to compile Qt yourself. But, there appear to be issues with Qt Cocoa on
Expand Down Expand Up @@ -1257,8 +1254,8 @@ have problems and you are on your own with those.
5.2.2. Additional Dependencies: Expat
=====================================

Snow Leopard note: Snow Leopard includes a usable expat, so this step is
not necessary on Snow Leopard.
Snow Leopard+ note: Snow Leopard includes a usable expat, so this step is
not necessary on Snow Leopard or Lion.

Get the expat sources:

Expand All @@ -1275,10 +1272,10 @@ source folder and:
5.2.3. Additional Dependencies: Python
======================================

Leopard and Snow Leopard note: Leopard and Snow Leopard include a usable
Python 2.5 and 2.6, respectively. So there is no need to install Python on
Leopard and Snow Leopard. You can still install Python from python.org if
preferred.
Leopard+ note: Starting with Leopard a usable Python is included
in the system. This Python 2.5, 2.6 and 2.7, respectively for Leo, Snow and Lion.
So there is no need to install Python on Leopard and newer.
You can still install Python from python.org if preferred.

If installing from python.org, make sure you install at least the latest Python
2.x from
Expand Down Expand Up @@ -1313,12 +1310,13 @@ More configuration is needed to install outside the system path:
python configure.py -n -d /Library/Python/2.5/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip -s MacOSX10.5.sdk

Snow Leopard system Python
Snow Leopard+ system Python

Similar to Leopard, you should install outside the system Python path.
Also, you need to specify the architecture you want (requires at least SIP
4.9), and make sure to run the versioned python binary (this one responds to
the 'arch' command, 'python' does not).
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.

If you are using 32-bit Qt (Qt Carbon):

Expand Down Expand Up @@ -1360,12 +1358,13 @@ More configuration is needed to install outside the system path:

python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin

Snow Leopard system Python
Snow Leopard+ system Python

Similar to Leopard, you should install outside the system Python path.
Also, you need to specify the architecture you want (requires at least PyQt 4.6),
and make sure to run the versioned python binary (this one responds to the
'arch' command, which is important for pyuic4, 'python' does not).
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.

If you are using 32-bit Qt (Qt Carbon):

Expand Down Expand Up @@ -1434,7 +1433,7 @@ Carbon note below):

Make sure to use the qwt install path from the Qwt build above.

Snow Leopard note
Snow Leopard+ note

If using Qt Carbon, you need to specify which architectures to build, otherwise
it will default to a combination that does not work (ie x86_64 for a Carbon Qt).
Expand All @@ -1448,18 +1447,15 @@ This is not needed for Qt Cocoa. Configure as follows:
5.2.7. Additional Dependencies: Bison
=====================================

Leopard and Snow Leopard note: Leopard and Snow Leopard include Bison 2.3,
so this step can be skipped on Leopard and Snow Leopard.

The version of bison available by default on Mac OS X 10.4 is too old so you
need to get a more recent one on your system. Download at least version 2.3 from:
The version of bison available by default on Mac OS X is too old so you
need to get a more recent one on your system. Download at least version 2.4 from:

ftp.gnu.org/gnu/bison/

Now build and install it to a prefix of /usr/local.ďż˝ Double-click the source
Now build and install it to a prefix of /usr/local. Double-click the source
tarball to unpack it, then cd to the source folder and:

./configure --prefix=/usr/local
./configure --disable-dependency-tracking CFLAGS=-Os
make
sudo make install

Expand All @@ -1473,8 +1469,9 @@ http://www.cmake.org/cmake/resources/software.html

Binary installers are available for OS X, but they are not recommended
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
strange application). Instead, download the source, double-click the source
tarball, then cd to the source folder and:
strange application). Instead, download the source.
NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
Double-click the source tarball, then cd to the source folder and:

./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
make
Expand All @@ -1500,16 +1497,17 @@ CMake supports out of source build so we will create a 'build' dir for the
build process. OS X uses ${HOME}/Applications as a standard user app folder (it
gives it the system app folder icon). If you have the correct permissions you
may want to build straight into your /Applications folder. The instructions
below assume you are building into a pre-existing ${HOME}/Applications directory.
below assume you are building into a ${HOME}/Applications directory.
In a Terminal cd to the qgis source folder previously downloaded, then:

mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
..

This will automatically find and use the previously installed frameworks, and
Expand All @@ -1521,10 +1519,11 @@ path and version as required):

cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D GRASS_PREFIX=/user/local/grass-6.4.1 \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
..

Snow Leopard note: To handle 32-bit Qt (Carbon), create a 32bit python wrapper
Expand All @@ -1539,12 +1538,23 @@ script and add arch flags to the configuration:

cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
-D CMAKE_OSX_ARCHITECTURES=i386 -D PYTHON_EXECUTABLE=/usr/local/bin/python32 \
..

The Qgis Mapserver feature requires fastcgi support. This is included in
Leopard and Snow Leopard, but was dropped at Lion. To build the Mapserver
component on Leopard and Snow, add the followling line before the last line in
the above configuration:

-D WITH_MAPSERVER=TRUE \

On Lion you are on your own to figure out how to install libfcgi and add fcgi
support to the system Apache. Not recommended for the average user.

Bundling note: Older Qt versions may have problems with some Qt plugins and
Qgis. The way to handle this is to bundle Qt inside the Qgis application. You
can do this now or wait to see if there are immediate crashes when running Qgis.
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ installation document in qgis/doc/index.html. The installation document is
also available as PDF in the same directory.

HELP US -- Please submit bug reports using the QGIS bug tracker at:
http://trac.osgeo.org/qgis/
http://hub.qgis.org/
When reporting a bug, either login or, if you don't
have a qgis trac, provide an email address where we can
request additional information.
Expand All @@ -60,7 +60,7 @@ SUPPORT - You can get support in the following ways:
folks on the channel are doing other things and it may take a
while for them to notice your question.

QGIS is on GitHub at http://github.com/qgis/qgis. If you wish to contribute
QGIS is on GitHub at http://github.com/qgis/Quantum-GIS. If you wish to contribute
patches you can fork the project, make your changes, commit to your
repository, and then issue a pull request. The development team can then
review your contribution and commit it upstream as appropriate. See
Expand Down
252 changes: 145 additions & 107 deletions doc/INSTALL.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/SPONSORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Please consider sponsoring the development of QuantumGIS.
See: http://qgis.org/en/sponsorship.html

SILVER
State of Vorarlberg, Austria (11.2011)|http://www.vorarlberg.at/
Kanton Solothurn, Switzerland (4.2011)|http://www.agi.so.ch/

BRONZE
Expand Down
418 changes: 320 additions & 98 deletions doc/changelog.html

Large diffs are not rendered by default.

56 changes: 52 additions & 4 deletions doc/changelog.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,68 @@ Change history for the QGIS Project
%rather apply it selectively to paragraphs where needed.

% To generate the text version of this document:
% txt2tags -t txt -o CHANGELOG CHANGELOG.t2t
% txt2tags -t txt -o ../CHANGELOG changelog.t2t
% To generate the mediawiki version of this document:
% txt2tags -t wiki --no-enum-title -o CHANGELOG.wiki CHANGELOG.t2t
% txt2tags -t wiki --no-enum-title -o CHANGELOG.wiki changelog.t2t
% To generate the html version of this document:
% txt2tags -t html -o CHANGELOG.html CHANGELOG.t2t
% txt2tags -t html -o changelog.html changelog.t2t
% To generate the LaTeX version of this document:
% txt2tags -t tex -o CHANGELOG.tex CHANGELOG.t2t; pdflatex CHANGELOG.tex
% txt2tags -t tex -o CHANGELOG.tex CHANGELOG.t2t; pdflatex changelog.tex

% End of comments
% -------------------

Last Updated: %%date(%A %B %d, %Y)
Last Change : %%mtime(%A %B %d, %Y)

= Whats new in Version 1.7.2 'Wroclaw'? =

This is a bugfix release over version 1.7.1. The following changes
were made.

- Fix Gdaltools error checking for ogr layers
- More Translations in OSM plugin
- Fix for ticket #4283 (composer forgets on/off status of layers)
- Fix to v.generalize for recent GRASS versions
- Fix typos in GRASS command list
- Restore override cursor when about box is shown
- Fix #4319 (Enhance maximum for point displacement tolerance)
- Added Python wrappers for QgsZonalStatistics
- Fix #4331 (Classification dialog issues)
- Fix #4282 (Wrong map zooming when using the "Attribute Table" zoom tool)
- Match proj4string in database
- Fix #4241 (Ensure that we have a valid line in line decoration)
- Fix label id for GetPrint in composer
- Fix #3041 (Make the gdaltools command editable)
- Fix shift in point displacement renderer
- Fix for a crash in projection selection
- Fix #4308 (Interpolation and Terrain core plugins)
- Insert date value in attribute editor
- Fix #4387 (Enable "add direction symbol" only for line layers)
- Fix #2491 (Handle raster layer's transparency band while rendering)
- Allow setting I/O encoding for OGR layers in vector layer properties.
- Fix #4414 (SVG indicators for arrows are not shown)
- Label direction symbol shouldn't depend on "map" vs. "line" orientation.
- Set prompt as default behaviour for unknown CRS
- For EPSG initialize GDAL CRS from authid instead of proj.4 string
- Fix #4439 (Crash when changing style in Layer Properties)
- Fix #4444 (Error when loading Python plugins)
- Fix #4440 (invalid reference to Trac)
- Fix stopRender call in graduated symbol renderer
- Fix #4479 - trigger "new color ramp" always when activated
- Hide query entry in legend context menu for layers with joins
- Fix #4496 (Refresh map list in composer table widget in showEvent)
- OS X build/install updates
- GRASS version support
- Intializing from WKT favourize EPSG instead of PROJ.4
- Add What's this to Help menu (implement #4179)
- fTools: update layers lists after adding new layer to TOC (fix #4318)
- Don't block QGIS main window when running Merge shapefiles tool. Partially addresses #4383
- Fix broken Assign projection functionality in GDALTools and improve handling output file extension
-



= Whats new in Version 1.7.1 'Wroclaw'? =

This is a bugfix release over version 1.7.0. The following changes
Expand Down
73 changes: 45 additions & 28 deletions doc/osx.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ In this approach I will try to avoid as much as possible building dependencies
from source and rather use frameworks wherever possible.

The base system here is Mac OS X 10.4 (__Tiger__), with a single architecture
build. Included are notes for building on Mac OS X 10.5 (__Leopard__) and 10.6
(__Snow Leopard__). Make sure to read each section completely before typing
the first command you see.
build. Included are notes for building on Mac OS X 10.5 (__Leopard__), 10.6
(__Snow Leopard__) and 10.7 (__Lion__).
Make sure to read each section completely before typing the first command you see.

__General note on Terminal usage:__ When I say "cd" to a folder in a Terminal,
it means type "cd " (without the quotes, make sure to type a space after) and
Expand Down Expand Up @@ -38,10 +38,12 @@ You need a minimum of Qt-4.4.0. I suggest getting the latest. There is no need
for the full Qt SDK, so save yourself some download time and get the frameworks
only.

__Snow Leopard note:__ If you are building on Snow Leopard, you will need to
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
__Snow Leopard+ note:__ If you are building on Snow Leopard+, you will need to
decide between 32-bit support in the older Qt Carbon branch, or 64-bit
support in the Qt Cocoa branch. Appropriate installers are available for both
as of Qt-4.5.2. Qt 4.6+ is recommended for Cocoa.
as of Qt-4.5.2, though they stopped making Carbon packages at Qt 4.7.4.
Qt 4.6+ is recommended for Cocoa.
Starting with Lion, Carbon may not work properly, if at all.

__PPC note:__ The readymade Qt Cocoa installers don't include PPC support, you'd
have to compile Qt yourself. But, there appear to be issues with Qt Cocoa on
Expand Down Expand Up @@ -106,8 +108,8 @@ have problems and you are on your own with those.

=== Additional Dependencies: Expat ===

__Snow Leopard note:__ Snow Leopard includes a usable expat, so this step is
not necessary on Snow Leopard.
__Snow Leopard+ note:__ Snow Leopard includes a usable expat, so this step is
not necessary on Snow Leopard or Lion.

Get the expat sources:

Expand All @@ -124,10 +126,10 @@ sudo make install

=== Additional Dependencies: Python ===

__Leopard and Snow Leopard note:__ Leopard and Snow Leopard include a usable
Python 2.5 and 2.6, respectively. So there is no need to install Python on
Leopard and Snow Leopard. You can still install Python from python.org if
preferred.
__Leopard+ note:__ Starting with Leopard a usable Python is included
in the system. This Python 2.5, 2.6 and 2.7, respectively for Leo, Snow and Lion.
So there is no need to install Python on Leopard and newer.
You can still install Python from python.org if preferred.

If installing from python.org, make sure you install at least the latest Python
2.x from
Expand Down Expand Up @@ -164,12 +166,13 @@ python configure.py -n -d /Library/Python/2.5/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip -s MacOSX10.5.sdk
```

__Snow Leopard system Python__
__Snow Leopard+ system Python__

Similar to Leopard, you should install outside the system Python path.
Also, you need to specify the architecture you want (requires at least SIP
4.9), and make sure to run the versioned python binary (this one responds to
the 'arch' command, 'python' does not).
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.

If you are using 32-bit Qt (Qt Carbon):

Expand Down Expand Up @@ -219,12 +222,13 @@ More configuration is needed to install outside the system path:
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
```

__Snow Leopard system Python__
__Snow Leopard+ system Python__

Similar to Leopard, you should install outside the system Python path.
Also, you need to specify the architecture you want (requires at least PyQt 4.6),
and make sure to run the versioned python binary (this one responds to the
'arch' command, which is important for pyuic4, 'python' does not).
Substitute '2.7' for python version and 10.7 for SDK version below for Lion.

If you are using 32-bit Qt (Qt Carbon):

Expand Down Expand Up @@ -304,7 +308,7 @@ sudo make install

Make sure to use the qwt install path from the Qwt build above.

__Snow Leopard note__
__Snow Leopard+ note__

If using Qt Carbon, you need to specify which architectures to build, otherwise
it will default to a combination that does not work (ie x86_64 for a Carbon Qt).
Expand All @@ -319,21 +323,18 @@ python configure.py --extra-cflags="-arch i386" --extra-cxxflags="-arch i386" \

=== Additional Dependencies: Bison ===

__Leopard and Snow Leopard note:__ Leopard and Snow Leopard include Bison 2.3,
so this step can be skipped on Leopard and Snow Leopard.

The version of bison available by default on Mac OS X 10.4 is too old so you
need to get a more recent one on your system. Download at least version 2.3 from:
The version of bison available by default on Mac OS X is too old so you
need to get a more recent one on your system. Download at least version 2.4 from:

```
ftp.gnu.org/gnu/bison/
```

Now build and install it to a prefix of /usr/local.ďż˝ Double-click the source
Now build and install it to a prefix of /usr/local. Double-click the source
tarball to unpack it, then cd to the source folder and:

```
./configure --prefix=/usr/local
./configure --disable-dependency-tracking CFLAGS=-Os
make
sudo make install
```
Expand All @@ -346,8 +347,9 @@ http://www.cmake.org/cmake/resources/software.html

Binary installers are available for OS X, but they are not recommended
(2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
strange application). Instead, download the source, double-click the source
tarball, then cd to the source folder and:
strange application). Instead, download the source.
NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
Double-click the source tarball, then cd to the source folder and:

```
./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
Expand All @@ -371,17 +373,18 @@ CMake supports out of source build so we will create a 'build' dir for the
build process. OS X uses ${HOME}/Applications as a standard user app folder (it
gives it the system app folder icon). If you have the correct permissions you
may want to build straight into your /Applications folder. The instructions
below assume you are building into a pre-existing ${HOME}/Applications directory.
below assume you are building into a ${HOME}/Applications directory.
In a Terminal cd to the qgis source folder previously downloaded, then:

```
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
..
```

Expand All @@ -395,10 +398,11 @@ path and version as required):
```
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D GRASS_PREFIX=/user/local/grass-6.4.1 \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
..
```

Expand All @@ -415,13 +419,26 @@ sudo chmod +x /usr/local/bin/python32

cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_MAPSERVER=TRUE \
-D WITH_INTERNAL_SPATIALITE=FALSE \
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
-D BISON_EXECUTABLE=/usr/local/bin/bison \
-D CMAKE_OSX_ARCHITECTURES=i386 -D PYTHON_EXECUTABLE=/usr/local/bin/python32 \
..
```

The Qgis Mapserver feature requires fastcgi support. This is included in
Leopard and Snow Leopard, but was dropped at Lion. To build the Mapserver
component on Leopard and Snow, add the followling line before the last line in
the above configuration:

```
-D WITH_MAPSERVER=TRUE \
```

On Lion you are on your own to figure out how to install libfcgi and add fcgi
support to the system Apache. Not recommended for the average user.

__Bundling note:__ Older Qt versions may have problems with some Qt plugins and
Qgis. The way to handle this is to bundle Qt inside the Qgis application. You
can do this now or wait to see if there are immediate crashes when running Qgis.
Expand Down
Binary file added doc/qgis-download-stats.ods
Binary file not shown.
3,391 changes: 1,649 additions & 1,742 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions i18n/qgis_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,7 @@ Disabilita l'opzione "Usa estensioni di intersezione" per ottener
</message>
<message>
<source>Select directory with GDAL executables</source>
<translation>Scegli la cartella contenente gli eseguibili GDAL</translation>
<translation>Scegli la cartella contenente gli eseguibili di GDAL</translation>
</message>
<message>
<source>Select directory with the GDAL documentation</source>
Expand Down Expand Up @@ -10247,7 +10247,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../src/ui/qgsannotationwidgetbase.ui" line="50"/>
<source>Frame width</source>
<translation>Larghezza del riquadro</translation>
<translation>Spessore del riquadro</translation>
</message>
<message>
<location filename="../src/ui/qgsannotationwidgetbase.ui" line="67"/>
Expand Down Expand Up @@ -12888,12 +12888,12 @@ Should the existing classes be deleted before classification?</source>
<message>
<location filename="../src/ui/qgscomposermapwidgetbase.ui" line="443"/>
<source>Annotation position</source>
<translation>Posizione dell&apos;annotazione</translation>
<translation>Posizione delle coordinate</translation>
</message>
<message>
<location filename="../src/ui/qgscomposermapwidgetbase.ui" line="462"/>
<source>Annotation direction</source>
<translation>Direzione dell&apos;annotazione</translation>
<translation>Direzione delle coordinate</translation>
</message>
<message>
<location filename="../src/ui/qgscomposermapwidgetbase.ui" line="596"/>
Expand Down Expand Up @@ -20440,7 +20440,7 @@ Può essere o un problema della propria connessione di rete o sul lato del serve
<location filename="../src/plugins/interpolation/qgsinterpolationdialog.cpp" line="165"/>
<location filename="../src/plugins/interpolation/qgsinterpolationdialog.cpp" line="275"/>
<source>Break lines</source>
<translation>Spezza linee</translation>
<translation>Linee di interruzione</translation>
</message>
<message>
<location filename="../src/plugins/interpolation/qgsinterpolationdialog.cpp" line="169"/>
Expand Down Expand Up @@ -22668,7 +22668,7 @@ Può essere o un problema della propria connessione di rete o sul lato del serve
<message>
<location filename="../python/plugins/mapserver_export/qgsmapserverexportbase.ui" line="24"/>
<source>Use current project</source>
<translation>Usa proiezione corrente</translation>
<translation>Usa progetto corrente</translation>
</message>
<message>
<location filename="../python/plugins/mapserver_export/qgsmapserverexportbase.ui" line="87"/>
Expand Down Expand Up @@ -29464,7 +29464,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisplugin.cpp" line="106"/>
<source>Calculating </source>
<translation>Calcolo in corso</translation>
<translation>Calcolo in corso </translation>
</message>
<message>
<location filename="../src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisplugin.cpp" line="106"/>
Expand Down Expand Up @@ -31094,7 +31094,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../src/plugins/spatialquery/qgsspatialquerydialogbase.ui" line="332"/>
<source>Zoom to item</source>
<translation>Zomm all&apos;oggetto</translation>
<translation>Zoom all&apos;oggetto</translation>
</message>
<message>
<location filename="../src/plugins/spatialquery/qgsspatialquerydialogbase.ui" line="353"/>
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/web_banner.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 modified images/splash/web_banner.xcf.bz2
Binary file not shown.
1 change: 1 addition & 0 deletions mac/cmake/1qt.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ FOREACH (QFW ${QTLISTQG})
FOREACH (QC cn;jp;kr;tw)
INSTALLNAMETOOL_CHANGE (${QFW_CHG} ${QFW_CHG_TO} "${QAPPDIRC}/PlugIns/codecs/libq${QC}codecs.dylib")
ENDFOREACH (QC)
INSTALLNAMETOOL_CHANGE (${QFW_CHG} ${QFW_CHG_TO} "${QAPPDIRC}/PlugIns/sqldrivers/libqsqlite.dylib")
# qt fw
IF (@OSX_HAVE_LOADERPATH@)
SET (QFW_CHG_TO "${ATLOADER}/../../../${QFW}.framework/${QFW}")
Expand Down
2 changes: 1 addition & 1 deletion python/analysis/analysis.sip
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

%Include qgsgeometryanalyzer.sip
%Include qgsoverlayanalyzer.sip

%Include qgszonalstatistics.sip
21 changes: 21 additions & 0 deletions python/analysis/qgszonalstatistics.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** \ingroup analysis
* The QGis class that calculates raster statistics (count, sum, mean) for
* a polygon or multipolygon layer and appends the results as attributes
*/

class QgsZonalStatistics
{
%TypeHeaderCode
#include <qgszonalstatistics.h>
%End

public:

QgsZonalStatistics( QgsVectorLayer* polygonLayer, const QString& rasterFile,
const QString& attributePrefix = "", int rasterBand = 1 );
~QgsZonalStatistics();

/**Starts the calculation
@return 0 in case of success*/
int calculateStatistics( QProgressDialog* p );
};
155 changes: 94 additions & 61 deletions python/plugins/GdalTools/GdalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,109 +104,137 @@ def initGui( self ):
self.menu = rasterMenu
self.menu.addSeparator()

if self.GdalVersion >= "1.6":
self.buildVRT = QAction( QIcon(":/icons/vrt.png"), QCoreApplication.translate( "GdalTools", "Build Virtual Raster (Catalog)" ), self.iface.mainWindow() )
self.buildVRT.setStatusTip( QCoreApplication.translate( "GdalTools", "Builds a VRT from a list of datasets") )
QObject.connect( self.buildVRT, SIGNAL( "triggered()" ), self.doBuildVRT )
self.menu.addAction(self.buildVRT)
# projections menu (Warp (Reproject), Assign projection)
self.projectionsMenu = QMenu( QCoreApplication.translate( "GdalTools", "Projections" ) )

if self.GdalVersion >= "1.6":
self.contour = QAction( QIcon(":/icons/contour.png"), QCoreApplication.translate( "GdalTools", "Contour" ), self.iface.mainWindow() )
self.contour.setStatusTip( QCoreApplication.translate( "GdalTools", "Builds vector contour lines from a DEM") )
QObject.connect( self.contour, SIGNAL( "triggered()" ), self.doContour )
self.menu.addAction(self.contour)
self.warp = QAction( QIcon(":/icons/warp.png"), QCoreApplication.translate( "GdalTools", "Warp (Reproject)" ), self.iface.mainWindow() )
self.warp.setStatusTip( QCoreApplication.translate( "GdalTools", "Warp an image into a new coordinate system") )
QObject.connect( self.warp, SIGNAL( "triggered()" ), self.doWarp )

self.projection = QAction( QIcon( ":icons/projection-add.png" ), QCoreApplication.translate( "GdalTools", "Assign projection" ), self.iface.mainWindow() )
self.projection.setStatusTip( QCoreApplication.translate( "GdalTools", "Add projection info to the raster" ) )
QObject.connect( self.projection, SIGNAL( "triggered()" ), self.doProjection )

self.extractProj = QAction( QIcon( ":icons/projection-export.png" ), QCoreApplication.translate( "GdalTools", "Extract projection" ), self.iface.mainWindow() )
self.extractProj.setStatusTip( QCoreApplication.translate( "GdalTools", "Extract projection information from raster(s)" ) )
QObject.connect( self.extractProj, SIGNAL( "triggered()" ), self.doExtractProj )

self.projectionsMenu.addActions( [ self.warp, self.projection, self.extractProj ] )

# conversion menu (Rasterize (Vector to raster), Polygonize (Raster to vector), Translate, RGB to PCT, PCT to RGB)
self.conversionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Conversion" ) )

if self.GdalVersion >= "1.3":
self.rasterize = QAction( QIcon(":/icons/rasterize.png"), QCoreApplication.translate( "GdalTools", "Rasterize (Vector to raster)" ), self.iface.mainWindow() )
self.rasterize.setStatusTip( QCoreApplication.translate( "GdalTools", "Burns vector geometries into a raster") )
QObject.connect( self.rasterize, SIGNAL( "triggered()" ), self.doRasterize )
self.menu.addAction(self.rasterize)
self.conversionMenu.addAction( self.rasterize )

if self.GdalVersion >= "1.6":
self.polygonize = QAction( QIcon(":/icons/polygonize.png"), QCoreApplication.translate( "GdalTools", "Polygonize (Raster to vector)" ), self.iface.mainWindow() )
self.polygonize.setStatusTip( QCoreApplication.translate( "GdalTools", "Produces a polygon feature layer from a raster") )
QObject.connect( self.polygonize, SIGNAL( "triggered()" ), self.doPolygonize )
self.menu.addAction(self.polygonize)
self.conversionMenu.addAction( self.polygonize )

self.merge = QAction( QIcon(":/icons/merge.png"), QCoreApplication.translate( "GdalTools", "Merge" ), self.iface.mainWindow() )
self.merge.setStatusTip( QCoreApplication.translate( "GdalTools", "Build a quick mosaic from a set of images") )
QObject.connect( self.merge, SIGNAL( "triggered()" ), self.doMerge )
self.menu.addAction(self.merge)
self.translate = QAction( QIcon(":/icons/translate.png"), QCoreApplication.translate( "GdalTools", "Translate (Convert format)" ), self.iface.mainWindow() )
self.translate.setStatusTip( QCoreApplication.translate( "GdalTools", "Converts raster data between different formats") )
QObject.connect( self.translate, SIGNAL( "triggered()" ), self.doTranslate )

self.paletted = QAction( QIcon( ":icons/raster-paletted.png" ), QCoreApplication.translate( "GdalTools", "RGB to PCT" ), self.iface.mainWindow() )
self.paletted.setStatusTip( QCoreApplication.translate( "GdalTools", "Convert a 24bit RGB image to 8bit paletted" ) )
QObject.connect( self.paletted, SIGNAL( "triggered()" ), self.doPaletted )

self.rgb = QAction( QIcon( ":icons/raster-paletted.png" ), QCoreApplication.translate( "GdalTools", "PCT to RGB" ), self.iface.mainWindow() )
self.rgb.setStatusTip( QCoreApplication.translate( "GdalTools", "Convert an 8bit paletted image to 24bit RGB" ) )
QObject.connect( self.rgb, SIGNAL( "triggered()" ), self.doRGB )

self.conversionMenu.addActions( [ self.translate, self.paletted, self.rgb ] )

# extraction menu (Clipper, Contour)
self.extractionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Extraction" ) )

if self.GdalVersion >= "1.6":
self.contour = QAction( QIcon(":/icons/contour.png"), QCoreApplication.translate( "GdalTools", "Contour" ), self.iface.mainWindow() )
self.contour.setStatusTip( QCoreApplication.translate( "GdalTools", "Builds vector contour lines from a DEM") )
QObject.connect( self.contour, SIGNAL( "triggered()" ), self.doContour )
self.extractionMenu.addAction( self.contour )

self.clipper = QAction( QIcon( ":icons/raster-clip.png" ), QCoreApplication.translate( "GdalTools", "Clipper" ), self.iface.mainWindow() )
#self.clipper.setStatusTip( QCoreApplication.translate( "GdalTools", "Converts raster data between different formats") )
QObject.connect( self.clipper, SIGNAL( "triggered()" ), self.doClipper )

self.extractionMenu.addActions( [ self.clipper ] )

# analysis menu (DEM (Terrain model), Grid (Interpolation), Near black, Proximity (Raster distance), Sieve)
self.analysisMenu = QMenu( QCoreApplication.translate( "GdalTools", "Analysis" ) )

if self.GdalVersion >= "1.6":
self.sieve = QAction( QIcon(":/icons/sieve.png"), QCoreApplication.translate( "GdalTools", "Sieve" ), self.iface.mainWindow() )
self.sieve.setStatusTip( QCoreApplication.translate( "GdalTools", "Removes small raster polygons") )
QObject.connect( self.sieve, SIGNAL( "triggered()" ), self.doSieve )
self.menu.addAction(self.sieve)

if self.GdalVersion >= "1.6":
self.proximity = QAction( QIcon(":/icons/proximity.png"), QCoreApplication.translate( "GdalTools", "Proximity (Raster distance)" ), self.iface.mainWindow() )
self.proximity.setStatusTip( QCoreApplication.translate( "GdalTools", "Produces a raster proximity map") )
QObject.connect( self.proximity, SIGNAL( "triggered()" ), self.doProximity )
self.menu.addAction(self.proximity)
self.analysisMenu.addAction( self.sieve )

if self.GdalVersion >= "1.5":
self.nearBlack = QAction( QIcon(":/icons/nearblack.png"), QCoreApplication.translate( "GdalTools", "Near black" ), self.iface.mainWindow() )
self.nearBlack.setStatusTip( QCoreApplication.translate( "GdalTools", "Convert nearly black/white borders to exact value") )
QObject.connect( self.nearBlack, SIGNAL( "triggered()" ), self.doNearBlack )
self.menu.addAction(self.nearBlack)
self.analysisMenu.addAction( self.nearBlack )

self.warp = QAction( QIcon(":/icons/warp.png"), QCoreApplication.translate( "GdalTools", "Warp (Reproject)" ), self.iface.mainWindow() )
self.warp.setStatusTip( QCoreApplication.translate( "GdalTools", "Warp an image into a new coordinate system") )
QObject.connect( self.warp, SIGNAL( "triggered()" ), self.doWarp )
self.menu.addAction(self.warp)
if self.GdalVersion >= "1.6":
self.proximity = QAction( QIcon(":/icons/proximity.png"), QCoreApplication.translate( "GdalTools", "Proximity (Raster distance)" ), self.iface.mainWindow() )
self.proximity.setStatusTip( QCoreApplication.translate( "GdalTools", "Produces a raster proximity map") )
QObject.connect( self.proximity, SIGNAL( "triggered()" ), self.doProximity )
self.analysisMenu.addAction( self.proximity )

if self.GdalVersion >= "1.5":
self.grid = QAction( QIcon(":/icons/grid.png"), QCoreApplication.translate( "GdalTools", "Grid (Interpolation)" ), self.iface.mainWindow() )
self.grid.setStatusTip( QCoreApplication.translate( "GdalTools", "Create raster from the scattered data") )
QObject.connect( self.grid, SIGNAL( "triggered()" ), self.doGrid )
self.menu.addAction(self.grid)
self.analysisMenu.addAction( self.grid )

self.translate = QAction( QIcon(":/icons/translate.png"), QCoreApplication.translate( "GdalTools", "Translate (Convert format)" ), self.iface.mainWindow() )
self.translate.setStatusTip( QCoreApplication.translate( "GdalTools", "Converts raster data between different formats") )
QObject.connect( self.translate, SIGNAL( "triggered()" ), self.doTranslate )
self.menu.addAction(self.translate)
if self.GdalVersion >= "1.7":
self.dem = QAction( QIcon( ":icons/dem.png" ), QCoreApplication.translate( "GdalTools", "DEM (Terrain models)" ), self.iface.mainWindow() )
self.dem.setStatusTip( QCoreApplication.translate( "GdalTools", "Tool to analyze and visualize DEMs" ) )
QObject.connect( self.dem, SIGNAL( "triggered()" ), self.doDEM )
self.analysisMenu.addAction( self.dem )

#self.analysisMenu.addActions( [ ] )

# miscellaneous menu (Build overviews (Pyramids), Tile index, Information, Merge, Build Virtual Raster (Catalog))
self.miscellaneousMenu = QMenu( QCoreApplication.translate( "GdalTools", "Miscellaneous" ) )

if self.GdalVersion >= "1.6":
self.buildVRT = QAction( QIcon(":/icons/vrt.png"), QCoreApplication.translate( "GdalTools", "Build Virtual Raster (Catalog)" ), self.iface.mainWindow() )
self.buildVRT.setStatusTip( QCoreApplication.translate( "GdalTools", "Builds a VRT from a list of datasets") )
QObject.connect( self.buildVRT, SIGNAL( "triggered()" ), self.doBuildVRT )
self.miscellaneousMenu.addAction( self.buildVRT )

self.merge = QAction( QIcon(":/icons/merge.png"), QCoreApplication.translate( "GdalTools", "Merge" ), self.iface.mainWindow() )
self.merge.setStatusTip( QCoreApplication.translate( "GdalTools", "Build a quick mosaic from a set of images") )
QObject.connect( self.merge, SIGNAL( "triggered()" ), self.doMerge )

self.info = QAction( QIcon( ":/icons/raster-info.png" ), QCoreApplication.translate( "GdalTools", "Information" ), self.iface.mainWindow() )
self.info.setStatusTip( QCoreApplication.translate( "GdalTools", "Lists information about raster dataset" ) )
QObject.connect( self.info, SIGNAL("triggered()"), self.doInfo )
self.menu.addAction( self.info )

self.projection = QAction( QIcon( ":icons/projection-add.png" ), QCoreApplication.translate( "GdalTools", "Assign projection" ), self.iface.mainWindow() )
self.projection.setStatusTip( QCoreApplication.translate( "GdalTools", "Add projection info to the raster" ) )
QObject.connect( self.projection, SIGNAL( "triggered()" ), self.doProjection )
self.menu.addAction( self.projection )

self.overview = QAction( QIcon( ":icons/raster-overview.png" ), QCoreApplication.translate( "GdalTools", "Build overviews (Pyramids)" ), self.iface.mainWindow() )
self.overview.setStatusTip( QCoreApplication.translate( "GdalTools", "Builds or rebuilds overview images" ) )
QObject.connect( self.overview, SIGNAL( "triggered()" ), self.doOverview )
self.menu.addAction( self.overview )

self.clipper = QAction( QIcon( ":icons/raster-clip.png" ), QCoreApplication.translate( "GdalTools", "Clipper" ), self.iface.mainWindow() )
#self.clipper.setStatusTip( QCoreApplication.translate( "GdalTools", "Converts raster data between different formats") )
QObject.connect( self.clipper, SIGNAL( "triggered()" ), self.doClipper )
self.menu.addAction(self.clipper)

self.paletted = QAction( QIcon( ":icons/raster-paletted.png" ), QCoreApplication.translate( "GdalTools", "RGB to PCT" ), self.iface.mainWindow() )
self.paletted.setStatusTip( QCoreApplication.translate( "GdalTools", "Convert a 24bit RGB image to 8bit paletted" ) )
QObject.connect( self.paletted, SIGNAL( "triggered()" ), self.doPaletted )
self.menu.addAction(self.paletted)

self.rgb = QAction( QIcon( ":icons/raster-paletted.png" ), QCoreApplication.translate( "GdalTools", "PCT to RGB" ), self.iface.mainWindow() )
self.rgb.setStatusTip( QCoreApplication.translate( "GdalTools", "Convert an 8bit paletted image to 24bit RGB" ) )
QObject.connect( self.rgb, SIGNAL( "triggered()" ), self.doRGB )
self.menu.addAction(self.rgb)

self.tileindex = QAction( QIcon( ":icons/tileindex.png" ), QCoreApplication.translate( "GdalTools", "Tile index" ), self.iface.mainWindow() )
self.tileindex.setStatusTip( QCoreApplication.translate( "GdalTools", "Build a shapefile as a raster tileindex" ) )
QObject.connect( self.tileindex, SIGNAL( "triggered()" ), self.doTileIndex )
self.menu.addAction(self.tileindex)

if self.GdalVersion >= "1.7":
self.dem = QAction( QIcon( ":icons/dem.png" ), QCoreApplication.translate( "GdalTools", "DEM (Terrain models)" ), self.iface.mainWindow() )
self.dem.setStatusTip( QCoreApplication.translate( "GdalTools", "Tool to analyze and visualize DEMs" ) )
QObject.connect( self.dem, SIGNAL( "triggered()" ), self.doDEM )
self.menu.addAction(self.dem)
self.miscellaneousMenu.addActions( [ self.merge, self.info, self.overview, self.tileindex ] )

self.menu.addMenu( self.projectionsMenu )
self.menu.addMenu( self.conversionMenu )
self.menu.addMenu( self.extractionMenu )

if not self.analysisMenu.isEmpty():
self.menu.addMenu( self.analysisMenu )

self.menu.addMenu( self.miscellaneousMenu )

self.settings = QAction( QCoreApplication.translate( "GdalTools", "GdalTools settings" ), self.iface.mainWindow() )
self.settings.setStatusTip( QCoreApplication.translate( "GdalTools", "Various settings for Gdal Tools" ) )
Expand Down Expand Up @@ -317,6 +345,11 @@ def doTileIndex( self ):
d = TileIndex( self.iface )
self.runToolDialog( d )

def doExtractProj( self ):
from tools.doExtractProj import GdalToolsDialog as ExtractProj
d = ExtractProj( self.iface )
d.exec_()

def doDEM( self ):
from tools.doDEM import GdalToolsDialog as DEM
d = DEM( self.iface )
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def name():
def description():
return "Integrate gdal tools into qgis"
def version():
return "Version 1.2.26"
return "Version 1.2.28"
def qgisMinimumVersion():
return "1.0"
def icon():
Expand Down
Binary file added python/plugins/GdalTools/icons/edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 python/plugins/GdalTools/icons/reset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion python/plugins/GdalTools/resources.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/" >
<qresource prefix="/">
<file>icons/contour.png</file>
<file>icons/merge.png</file>
<file>icons/polygonize.png</file>
Expand All @@ -20,5 +20,8 @@
<file>icons/tileindex.png</file>
<file>icons/about.png</file>
<file>icons/dem.png</file>
<file>icons/projection-export.png</file>
<file>icons/edit.png</file>
<file>icons/reset.png</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/GdalTools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def getRasterLayers(self):
def isVector(self, layer):
if layer.type() != layer.VectorLayer:
return False
if layer.usesProvider() and layer.providerKey() != 'ogr':
if layer.providerType() != 'ogr':
return False
return True

Expand Down
57 changes: 40 additions & 17 deletions python/plugins/GdalTools/tools/dialogBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from ui_dialogBase import Ui_GdalToolsDialog as Ui_Dialog
import GdalTools_utils as Utils
from .. import resources_rc

import os, platform

Expand Down Expand Up @@ -39,6 +40,12 @@ def __init__(self, parent, iface, pluginBase, pluginName, pluginCommand):
self.setupUi(self)
self.arguments = QStringList()

self.editCmdBtn.setIcon( QIcon(":/icons/edit.png") )
self.connect(self.editCmdBtn, SIGNAL("toggled(bool)"), self.editCommand)
self.resetCmdBtn.setIcon( QIcon(":/icons/reset.png") )
self.connect(self.resetCmdBtn, SIGNAL("clicked()"), self.resetCommand)
self.editCommand( False )

self.connect(self.buttonBox, SIGNAL("rejected()"), self.reject)
self.connect(self.buttonBox, SIGNAL("accepted()"), self.accept)
self.connect(self.buttonBox, SIGNAL("helpRequested()"), self.help)
Expand Down Expand Up @@ -66,6 +73,32 @@ def setPluginCommand(self, cmd):
else:
self.helpFileName = cmd + ".html"


def editCommand(self, enabled):
if not self.commandIsEnabled():
return
self.editCmdBtn.setChecked( enabled )
self.resetCmdBtn.setEnabled( enabled )
self.textEditCommand.setReadOnly( not enabled )
self.controlsWidget.setEnabled( not enabled )
self.emit( SIGNAL("refreshArgs()") )

def resetCommand(self):
if not self.commandIsEditable():
return
self.emit( SIGNAL("refreshArgs()") )

def commandIsEditable(self):
return self.commandIsEnabled() and self.editCmdBtn.isChecked()

def setCommandViewerEnabled(self, enable):
if not enable:
self.editCommand( False )
self.commandWidget.setEnabled( enable )

def commandIsEnabled(self):
return self.commandWidget.isEnabled()

def reject(self):
if self.process.state() != QProcess.NotRunning:
ret = QMessageBox.warning(self, self.tr( "Warning" ), self.tr( "The command is still running. \nDo you want terminate it anyway?" ), QMessageBox.Yes | QMessageBox.No)
Expand Down Expand Up @@ -98,37 +131,27 @@ def onHelp(self):
url = QUrl.fromLocalFile(helpPath + '/' + self.helpFileName)
QDesktopServices.openUrl(url)

def setCommandViewerEnabled(self, enable):
self.textEditCommand.setEnabled( enable )

# called when a value in the plugin widget interface changed
def refreshArgs(self, args):
self.arguments = args

if not self.textEditCommand.isEnabled():
self.textEditCommand.setText(self.command)
if not self.commandIsEnabled():
self.textEditCommand.setPlainText(self.command)
else:
self.textEditCommand.setText(self.command + " " + Utils.escapeAndJoin(self.arguments))
self.textEditCommand.setPlainText(self.command + " " + Utils.escapeAndJoin(self.arguments))

# enables the OK button
def enableRun(self, enable = True):
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)

# start the command execution
def onRun(self):
self.process.start(self.command, self.arguments, QIODevice.ReadOnly)
self.enableRun(False)
self.setCursor(Qt.WaitCursor)

"""
try:
print "Debug: " + self.command + " " + unicode(Utils.escapeAndJoin(self.arguments))
except UnicodeEncodeError:
try:
print "Debug: " + self.command + " " + unicode(Utils.escapeAndJoin(self.arguments)).encode('cp866', 'replace')
except:
print "Debug: " + self.command + " " + unicode(Utils.escapeAndJoin(self.arguments)).encode('ascii', 'replace')
"""
if not self.commandIsEditable():
self.process.start(self.command, self.arguments, QIODevice.ReadOnly)
else:
self.process.start(self.textEditCommand.toPlainText(), QIODevice.ReadOnly)

# stop the command execution
def stop(self):
Expand Down
94 changes: 75 additions & 19 deletions python/plugins/GdalTools/tools/dialogBase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="pluginLayout">
<property name="margin">
<number>0</number>
</property>
</layout>
<widget class="QWidget" name="controlsWidget" native="true">
<layout class="QVBoxLayout" name="pluginLayout">
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="loadCheckBox">
Expand All @@ -29,19 +31,74 @@
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEditCommand">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
<widget class="QWidget" name="commandWidget" native="true">
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QPlainTextEdit" name="textEditCommand">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QToolButton" name="editCmdBtn">
<property name="toolTip">
<string>Edit</string>
</property>
<property name="text">
<string>Edit</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="resetCmdBtn">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Reset</string>
</property>
<property name="text">
<string>Reset</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>
</widget>
</item>
<item>
Expand All @@ -57,7 +114,6 @@
</layout>
</widget>
<tabstops>
<tabstop>textEditCommand</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
Expand Down
33 changes: 22 additions & 11 deletions python/plugins/GdalTools/tools/doProjection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ def __init__( self, iface ):
self.connect( self.batchCheck, SIGNAL( "stateChanged( int )" ), self.switchToolMode )
self.connect( self.recurseCheck, SIGNAL( "stateChanged( int )" ), self.enableRecurse )

#QObject.disconnect( self.base.buttonBox.button( QDialogButtonBox.Ok ), SIGNAL( "clicked()" ), self.onRun )
#QObject.connect( self.base.buttonBox.button( QDialogButtonBox.Ok ), SIGNAL( "clicked()" ), self.checkLayer )

def switchToolMode( self ):
self.setCommandViewerEnabled( not self.batchCheck.isChecked() )
self.progressBar.setVisible( self.batchCheck.isChecked() )
Expand Down Expand Up @@ -102,11 +99,32 @@ def getArguments( self ):
inputFn = self.getInputFileName()
arguments << inputFn
self.tempFile = QString( inputFn )
self.needOverwrite = False
if not self.tempFile.isEmpty():
self.tempFile = self.tempFile.replace( QRegExp( "\.[a-zA-Z]{2,4}$" ), ".tif" ).append( ".tmp" )
if self.tempFile.toLower().contains( QRegExp( "\.tif{1,2}" ) ):
self.tempFile = self.tempFile.replace( QRegExp( "\.[a-zA-Z]{2,4}$" ), ".tif" ).append( ".tmp" )
self.needOverwrite = True
else:
self.tempFile = self.tempFile.replace( QRegExp( "\.[a-zA-Z]{2,4}$" ), ".tif" )
arguments << self.tempFile
return arguments

def finished( self ):
outFn = self.getOutputFileName()
if self.needOverwrite:
oldFile = QFile( outFn )
newFile = QFile( self.tempFile )
if oldFile.remove():
newFile.rename( outFn )

fileInfo = QFileInfo( outFn )
if fileInfo.exists():
if self.base.loadCheckBox.isChecked():
self.addLayerIntoCanvas( fileInfo )
QMessageBox.information( self, self.tr( "Finished" ), self.tr( "Processing completed." ) )
else:
QMessageBox.warning( self, self.tr( "Warning" ), self.tr( "%1 not created." ).arg( outFn ) )

def getInputFileName(self):
return self.inSelector.filename()

Expand Down Expand Up @@ -149,10 +167,3 @@ def updateProgress(self, index, total):
self.progressBar.setValue(index + 1)
else:
self.progressBar.setValue(0)

def finished( self ):
oldFile = QFile( self.getInputFileName() )
newFile = QFile( self.tempFile )
if oldFile.remove():
newFile.rename( self.getInputFileName() )

1 change: 1 addition & 0 deletions python/plugins/GdalTools/tools/widgetPluginBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self, iface, commandName, parent = None):
self.connect(self.base, SIGNAL("helpClicked()"), self.onHelp)

self.connect(self.base, SIGNAL("finished(bool)"), self.finished)
self.connect(self.base, SIGNAL("refreshArgs()"), self.someValueChanged)

def someValueChanged(self):
self.emit(SIGNAL("valuesChanged(const QStringList &)"), self.getArguments())
Expand Down
Empty file modified python/plugins/fTools/__init__.py
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions python/plugins/fTools/fTools.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,6 @@ def dospatJoin(self):

def doMergeShapes(self):
d = doMergeShapes.Dialog(self.iface)
d.show()
d.exec_()

Empty file modified python/plugins/fTools/tools/doDefineProj.py
100755 → 100644
Empty file.
6 changes: 4 additions & 2 deletions python/plugins/fTools/tools/doGeometry.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ def manageGui(self):
self.cmbField.setVisible( False )
self.field_label.setVisible( False )
self.resize( 381, 100 )
myList = []
self.populateLayers()

def populateLayers( self ):
self.inShape.clear()
if self.myFunction == 3 or self.myFunction == 6:
myList = ftools_utils.getLayerNames( [ QGis.Polygon, QGis.Line ] )
Expand All @@ -176,7 +178,6 @@ def manageGui(self):
else:
myList = ftools_utils.getLayerNames( [ QGis.Point, QGis.Line, QGis.Polygon ] )
self.inShape.addItems( myList )
return

#1: Singleparts to multipart
#2: Multipart to singleparts
Expand Down Expand Up @@ -241,6 +242,7 @@ def runFinishedFromThread( self, success ):
if addToTOC == QMessageBox.Yes:
if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.shapefileName ) ))
self.populateLayers()
else:
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Error writing output shapefile." ) )

Expand Down
9 changes: 6 additions & 3 deletions python/plugins/fTools/tools/doGeoprocessing.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def manageGui( self ):
self.label_2.setText( self.tr( "Union layer" ) )
self.setWindowTitle( self.tr( "Union" ) )
self.resize(381, 100)
self.populateLayers()

def populateLayers( self ):
myListA = []
myListB = []
self.inShapeA.clear()
Expand All @@ -195,7 +198,6 @@ def manageGui( self ):
myListB = ftools_utils.getLayerNames( [ QGis.Point, QGis.Line, QGis.Polygon ] )
self.inShapeA.addItems( myListA )
self.inShapeB.addItems( myListB )
return

#1: Buffer
#2: Convex Hull
Expand Down Expand Up @@ -257,6 +259,7 @@ def runFinishedFromThread( self, results ):
if addToTOC == QMessageBox.Yes:
if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.shapefileName ) ))
self.populateLayers()

def runStatusFromThread( self, status ):
self.progressBar.setValue( status )
Expand Down Expand Up @@ -1103,7 +1106,7 @@ def union( self ):
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
# this really shouldn't happen, as we
# this really shouldn't happen, as we
# haven't edited the input geom at all
# continue
else:
Expand Down Expand Up @@ -1144,7 +1147,7 @@ def union( self ):
# print str(err)
FEATURE_EXCEPT = False
# else:
# # this only happends if the bounding box
# # this only happends if the bounding box
# # intersects, but the geometry doesn't
# try:
# outFeat.setGeometry( geom )
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/fTools/tools/doIntersectLines.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ def __init__(self, iface):
QObject.connect(self.inLine2, SIGNAL("currentIndexChanged(QString)"), self.update2)
self.setWindowTitle( self.tr("Line intersections") )
self.buttonOk = self.buttonBox_2.button( QDialogButtonBox.Ok )
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
self.populateLayers()

def populateLayers( self ):
layers = ftools_utils.getLayerNames([QGis.Line])
self.inLine1.clear()
self.inLine2.clear()
self.inLine1.addItems(layers)
self.inLine2.addItems(layers)

Expand Down Expand Up @@ -92,6 +95,7 @@ def accept(self):
if addToTOC == QMessageBox.Yes:
if not ftools_utils.addShapeToCanvas( unicode( outPath ) ):
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( outPath ) ))
self.populateLayers()
self.progressBar.setValue(0)
self.buttonOk.setEnabled( True )

Expand Down
10 changes: 7 additions & 3 deletions python/plugins/fTools/tools/doMeanCoords.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ def __init__(self, iface, function):
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.buttonOk = self.buttonBox_2.button( QDialogButtonBox.Ok )

# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
self.populateLayers()

def populateLayers( self ):
layers = ftools_utils.getLayerNames([QGis.Point, QGis.Line, QGis.Polygon])
QObject.disconnect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.inShape.clear()
self.inShape.addItems(layers)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)

def updateUi(self):
if self.function == 1:
Expand Down Expand Up @@ -96,6 +99,7 @@ def accept(self):
if addToTOC == QMessageBox.Yes:
vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(vlayer)
self.populateLayers()
self.progressBar.setValue(0)
self.buttonOk.setEnabled( True )

Expand Down
Empty file modified python/plugins/fTools/tools/doMergeShapes.py
100755 → 100644
Empty file.
Empty file modified python/plugins/fTools/tools/doPointDistance.py
100755 → 100644
Empty file.
12 changes: 8 additions & 4 deletions python/plugins/fTools/tools/doPointsInPolygon.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ def __init__(self, iface):
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
self.setWindowTitle(self.tr("Count Points in Polygon"))
self.buttonOk = self.buttonBox_2.button( QDialogButtonBox.Ok )
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
self.populateLayers()

def populateLayers( self ):
layers = ftools_utils.getLayerNames([QGis.Polygon])
self.inPolygon.clear()
self.inPolygon.addItems(layers)

self.inPoint.clear()
layers = ftools_utils.getLayerNames([QGis.Point])
self.inPoint.addItems(layers)

def accept(self):
self.buttonOk.setEnabled( False )
if self.inPolygon.currentText() == "":
Expand Down Expand Up @@ -79,6 +83,7 @@ def accept(self):
if addToTOC == QMessageBox.Yes:
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.populateLayers()
self.progressBar.setValue(0)
self.buttonOk.setEnabled( True )

Expand Down Expand Up @@ -112,7 +117,6 @@ def compute(self, inPoly, inPts, inField, outPath, progressBar):
if not QgsVectorFileWriter.deleteShapeFile(self.shapefileName):
return
writer = QgsVectorFileWriter(self.shapefileName, self.encoding, fieldList, polyProvider.geometryType(), sRs)
#writer = QgsVectorFileWriter(outPath, "UTF-8", fieldList, polyProvider.geometryType(), sRs)
inFeat = QgsFeature()
inFeatB = QgsFeature()
outFeat = QgsFeature()
Expand Down
10 changes: 8 additions & 2 deletions python/plugins/fTools/tools/doRandPoints.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ def __init__(self, iface):
self.progressBar.setValue(0)
self.setWindowTitle(self.tr("Random Points"))
self.buttonOk = self.buttonBox_2.button( QDialogButtonBox.Ok )
self.mapCanvas = self.iface.mapCanvas()
self.populateLayers()

def populateLayers( self ):
layers = ftools_utils.getLayerNames([QGis.Polygon, "Raster"])
QObject.disconnect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.inShape.clear()
self.inShape.addItems(layers)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)

# If input layer is changed, update field list
def update(self, inputLayer):
Expand Down Expand Up @@ -123,6 +128,7 @@ def accept(self):
if addToTOC == QMessageBox.Yes:
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.populateLayers()
self.progressBar.setValue(0)
self.buttonOk.setEnabled( True )

Expand Down Expand Up @@ -208,7 +214,7 @@ def randomize(self, inLayer, outPath, minimum, design, value):
points = self.vectorRandom(int(value), inLayer,
ext.xMinimum(), ext.xMaximum(), ext.yMinimum(), ext.yMaximum())
else: points = self.loopThruPolygons(inLayer, value, design)
crs = self.mapCanvas.mapRenderer().destinationSrs()
crs = self.iface.mapCanvas().mapRenderer().destinationSrs()
if not crs.isValid(): crs = None
fields = { 0 : QgsField("ID", QVariant.Int) }
check = QFile(self.shapefileName)
Expand Down
Empty file modified python/plugins/fTools/tools/doRandom.py
100755 → 100644
Empty file.
9 changes: 7 additions & 2 deletions python/plugins/fTools/tools/doRegPoints.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def __init__(self, iface):
self.buttonOk = self.buttonBox_2.button( QDialogButtonBox.Ok )
self.progressBar.setValue(0)
self.mapCanvas = self.iface.mapCanvas()
self.populateLayers()

def populateLayers( self ):
layers = ftools_utils.getLayerNames("all")
self.inShape.clear()
self.inShape.addItems(layers)

def accept(self):
Expand Down Expand Up @@ -89,6 +93,7 @@ def accept(self):
if addToTOC == QMessageBox.Yes:
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.populateLayers()
self.progressBar.setValue(0)
self.buttonOk.setEnabled( True )

Expand All @@ -98,7 +103,7 @@ def outFile(self):
if self.shapefileName is None or self.encoding is None:
return
self.outShape.setText( QString( self.shapefileName ) )

# Generate list of random points
def simpleRandom(self, n, bound, xmin, xmax, ymin, ymax):
seed()
Expand All @@ -109,7 +114,7 @@ def simpleRandom(self, n, bound, xmin, xmax, ymin, ymax):
if pGeom.intersects(bound):
points.append(pGeom)
i = i + 1
return points
return points

def regularize(self, bound, outPath, offset, value, gridType, inset, crs):
area = bound.width() * bound.height()
Expand Down
Empty file modified python/plugins/fTools/tools/doSelectByLocation.py
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion python/plugins/fTools/tools/doSimplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__( self, iface ):

def manageGui( self ):
layers = ftools_utils.getLayerNames( [ QGis.Polygon, QGis.Line ] )
self.cmbInputLayer.clear()
self.cmbInputLayer.addItems( layers )

def updateGui( self ):
Expand Down Expand Up @@ -125,8 +126,8 @@ def generalizationFinished( self, pointsCount ):
self.tr( "Error loading output shapefile:\n%1" )
.arg( unicode( self.shapefileName ) ) )

self.manageGui()
self.iface.mapCanvas().refresh()
#self.restoreGui()

def generalizationInterrupted( self ):
self.restoreGui()
Expand Down
Empty file modified python/plugins/fTools/tools/doSpatialJoin.py
100755 → 100644
Empty file.
Empty file modified python/plugins/fTools/tools/doSubsetSelect.py
100755 → 100644
Empty file.
10 changes: 7 additions & 3 deletions python/plugins/fTools/tools/doSumLines.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ def __init__(self, iface):
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
self.setWindowTitle(self.tr("Sum line lengths"))
self.buttonOk = self.buttonBox_2.button( QDialogButtonBox.Ok )
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
self.populateLayers()

def populateLayers( self ):
layers = ftools_utils.getLayerNames([QGis.Line])
self.inPoint.clear()
self.inPoint.addItems(layers)
layers = ftools_utils.getLayerNames([QGis.Polygon])
self.inPolygon.clear()
self.inPolygon.addItems(layers)

def accept(self):
self.buttonOk.setEnabled( False )
if self.inPolygon.currentText() == "":
Expand Down Expand Up @@ -79,6 +82,7 @@ def accept(self):
if addToTOC == QMessageBox.Yes:
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.populateLayers()
self.progressBar.setValue(0)
self.buttonOk.setEnabled( True )

Expand Down
9 changes: 7 additions & 2 deletions python/plugins/fTools/tools/doVectorGrid.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def __init__(self, iface):
self.xMax.setValidator(QDoubleValidator(self.xMax))
self.yMin.setValidator(QDoubleValidator(self.yMin))
self.yMax.setValidator(QDoubleValidator(self.yMax))
self.populateLayers()

def populateLayers( self ):
self.inShape.clear()
layermap = QgsMapLayerRegistry.instance().mapLayers()
for name, layer in layermap.iteritems():
self.inShape.addItem( unicode( layer.name() ) )
Expand All @@ -64,12 +68,12 @@ def updateLayer( self ):
mLayer = ftools_utils.getMapLayerByName( unicode( mLayerName ) )
boundBox = mLayer.extent()
self.updateExtents( boundBox )

def updateCanvas( self ):
canvas = self.iface.mapCanvas()
boundBox = canvas.extent()
self.updateExtents( boundBox )

def updateExtents( self, boundBox ):
self.xMin.setText( unicode( boundBox.xMinimum() ) )
self.yMin.setText( unicode( boundBox.yMinimum() ) )
Expand Down Expand Up @@ -100,6 +104,7 @@ def accept(self):
addToTOC = QMessageBox.question(self, self.tr("Generate Vector Grid"), self.tr("Created output shapefile:\n%1\n\nWould you like to add the new layer to the TOC?").arg(unicode(self.shapefileName)), QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton)
if addToTOC == QMessageBox.Yes:
ftools_utils.addShapeToCanvas( self.shapefileName )
self.populateLayers()
self.progressBar.setValue( 0 )
self.buttonOk.setEnabled( True )

Expand Down
Empty file modified python/plugins/fTools/tools/doVectorSplit.py
100755 → 100644
Empty file.
Empty file modified python/plugins/fTools/tools/doVisual.py
100755 → 100644
Empty file.
Empty file modified python/plugins/fTools/tools/ftools_utils.py
100755 → 100644
Empty file.
Empty file modified python/plugins/fTools/tools/voronoi.py
100755 → 100644
Empty file.
20 changes: 8 additions & 12 deletions python/plugins/osm/OsmAddRelationDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def __init__(self, plugin, newRelationFirstMember=None, relationToEdit=None):
# we are editing existing relation
self.editing = True
self.relId = relationToEdit
self.createRelButton.setText("Save")
self.setWindowTitle("Edit OSM relation")
self.createRelButton.setText( self.tr("Save") )
self.setWindowTitle( self.tr("Edit OSM relation") )
else:
self.editing = False
# we are adding new relation
Expand Down Expand Up @@ -790,18 +790,14 @@ def __showTypeInfo(self):
info = ""

if typeName=="boundary":
info = "for grouping boundaries and marking enclaves / exclaves"
info = QCoreApplication.translate( "OsmAddRelationDlg", "for grouping boundaries and marking enclaves / exclaves" )
elif typeName=="multipolygon":
info = "to put holes into areas (might have to be renamed, see article)"
info = QCoreApplication.translate( "OsmAddRelationDlg", "to put holes into areas (might have to be renamed, see article)" )
elif typeName=="restriction":
info = "any kind of turn restriction"
info = QCoreApplication.translate( "OsmAddRelationDlg", "any kind of turn restriction" )
elif typeName=="route":
info = "like bus routes, cycle routes and numbered highways"
info = QCoreApplication.translate( "OsmAddRelationDlg", "like bus routes, cycle routes and numbered highways" )
elif typeName=="enforcement":
info = "traffic enforcement devices; speed cameras, redlight cameras, weight checks, ..."

QMessageBox.information(self, self.tr("OSM Information")
,self.tr(info))


info = QCoreApplication.translate( "OsmAddRelationDlg", "traffic enforcement devices; speed cameras, redlight cameras, weight checks, ..." )

QMessageBox.information(self, self.tr("OSM Information"), info)
9 changes: 3 additions & 6 deletions python/plugins/osm/OsmDownloadDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def httpDone(self,error):
# and tell user (if the download wasn't cancelled by user)
if self.errMessage != "__cancel__":
if self.errMessage==None:
self.errMessage="Check your internet connection"
self.errMessage=QCoreApplication.translate( "OsmDownloadDlg", "Check your internet connection" )
QMessageBox.information(self, self.tr("OSM Download Error")
,self.tr("Download failed: %1.").arg(self.errMessage))
return
Expand Down Expand Up @@ -302,7 +302,7 @@ def showChooseDirectoryDialog(self):
"""

# display file open dialog and get absolute path to selected directory
fileSelected = QFileDialog.getSaveFileName(self, "Choose file to save","download.osm", "OSM Files (*.osm)");
fileSelected = QFileDialog.getSaveFileName(self, self.tr("Choose file to save"),"download.osm", self.tr("OSM Files (*.osm)") );
# insert selected directory path into line edit control
if not fileSelected.isNull():
self.destdirLineEdit.setText(fileSelected)
Expand Down Expand Up @@ -339,7 +339,7 @@ def autoLoadClicked(self):

def showExtentHelp(self):
"""Function is called after clicking on Help button.
It shows basic information on downloading.
It shows basic information on downloading.
"""

mb=QMessageBox()
Expand Down Expand Up @@ -464,6 +464,3 @@ def disconnectDlgSignals(self):
self.disconnect(self.downloadButton, SIGNAL("clicked()"), self.downloadFile)
self.disconnect(self.choosedirButton, SIGNAL("clicked()"), self.showChooseDirectoryDialog)
self.disconnect(self.autoLoadCheckBox, SIGNAL("clicked()"), self.autoLoadClicked)



16 changes: 7 additions & 9 deletions python/plugins/osm/OsmFeatureDW.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def __startMovingFeature(self):

# clear dockwidget
self.clear()
self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.")
self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it."))

self.mapTool=OsmMoveMT(self.plugin)
self.plugin.canvas.setMapTool(self.mapTool)
Expand All @@ -639,7 +639,7 @@ def __startPointCreation(self):
if self.activeEditButton==self.createPointButton:
return

self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.")
self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it."))

self.mapTool=OsmCreatePointMT(self.plugin)
self.plugin.canvas.setMapTool(self.mapTool)
Expand All @@ -656,7 +656,7 @@ def __startLineCreation(self):
if self.activeEditButton==self.createLineButton:
return

self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.")
self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it."))

self.mapTool=OsmCreateLineMT(self.plugin)
self.plugin.canvas.setMapTool(self.mapTool)
Expand All @@ -673,7 +673,7 @@ def __startPolygonCreation(self):
if self.activeEditButton==self.createPolygonButton:
return

self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.")
self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it."))

self.mapTool=OsmCreatePolygonMT(self.plugin)
self.plugin.canvas.setMapTool(self.mapTool)
Expand Down Expand Up @@ -770,7 +770,7 @@ def removeSelectedTags(self):
elif self.featureType=='Relation':
self.plugin.dbm.changeRelationStatus(self.feature.id(),'N','U')

# perform tag removing
# perform tag removing
self.plugin.dbm.removeTag(self.feature.id(),self.featureType,key.toAscii().data())

self.tagTable.removeRow(ix)
Expand Down Expand Up @@ -1254,9 +1254,7 @@ def __urDetailsChecked(self):

if self.urDetailsButton.isChecked():
self.plugin.undoredo.show()
self.urDetailsButton.setToolTip("Hide OSM Edit History")
self.urDetailsButton.setToolTip(self.tr("Hide OSM Edit History"))
else:
self.plugin.undoredo.hide()
self.urDetailsButton.setToolTip("Show OSM Edit History")


self.urDetailsButton.setToolTip(self.tr("Show OSM Edit History"))
7 changes: 3 additions & 4 deletions python/plugins/osm/OsmImportDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def onOK(self):

layer = QgsMapLayerRegistry.instance().mapLayer(layerId)
if layer is None:
QMessageBox.warning(self, "Layer doesn't exist", "The selected layer doesn't exist anymore!")
QMessageBox.warning(self, self.tr("Layer doesn't exist"), self.tr("The selected layer doesn't exist anymore!"))
return

self.progress = QProgressDialog("Importing features...", "Cancel", 0, 100, self)
self.progress = QProgressDialog(self.tr("Importing features..."), self.tr("Cancel"), 0, 100, self)
self.progress.setWindowModality(Qt.WindowModal)

self.nodes = { }
Expand Down Expand Up @@ -135,7 +135,7 @@ def onOK(self):
self.dbm.recacheAffectedNow(self.affected)
self.plugin.canvas.refresh()

QMessageBox.information(self, "Import", "Import has been completed.")
QMessageBox.information(self, self.tr("Import"), self.tr("Import has been completed."))
self.accept()


Expand Down Expand Up @@ -249,4 +249,3 @@ def extractPolygon(self, polygon):
dp = dummyPoint(p[0])
self.nodes[dp] = dummyFeat(nodeId)
nodeId -= 1

24 changes: 11 additions & 13 deletions python/plugins/osm/OsmLoadDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def showOpenFileDialog(self):
lastDir=settings.value("/OSM_Plugin/lastDir", QVariant(QString())).toString()

# display file open dialog and get absolute path to selected file
fileSelected=QFileDialog.getOpenFileName(self,"Choose an Open Street Map file",lastDir,"OSM Files (*.osm)");
fileSelected=QFileDialog.getOpenFileName(self,self.tr("Choose an Open Street Map file"),lastDir,self.tr("OSM Files (*.osm)"));
# insert OSM file path into line edit control
if not fileSelected.isNull():
self.OSMFileEdit.setText(fileSelected)
Expand All @@ -108,7 +108,7 @@ def onOK(self):
self.fname = self.OSMFileEdit.text()

if self.fname=='':
QMessageBox.information(self, "OSM Load", QString("Please enter path to OSM data file."))
QMessageBox.information(self, self.tr("OSM Load"),self.tr("Please enter path to OSM data file."))
self.buttonBox.setEnabled(True)
return

Expand All @@ -117,7 +117,7 @@ def onOK(self):
basename = osmfile.baseName()

if not osmfile.exists():
QMessageBox.information(self, "OSM Load", QString("Path to OSM file is invalid: %1.").arg(self.fname))
QMessageBox.information(self, self.tr("OSM Load"), self.tr("Path to OSM file is invalid: %1.").arg(self.fname))
return

fLoaded=self.filesLoaded()
Expand All @@ -126,11 +126,11 @@ def onOK(self):
curDB=self.dbm.currentKey

if basename in fLoaded and newDB<>curDB:
QMessageBox.information(self, "Error", QString("Layers of OSM file \"%1\" are loaded already.").arg(self.fname))
QMessageBox.information(self, self.tr("Error"), self.tr("Layers of OSM file \"%1\" are loaded already.").arg(self.fname))
return

if replacing:
# remove layers of current data first
if replacing:
# remove layers of current data first
QgsMapLayerRegistry.instance().removeMapLayer(self.canvas.currentLayer().id(),True)

if self.chkCustomRenderer.isChecked():
Expand Down Expand Up @@ -162,7 +162,7 @@ def onOK(self):
polygonLayer=None
return
if not polygonLayer.isValid():
QMessageBox.information(self,"Error",QString("Failed to load polygon layer."))
QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load polygon layer."))
return

if self.chkCustomRenderer.isChecked():
Expand All @@ -176,7 +176,7 @@ def onOK(self):
lineLayer=None
return
if not lineLayer.isValid():
QMessageBox.information(self,"Error",QString("Failed to load line layer."))
QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load line layer."))
return

if self.chkCustomRenderer.isChecked():
Expand All @@ -190,7 +190,7 @@ def onOK(self):
pointLayer=None
return
if not pointLayer.isValid():
QMessageBox.information(self,"Error",QString("Failed to load point layer."))
QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load point layer."))
return

if self.chkCustomRenderer.isChecked():
Expand Down Expand Up @@ -231,7 +231,7 @@ def setCustomRenderer(self, layer):
self.emit( SIGNAL( "setRenderer(QgsVectorLayer *)" ), layer )
QObject.disconnect( self, SIGNAL( "setRenderer(QgsVectorLayer *)" ), layer.dataProvider(), SLOT( "setRenderer( QgsVectorLayer * )" ) )
else:
QMessageBox.information(self, "OSM Load", QString("Could not connect to setRenderer signal."))
QMessageBox.information(self, self.tr("OSM Load"), self.tr("Could not connect to setRenderer signal."))

def filesLoaded(self):
"""Function returns list of keys of all currently loaded vector layers.
Expand Down Expand Up @@ -303,11 +303,9 @@ def event(self, e):
QObject.disconnect(self.progress,SIGNAL("canceled()"),self.cancelLoading)
self.progress.close()
self.progress = None
QMessageBox.information(self,"Error",QString("Failed to load layers: %1")
QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load layers: %1")
.arg(self.property("osm_failure").toString()))
self.buttonBox.setEnabled(True)

qApp.processEvents()
return QDialog.event(self,e)


59 changes: 31 additions & 28 deletions python/plugins/osm/OsmPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,28 @@ def initGui(self):

# create action for loading OSM file
self.actionLoad=QAction(QIcon(":/plugins/osm_plugin/images/osm_load.png")
,"Load OSM from file", self.iface.mainWindow())
self.actionLoad.setWhatsThis("Load OpenStreetMap from file")
,QCoreApplication.translate( "OsmPlugin", "Load OSM from file"), self.iface.mainWindow())
self.actionLoad.setWhatsThis( QCoreApplication.translate( "OsmPlugin", "Load OpenStreetMap from file") )
# create action for import of a layer into OSM
self.actionImport=QAction(QIcon(":/plugins/osm_plugin/images/osm_import.png")
,"Import data from a layer", self.iface.mainWindow())
self.actionImport.setWhatsThis("Import data from a layer to OpenStreetMap")
,QCoreApplication.translate( "OsmPlugin", "Import data from a layer"), self.iface.mainWindow())
self.actionImport.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Import data from a layer to OpenStreetMap") )
# create action for saving OSM file
self.actionSave=QAction(QIcon(":/plugins/osm_plugin/images/osm_save.png")
,"Save OSM to file", self.iface.mainWindow())
self.actionSave.setWhatsThis("Save OpenStreetMap to file")
,QCoreApplication.translate( "OsmPlugin", "Save OSM to file"), self.iface.mainWindow())
self.actionSave.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Save OpenStreetMap to file") )
# create action for OSM data downloading
self.actionDownload=QAction(QIcon(":/plugins/osm_plugin/images/osm_download.png")
,"Download OSM data", self.iface.mainWindow())
self.actionDownload.setWhatsThis("Download OpenStreetMap data")
,QCoreApplication.translate( "OsmPlugin", "Download OSM data"), self.iface.mainWindow())
self.actionDownload.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Download OpenStreetMap data") )
# create action for OSM data downloading
self.actionUpload=QAction(QIcon(":/plugins/osm_plugin/images/osm_upload.png")
,"Upload OSM data", self.iface.mainWindow())
self.actionUpload.setWhatsThis("Upload OpenStreetMap data")
,QCoreApplication.translate( "OsmPlugin", "Upload OSM data"), self.iface.mainWindow())
self.actionUpload.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Upload OpenStreetMap data") )
# create action for OSM dockable window
self.actionDockWidget=QAction(QIcon(":/plugins/osm_plugin/images/osm_featureManager.png")
,"Show/Hide OSM Feature Manager",self.iface.mainWindow())
self.actionDockWidget.setWhatsThis("Show/Hide OpenStreetMap Feature Manager")
,QCoreApplication.translate( "OsmPlugin", "Show/Hide OSM Feature Manager"),self.iface.mainWindow())
self.actionDockWidget.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Show/Hide OpenStreetMap Feature Manager") )
self.actionDockWidget.setCheckable(True)

# connect new action to plugin function - when action is triggered
Expand Down Expand Up @@ -193,7 +193,8 @@ def loadOsmFromFile(self):

# sanity check whether we're able to load osm data
if 'osm' not in QgsProviderRegistry.instance().providerList():
QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!")
QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry" ),
QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") )
return

# show modal dialog with OSM file selection
Expand Down Expand Up @@ -222,13 +223,14 @@ def saveOsmToFile(self):
"""

if 'osm' not in QgsProviderRegistry.instance().providerList():
QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!")
QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry" ),
QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") )
return

if not self.dbm.currentKey:
QMessageBox.information(QWidget(), QString("OSM Save to file")
,"No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
Please change this situation first, because OSM Plugin doesn't know what to save.")
QMessageBox.information(QWidget(), QCoreApplication.translate( "OsmPlugin", "OSM Save to file"),
QCoreApplication.translate( "OsmPlugin", "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
Please change this situation first, because OSM Plugin doesn't know what to save.") )
return

# show modal dialog with OSM file selection
Expand All @@ -247,7 +249,8 @@ def downloadOsmData(self):
"""

if 'osm' not in QgsProviderRegistry.instance().providerList():
QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!")
QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry" ),
QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") )
return

self.dlgDownload=OsmDownloadDlg(self)
Expand Down Expand Up @@ -299,9 +302,9 @@ def uploadOsmData(self):

# first check if there are some data; if not upload doesn't have sense
if not self.dbm.currentKey:
QMessageBox.information(QWidget(), QString("OSM Upload")
,"No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
Please change this situation first, because OSM Plugin doesn't know what to upload.")
QMessageBox.information(QWidget(), QCoreApplication.translate( "OsmPlugin", "OSM Upload"),
QCoreApplication.translate( "OsmPlugin", "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
Please change this situation first, because OSM Plugin doesn't know what to upload.") )
return

self.dlgUpload=OsmUploadDlg(self)
Expand All @@ -316,18 +319,20 @@ def importData(self):
"""

if 'osm' not in QgsProviderRegistry.instance().providerList():
QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!")
QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry"),
QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") )
return

if self.dbm.currentKey is None:
QMessageBox.information(self.iface.mainWindow(), "OSM Import"
,"No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
Please change this situation first, because OSM Plugin doesn't know what layer will be destination of the import.")
QMessageBox.information(self.iface.mainWindow(), QCoreApplication.translate( "OsmPlugin", "OSM Import"),
QCoreApplication.translate( "OsmPlugin", "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
Please change this situation first, because OSM Plugin doesn't know what layer will be destination of the import.") )
return

dlg=OsmImportDlg(self)
if dlg.cboLayer.count()==0:
QMessageBox.information(self.iface.mainWindow(), "OSM Import", "There are currently no available vector layers.")
QMessageBox.information(self.iface.mainWindow(), QCoreApplication.translate( "OsmPlugin", "OSM Import"),
QCoreApplication.translate( "OsmPlugin", "There are currently no available vector layers.") )
return

dlg.exec_()
Expand Down Expand Up @@ -367,5 +372,3 @@ def __ofVisibilityChanged(self):
self.actionDockWidget.setChecked(True)
else:
self.actionDockWidget.setChecked(False)


5 changes: 1 addition & 4 deletions python/plugins/osm/OsmSaveDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def showSaveFileDialog(self):
lastDir = settings.value("/OSM_Plugin/lastDir", QVariant(QString())).toString()

# display file open dialog and get absolute path to selected file
fileSelected = QFileDialog.getSaveFileName(self,"Choose an Open Street Map file",lastDir,"OSM Files (*.osm)");
fileSelected = QFileDialog.getSaveFileName(self, self.tr("Choose an Open Street Map file"),lastDir,self.tr("OSM Files (*.osm)") );
# insert OSM file path into line edit control
if not fileSelected.isNull():
self.OSMFileEdit.setText(fileSelected)
Expand Down Expand Up @@ -457,6 +457,3 @@ def onOK(self):
if self.outFile and self.outFile.exists():
self.outFile.close()
self.close()



2 changes: 0 additions & 2 deletions python/plugins/osm/OsmUndoRedoDW.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,5 +437,3 @@ def redo(self,standAlone=True):
if self.redoCounter>0:
self.redoButton.setEnabled(True)
self.plugin.dockWidget.redoButton.setEnabled(True)


34 changes: 17 additions & 17 deletions python/plugins/osm/OsmUploadDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self,plugin):
self.ur=plugin.undoredo

self.urlHost = "api.openstreetmap.org"
self.uploadButton = self.buttonBox.addButton("Upload", QDialogButtonBox.ActionRole)
self.uploadButton = self.buttonBox.addButton(self.tr("Upload"), QDialogButtonBox.ActionRole)

self.uploadChangesTable.setColumnCount(5)
self.uploadChangesTable.setColumnWidth(0,80)
Expand Down Expand Up @@ -1079,7 +1079,7 @@ def __httpNodeAdditionReqFinished(self, requestId, error):
del self.pseudoId_map[requestId]

if error:
self.cancelUpload("Node addition failed.")
self.cancelUpload( self.tr("Node addition failed.") )
return

newNodeIdStr=QString(self.http.readAll().data())
Expand Down Expand Up @@ -1119,7 +1119,7 @@ def __httpNodeUpdateReqFinished(self, requestId, error):
del self.featureId_map[requestId]

if error:
self.cancelUpload("Node update failed.")
self.cancelUpload(self.tr("Node update failed."))
return

newVersionIdStr=QString(self.http.readAll().data())
Expand Down Expand Up @@ -1158,7 +1158,7 @@ def __httpNodeDeletionReqFinished(self, requestId, error):
del self.featureId_map[requestId]

if error:
self.cancelUpload("Node deletion failed.")
self.cancelUpload(self.tr("Node deletion failed."))
return

self.dbm.removePointRecord(pointId)
Expand Down Expand Up @@ -1194,7 +1194,7 @@ def __httpWayAdditionReqFinished(self, requestId, error):
del self.pseudoId_map[requestId]

if error:
self.cancelUpload("Way addition failed.")
self.cancelUpload(self.tr("Way addition failed."))
return

newWayIdStr = QString(self.http.readAll().data())
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def __httpWayUpdateReqFinished(self, requestId, error):
del self.featureId_map[requestId]

if error:
self.cancelUpload("Way update failed.")
self.cancelUpload(self.tr("Way update failed."))
return

newVersionIdStr=QString(self.http.readAll().data())
Expand Down Expand Up @@ -1273,7 +1273,7 @@ def __httpWayDeletionReqFinished(self, requestId, error):
del self.featureId_map[requestId]

if error:
self.cancelUpload("Way deletion failed.")
self.cancelUpload(self.tr("Way deletion failed."))
return

self.dbm.removeWayRecord(wayId)
Expand Down Expand Up @@ -1309,7 +1309,7 @@ def __httpRelationAdditionReqFinished(self, requestId, error):
del self.pseudoId_map[requestId]

if error:
self.cancelUpload("Relation addition failed.")
self.cancelUpload(self.tr("Relation addition failed."))
return

newRelIdStr=QString(self.http.readAll().data())
Expand Down Expand Up @@ -1348,7 +1348,7 @@ def __httpRelationUpdateReqFinished(self, requestId, error):
del self.featureId_map[requestId]

if error:
self.cancelUpload("Relation update failed.")
self.cancelUpload(self.tr("Relation update failed."))
return

newVersionIdStr=QString(self.http.readAll().data())
Expand Down Expand Up @@ -1386,7 +1386,7 @@ def __httpRelationDeletionReqFinished(self, requestId, error):
del self.featureId_map[requestId]

if error:
self.cancelUpload("Relation deletion failed.")
self.cancelUpload(self.tr("Relation deletion failed."))
return

self.dbm.removeRelationRecord(relId)
Expand Down Expand Up @@ -1417,7 +1417,7 @@ def __httpChangesetCreationReqFinished(self, requestId, error):
self.disconnect(self.http, SIGNAL("requestFinished(int, bool)"), self.__httpChangesetCreationReqFinished)

if error:
self.cancelUpload("Connection to OpenStreetMap server cannot be established. Please check your proxy settings, firewall settings and try again.")
self.cancelUpload(self.tr("Connection to OpenStreetMap server cannot be established. Please check your proxy settings, firewall settings and try again."))
return

del self.qhttp_map[requestId]
Expand Down Expand Up @@ -1448,7 +1448,7 @@ def __httpChangesetClosingReqFinished(self, requestId, error):
self.disconnect(self.http, SIGNAL("requestFinished(int, bool)"), self.__httpChangesetClosingReqFinished)

if error:
self.cancelUpload("Changeset closing failed.")
self.cancelUpload(self.tr("Changeset closing failed."))
return

# call the next upload step
Expand All @@ -1468,7 +1468,7 @@ def __readResponseHeader(self, responseHeader):

if responseHeader.statusCode() != 200:

self.cancelUpload(QString("Upload process failed. OpenStreetMap server response: %1 - %2.")
self.cancelUpload(self.tr("Upload process failed. OpenStreetMap server response: %1 - %2.")
.arg(responseHeader.reasonPhrase())
.arg(responseHeader.value("Error")))

Expand All @@ -1480,7 +1480,7 @@ def __authRequired(self,s,a,b):
We are really not interested in function parameters - we just cancel the connection.
"""

self.cancelUpload("Authentication failed. Please try again with correct login and password.")
self.cancelUpload(self.tr("Authentication failed. Please try again with correct login and password."))


def __setProxy(self):
Expand Down Expand Up @@ -1536,13 +1536,13 @@ def __examineResponse(self,requestId,error):
return

if requestId==self.reqSetHost:
self.cancelUpload("Setting host failed.")
self.cancelUpload(self.tr("Setting host failed."))

elif requestId==self.reqSetUser:
self.cancelUpload("Setting user and password failed.")
self.cancelUpload(self.tr("Setting user and password failed."))

elif requestId==self.reqSetProxy:
self.cancelUpload("Setting proxy failed.")
self.cancelUpload(self.tr("Setting proxy failed."))



Loading