Skip to content
Permalink
Browse files

[processing] More string HIG fixes

  • Loading branch information
nyalldawson committed Feb 21, 2018
1 parent bd99f69 commit 835cca7cae3a8bc4cdff881ec7be374eaf390f6f
@@ -87,12 +87,12 @@ def showPopupMenu(self):
if not (isinstance(self.param, QgsProcessingParameterMultipleLayers) and
self.param.layerType == dataobjects.TYPE_FILE):
selectLayerAction = QAction(
self.tr('Select from open layers'), self.pushButton)
self.tr('Select from Open Layers…'), self.pushButton)
selectLayerAction.triggered.connect(self.showLayerSelectionDialog)
popupmenu.addAction(selectLayerAction)

selectFileAction = QAction(
self.tr('Select from file system'), self.pushButton)
self.tr('Select from File System…'), self.pushButton)
selectFileAction.triggered.connect(self.showFileSelectionDialog)
popupmenu.addAction(selectFileAction)

@@ -156,7 +156,7 @@ def showFileSelectionDialog(self):
else:
path = ''

ret, selected_filter = QFileDialog.getOpenFileNames(self, self.tr('Open file'), path,
ret, selected_filter = QFileDialog.getOpenFileNames(self, self.tr('Select Files'), path,
getFileFilter(self.param))
if ret:
files = list(ret)
@@ -81,7 +81,7 @@ def showSelectionDialog(self):
else:
path = ''
filename, selectedFileFilter = QFileDialog.getSaveFileName(self,
self.tr('Save file'), path, filefilter)
self.tr('Save File'), path, filefilter)
if filename:
if not filename.lower().endswith(
tuple(re.findall("\\*(\\.[a-z]{1,10})", filefilter))):
@@ -143,7 +143,7 @@ def selectDirectory(self):
lastDir = ''

dirName = QFileDialog.getExistingDirectory(self,
self.tr('Select directory'), lastDir, QFileDialog.ShowDirsOnly)
self.tr('Output Directory'), lastDir, QFileDialog.ShowDirsOnly)

if dirName:
self.table.cellWidget(self.row, self.col).setValue(dirName)
@@ -102,23 +102,23 @@ def selectOutput(self):

if self.parameter.flags() & QgsProcessingParameterDefinition.FlagOptional:
actionSkipOutput = QAction(
self.tr('Skip output'), self.btnSelect)
self.tr('Skip Output'), self.btnSelect)
actionSkipOutput.triggered.connect(self.skipOutput)
popupMenu.addAction(actionSkipOutput)

if isinstance(self.parameter, QgsProcessingParameterFeatureSink) \
and self.parameter.supportsNonFileBasedOutput():
# use memory layers for temporary layers if supported
actionSaveToTemp = QAction(
self.tr('Create temporary layer'), self.btnSelect)
self.tr('Create Temporary Layer'), self.btnSelect)
else:
actionSaveToTemp = QAction(
self.tr('Save to a temporary file'), self.btnSelect)
self.tr('Save to a Temporary File'), self.btnSelect)
actionSaveToTemp.triggered.connect(self.saveToTemporary)
popupMenu.addAction(actionSaveToTemp)

actionSaveToFile = QAction(
QCoreApplication.translate('DestinationSelectionPanel', 'Save to file…'), self.btnSelect)
QCoreApplication.translate('DestinationSelectionPanel', 'Save to File…'), self.btnSelect)
actionSaveToFile.triggered.connect(self.selectFile)
popupMenu.addAction(actionSaveToFile)

@@ -129,7 +129,7 @@ def selectOutput(self):
actionSaveToGpkg.triggered.connect(self.saveToGeopackage)
popupMenu.addAction(actionSaveToGpkg)
actionSaveToPostGIS = QAction(
QCoreApplication.translate('DestinationSelectionPanel', 'Save to PostGIS table…'), self.btnSelect)
QCoreApplication.translate('DestinationSelectionPanel', 'Save to PostGIS Table…'), self.btnSelect)
actionSaveToPostGIS.triggered.connect(self.saveToPostGIS)
settings = QgsSettings()
settings.beginGroup('/PostgreSQL/connections/')
@@ -139,7 +139,7 @@ def selectOutput(self):
popupMenu.addAction(actionSaveToPostGIS)

