2 changes: 0 additions & 2 deletions debian/python-qgis.install.quantal
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
usr/lib/python*/*-packages/qgis/*.py
usr/lib/python*/*-packages/qgis/*.so
usr/lib/python*/*-packages/pyspatialite/*.py
usr/lib/python*/*-packages/pyspatialite/*.so
usr/lib/libqgispython.so.{QGIS_ABI}
5 changes: 5 additions & 0 deletions debian/python-qgis.install.raring
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
usr/lib/python*/*-packages/qgis/*.py
usr/lib/python*/*-packages/qgis/*.so
usr/lib/python*/*-packages/pyspatialite/*.py
usr/lib/python*/*-packages/pyspatialite/*.so
usr/lib/libqgispython.so.{QGIS_ABI}
8 changes: 6 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ifeq (,$(DISTRIBUTION))
DISTRIBUTION := $(shell dpkg-parsechangelog --format rfc822 | sed -ne "s/^Distribution: //p")
endif

ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"squeeze wheezy lucid maverick natty oneiric precise sid-oracle"))
ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"squeeze wheezy lucid maverick natty oneiric precise quantal raring sid-oracle"))
DISTRIBUTION := sid
endif

Expand Down Expand Up @@ -71,6 +71,10 @@ else
CMAKE_OPTS += -D WITH_GLOBE=TRUE
endif

ifneq (,$(findstring $(DISTRIBUTION),"raring"))
CMAKE_OPTS += -D PYTHON_LIBRARY=/usr/lib/$(DEB_BUILD_GNU_TYPE)/libpython2.7.so
endif

ifneq (,$(findstring -oracle,$(DISTRIBUTION)))
CMAKE_OPTS += -D WITH_ORACLE=TRUE
endif
Expand Down Expand Up @@ -210,7 +214,7 @@ binary-arch: build install
install -o root -g root -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis-plugin-grass/usr/bin/qgis
install -o root -g root -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis-plugin-grass/usr/bin/qbrowser

ifneq (,$(findstring $(DISTRIBUTION),"wheezy sid"))
ifneq (,$(findstring $(DISTRIBUTION),"wheezy sid quantal raring"))
dh_python2 --no-guessing-versions
else
dh_pycentral
Expand Down
76 changes: 38 additions & 38 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

30 changes: 27 additions & 3 deletions doc/osx.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ of Xcode, regardless of using a separate DMG installer for just the tools.

Xcode 4.4+ also introduces the clang frontend to the LLVM compiler as default.

**Note:** In XCODE 4.5 installed from teh app store, you need to install the
**Note:** In XCODE 4.5 installed from the app store, you need to install the
command line tools from XCode -> Preferences -> Downloads and choose command line tools.

http://clang.llvm.org/
Expand Down Expand Up @@ -113,7 +113,7 @@ __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
PPC Macs anyways. Qt Carbon is recommended on PPC Macs.

http://qt.nokia.com/downloads
http://qt-project.org/downloads

If you want debug frameworks, Qt also provides a separate download with these.
These are in addition to the non-debug frameworks.
Expand Down Expand Up @@ -456,7 +456,7 @@ For 64-bit Qt (Qt Cocoa), use this configure line:
python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
```

__Lion system Python__
__Lion and Mt. Lion system Python__

Similar to Snow Leopard, you should install outside the system Python path.
But you don't need the arch option:
Expand Down Expand Up @@ -527,7 +527,31 @@ cd <Qwt 6.x.x source directory>
qmake -spec macx-g++
make -j [#cpus]
sudo make install
```

**TODO:** Remedy for :

```
shrub:qwt-6.1-rc3 timlinux$ sudo make install
Password:
cd src/ && make -f Makefile install
rm -f -r "/usr/local/qwt-6.1.0-rc3/lib/qwt.framework"
cp -f -R "../lib/qwt.framework" "/usr/local/qwt-6.1.0-rc3/lib/qwt.framework"
cp -f -R /Users/timlinux/dev/cpp/qwt-6.1-rc3/doc/html /usr/local/qwt-6.1.0-rc3/doc/
cp -f -R /Users/timlinux/dev/cpp/qwt-6.1-rc3/doc/man /usr/local/qwt-6.1.0-rc3/doc/
cd textengines/ && make -f Makefile install
make[1]: Nothing to be done for `install'.
cd designer/ && make -f Makefile install
rm -f libqwt_designer_plugin.dylib
linking plugins/designer/libqwt_designer_plugin.dylib
ld: library not found for -lqwt
collect2: ld returned 1 exit status
make[1]: *** [plugins/designer/libqwt_designer_plugin.dylib] Error 1
make: *** [sub-designer-install_subtargets-ordered] Error 2
```


```
sudo install_name_tool -id /usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/qwt \
/usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/qwt
```
Expand Down
2,300 changes: 1,180 additions & 1,120 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

16,126 changes: 10,500 additions & 5,626 deletions i18n/qgis_et_EE.ts

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions i18n/qgis_pt_PT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31530,17 +31530,17 @@ Always network: always load from network and do not check if the cache has a val
<message>
<location filename="../src/plugins/offline_editing/offline_editing_plugin_gui.cpp" line="128"/>
<source>Offline Editing Plugin</source>
<translation type="unfinished">Edição Offline</translation>
<translation>Edição Offline</translation>
</message>
<message>
<location filename="../src/plugins/offline_editing/offline_editing_plugin_gui.cpp" line="129"/>
<source>Converting to offline project.</source>
<translation type="unfinished">Converter para projeto offline.</translation>
<translation>Converter para projecto offline.</translation>
</message>
<message>
<location filename="../src/plugins/offline_editing/offline_editing_plugin_gui.cpp" line="130"/>
<source>Offline database file &apos;%1&apos; exists. Overwrite?</source>
<translation type="unfinished">Base de dados offline %1 já existe. Substituir?</translation>
<translation>Base de dados offline %1 já existe. Substituir?</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -35915,7 +35915,7 @@ Database error: %2</source>
<message>
<location filename="../src/gui/qgsprojectbadlayerguihandler.cpp" line="46"/>
<source>Ignore</source>
<translation type="unfinished">Ignorar</translation>
<translation>Ignorar</translation>
</message>
<message>
<location filename="../src/gui/qgsprojectbadlayerguihandler.cpp" line="52"/>
Expand Down Expand Up @@ -40877,7 +40877,7 @@ O erro foi:
<message>
<location filename="../src/app/qgssinglesymboldialog.cpp" line="207"/>
<source>Texture</source>
<translation type="unfinished">Textura</translation>
<translation>Textura</translation>
</message>
<message>
<location filename="../src/app/qgssinglesymboldialog.cpp" line="293"/>
Expand All @@ -40897,7 +40897,7 @@ O erro foi:
<location filename="../src/app/qgssinglesymboldialog.cpp" line="183"/>
<location filename="../src/app/qgssinglesymboldialog.cpp" line="193"/>
<source>None</source>
<translation type="unfinished">Nenhum</translation>
<translation>Nenhum</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -45211,7 +45211,7 @@ Existem classes que poderiam ser excluídas antes da classificação?</translati
<message>
<location filename="../src/app/ogr/qgsvectorlayersaveasdialog.cpp" line="43"/>
<source>SpatiaLite</source>
<translation type="unfinished">SpatiaLite</translation>
<translation>SpatiaLite</translation>
</message>
<message>
<source>Original CRS</source>
Expand Down Expand Up @@ -45359,12 +45359,12 @@ Existem classes que poderiam ser excluídas antes da classificação?</translati
<message>
<location filename="../src/providers/wcs/qgswcsdataitems.cpp" line="90"/>
<source>Edit...</source>
<translation type="unfinished">Editar...</translation>
<translation>Editar...</translation>
</message>
<message>
<location filename="../src/providers/wcs/qgswcsdataitems.cpp" line="94"/>
<source>Delete</source>
<translation type="unfinished">Apagar</translation>
<translation>Apagar</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -45421,7 +45421,7 @@ Existem classes que poderiam ser excluídas antes da classificação?</translati
<location filename="../src/providers/wfs/qgswfsdata.cpp" line="104"/>
<source>Loading WFS data
%1</source>
<translation type="unfinished">Carregando dados WFS
<translation>Carregando dados WFS
%1</translation>
</message>
</context>
Expand Down Expand Up @@ -48694,7 +48694,7 @@ provedores adicionais de algoritmos</translation>
<message>
<location filename="../src/ui/symbollayer/widget_fontmarker.ui" line="98"/>
<source>Offset X,Y</source>
<translation type="unfinished">Deslocamento X,Y</translation>
<translation>Deslocamento X,Y</translation>
</message>
</context>
<context>
Expand All @@ -48717,7 +48717,7 @@ provedores adicionais de algoritmos</translation>
<message>
<location filename="../src/ui/symbollayer/widget_linedecoration.ui" line="61"/>
<source>Pen width</source>
<translation type="unfinished">Espessura da linha</translation>
<translation>Espessura da linha</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -48761,7 +48761,7 @@ provedores adicionais de algoritmos</translation>
<message>
<location filename="../src/ui/symbollayer/widget_linepatternfill.ui" line="96"/>
<source>Offset</source>
<translation type="unfinished">Deslocamento</translation>
<translation>Deslocamento</translation>
</message>
</context>
<context>
Expand All @@ -48782,7 +48782,7 @@ provedores adicionais de algoritmos</translation>
<message>
<location filename="../src/ui/symbollayer/widget_markerline.ui" line="81"/>
<source>Line offset</source>
<translation type="unfinished">Deslocamento da linha</translation>
<translation>Deslocamento da linha</translation>
</message>
<message>
<source>Change</source>
Expand Down Expand Up @@ -49024,7 +49024,7 @@ provedores adicionais de algoritmos</translation>
<message>
<location filename="../src/ui/symbollayer/widget_simplemarker.ui" line="55"/>
<source>Fill color</source>
<translation type="unfinished">Cor do preenchimento</translation>
<translation>Cor do preenchimento</translation>
</message>
<message>
<location filename="../src/ui/symbollayer/widget_simplemarker.ui" line="69"/>
Expand All @@ -49039,13 +49039,13 @@ provedores adicionais de algoritmos</translation>
<message>
<location filename="../src/ui/symbollayer/widget_simplemarker.ui" line="96"/>
<source>Offset X,Y</source>
<translation type="unfinished">Deslocamento X,Y</translation>
<translation>Deslocamento X,Y</translation>
</message>
<message>
<location filename="../src/ui/symbollayer/widget_simplemarker.ui" line="32"/>
<location filename="../src/ui/symbollayer/widget_simplemarker.ui" line="62"/>
<source>Change</source>
<translation type="unfinished">Mudar</translation>
<translation>Mudar</translation>
</message>
</context>
<context>
Expand Down
3 changes: 3 additions & 0 deletions mac/cmake/0vars.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ SET (WITH_GLOBE "@WITH_GLOBE@")
SET (WITH_GRASS "@WITH_GRASS@")
SET (WITH_MAPSERVER "@WITH_MAPSERVER@")
SET (WITH_POSTGRESQL "@WITH_POSTGRESQL@")

# tests
SET (ENABLE_TESTS "@ENABLE_TESTS@")
2 changes: 1 addition & 1 deletion mac/cmake/1qt.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ IF (@QSCI_FOUND@)
ENDIF (@QSCI_FOUND@)

# for tests
IF (ENABLE_TESTS)
IF (@ENABLE_TESTS@)
SET (QTLISTQG ${QTLISTQG} QtTest)
SET (PYQTLIST ${PYQTLIST} QtTest)
ENDIF ()
Expand Down
9 changes: 8 additions & 1 deletion ms-windows/QGIS-Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ Section "Quantum GIS" SecQGIS
GetFullPathName /SHORT $0 $INSTALL_DIR
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_MENU_LINKS", "1").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_DESKTOP_LINKS", "1").r0'

ReadEnvStr $0 COMSPEC
nsExec::ExecToLog '"$0" /c "$INSTALL_DIR\postinstall.bat"'
Expand All @@ -355,11 +357,14 @@ RebootNecessary:
SetRebootFlag true

NoRebootNecessary:
Delete "$DESKTOP\Quantum GIS (${VERSION_NUMBER}).lnk"
Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk"

Delete "$DESKTOP\Quantum GIS Desktop (${VERSION_NUMBER}).lnk"
CreateShortCut "$DESKTOP\Quantum GIS Desktop (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"

Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS (${VERSION_NUMBER}).lnk"
Delete "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS Desktop (${VERSION_NUMBER}).lnk"
CreateShortCut "$SMPROGRAMS\${QGIS_BASE}\Quantum GIS Desktop (${VERSION_NUMBER}).lnk" "$INSTALL_DIR\bin\nircmd.exe" 'exec hide "$INSTALL_DIR\bin\${SHORTNAME}.bat"' \
"$INSTALL_DIR\icons\QGIS.ico" "" SW_SHOWNORMAL "" "Launch ${COMPLETE_NAME}"

Expand Down Expand Up @@ -487,6 +492,8 @@ Section "Uninstall"
GetFullPathName /SHORT $0 $INSTDIR
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_ROOT", "$0").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_STARTMENU", "$SMPROGRAMS\${QGIS_BASE}").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_MENU_LINKS", "1").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("OSGEO4W_DESKTOP_LINKS", "1").r0'

ReadEnvStr $0 COMSPEC
nsExec::ExecToLog '"$0" /c "$INSTALL_DIR\preremove.bat"'
Expand Down
9 changes: 5 additions & 4 deletions ms-windows/osgeo4w/creatensis.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
my $shortname;
my $version;
my $binary;
my $ininame = "setup.ini";
my $help;

my $result = GetOptions(
"verbose+" => \$verbose,
"keep" => \$keep,
"releasename=s" => \$releasename,
"version=s" => \$version,
"binary=s" => \$binary,
"binary=i" => \$binary,
"packagename=s" => \$packagename,
"shortname=s" => \$shortname,
"ininame=s" => \$ininame,
"help" => \$help
);

Expand All @@ -62,7 +64,7 @@
my %file;
my $package;

system "wget $wgetopt -c $root/setup.ini";
system "wget $wgetopt -O setup.ini -c $root/$ininame";
open F, "setup.ini" || die "setup.ini not found";
while(<F>) {
chop;
Expand Down Expand Up @@ -246,8 +248,6 @@ sub getDeps {
} else {
$binary = 1;
}
} else {
die "given binary version not numeric" unless $package =~ /^\d+$/;
}

system "unzip packages/Untgz.zip" unless -d "untgz";
Expand Down Expand Up @@ -294,6 +294,7 @@ =head1 SYNOPSIS
-keep don't start with a fresh unpacked directory
-version=m.m.p package version (defaults to CMakeLists.txt setting)
-binary=b binary version of package
-ininame=filename name of the setup.ini (defaults to setup.ini)
-packagename=s name of package (defaults to 'Quantum GIS')
-shortname=s shortname used for batch file (defaults to 'qgis')
-help this help
Expand Down
2 changes: 1 addition & 1 deletion ms-windows/osgeo4w/package-nightly.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ if errorlevel 1 goto error

set LIB=%LIB%;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%

cmake -G "Visual Studio 9 2008" ^
-D BUILDNAME="OSGeo4W-Nightly-VC9" ^
Expand All @@ -120,7 +121,6 @@ cmake -G "Visual Studio 9 2008" ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python27/sip.exe ^
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION% ^
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
-D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^
Expand Down
4 changes: 2 additions & 2 deletions ms-windows/osgeo4w/package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set PACKAGE=%2
set PACKAGENAME=%3
if "%VERSION%"=="" goto error
if "%PACKAGE%"=="" goto error
if "%PACKAGENAME%"=="" set PACKAGENAME=qgis-dev
if "%PACKAGENAME%"=="" set PACKAGENAME=qgis

path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;%PROGRAMFILES%\CMake 2.8\bin
set PYTHONPATH=
Expand Down Expand Up @@ -100,6 +100,7 @@ if errorlevel 1 goto error

set LIB=%LIB%;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%

cmake -G "Visual Studio 9 2008" ^
-D PEDANTIC=TRUE ^
Expand All @@ -117,7 +118,6 @@ cmake -G "Visual Studio 9 2008" ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python27/sip.exe ^
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION% ^
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
-D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^
Expand Down
35 changes: 22 additions & 13 deletions python/console/console_help/i18n/ru_RU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@ i18n_dict = {
"header.subject" : "Консоль Python на основе PyQScintilla2.",
"header.subject.main" : "Для доступа к окружению Quantum GIS из консоли \
используйте объект qgis.utils.iface (экземпляр класса QgisInterface). \
Также можно импортировать класс QgisInterface при помощи специальной \
Также можно испортировать класс QgisInterface при помощи специальной \
кнопки на панели инструментов слева.",
"header.subject.A" : "Консоль разделена на две части: поля ввода и вывода. \
Размер полей можно изменять двигая горизонтальный разделитель. \
Поле вывода доступно только для чтения, здесь отображаются результаты выполнения команд. \
Текст в поле ввода можно перетаскивать или копировать \
(при этом наличие в тексте символов >>> или ... не критично). \
Для обмена фрагментами кода используйте пункт 'Share on codepad' контекстного меню. \
Контекстное меню показано на рисунке ниже.",
"header.subject.B" : "Поле ввода предоставляет доступ к интерактивному интерпретатору Python и предназначена для ввода команд.",
"features" : "Возможности",
"features.title" : "Автодополнение и подсветка синтаксиса для следующих API:",
"features.a" : "CTRL+SPACE для вызова списка автодополнения.",
"features.b" : "CTRL+ALT+SPACE для вызова истории команд.",
"features.c" : "Сохранение истории введённых команд при помощи метода '_save' или при закрытии окна. \
История комад сохраняется в файле ~/.qgis/console_history.txt",
"features.b" : "CTRL+ALT+SPACE для просмотра истории команд.",
"features.c" : "Сохранение истории введённых команд при помощи метода '_save' или при закрытии консоли. \
История команд сохраняется в файле ~/.qgis/console_history.txt",
"features.d" : "Очистка истории введённых команд при помощи метода '_clear'. \
Метод выполняет очистку файла истории ~/.qgis/console_history.txt",
Очищает содержимое файла ~/.qgis/console_history.txt",
"features.e" : "Полная очистка истории введённых команд при помощи метода '_clearAll'. \
Вызов метода приведет к полной очистке истории команд. Это действие невозможно отменить.",
Вызов метода приведёт к полной очистке истории введённых команд. Эту операцию нельзя отменить.",
"features.api.doc" : "Открытие API-документации Quantum GIS API при помощи метода '_api'.",
"features.pyqgis.doc" : "Открытие Поваренной книги разработчика PyQGIS при помощи метода '_pyqgis'.",
"toolbar" : "Панель инструментов",
"toolbar.title" : "На панели инструментов расположены следующие кнопки:",
"toolbar.clear" : "Очистить консоль",
"toolbar.iface" : "Импортировать класс iface",
"toolbar.sextante" : "Импортировать класс Sextante",
"toolbar.qtcore" : "Импортировать класс PyQt4.QtCore",
"toolbar.qtgui" : "Импортировать класс PyQt4.QtGui",
"toolbar.script.open" : "Загрузить скрипт Python",
"toolbar.script.save" : "Сохранить как скрипт Python",
"toolbar.qtcore" : "импортировать модуль PyQt4.QtCore",
"toolbar.qtgui" : "Импортировать модуль PyQt4.QtGui",
"toolbar.script.open" : "Загрузить скрипт Pythоn",
"toolbar.script.save" : "Сохранить скрипт Python",
"toolbar.settings" : "Настройки",
"toolbar.help" : "Справка",
"toolbar.run" : "Выполнить команду (действие аналогично нажатию клавиши Enter)",
"thanks" : "Благодарности",
"thanks.text" : "Автор выражает благодарность Larry Shaffer за предоставленые файлы API."
"toolbar.run" : "выполнить команду (действие аналогично нажатию клавиши Enter)"
};
14 changes: 14 additions & 0 deletions python/core/qgsdataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,18 @@ class QgsDataProvider : QObject
*/
void fullExtentCalculated();

