Skip to content

Commit

Permalink
ftools: fix strings and add to translation (fixes #9970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 24, 2015
1 parent 7019db8 commit e21010c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions python/plugins/fTools/tools/ftools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#
# -------------------------------------------------

from PyQt4.QtCore import QTextCodec, QFileInfo, QSettings
from PyQt4.QtCore import QTextCodec, QFileInfo, QSettings, QCoreApplication
from PyQt4.QtGui import QDialog, QFileDialog
from qgis.core import QgsVectorFileWriter, QGis, QgsDistanceArea, QgsGeometry, QgsMapLayer, QgsVectorLayer, QgsMapLayerRegistry, QgsFeature, QgsSpatialIndex
from qgis.gui import QgsEncodingFileDialog
Expand Down Expand Up @@ -282,7 +282,7 @@ def saveDialog( parent, filtering="Shapefiles (*.shp *.SHP)"):
settings = QSettings()
dirName = settings.value( "/UI/lastShapefileDir" )
encode = settings.value( "/UI/encoding" )
fileDialog = QgsEncodingFileDialog( parent, "Save output shapefile", dirName, filtering, encode )
fileDialog = QgsEncodingFileDialog( parent, QCoreApplication.translate("fTools", "Save output shapefile" ), dirName, filtering, encode )
fileDialog.setDefaultSuffix( "shp" )
fileDialog.setFileMode( QFileDialog.AnyFile )
fileDialog.setAcceptMode( QFileDialog.AcceptSave )
Expand All @@ -299,7 +299,12 @@ def openDialog( parent, filtering="Shapefiles (*.shp *.SHP)", dialogMode="Single
settings = QSettings()
dirName = settings.value( "/UI/lastShapefileDir" )
encode = settings.value( "/UI/encoding" )
fileDialog = QgsEncodingFileDialog( parent, "Save output shapefile", dirName, filtering, encode )
fileDialog = QgsEncodingFileDialog(
parent,
QCoreApplication.translate("fTools", "Select input file" )
if dialogMode == "SingleFile" else
QCoreApplication.translate("fTools", "Select input files" ),
dirName, filtering, encode )
fileDialog.setFileMode( QFileDialog.ExistingFiles )
fileDialog.setAcceptMode( QFileDialog.AcceptOpen )
if not fileDialog.exec_() == QDialog.Accepted:
Expand All @@ -316,7 +321,7 @@ def dirDialog( parent ):
settings = QSettings()
dirName = settings.value( "/UI/lastShapefileDir" )
encode = settings.value( "/UI/encoding" )
fileDialog = QgsEncodingFileDialog( parent, "Save output shapefile", dirName, encode )
fileDialog = QgsEncodingFileDialog( parent, QCoreApplication.translate("fTools", "Save output directory" ), dirName, encode )
fileDialog.setFileMode( QFileDialog.DirectoryOnly )
fileDialog.setAcceptMode( QFileDialog.AcceptSave )
fileDialog.setConfirmOverwrite( False )
Expand Down

0 comments on commit e21010c

Please sign in to comment.