actionSetEncoding = QAction(
QCoreApplication.translate('DestinationSelectionPanel', 'Change file encoding ({})…').format(self.encoding), self.btnSelect)
QCoreApplication.translate('DestinationSelectionPanel', 'Change File Encoding ({})…').format(self.encoding), self.btnSelect)
actionSetEncoding.triggered.connect(self.selectEncoding)
popupMenu.addAction(actionSetEncoding)

@@ -260,7 +260,7 @@ def selectDirectory(self):
if not lastDir:
lastDir = settings.value("/Processing/LastOutputPath", QDir.homePath())

dirName = QFileDialog.getExistingDirectory(self, self.tr('Select directory'),
dirName = QFileDialog.getExistingDirectory(self, self.tr('Select Directory'),
lastDir, QFileDialog.ShowDirsOnly)
if dirName:
self.leText.setText(QDir.toNativeSeparators(dirName))
@@ -132,7 +132,7 @@ def useLayerExtent(self):
layerName = layer.name()
extents.append(layerName)
extentsDict[layerName] = {"extent": layer.extent(), "authid": authid}
(item, ok) = QInputDialog.getItem(self, self.tr('Select extent'),
(item, ok) = QInputDialog.getItem(self, self.tr('Select Extent'),
self.tr('Use extent from'), extents, False)
if ok:
self.setValueFromRect(QgsReferencedRectangle(extentsDict[item]["extent"], QgsCoordinateReferenceSystem(extentsDict[item]["authid"])))
@@ -64,14 +64,14 @@ def showSelectionDialog(self):

if self.isFolder:
folder = QFileDialog.getExistingDirectory(self,
self.tr('Select folder'), path)
self.tr('Select Folder'), path)
if folder:
self.leText.setText(folder)
settings.setValue('/Processing/LastInputPath',
os.path.dirname(folder))
else:
filenames, selected_filter = QFileDialog.getOpenFileNames(self,
self.tr('Select file'), path, self.tr('{} files').format(self.ext.upper()) + ' (*.' + self.ext + self.tr(');;All files (*.*)'))
self.tr('Select File'), path, self.tr('{} files').format(self.ext.upper()) + ' (*.' + self.ext + self.tr(');;All files (*.*)'))
if filenames:
self.leText.setText(u';'.join(filenames))
settings.setValue('/Processing/LastInputPath',
@@ -85,7 +85,7 @@ def clearLog(self):

def saveLog(self):
fileName, filter = QFileDialog.getSaveFileName(self,
self.tr('Save file'), '.', self.tr('Log files (*.log *.LOG)'))
self.tr('Save File'), '.', self.tr('Log files (*.log *.LOG)'))

if fileName == '':
return
@@ -133,7 +133,7 @@ def showPopupMenu(self, point):
if isinstance(item, TreeLogEntryItem):
if item.isAlg:
popupmenu = QMenu()
createTestAction = QAction(self.tr('Create test'), self.tree)
createTestAction = QAction(self.tr('Create Test…'), self.tree)
createTestAction.triggered.connect(self.createTest)
popupmenu.addAction(createTestAction)
popupmenu.exec_(self.tree.mapToGlobal(point))
@@ -101,7 +101,7 @@ def addFile(self):
path = ''

files, selected_filter = QFileDialog.getOpenFileNames(self,
self.tr('Select file(s)'), path, self.tr('All files (*.*)'))
self.tr('Select File(s)'), path, self.tr('All files (*.*)'))

if len(files) == 0:
return
@@ -168,7 +168,7 @@ def addFiles(self):
settings = QgsSettings()
path = str(settings.value('/Processing/LastInputPath'))