/**
* This is emitted whenever an asynchronous operation has finished
* and the data should be redrawn
* @note added in 1.5
*/
void dataChanged();

/**
* This is emitted whenever data or metadata (e.g. color table, extent) has changed
* @param changed binary combination of changes
* @note added in 1.7
*/
void dataChanged( int changed );

};
3 changes: 2 additions & 1 deletion python/core/qgsfeature.sip
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

typedef qint64 QgsFeatureId;

// key = field index, value = field value
typedef QMap<int, QVariant> QgsAttributeMap;
Expand Down Expand Up @@ -189,6 +190,6 @@ class QgsFeature
*/
int fieldNameIndex( const QString& fieldName ) const;


}; // class QgsFeature

typedef QSet<QgsFeatureId> QgsFeatureIds;
8 changes: 4 additions & 4 deletions python/core/qgsfeaturerequest.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class QgsFeatureRequest

enum FilterType
{
FilterNone, //!< No filter is applied
FilterRect, //!< Filter using a rectangle
FilterFid //!< Filter using feature ID
FilterNone, //!< No filter is applied
FilterRect, //!< Filter using a rectangle
FilterFid //!< Filter using feature ID
};

//! construct a default request: for all features get attributes and geometries
Expand All @@ -33,7 +33,7 @@ class QgsFeatureRequest

