Binary file added python/plugins/GdalTools/icons/tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/plugins/GdalTools/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
<file>icons/projection-export.png</file>
<file>icons/edit.png</file>
<file>icons/reset.png</file>
<file>icons/tooltip.png</file>
</qresource>
</RCC>
6 changes: 6 additions & 0 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,9 @@ def __cmp__(self, other):

def __str__(self):
return ".".join(self.vers)


# setup the default MacOs path
#if platform.system() == "Darwin" and getGdalPath().isEmpty():
# setGdalPath( u"/Library/Frameworks/GDAL.framework/Versions/%s/Programs" % str(GdalConfig.version())[:3] )

17 changes: 10 additions & 7 deletions python/plugins/GdalTools/tools/dialogBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ def __init__(self, parent, iface, pluginBase, pluginName, pluginCommand):
self.process = QProcess(self)
gdalPath = Utils.getGdalPath()
if not gdalPath.isEmpty():
sep = ";" if platform.system() == "Windows" else ":"
env = self.process.environment()
if env.isEmpty():
#env << "PATH=" + gdalPath
os.putenv( "PATH", str( gdalPath ) )
# process.enviroment() is probably not supported (MacOS?),
# use os.putenv() instead
path = os.getenv("PATH")
if path != "":
path += sep
path += gdalPath
os.putenv( "PATH", path )
else:
if platform.system() == "Windows":
env.replaceInStrings( QRegExp( "^PATH=(.*)", Qt.CaseInsensitive ), "PATH=\\1;" + gdalPath )
else:
env.replaceInStrings( QRegExp( "^PATH=(.*)", Qt.CaseInsensitive ), "PATH=\\1:" + gdalPath )
self.process.setEnvironment( env )
env.replaceInStrings( QRegExp( "^PATH=(.*)", Qt.CaseInsensitive ), "PATH=\\1%s%s" % (sep, gdalPath) )
self.process.setEnvironment( env )
self.connect(self.process, SIGNAL("error(QProcess::ProcessError)"), self.processError)
self.connect(self.process, SIGNAL("finished(int, QProcess::ExitStatus)"), self.processFinished)

Expand Down
56 changes: 45 additions & 11 deletions python/plugins/GdalTools/tools/dialogSettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,36 @@
<x>0</x>
<y>0</y>
<width>368</width>
<height>324</height>
<height>337</height>
</rect>
</property>
<property name="windowTitle">
<string>Gdal Tools settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Path to the GDAL binaries</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Path to the GDAL binaries</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bin_tooltip_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">##tooltip icon##</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
Expand All @@ -36,11 +53,28 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>GDAL help path</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>GDAL help path</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="help_tooltip_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">##tooltip icon##</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
Expand Down
20 changes: 18 additions & 2 deletions python/plugins/GdalTools/tools/doSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,34 @@
from ui_dialogSettings import Ui_GdalToolsSettingsDialog as Ui_Dialog
import GdalTools_utils as Utils

from .. import resources_rc

class GdalToolsSettingsDialog( QDialog, Ui_Dialog ):
def __init__( self, iface ):
QDialog.__init__( self, iface.mainWindow() )
self.setAttribute(Qt.WA_DeleteOnClose)
self.iface = iface
self.setupUi( self )

# binaries
self.leGdalBinPath.setText( Utils.getGdalPath() )
self.leGdalHelpPath.setText( Utils.getHelpPath() )

QObject.connect( self.btnSetBinPath, SIGNAL( "clicked()" ), self.setBinPath )
self.bin_tooltip_label.setPixmap( QPixmap(':/icons/tooltip.png') )
self.bin_tooltip_label.setToolTip( self.tr( \
u"""A list of colon-separated (Linux and MacOS) or
semicolon-separated (Windows) paths to executables.
MacOS users usually need to set it to something like
/Library/Frameworks/GDAL.framework/Versions/1.8/Programs""") )

# help
self.leGdalHelpPath.setText( Utils.getHelpPath() )
QObject.connect( self.btnSetHelpPath, SIGNAL( "clicked()" ), self.setHelpPath )
self.help_tooltip_label.setPixmap( QPixmap(':/icons/tooltip.png') )
self.help_tooltip_label.setToolTip( self.tr( \
u"""Useful to open local GDAL documentation instead of online help
when pressing on the tool dialog's Help button.""") )


def setBinPath( self ):
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select directory with GDAL executables" ) )
Expand Down
5 changes: 4 additions & 1 deletion src/app/composer/qgscomposershapewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape

blockAllSignals( false );

connect( mShapeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( setGuiElementValues() ) );
if ( mComposerShape )
{
connect( mComposerShape, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
}
}

QgsComposerShapeWidget::~QgsComposerShapeWidget()
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ QgisApp *QgisApp::smInstance = 0;
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent, Qt::WFlags fl )
: QMainWindow( parent, fl )
, mSplash( splash )
, mShowProjectionTab( false )
, mPythonUtils( NULL )
, mpTileScaleWidget( NULL )
#ifdef Q_OS_WIN
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ struct QgsProject::Imp
// XXX THESE SHOULD BE MOVED TO STATUSBAR RELATED SOURCE
QgsProject::instance()->writeEntry( "PositionPrecision", "/Automatic", true );
QgsProject::instance()->writeEntry( "PositionPrecision", "/DecimalPlaces", 2 );
QgsProject::instance()->writeEntry( "Paths", "/Absolute", false );
}

}; // struct QgsProject::Imp
Expand All @@ -339,6 +340,7 @@ QgsProject::QgsProject()
// XXX THESE SHOULD BE MOVED TO STATUSBAR RELATED SOURCE
writeEntry( "PositionPrecision", "/Automatic", true );
writeEntry( "PositionPrecision", "/DecimalPlaces", 2 );
writeEntry( "Paths", "/Absolute", false );
// XXX writeEntry() makes the project dirty, but it doesn't make sense
// for a new project to be dirty, so let's clean it up
dirty( false );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/modules/v.what.vect.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<option key="vector" layeroption="layer" typemask="point"/>
<field key="column" layer="vector" type="integer,double,string"/>
<option key="qvector" layeroption="qlayer" typemask="area"/>
<field key="qcolumn" layer="qvector" type="string"/>
<field key="qcolumn" layer="qvector" type="integer,double,string"/>
</qgisgrassmodule>