ret, selected_filter = QFileDialog.getOpenFileNames(self, self.tr('Select file(s)'),
ret, selected_filter = QFileDialog.getOpenFileNames(self, self.tr('Select File(s)'),
path, filter)
if ret:
files = list(ret)
@@ -85,7 +85,7 @@ def showExpressionsBuilder(self):

dlg = QgsExpressionBuilderDialog(None, str(self.leText.text()), self, 'generic', context)

dlg.setWindowTitle(self.tr('Expression based input'))
dlg.setWindowTitle(self.tr('Expression Based Input'))
if dlg.exec_() == QDialog.Accepted:
exp = QgsExpression(dlg.expressionText())
if not exp.hasParserError():
@@ -232,19 +232,19 @@ def showPopupMenu(self, point):
popupmenu = QMenu()
if isinstance(item, TreeAlgorithmItem):
alg = item.alg
executeAction = QAction(self.tr('Execute'), self.algorithmTree)
executeAction = QAction(self.tr('Execute'), self.algorithmTree)
executeAction.triggered.connect(self.executeAlgorithm)
popupmenu.addAction(executeAction)
if alg.flags() & QgsProcessingAlgorithm.FlagSupportsBatch:
executeBatchAction = QAction(
self.tr('Execute as batch process'),
self.tr('Execute as Batch Process…'),
self.algorithmTree)
executeBatchAction.triggered.connect(
self.executeAlgorithmAsBatchProcess)
popupmenu.addAction(executeBatchAction)
popupmenu.addSeparator()
editRenderingStylesAction = QAction(
self.tr('Edit rendering styles for outputs'),
self.tr('Edit Rendering Styles for Outputs…'),
self.algorithmTree)
editRenderingStylesAction.triggered.connect(
self.editRenderingStyles)
@@ -47,7 +47,7 @@ def __init__(self):

def showSelectionDialog(self):
filename, selected_filter = QFileDialog.getOpenFileName(self,
self.tr('Select style file'), '',
self.tr('Select Style File'), '',
self.tr('QGIS Layer Style File (*.qml *.QML)'))
if filename:
self.leText.setText(filename)
@@ -301,7 +301,7 @@ def __init__(self, s):
QDialog.__init__(self)
self.setModal(True)
self.resize(600, 400)
self.setWindowTitle(self.tr('Unit test'))
self.setWindowTitle(self.tr('Unit Test'))
layout = QVBoxLayout()
self.text = QTextEdit()
self.text.setFontFamily("monospace")
@@ -218,7 +218,7 @@ def getFileName(self, initial_value=''):
path = ''

# TODO: should use selectedFilter argument for default file format
filename, selected_filter = QFileDialog.getOpenFileName(self.widget, self.tr('Select file'),
filename, selected_filter = QFileDialog.getOpenFileName(self.widget, self.tr('Select File'),
path, getFileFilter(self.param))
if filename:
settings.setValue('/Processing/LastInputPath',
@@ -505,7 +505,7 @@ def selectFile(self):
filter = self.tr('All files (*.*)')

filename, selected_filter = QFileDialog.getOpenFileName(self.widget,
self.tr('Select file'), path,
self.tr('Select File'), path,
filter)
if filename:
self.combo.setEditText(filename)
@@ -42,7 +42,7 @@
class AddModelFromFileAction(ToolboxAction):

def __init__(self):
self.name = self.tr('Add Model From File…')
self.name = self.tr('Add Model from File…')
self.group = self.tr('Tools')

def getIcon(self):
@@ -40,7 +40,7 @@
class AddScriptFromFileAction(ToolboxAction):

def __init__(self):
self.name = self.tr("Add Script From File…")
self.name = self.tr("Add Script from File…")
self.group = self.tr("Tools")

def execute(self):

0 comments on commit 835cca7

Please sign in to comment.
You can’t perform that action at this time.