//! Set feature ID that should be fetched.
QgsFeatureRequest& setFilterFid( qint64 fid );
const qint64& filterFid() const;
qint64 filterFid() const;

//! Set flags that affect how features will be fetched
QgsFeatureRequest& setFlags( Flags flags );
Expand Down
9 changes: 7 additions & 2 deletions python/core/qgsmaplayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class QgsMapLayer : QObject
*/
const QString & name() const;

/** Get the original name of the layer
* @note added in 1.9
*/
const QString & originalName() const;

void setTitle( const QString& title );
const QString& title() const;

Expand Down Expand Up @@ -207,8 +212,8 @@ class QgsMapLayer : QObject
@note emitSignal added in 1.4 */
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );

/** A convenience function to capitalise the layer name */
static QString capitaliseLayerName( const QString name );
/** A convenience function to (un)capitalise the layer name */
static QString capitaliseLayerName( const QString& name );

/** Retrieve the style URI for this layer
* (either as a .qml file on disk or as a
Expand Down
7 changes: 6 additions & 1 deletion python/core/qgsmaplayerregistry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class QgsMapLayerRegistry : QObject
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers /Transfer/,
bool theEmitSignal = true );

/** Add a layer to the map of loaded layers
@returns NULL if unable to add layer, otherwise pointer to newly added layer
@see addMapLayers
@note Use addMapLayers if adding more than one layer at a time
*/
QgsMapLayer *addMapLayer( QgsMapLayer * theMapLayer /Transfer/, bool theEmitSignal = true ) /Deprecated/;

/** Remove a set of layers from qgis
@note As a side-effect QgsProject is made dirty.
Expand All @@ -57,7 +63,6 @@ class QgsMapLayerRegistry : QObject
*/
void removeMapLayers( QStringList theLayerIds, bool theEmitSignal = true );


/** Remove all registered layers
@note raises removedAll()
As a side-effect QgsProject is made dirty.
Expand Down
59 changes: 33 additions & 26 deletions python/core/qgsvectordataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ class QgsVectorDataProvider : QgsDataProvider

public:

// If you add to this, please also add to capabilitiesString()
/**
* enumeration with capabilities that providers might implement
*/
enum Capability
{
NoCapabilities = 0,
AddFeatures = 1,
DeleteFeatures = 2,
ChangeAttributeValues = 4,
AddAttributes = 8,
DeleteAttributes = 16,
SaveAsShapefile = 32,
CreateSpatialIndex = 64,
SelectAtId = 128,
ChangeGeometries = 256,
SelectGeometryAtId = 512,
RandomSelectGeometryAtId = 1024,
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
SetEncoding = 8192,
};
// If you add to this, please also add to capabilitiesString()
/**
* enumeration with capabilities that providers might implement
*/
enum Capability
{
NoCapabilities = 0,
AddFeatures = 1,
DeleteFeatures = 2,
ChangeAttributeValues = 4,
AddAttributes = 8,
DeleteAttributes = 16,
SaveAsShapefile = 32,
CreateSpatialIndex = 64,
SelectAtId = 128,
ChangeGeometries = 256,
SelectGeometryAtId = 512,
RandomSelectGeometryAtId = 1024,
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
SetEncoding = 8192,
};

/** bitmask of all provider's editing capabilities */
static const int EditingCapabilities;
Expand Down Expand Up @@ -120,7 +120,7 @@ class QgsVectorDataProvider : QgsDataProvider
* Adds a list of features
* @return true in case of success and false in case of failure
*/
virtual bool addFeatures( QList<QgsFeature> & flist /In,Out/ );
virtual bool addFeatures( QList<QgsFeature> &flist /In,Out/ );

/**
* Deletes one or more features
Expand Down Expand Up @@ -158,9 +158,10 @@ class QgsVectorDataProvider : QgsDataProvider

/**
* Changes geometries of existing features
* @param geometry_map A std::map containing the feature IDs to change the geometries of.
* the second map parameter being the new geometries themselves
* @return true in case of success and false in case of failure
* @param geometry_map A QgsGeometryMap whose index contains the feature IDs
* that will have their geometries changed.
* The second map parameter being the new geometries themselves
* @return True in case of success and false in case of failure
*/
virtual bool changeGeometryValues( QMap<qint64, QgsGeometry> & geometry_map );

Expand Down Expand Up @@ -208,6 +209,12 @@ class QgsVectorDataProvider : QgsDataProvider
*/
QList<int> attributeIndexes();

/**
* Return list of indexes of fields that make up the primary key
* @note added in 2.0
*/
virtual QList<int> pkAttributeIndexes();

/**
* Set whether provider should also return features that don't have
* associated geometry. false by default
Expand Down
154 changes: 126 additions & 28 deletions python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
@@ -1,9 +1,63 @@

typedef QList<int> QgsAttributeList;
typedef QSet<qint64> QgsFeatureIds;
typedef QSet<int> QgsAttributeIds;
typedef qint64 QgsFeatureId;

/** @note Added in 1.9 */
class QgsAttributeEditorElement : QObject
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:

enum AttributeEditorType
{
AeTypeContainer,
AeTypeField,
AeTypeInvalid
};

QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL );

virtual ~QgsAttributeEditorElement();

QString name() const;
AttributeEditorType type() const;

virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
};

/** @note Added in 1.9 */
class QgsAttributeEditorContainer : QgsAttributeEditorElement
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:
QgsAttributeEditorContainer( QString name, QObject *parent );
~QgsAttributeEditorContainer();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
virtual void addChildElement( QgsAttributeEditorElement *widget );
QList<QgsAttributeEditorElement*> children() const;
};

/** @note Added in 1.9 */
class QgsAttributeEditorField : QgsAttributeEditorElement
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:
QgsAttributeEditorField( QString name , int idx, QObject *parent );
~QgsAttributeEditorField();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
int idx() const;
};

/** @note added in 1.7 */
struct QgsVectorJoinInfo
Expand Down Expand Up @@ -52,6 +106,13 @@ class QgsVectorLayer : QgsMapLayer
}
%End

enum EditorLayout
{
GeneratedLayout,
TabLayout,
UiFileLayout,
};

enum EditType
{
LineEdit,
Expand All @@ -73,13 +134,6 @@ class QgsVectorLayer : QgsMapLayer
UuidGenerator, /* uuid generator - readonly and automatically intialized @added in 1.9 */
};

enum EditorLayout
{
GeneratedLayout,
TabLayout,
UiFileLayout,
};

struct RangeData
{
RangeData();
Expand Down Expand Up @@ -108,6 +162,23 @@ class QgsVectorLayer : QgsMapLayer
bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
};

struct GroupData
{
GroupData();
GroupData( QString name , QList<QString> fields );
QString mName;
QList<QString> mFields;
};

struct TabData
{
TabData();
TabData( QString name , QList<QString> fields , QList<QgsVectorLayer::GroupData> groups );
QString mName;
QList<QString> mFields;
QList<QgsVectorLayer::GroupData> mGroups;
};

/** Constructor */
QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
Expand Down Expand Up @@ -219,12 +290,12 @@ class QgsVectorLayer : QgsMapLayer
/** Draw layer with renderer V2.
* @note added in 1.4
*/
void drawRendererV2( QgsRenderContext& rendererContext, bool labeling );
void drawRendererV2( QgsFeatureIterator &fit, QgsRenderContext& rendererContext, bool labeling );

/** Draw layer with renderer V2 using symbol levels.
* @note added in 1.4
*/
void drawRendererV2Levels( QgsRenderContext& rendererContext, bool labeling );
void drawRendererV2Levels( QgsFeatureIterator &fit, QgsRenderContext& rendererContext, bool labeling );

/** Returns point, line or polygon */
QGis::GeometryType geometryType() const;
Expand All @@ -250,6 +321,12 @@ class QgsVectorLayer : QgsMapLayer
*/
virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );

/** convert a saved attribute editor element into a AttributeEditor structure as it's used internally.
* @param elem the DOM element
* @param parent the QObject which will own this object
*/
QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );

/** Read the symbology for the current layer from the Dom node supplied.
* @param node node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
Expand Down Expand Up @@ -277,6 +354,21 @@ class QgsVectorLayer : QgsMapLayer
*/
virtual long featureCount() const;

/**
* Number of features rendered with specified symbol. Features must be first
* calculated by countSymbolFeatures()
* @param symbol the symbol
* @return number of features rendered by symbol or -1 if failed or counts are not available
*/
long featureCount( QgsSymbolV2* symbol );

/**
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbolV2*).
* @param showProgress show progress dialog
* @return true if calculated, false if failed or was canceled by user
*/
bool countSymbolFeatures( bool showProgress = true );

/**
* Set the string (typically sql) used to define a subset of the layer
* @param subset The subset string. This may be the where clause of a sql statement
Expand Down Expand Up @@ -362,7 +454,8 @@ class QgsVectorLayer : QgsMapLayer
2 ring not closed,
3 ring not valid,
4 ring crosses existing rings,
5 no feature found where ring can be inserted*/
5 no feature found where ring can be inserted
6 layer not editable */
int addRing( const QList<QgsPoint>& ring );

/**Adds a new part polygon to a multipart feature
Expand All @@ -373,7 +466,8 @@ class QgsVectorLayer : QgsMapLayer
3 if new polygon ring not disjoint with existing rings,
4 if no feature was selected,
5 if several features are selected,
6 if selected geometry not found*/
6 if selected geometry not found
7 layer not editable */
int addPart( const QList<QgsPoint>& ring );

/**Translates feature by dx, dy
Expand Down Expand Up @@ -481,6 +575,11 @@ class QgsVectorLayer : QgsMapLayer
/** returns list of attributes */
QList<int> pendingAllAttributesList();

/** returns list of attribute making up the primary key
* @note added in 2.0
*/
QList<int> pendingPkAttributesList();

/** returns feature count after commit */
int pendingFeatureCount();

Expand Down Expand Up @@ -509,6 +608,16 @@ class QgsVectorLayer : QgsMapLayer
@note added in version 1.2*/
void addAttributeAlias( int attIndex, QString aliasString );

/**Adds a tab (for the attribute editor form) holding groups and fields
@note added in version 1.9*/
void addAttributeEditorWidget( QgsAttributeEditorElement* data );
/**Returns a list of tabs holding groups and fields
@note added in version 1.9*/
QList< QgsAttributeEditorElement* > &attributeEditorElements();
/**Clears all the tabs for the attribute editor form
@note added in version 1.9*/
void clearAttributeEditorWidgets();

/**Returns the alias of an attribute name or an empty string if there is no alias
@note added in version 1.2*/
QString attributeAlias( int attributeIndex ) const;
Expand Down Expand Up @@ -561,11 +670,11 @@ class QgsVectorLayer : QgsMapLayer
/**set edit type*/
void setEditType( int idx, EditType edit );

/**get editor layout**/
/** get the active layout for the attribute editor for this layer (added in 1.9) */
EditorLayout editorLayout();

/**set editor layout*/
void setEditorLayout( EditorLayout layout );
/** set the active layout for the attribute editor for this layer (added in 1.9) */
void setEditorLayout( EditorLayout editorLayout );

/** set string representing 'true' for a checkbox (added in 1.4) */
void setCheckedState( int idx, QString checked, QString notChecked );
Expand Down Expand Up @@ -625,7 +734,6 @@ class QgsVectorLayer : QgsMapLayer
*/
QgsVectorOverlay* findOverlayByType( const QString& typeName );


//! Buffer with uncommitted editing operations. Only valid after editing has been turned on.
QgsVectorLayerEditBuffer* editBuffer();

Expand All @@ -641,16 +749,6 @@ class QgsVectorLayer : QgsMapLayer
/** Destroy active command and reverts all changes in it */
void destroyEditCommand();

/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand.
* @note not available in python bindings
*/
// void undoEditCommand( QgsUndoCommand* cmd );

/** Execute redo operation. To be called only from QgsVectorLayerUndoCommand.
* @note not available in python bindings
*/
// void redoEditCommand( QgsUndoCommand* cmd );

/** Returns the index of a field name or -1 if the field does not exist
@note this method was added in version 1.4
*/
Expand Down Expand Up @@ -732,7 +830,7 @@ class QgsVectorLayer : QgsMapLayer

/** Signals emitted after committing changes
\note added in v1.6 */
void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributeIds );
void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
Expand Down
145 changes: 75 additions & 70 deletions python/core/qgsvectorlayereditbuffer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,99 +7,104 @@ class QgsVectorLayerEditBuffer : QObject
#include "qgsvectorlayereditbuffer.h"
%End

public:
QgsVectorLayerEditBuffer(QgsVectorLayer* layer);
~QgsVectorLayerEditBuffer();
public:
QgsVectorLayerEditBuffer( QgsVectorLayer* layer );
~QgsVectorLayerEditBuffer();

/** Returns true if the provider has been modified since the last commit */
bool isModified() const;
/** Returns true if the provider has been modified since the last commit */
bool isModified() const;


/** Adds a feature
@param f feature to add
@param alsoUpdateExtent If True, will also go to the effort of e.g. updating the extents.
@return True in case of success and False in case of error
*/
bool addFeature( QgsFeature& f );
/** Adds a feature
@param f feature to add
@param alsoUpdateExtent If True, will also go to the effort of e.g. updating the extents.
@return True in case of success and False in case of error
*/
bool addFeature( QgsFeature& f );

/** Insert a copy of the given features into the layer (but does not commit it) */
bool addFeatures( QgsFeatureList& features );
/** Insert a copy of the given features into the layer (but does not commit it) */
bool addFeatures( QgsFeatureList& features );

/** delete a feature from the layer (but does not commit it) */
bool deleteFeature( QgsFeatureId fid );
/** delete a feature from the layer (but does not commit it) */
bool deleteFeature( QgsFeatureId fid );

/** change feature's geometry
@note added in version 1.2 */
bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
/** change feature's geometry
@note added in version 1.2 */
bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );

/** changed an attribute value (but does not commit it) */
bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value );
/** changed an attribute value (but does not commit it) */
bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value );

/** add an attribute field (but does not commit it)
returns true if the field was added
@note added in version 1.2 */
bool addAttribute( const QgsField &field );
/** add an attribute field (but does not commit it)
returns true if the field was added
@note added in version 1.2 */
bool addAttribute( const QgsField &field );

/** delete an attribute field (but does not commit it) */
bool deleteAttribute( int attr );
/** delete an attribute field (but does not commit it) */
bool deleteAttribute( int attr );


/**
Attempts to commit any changes to disk. Returns the result of the attempt.
If a commit fails, the in-memory changes are left alone.
/**
Attempts to commit any changes to disk. Returns the result of the attempt.
If a commit fails, the in-memory changes are left alone.

This allows editing to continue if the commit failed on e.g. a
disallowed value in a Postgres database - the user can re-edit and try
again.
This allows editing to continue if the commit failed on e.g. a
disallowed value in a Postgres database - the user can re-edit and try
again.

The commits occur in distinct stages,
(add attributes, add features, change attribute values, change
geometries, delete features, delete attributes)
so if a stage fails, it's difficult to roll back cleanly.
Therefore any error message also includes which stage failed so
that the user has some chance of repairing the damage cleanly.
*/
bool commitChanges(QStringList& commitErrors);
The commits occur in distinct stages,
(add attributes, add features, change attribute values, change
geometries, delete features, delete attributes)
so if a stage fails, it's difficult to roll back cleanly.
Therefore any error message also includes which stage failed so
that the user has some chance of repairing the damage cleanly.
*/
bool commitChanges( QStringList& commitErrors );

/** Stop editing and discard the edits */
void rollBack();
/** Stop editing and discard the edits */
void rollBack();


/** New features which are not commited. */
const QgsFeatureMap& addedFeatures();

/** Changed attributes values which are not commited */
const QgsChangedAttributesMap& changedAttributeValues();
/** New features which are not commited. */
const QgsFeatureMap& addedFeatures();

/** deleted attributes fields which are not commited. The list is kept sorted. */
const QgsAttributeList& deletedAttributeIds();
/** Changed attributes values which are not commited */
const QgsChangedAttributesMap& changedAttributeValues();

/** added attributes fields which are not commited */
const QList<QgsField>& addedAttributes();
/** deleted attributes fields which are not commited. The list is kept sorted. */
const QgsAttributeList& deletedAttributeIds();

/** Changed geometries which are not commited. */
const QgsGeometryMap& changedGeometries();
/** added attributes fields which are not commited */
const QList<QgsField>& addedAttributes();

//QString dumpEditBuffer();
/** Changed geometries which are not commited. */
const QgsGeometryMap& changedGeometries();

signals:
/** This signal is emitted when modifications has been done on layer */
void layerModified( bool onlyGeometry );
//QString dumpEditBuffer();

void featureAdded( QgsFeatureId fid );
void featureDeleted( QgsFeatureId fid );
void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
void attributeAdded( int idx );
void attributeDeleted( int idx );

/** Signals emitted after committing changes
\note added in v1.6 */
void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
protected slots:
void undoIndexChanged( int index );

signals:
/** This signal is emitted when modifications has been done on layer */
void layerModified();

void featureAdded( QgsFeatureId fid );
void featureDeleted( QgsFeatureId fid );
void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
void attributeAdded( int idx );
void attributeDeleted( int idx );

/** Signals emitted after committing changes
\note added in v1.6 */
void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );

};
2 changes: 2 additions & 0 deletions python/core/qgsvectorlayerimport.sip
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@ class QProgressDialog;
/** flush the buffer writing the features to the new layer */
bool flushBuffer();

/** create index */
bool createSpatialIndex();
};

28 changes: 19 additions & 9 deletions python/core/raster/qgsrasterdataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
virtual QStringList subLayers() const;

/** \brief Create pyramid overviews */
virtual QString buildPyramids( const QList<QgsRasterPyramid> & thePyramidList,
const QString & theResamplingMethod = "NEAREST",
RasterPyramidsFormat theFormat = PyramidsGTiff );

virtual QString buildPyramids( const QList<QgsRasterPyramid> & thePyramidList,
const QString & theResamplingMethod = "NEAREST",
RasterPyramidsFormat theFormat = PyramidsGTiff,
const QStringList & theConfigOptions = QStringList() );

/** \brief Accessor for ths raster layers pyramid list.
* @param overviewList used to construct the pyramid list (optional), when empty the list is defined by the provider.
* A pyramid list defines the
Expand Down Expand Up @@ -269,13 +270,22 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
/** Remove dataset*/
virtual bool remove();

static QStringList pyramidResamplingMethods( QString providerKey );
/** Returns a list of pyramid resampling method names for given provider */
static QStringList pyramidResamplingMethods( QString providerKey = "gdal" );
/** Returns the pyramid resampling argument that corresponds to a given method */
static QString pyramidResamplingArg( QString method, QString providerKey = "gdal" );

/** Validates creation options for a specific dataset and destination format.
* @note used by GDAL provider only
* @note see also validateCreationOptionsFormat() in gdal provider for validating options based on format only */
virtual QString validateCreationOptions( const QStringList& createOptions, QString format );

/** Validates creation options for a specific dataset and destination format - used by GDAL provider only.
* See also validateCreationOptionsFormat() in gdal provider for validating options based on format only. */
virtual QString validateCreationOptions( const QStringList& createOptions, QString format );
/** Validates pyramid creation options for a specific dataset and destination format
* @note used by GDAL provider only */
virtual QString validatePyramidsConfigOptions( RasterPyramidsFormat pyramidsFormat,
const QStringList & theConfigOptions, const QString & fileFormat );

signals:
signals:
/** Emit a signal to notify of the progress event.
* Emited theProgress is in percents (0.0-100.0) */
void progress( int theType, double theProgress, QString theMessage );
Expand Down
4 changes: 3 additions & 1 deletion python/core/raster/qgsrasterfilewriter.sip
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ class QgsRasterFileWriter
void setMaxTileHeight( int h );
int maxTileHeight() const;

// for now not putting createOptions in all methods, use createOptions()
void setCreateOptions( const QStringList& list );
QStringList createOptions() const;

QStringList pyramidsConfigOptions() const;
void setPyramidsConfigOptions( const QStringList& list );
};

21 changes: 0 additions & 21 deletions python/core/raster/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,6 @@ class QgsRasterLayer : QgsMapLayer
/** \brief Accessor for color shader algorithm */
QString colorShadingAlgorithmAsString() const;

/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
// void computeMinimumMaximumEstimates( int theBand, double* theMinMax );

/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
// void computeMinimumMaximumEstimates( QString theBand, double* theMinMax );

/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option
\note added in v1.6 */
//void computeMinimumMaximumEstimates( int theBand, double& theMin /Out/, double& theMax /Out/ );

/** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */
// void computeMinimumMaximumFromLastExtent( int theBand, double* theMinMax );

/** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent */
// void computeMinimumMaximumFromLastExtent( QString theBand, double* theMinMax );

/** \brief Compute the actual minimum maximum pixel values based on the current (last) display extent
\note added in v1.6 */
//void computeMinimumMaximumFromLastExtent( int theBand, double& theMin /Out/, double& theMax /Out/ );
Expand Down Expand Up @@ -406,11 +390,6 @@ class QgsRasterLayer : QgsMapLayer
/** \brief Draws a preview of the rasterlayer into a pixmap */
QPixmap previewAsPixmap( QSize size, QColor bgColor = QColor( 255, 255, 255 ) );

/** \brief Draws a thumbnail of the rasterlayer into the supplied QImage pointer
* @note added in QGIS 1.6
* */
/* void thumbnailAsImage( QImage * thepImage ) /Deprecated/; */

/** \brief Emit a signal asking for a repaint. (inherited from maplayer) */
void triggerRepaint();

Expand Down
4 changes: 2 additions & 2 deletions python/core/symbology-ng/qgssymbollayerv2utils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ class QgsSymbolLayerV2Utils
static QColor parseColor( QString colorStr );

/**Returns the line width scale factor depending on the unit and the paint device*/
static double lineWidthScaleFactor( QgsRenderContext& c, QgsSymbolV2::OutputUnit u );
static double lineWidthScaleFactor( const QgsRenderContext& c, QgsSymbolV2::OutputUnit u );
/**Returns scale factor painter units -> pixel dimensions*/
static double pixelSizeScaleFactor( QgsRenderContext& c, QgsSymbolV2::OutputUnit u );
static double pixelSizeScaleFactor( const QgsRenderContext& c, QgsSymbolV2::OutputUnit u );
/**Creates a render context for a pixel based device*/
static QgsRenderContext createRenderContext( QPainter* p );

Expand Down
7 changes: 5 additions & 2 deletions python/gui/qgscollapsiblegroupbox.sip
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ class QgsCollapsibleGroupBox : QGroupBox
#include <qgscollapsiblegroupbox.h>
%End
public:
QgsCollapsibleGroupBox( QWidget *parent = 0 );
QgsCollapsibleGroupBox( const QString &title, QWidget *parent = 0 );
QgsCollapsibleGroupBox( QWidget *parent = 0, QSettings* settings = 0 );
QgsCollapsibleGroupBox( const QString &title, QWidget *parent = 0, QSettings* settings = 0 );
~QgsCollapsibleGroupBox();

// set custom QSettings pointer if group box was already created from QtDesigner promotion
void setSettings( QSettings* settings );

bool isCollapsed() const;
void setCollapsed( bool collapse );

Expand Down
28 changes: 28 additions & 0 deletions python/gui/qgslegendinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,34 @@ class QgsLegendInterface : QObject
//! @note added in 1.5
virtual bool isLayerVisible( QgsMapLayer * ml ) = 0;

/** Add action for layers in the legend
* @note added in 2.0
*/
virtual void addLegendLayerAction( QAction* action, QString menu, QString id,
QgsMapLayer::LayerType type, bool allLayers ) = 0;

/** Add action for a specific layers in the legend.
* Use this in combination with addLegendLayerAction( allLayers = False )
* @note added in 2.0
*/
virtual void addLegendLayerActionForLayer( QAction* action, QgsMapLayer* layer ) = 0;

/** Remove action for layers in the legend
* @note added in 2.0
*/
virtual bool removeLegendLayerAction( QAction* action ) = 0;

//! Returns the current layer if the current item is a QgsLegendLayer.
//! If the current item is a QgsLegendLayer, its first maplayer is returned.
//! Else, 0 is returned.
//! @note Added in 2.0
virtual QgsMapLayer* currentLayer() = 0;

//! set the current layer
//! returns true if the layer exists, false otherwise
//! @note Added in 2.0
virtual bool setCurrentLayer( QgsMapLayer *layer ) = 0;

signals:

//! emitted when a group index has changed
Expand Down
2 changes: 2 additions & 0 deletions python/gui/qgsrasterformatsaveoptionswidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class QgsRasterFormatSaveOptionsWidget : QWidget
void setFormat( QString format );
void setProvider( QString provider );
void setRasterLayer( QgsRasterLayer* rasterLayer );
void setRasterFileName( const QString& file );
QStringList options() const;
void setType( QgsRasterFormatSaveOptionsWidget::Type type = Default );
void setPyramidsFormat( QgsRasterDataProvider::RasterPyramidsFormat format );

public slots:

Expand Down
5 changes: 3 additions & 2 deletions python/gui/qgsrasterlayersaveasdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ class QgsRasterLayerSaveAsDialog : QDialog
QgsRectangle outputRectangle() const;
QList<QgsRasterNuller::NoData> noData() const;

QList< int > overviewList() const;
QList< int > pyramidsList() const;
QgsRasterDataProvider::RasterBuildPyramids buildPyramidsFlag() const;
QString pyramidsResampling() const;
QString pyramidsResamplingMethod() const;
QgsRasterDataProvider::RasterPyramidsFormat pyramidsFormat() const;
QStringList pyramidsConfigOptions() const;

void hideFormat();
void hideOutput();
Expand Down
11 changes: 10 additions & 1 deletion python/gui/qgsrasterpyramidsoptionswidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ class QgsRasterPyramidsOptionsWidget: QWidget
QgsRasterPyramidsOptionsWidget( QWidget* parent = 0, QString provider = "gdal" );
~QgsRasterPyramidsOptionsWidget();

QStringList createOptions() const;
QStringList configOptions() const;
QgsRasterFormatSaveOptionsWidget* createOptionsWidget() /Factory/;
const QList<int> overviewList() const;
QgsRasterDataProvider::RasterPyramidsFormat pyramidsFormat() const;
QString resamplingMethod() const;
void setRasterLayer( QgsRasterLayer* rasterLayer );
void setRasterFileName( const QString& file );

public slots:

void apply();
void checkAllLevels( bool checked );

private slots:

void on_cbxPyramidsLevelsCustom_toggled( bool toggled );
void on_cbxPyramidsFormat_currentIndexChanged( int index );
void setOverviewList();
void updateUi();

signals:
void overviewListChanged();
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ class QgsCategorizedSymbolRendererV2Widget : QgsRendererV2Widget

void showSymbolLevels();

void rowsMoved();

protected:

void updateUiFromRenderer();

void updateCategorizedSymbolIcon();

//! populate categories view
// Called by virtual refreshSymbolView()
void populateCategories();

//! populate column combo
Expand All @@ -42,6 +44,12 @@ class QgsCategorizedSymbolRendererV2Widget : QgsRendererV2Widget
//! return row index for the currently selected category (-1 if on no selection)
int currentCategoryRow();

//! return a list of indexes for the categories unders selection
QList<int> selectedCategories();

//! change the selected symbols alone for the change button, if there is a selection
void changeSelectedSymbols();

void changeCategorySymbol();

QList<QgsSymbolV2*> selectedSymbols();
Expand Down
11 changes: 10 additions & 1 deletion python/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,35 @@ class QgsGraduatedSymbolRendererV2Widget : QgsRendererV2Widget

/**Adds a class manually to the classification*/
void addClass();
/**Removes selected classes*/
/**Removes currently selected classes */
void deleteClasses();
/**Removes all classes from the classification*/
void deleteAllClasses();

void rotationFieldChanged( QString fldName );
void sizeScaleFieldChanged( QString fldName );
void scaleMethodChanged( QgsSymbolV2::ScaleMethod scaleMethod );

void showSymbolLevels();

void rowsMoved();

protected:
void updateUiFromRenderer();

void updateGraduatedSymbolIcon();

//! return a list of indexes for the classes under selection
QList<int> selectedClasses();

//! populate column combos in categorized and graduated page
void populateColumns();

void changeRangeSymbol( int rangeIdx );
void changeRange( int rangeIdx );

void changeSelectedSymbols();

QList<QgsSymbolV2*> selectedSymbols();
QgsSymbolV2* findSymbolForRange( double lowerBound, double upperBound, const QgsRangeList& ranges ) const;
void refreshSymbolView();
Expand Down
22 changes: 11 additions & 11 deletions python/plugins/GdalTools/GdalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def initGui( self ):
return None

from tools.GdalTools_utils import Version, GdalConfig, LayerRegistry
self.GdalVersion = Version( GdalConfig.version() )
self.GdalVersionNum = GdalConfig.versionNum()
LayerRegistry.setIface( self.iface )

# find the Raster menu
Expand Down Expand Up @@ -141,13 +141,13 @@ def initGui( self ):
# conversion menu (Rasterize (Vector to raster), Polygonize (Raster to vector), Translate, RGB to PCT, PCT to RGB)
self.conversionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Conversion" ), self.iface.mainWindow() )

if self.GdalVersion >= "1.3":
if self.GdalVersionNum >= 1300:
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.conversionMenu.addAction( self.rasterize )

if self.GdalVersion >= "1.6":
if self.GdalVersionNum >= 1600:
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 )
Expand All @@ -170,7 +170,7 @@ def initGui( self ):
# extraction menu (Clipper, Contour)
self.extractionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Extraction" ), self.iface.mainWindow() )

if self.GdalVersion >= "1.6":
if self.GdalVersionNum >= 1600:
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 )
Expand All @@ -185,37 +185,37 @@ def initGui( self ):
# analysis menu (DEM (Terrain model), Grid (Interpolation), Near black, Proximity (Raster distance), Sieve)
self.analysisMenu = QMenu( QCoreApplication.translate( "GdalTools", "Analysis" ), self.iface.mainWindow() )

if self.GdalVersion >= "1.6":
if self.GdalVersionNum >= 1600:
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.analysisMenu.addAction( self.sieve )

if self.GdalVersion >= "1.5":
if self.GdalVersionNum >= 1500:
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.analysisMenu.addAction( self.nearBlack )

if self.GdalVersion >= "1.7":
if self.GdalVersionNum >= 1700:
self.fillNodata = QAction( QIcon(":/icons/fillnodata.png"), QCoreApplication.translate( "GdalTools", "Fill nodata" ), self.iface.mainWindow() )
self.fillNodata.setStatusTip( QCoreApplication.translate( "GdalTools", "Fill raster regions by interpolation from edges") )
QObject.connect( self.fillNodata, SIGNAL( "triggered()" ), self.doFillNodata )
self.analysisMenu.addAction( self.fillNodata )

if self.GdalVersion >= "1.6":
if self.GdalVersionNum >= 1600:
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":
if self.GdalVersionNum >= 1500:
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.analysisMenu.addAction( self.grid )

if self.GdalVersion >= "1.7":
if self.GdalVersionNum >= 1700:
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 )
Expand All @@ -226,7 +226,7 @@ def initGui( self ):
# miscellaneous menu (Build overviews (Pyramids), Tile index, Information, Merge, Build Virtual Raster (Catalog))
self.miscellaneousMenu = QMenu( QCoreApplication.translate( "GdalTools", "Miscellaneous" ), self.iface.mainWindow() )

if self.GdalVersion >= "1.6":
if self.GdalVersionNum >= 1600:
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 )
Expand Down
5 changes: 5 additions & 0 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ class GdalConfig:
def version(self):
return Version(gdal.VersionInfo("RELEASE_NAME"))

@classmethod
def versionNum(self):
return int(gdal.VersionInfo("VERSION_NUM"))

# store the supported rasters info
supportedRasters = None

Expand Down Expand Up @@ -844,6 +848,7 @@ def setMacOSXDefaultEnvironment():
qgis_standalone_gdal_path = u"%s/Frameworks/GDAL.framework" % qgis_app

# path to the GDAL framework when installed as external framework
# TODO adjust this for gdal 1.10
gdal_bin_path = u"/Library/Frameworks/GDAL.framework/Versions/%s/Programs" % str(GdalConfig.version())[:3]

if os.path.exists( qgis_standalone_gdal_path ): # qgis standalone
Expand Down
20 changes: 15 additions & 5 deletions python/plugins/GdalTools/tools/doDEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ def __init__(self, iface):
self.configSelector.setFilename(colorConfigFile)

self.outputFormat = Utils.fillRasterOutputFormat()
self.creationOptionsWidget.setFormat(self.outputFormat)

self.setParamsStatus(
[
(self.inSelector, SIGNAL("filenameChanged()")),
(self.outSelector, SIGNAL("filenameChanged()")),
(self.computeEdgesCheck, SIGNAL("stateChanged(int)"), None, "1.8.0"),
(self.computeEdgesCheck, SIGNAL("stateChanged(int)"), None, 1800),
(self.bandSpin, SIGNAL("valueChanged(int)"), self.bandCheck),
(self.algorithmCheck, SIGNAL("stateChanged(int)"), None, "1.8.0"),
(self.creationOptionsTable, [SIGNAL("cellValueChanged(int, int)"), SIGNAL("rowRemoved()")], self.creationGroupBox),
(self.algorithmCheck, SIGNAL("stateChanged(int)"), None, 1800),
(self.creationOptionsWidget, SIGNAL("optionsChanged()")),
(self.creationOptionsGroupBox, SIGNAL("toggled(bool)")),
(self.modeCombo, SIGNAL("currentIndexChanged(int)")),
([self.hillshadeZFactorSpin, self.hillshadeScaleSpin, self.hillshadeAltitudeSpin, self.hillshadeAzimuthSpin], SIGNAL("valueChanged(double)")),
(self.slopeScaleSpin, SIGNAL("valueChanged(double)")),
Expand Down Expand Up @@ -102,6 +104,7 @@ def fillInputFileEdit(self):
Utils.FileFilter.setLastUsedRasterFilter(lastUsedFilter)

self.inSelector.setFilename(inputFile)
self.getArguments()

def fillOutputFileEdit(self):
lastUsedFilter = Utils.FileFilter.lastUsedRasterFilter()
Expand All @@ -112,6 +115,7 @@ def fillOutputFileEdit(self):

self.outputFormat = Utils.fillRasterOutputFormat( lastUsedFilter, outputFile )
self.outSelector.setFilename(outputFile)
self.creationOptionsWidget.setFormat(self.outputFormat)

def fillColorConfigFileEdit(self):
configFile = Utils.FileDialog.getOpenFileName(self, self.tr( "Select the color configuration file" ))
Expand Down Expand Up @@ -158,9 +162,15 @@ def getArguments(self):
arguments << "-b" << str(self.bandSpin.value())
if not outputFn.isEmpty():
arguments << "-of" << self.outputFormat
if self.creationGroupBox.isChecked():
for opt in self.creationOptionsTable.options():
if self.creationOptionsGroupBox.isChecked():
for opt in self.creationOptionsWidget.options():
arguments << "-co" << opt
# set creation options filename/layer for validation
if self.inSelector.layer():
self.creationOptionsWidget.setRasterLayer(self.inSelector.layer())
else:
self.creationOptionsWidget.setRasterFileName(self.getInputFileName())

return arguments

def getInputFileName(self):
Expand Down
54 changes: 38 additions & 16 deletions python/plugins/GdalTools/tools/doOverview.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,24 @@ def __init__( self, iface ):

self.setParamsStatus(
[
(self.inSelector, SIGNAL("filenameChanged()")),
( self.inSelector, SIGNAL("filenameChanged()")),
( self.algorithmCombo, SIGNAL( "currentIndexChanged( int )" ), self.algorithmCheck ),
( self.levelsEdit, SIGNAL( "textChanged( const QString & )" ) ),
( self.roModeCheck, SIGNAL( "stateChanged( int )" ), None, "1.6.0" ),
( self.roModeCheck, SIGNAL( "stateChanged( int )" ), None, 1600 ),
( self.rrdCheck, SIGNAL( "stateChanged(int)" ) ),
( self.jpegQualitySpin, SIGNAL( "valueChanged (int)" ) ),
( self.jpegQualityContainer, None, self.tiffjpegCheck),
( self.jpegQualityContainer, None, None, "1.7.0"),
( self.cleanCheck, SIGNAL( "stateChanged(int)" ), None, "1.7.0" )
( self.jpegQualityContainer, None, None, 1700),
( self.cleanCheck, SIGNAL( "stateChanged(int)" ), None, 1700 ),
( self.mPyramidOptionsWidget, SIGNAL( "overviewListChanged()" )),
( self.mPyramidOptionsWidget, SIGNAL( "someValueChanged()" ))
]
)

self.connect( self.inSelector, SIGNAL( "selectClicked()" ), self.fillInputFile )
self.connect( self.batchCheck, SIGNAL( "stateChanged( int )" ), self.switchToolMode )

self.init = False #workaround bug that pyramid options widgets are not initialized at first

# switch to batch or normal mode
def switchToolMode( self ):
Expand Down Expand Up @@ -101,6 +104,8 @@ def fillInputFile( self ):

self.inSelector.setFilename( inputFile )

self.mPyramidOptionsWidget.setRasterLayer(None)

def fillInputDir( self ):
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select the input directory with files" ))
if inputDir.isEmpty():
Expand All @@ -110,27 +115,44 @@ def fillInputDir( self ):

def getArguments( self ):
arguments = QStringList()
if self.algorithmCheck.isChecked() and self.algorithmCombo.currentIndex() >= 0:
arguments << "-r"
arguments << self.resampling_method[self.algorithmCombo.currentIndex()]
if self.roModeCheck.isChecked():

arguments << "-r"
arguments << self.mPyramidOptionsWidget.resamplingMethod();

format = self.mPyramidOptionsWidget.pyramidsFormat()
if format == QgsRasterDataProvider.PyramidsGTiff:
arguments << "-ro"
if self.rrdCheck.isChecked():
elif format == QgsRasterDataProvider.PyramidsErdas:
arguments << "--config" << "USE_RRD" << "YES"
if self.tiffjpegCheck.isChecked():
arguments << "--config" << "COMPRESS_OVERVIEW" << "JPEG" << "--config" << "PHOTOMETRIC_OVERVIEW" << "YCBCR" << "--config" << "INTERLEAVE_OVERVIEW" << "PIXEL"
if self.jpegQualityContainer.isVisible():
arguments << "--config" << "JPEG_QUALITY_OVERVIEW" << self.jpegQualitySpin.cleanText()

for option in self.mPyramidOptionsWidget.configOptions():
(k,v) = option.split("=")
arguments << "--config" << str(k) << str(v)

if self.cleanCheck.isChecked():
arguments << "-clean"

if self.isBatchEnabled():
return arguments

arguments << self.getInputFileName()
if not self.levelsEdit.text().isEmpty():
arguments << self.levelsEdit.text().split( " " )

if len(self.mPyramidOptionsWidget.overviewList()) == 0:
arguments << "[levels]"
for level in self.mPyramidOptionsWidget.overviewList():
arguments << str(level)

# set creation options filename/layer for validation
if self.init:
if self.isBatchEnabled():
self.mPyramidOptionsWidget.setRasterLayer(None)
elif self.inSelector.layer():
self.mPyramidOptionsWidget.setRasterLayer(self.inSelector.layer())
else:
self.mPyramidOptionsWidget.setRasterFileName(self.getInputFileName())
else:
arguments << "2" << "4" << "8" << "16" << "32"
self.init = True

return arguments

def getInputFileName( self ):
Expand Down
18 changes: 12 additions & 6 deletions python/plugins/GdalTools/tools/doTranslate.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def __init__(self, iface):
(self.outSelector, SIGNAL("filenameChanged()")),
(self.targetSRSEdit, SIGNAL("textChanged(const QString &)"), self.targetSRSCheck),
(self.selectTargetSRSButton, None, self.targetSRSCheck),
(self.creationOptionsTable, [SIGNAL("cellValueChanged(int, int)"), SIGNAL("rowRemoved()")], self.creationGroupBox),
(self.creationOptionsWidget, SIGNAL("optionsChanged()")),
(self.outsizeSpin, SIGNAL("valueChanged(const QString &)"), self.outsizeCheck),
(self.nodataSpin, SIGNAL("valueChanged(int)"), self.nodataCheck),
(self.expandCombo, SIGNAL("currentIndexChanged(int)"), self.expandCheck, "1.6.0"),
(self.expandCombo, SIGNAL("currentIndexChanged(int)"), self.expandCheck, 1600),
(self.sdsCheck, SIGNAL("stateChanged(int)")),
(self.srcwinEdit, SIGNAL("textChanged(const QString &)"), self.srcwinCheck),
(self.prjwinEdit, SIGNAL("textChanged(const QString &)"), self.prjwinCheck)
Expand Down Expand Up @@ -188,10 +188,9 @@ def getArguments(self):
if self.targetSRSCheck.isChecked() and not self.targetSRSEdit.text().isEmpty():
arguments << "-a_srs"
arguments << self.targetSRSEdit.text()
if self.creationGroupBox.isChecked():
for opt in self.creationOptionsTable.options():
arguments << "-co"
arguments << opt
if self.creationOptionsGroupBox.isChecked():
for opt in self.creationOptionsWidget.options():
arguments << "-co" << opt
if self.outsizeCheck.isChecked() and self.outsizeSpin.value() != 100:
arguments << "-outsize"
arguments << self.outsizeSpin.text()
Expand Down Expand Up @@ -244,6 +243,13 @@ def getArguments(self):
arguments << self.outputFormat
arguments << self.getInputFileName()
arguments << outputFn

# set creation options filename/layer for validation
if self.inSelector.layer():
self.creationOptionsWidget.setRasterLayer(self.inSelector.layer())
else:
self.creationOptionsWidget.setRasterFileName(self.getInputFileName())

return arguments

def getInputFileName(self):
Expand Down
534 changes: 282 additions & 252 deletions python/plugins/GdalTools/tools/widgetDEM.ui

Large diffs are not rendered by default.

325 changes: 181 additions & 144 deletions python/plugins/GdalTools/tools/widgetOverview.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>376</width>
<height>311</height>
<height>342</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -39,62 +39,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="algorithmCheck">
<property name="text">
<string>Resampling method</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="algorithmCombo">
<item>
<property name="text">
<string>nearest</string>
</property>
</item>
<item>
<property name="text">
<string>average</string>
</property>
</item>
<item>
<property name="text">
<string>gauss</string>
</property>
</item>
<item>
<property name="text">
<string>cubic</string>
</property>
</item>
<item>
<property name="text">
<string>average_mp</string>
</property>
</item>
<item>
<property name="text">
<string>average_magphase</string>
</property>
</item>
<item>
<property name="text">
<string>mode</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Levels (space delimited)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="levelsEdit"/>
</item>
<item row="0" column="1">
<widget class="GdalToolsInOutSelector" name="inSelector" native="true"/>
</item>
Expand All @@ -111,96 +55,183 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="roModeCheck">
<property name="toolTip">
<string>In order to generate external overview (for GeoTIFF especially).</string>
</property>
<property name="text">
<string>Open in read-only mode</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="tiffjpegCheck">
<property name="toolTip">
<string>Create external overviews in TIFF format, compressed using JPEG.</string>
</property>
<property name="text">
<string>Overviews in TIFF format with JPEG compression</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="jpegQualityContainer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>24</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="jpegQualityLabel">
<property name="toolTip">
<string>For JPEG compressed external overviews,
the JPEG quality can be set.</string>
</property>
<property name="text">
<string>JPEG Quality (1-100)</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="jpegQualitySpin">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>For JPEG compressed external overviews,
the JPEG quality can be set.</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rrdCheck">
<property name="toolTip">
<string>Alternate overview format using Erdas Imagine format,
<widget class="QWidget" name="tab">
<attribute name="title">
<string>old</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Levels (space delimited)</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="rrdCheck">
<property name="toolTip">
<string>Alternate overview format using Erdas Imagine format,
placing the overviews in an associated .aux file
suitable for direct use with Imagine,ArcGIS, GDAL.</string>
</property>
<property name="text">
<string>Use Imagine format (.aux file)</string>
</property>
</property>
<property name="text">
<string>Use Imagine format (.aux file)</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QFrame" name="jpegQualityContainer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>24</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="jpegQualityLabel">
<property name="toolTip">
<string>For JPEG compressed external overviews,
the JPEG quality can be set.</string>
</property>
<property name="text">
<string>JPEG Quality (1-100)</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="jpegQualitySpin">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>For JPEG compressed external overviews,
the JPEG quality can be set.</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="levelsEdit"/>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="tiffjpegCheck">
<property name="toolTip">
<string>Create external overviews in TIFF format, compressed using JPEG.</string>
</property>
<property name="text">
<string>Overviews in TIFF format with JPEG compression</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="roModeCheck">
<property name="toolTip">
<string>In order to generate external overview (for GeoTIFF especially).</string>
</property>
<property name="text">
<string>Open in read-only mode</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="algorithmCheck">
<property name="text">
<string>Resampling method</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="algorithmCombo">
<item>
<property name="text">
<string>nearest</string>
</property>
</item>
<item>
<property name="text">
<string>average</string>
</property>
</item>
<item>
<property name="text">
<string>gauss</string>
</property>
</item>
<item>
<property name="text">
<string>cubic</string>
</property>
</item>
<item>
<property name="text">
<string>average_mp</string>
</property>
</item>
<item>
<property name="text">
<string>average_magphase</string>
</property>
</item>
<item>
<property name="text">
<string>mode</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>new</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QgsRasterPyramidsOptionsWidget" name="mPyramidOptionsWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
Expand All @@ -215,6 +246,12 @@ suitable for direct use with Imagine,ArcGIS, GDAL.</string>
<header>inOutSelector</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsRasterPyramidsOptionsWidget</class>
<extends>QWidget</extends>
<header>qgis.gui</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
Expand Down
13 changes: 12 additions & 1 deletion python/plugins/GdalTools/tools/widgetPluginBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,18 @@ def setParamsStatus(self, wdgts_sgnls_chk_ver_list):
return

# if check version fails, disable the widget then hide both it and its enabler checkbox
if ver != None:
# new check for gdal 1.10, must update all widgets for this and then remove previous check
if ver != None and isinstance(ver, int):
gdalVerNum = Utils.GdalConfig.versionNum()
if ver > gdalVerNum:
wdgt.setVisible(False)
if isinstance(chk, QWidget):
chk.setVisible(False)
chk.setChecked(False)
sgnls = None
chk = False

elif ver != None:
if not isinstance(ver, Utils.Version):
ver = Utils.Version(ver)
gdalVer = Utils.GdalConfig.version()
Expand Down
19 changes: 14 additions & 5 deletions python/plugins/GdalTools/tools/widgetTranslate.ui
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ The 'gray' value (from GDAL 1.7.0) enables to expand a dataset with a color tabl
</layout>
</item>
<item>
<widget class="QGroupBox" name="creationGroupBox">
<widget class="QgsCollapsibleGroupBox" name="creationOptionsGroupBox">
<property name="title">
<string>&amp;Creation Options</string>
</property>
Expand All @@ -261,11 +261,14 @@ The 'gray' value (from GDAL 1.7.0) enables to expand a dataset with a color tabl
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>9</number>
</property>
<item>
<widget class="GdalToolsOptionsTable" name="creationOptionsTable" native="true"/>
<widget class="QgsRasterFormatSaveOptionsWidget" name="creationOptionsWidget" native="true"/>
</item>
</layout>
</widget>
Expand All @@ -283,9 +286,15 @@ The 'gray' value (from GDAL 1.7.0) enables to expand a dataset with a color tabl
<container>1</container>
</customwidget>
<customwidget>
<class>GdalToolsOptionsTable</class>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgis.gui</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsRasterFormatSaveOptionsWidget</class>
<extends>QWidget</extends>
<header>optionsTable</header>
<header>qgis.gui</header>
<container>1</container>
</customwidget>
</customwidgets>
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/db_manager/dlg_import_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ def accept(self):
QApplication.restoreOverrideCursor()

if ret != 0:
QMessageBox.warning(self, "Import to database", u"Error %d\n%s" % (ret, errMsg) )
output = qgis.gui.QgsMessageViewer()
output.setTitle( "Import to database" )
output.setMessageAsPlainText( u"Error %d\n%s" % (ret, errMsg) )
output.showMessage()
return

# create spatial index
Expand Down
16 changes: 8 additions & 8 deletions python/plugins/fTools/tools/doEliminate.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):
else:
QtGui.QMessageBox.warning(self, self.tr("Eliminate"), self.tr("Could not delete features"))
return None

# ANALYZE
start = 20.00
progressBar.setValue(start)
Expand All @@ -160,7 +160,7 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):
for fid2Eliminate in inLayer.selectedFeaturesIds():
feat = QgsFeature()

if inLayer.featureAtId(fid2Eliminate, feat, True, False):
if inLayer.getFeatures( QgsFeatureRequest().setFilterFid( fid2Eliminate ).setSubsetOfAttributes([]) ).nextFeature( feat ):
geom2Eliminate = feat.geometry()
bbox = geom2Eliminate.boundingBox()
outLayer.select(bbox, False) # make a new selection
Expand All @@ -171,7 +171,7 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):
for selFid in outLayer.selectedFeaturesIds():
selFeat = QgsFeature()

if outLayer.featureAtId(selFid, selFeat, True, False):
if outLayer.getFeatures( QgsFeatureRequest().setFilterFid( selFid ).setSubsetOfAttributes([]) ).nextFeature( selFeat ):
selGeom = selFeat.geometry()

if geom2Eliminate.intersects(selGeom): # we have a candidate
Expand All @@ -190,7 +190,7 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):
max = selValue
mergeWithFid = selFid
mergeWithGeom = QgsGeometry(selGeom) # deep copy of the geometry

if mergeWithFid != None: # a successful candidate
newGeom = mergeWithGeom.combine(geom2Eliminate)

Expand All @@ -206,16 +206,16 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):
else:
QtGui.QMessageBox.warning(self, self.tr("Eliminate"),
self.tr("Could not replace geometry of feature with id %1").arg( mergeWithFid ))
return None
return None

start = start + add
progressBar.setValue(start)
# end for fid2Eliminate

# deselect features that are already eliminated in inLayer
for aFid in fidsToDeselect:
inLayer.deselect(aFid, False)

#end while

if inLayer.selectedFeatureCount() > 0:
Expand All @@ -232,7 +232,7 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):

QtGui.QMessageBox.information(self, self.tr("Eliminate"),
self.tr("Could not eliminate features with these ids:\n%1").arg(fidList))
else:
else:
QtGui.QMessageBox.warning(self, self.tr("Eliminate"), self.tr("Could not add features"))

# stop editing outLayer and commit any pending changes
Expand Down
Loading