Skip to content
Permalink
Browse files

cleanup separate file type names from extensions in translations

  • Loading branch information
jef-n committed Jan 29, 2012
1 parent eae552f commit 0752176e4d39648d0d7900d7f00b7c0ec5862aa5
@@ -1165,7 +1165,7 @@ void QgsGPSInformationWidget::on_mBtnLogFile_clicked()
QSettings settings;
QString settingPath( "/gps/lastLogFileDir" );
QString lastUsedDir = settings.value( settingPath, "." ).toString();
QString saveFilePath = QFileDialog::getSaveFileName( this, tr( "Save GPS log file as" ), lastUsedDir, tr( "NMEA files (*.nmea)" ) );
QString saveFilePath = QFileDialog::getSaveFileName( this, tr( "Save GPS log file as" ), lastUsedDir, tr( "NMEA files" ) + " (*.nmea)" );
if ( saveFilePath.isNull() ) //canceled
{
return;
@@ -2700,7 +2700,10 @@ void QgisApp::fileOpen()
// Retrieve last used project dir from persistent settings
QSettings settings;
QString lastUsedDir = settings.value( "/UI/lastProjectDir", "." ).toString();
QString fullPath = QFileDialog::getOpenFileName( this, tr( "Choose a QGIS project file to open" ), lastUsedDir, tr( "QGis files (*.qgs *.QGS)" ) );
QString fullPath = QFileDialog::getOpenFileName( this,
tr( "Choose a QGIS project file to open" ),
lastUsedDir,
tr( "QGis files" ) + " (*.qgs *.QGS)" );
if ( fullPath.isNull() )
{
return;
@@ -2843,7 +2846,7 @@ bool QgisApp::fileSave()
this,
tr( "Choose a QGIS project file" ),
lastUsedDir + "/" + QgsProject::instance()->title(),
tr( "QGis files (*.qgs *.QGS)" ) );
tr( "QGis files" ) + " (*.qgs *.QGS)" );
if ( path.isEmpty() )
return true;

@@ -2892,7 +2895,10 @@ void QgisApp::fileSaveAs()
QSettings settings;
QString lastUsedDir = settings.value( "/UI/lastProjectDir", "." ).toString();

QString path = QFileDialog::getSaveFileName( this, tr( "Choose a file name to save the QGIS project file as" ), lastUsedDir + "/" + QgsProject::instance()->title(), tr( "QGis files (*.qgs *.QGS)" ) );
QString path = QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save the QGIS project file as" ),
lastUsedDir + "/" + QgsProject::instance()->title(),
tr( "QGis files" ) + " (*.qgs *.QGS)" );
if ( path.isEmpty() )
return;

@@ -98,7 +98,7 @@ void QgsConfigureShortcutsDialog::populateActions()

void QgsConfigureShortcutsDialog::saveShortcuts()
{
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save shortcuts" ), ".", tr( "XML file (*.xml);; All files (*)" ) );
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save shortcuts" ), ".", tr( "XML file" ) + " (*.xml);;" + tr( "All files" ) + " (*)" );

if ( fileName.isEmpty() )
return;
@@ -150,7 +150,7 @@ void QgsConfigureShortcutsDialog::saveShortcuts()

void QgsConfigureShortcutsDialog::loadShortcuts()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load shortcuts" ), ".", tr( "XML file (*.xml);; All files (*)" ) );
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load shortcuts" ), ".", tr( "XML file" ) + " (*.xml);;" + tr( "All files" ) + " (*)" );

if ( fileName.isEmpty() )
{
@@ -62,7 +62,10 @@ void QgsEmbedLayerDialog::on_mBrowseFileToolButton_clicked()
mProjectFileLineEdit->blockSignals( true );

QSettings s;
QString projectFile = QFileDialog::getOpenFileName( 0, tr( "Select project file" ), s.value( "/qgis/last_embedded_project_path" ).toString() , tr( "QGIS project files (*.qgs *.QGS)" ) );
QString projectFile = QFileDialog::getOpenFileName( this,
tr( "Select project file" ),
s.value( "/qgis/last_embedded_project_path" ).toString() ,
tr( "QGis files" ) + " (*.qgs *.QGS)" );
if ( !projectFile.isEmpty() )
{
mProjectFileLineEdit->setText( projectFile );
@@ -1827,7 +1827,7 @@ void QgsRasterLayerProperties::on_pbnExportTransparentPixelValues_clicked()
{
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile (*.txt)" ) );
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
if ( !myFileName.isEmpty() )
{
if ( !myFileName.endsWith( ".txt", Qt::CaseInsensitive ) )
@@ -2035,7 +2035,7 @@ void QgsRasterLayerProperties::on_pbnImportTransparentPixelValues_clicked()
QString myBadLines;
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile (*.txt)" ) );
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
QFile myInputFile( myFileName );
if ( myInputFile.open( QFile::ReadOnly ) )
{
@@ -2510,7 +2510,7 @@ void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
{
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile (*.txt)" ) );
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
if ( !myFileName.isEmpty() )
{
if ( !myFileName.endsWith( ".txt", Qt::CaseInsensitive ) )
@@ -2592,7 +2592,7 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
QString myBadLines;
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile (*.txt)" ) );
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
QFile myInputFile( myFileName );
if ( myInputFile.open( QFile::ReadOnly ) )
{
@@ -2955,9 +2955,9 @@ void QgsRasterLayerProperties::on_pbnLoadStyle_clicked()

QString fileName = QFileDialog::getOpenFileName(
this,
tr( "Load layer properties from style file (.qml)" ),
tr( "Load layer properties from style file" ),
lastUsedDir,
tr( "QGIS Layer Style File (*.qml)" ) );
tr( "QGIS Layer Style File" ) + " (*.qml)" );
if ( fileName.isEmpty() )
return;

@@ -2985,7 +2985,11 @@ void QgsRasterLayerProperties::on_pbnSaveStyleAs_clicked()
QSettings settings;
QString lastUsedDir = settings.value( "style/lastStyleDir", "." ).toString();

QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save layer properties as style file (.qml)" ), lastUsedDir );
QString outputFileName = QFileDialog::getSaveFileName(
this,
tr( "Save layer properties as style file" ),
lastUsedDir,
tr( "QGIS Layer Style File" ) + " (*.qml)" );
if ( outputFileName.isEmpty() )
return;

@@ -292,7 +292,7 @@ void QgsSingleSymbolDialog::selectTextureImage()
QString fileName = QFileDialog::getOpenFileName( this,
tr( "Open File" ),
mTexturePath,
tr( "Images (*.png *.xpm *.jpg)" ) ); //should we allow other types of images?
tr( "Images" ) + " (*.png *.xpm *.jpg)" ); //should we allow other types of images?

if ( !fileName.isNull() )
{ //only process the string if the user clicked OK
@@ -1048,7 +1048,7 @@ void QgsVectorLayerProperties::on_pbnSelectEditForm_clicked()
{
QSettings myQSettings;
QString lastUsedDir = myQSettings.value( "style/lastUIDir", "." ).toString();
QString uifilename = QFileDialog::getOpenFileName( this, tr( "Select edit form" ), lastUsedDir, tr( "UI file (*.ui)" ) );
QString uifilename = QFileDialog::getOpenFileName( this, tr( "Select edit form" ), lastUsedDir, tr( "UI file" ) + " (*.ui)" );

if ( uifilename.isNull() )
return;
@@ -403,7 +403,7 @@ void QgsSearchQueryBuilder::loadQuery()
QSettings s;
QString lastQueryFileDir = s.value( "/UI/lastQueryFileDir", "" ).toString();

QString queryFileName = QFileDialog::getOpenFileName( 0, tr( "Load query from file" ), lastQueryFileDir, tr( "Query files" ) + "(*.qqf);;" + tr( "All files" ) + "(*)" );
QString queryFileName = QFileDialog::getOpenFileName( 0, tr( "Load query from file" ), lastQueryFileDir, tr( "Query files" ) + " (*.qqf);;" + tr( "All files" ) + " (*)" );
if ( queryFileName.isNull() )
{
return;
@@ -676,7 +676,10 @@ void QgsSvgMarkerSymbolLayerV2Widget::setOffset()
void QgsSvgMarkerSymbolLayerV2Widget::on_mFileToolButton_clicked()
{
QSettings s;
QString file = QFileDialog::getOpenFileName( 0, tr( "Select SVG file" ), s.value( "/UI/lastSVGMarkerDir" ).toString(), "SVG files (*.svg)" );
QString file = QFileDialog::getOpenFileName( 0,
tr( "Select SVG file" ),
s.value( "/UI/lastSVGMarkerDir" ).toString(),
tr( "SVG files" ) + " (*.svg)" );
QFileInfo fi( file );
if ( file.isEmpty() || !fi.exists() )
{
@@ -450,7 +450,9 @@ void QgsDelimitedTextPluginGui::getOpenFileName()
this,
tr( "Choose a delimited text file to open" ),
settings.value( "/Plugin-DelimitedText/text_path", "./" ).toString(),
"Text files (*.txt *.csv);;Well Known Text files (*.wkt);;All files (* *.*)" );
tr( "Text files" ) + " (*.txt *.csv);;"
+ tr( "Well Known Text files" ) + " (*.wkt);;"
+ tr( "All files" ) + " (* *.*)" );
// set path
txtFilePath->setText( s );
}
@@ -156,7 +156,7 @@ void dxf2shpConverterGui::getInputFileName()
QString s = QFileDialog::getOpenFileName( this,
tr( "Choose a DXF file to open" ),
settings.value( "/Plugin-DXF/text_path", "./" ).toString(),
tr( "DXF files (*.dxf)" ) );
tr( "DXF files" ) + " (*.dxf)" );

if ( !s.isEmpty() )
{
@@ -171,7 +171,7 @@ void dxf2shpConverterGui::getOutputDir()
QString s = QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save to" ),
settings.value( "/UI/lastShapefileDir", "./" ).toString(),
tr( "Shapefile (*.shp)" ) );
tr( "Shapefile" ) + " (*.shp)" );

if ( !s.isEmpty() )
{
@@ -562,7 +562,7 @@ void QgsGeorefPluginGui::loadGCPsDialog()
{
QString selectedFile = mRasterFileName.isEmpty() ? "" : mRasterFileName + ".points";
mGCPpointsFileName = QFileDialog::getOpenFileName( this, tr( "Load GCP points" ),
selectedFile, "GCP file (*.points)" );
selectedFile, tr( "GCP file" ) + " (*.points)" );
if ( mGCPpointsFileName.isEmpty() )
return;

@@ -580,7 +580,7 @@ void QgsGeorefPluginGui::saveGCPsDialog()
QString selectedFile = mRasterFileName.isEmpty() ? "" : mRasterFileName + ".points";
mGCPpointsFileName = QFileDialog::getSaveFileName( this, tr( "Save GCP points" ),
selectedFile,
"GCP file (*.points)" );
tr( "GCP file" ) + " (*.points)" );

if ( mGCPpointsFileName.isEmpty() )
return;
@@ -372,8 +372,9 @@ QgsVectorLayer* QgsGlobePluginDialog::modelLayer()
void QgsGlobePluginDialog::on_modelBrowse_clicked()
{
//see http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Plugins
const char* filter = "Model files (*.3dc *.asc *.3ds *.ac *.bsp *.dae *.dw *.dxf *.fbx *.gem *.geo *.iv *.wrl *.ive *.logo *.lwo *.lw *.geo *.lws *.md2 *.obj *.ogr *.flt *.osg *.shp *.stl *.sta *.wrl *.x) \
;;All files (*.*)";
const char* filter =
tr( "Model files" ) + " (*.3dc *.asc *.3ds *.ac *.bsp *.dae *.dw *.dxf *.fbx *.gem *.geo *.iv *.wrl *.ive *.logo *.lwo *.lw *.geo *.lws *.md2 *.obj *.ogr *.flt *.osg *.shp *.stl *.sta *.wrl *.x);;"
+ tr( "All files" ) + " (*.*)";
QString path = QFileDialog::getOpenFileName( this,
tr( "Open 3D model file" ),
QDir::homePath(),
@@ -163,7 +163,7 @@ void QgsGPSPlugin::createGPX()
QFileDialog::getSaveFileName( mQGisInterface->mainWindow(),
tr( "Save new GPX file as..." ),
dir,
tr( "GPS eXchange file (*.gpx)" ) );
tr( "GPS eXchange file" ) + " (*.gpx)" );
if ( !fileName.isEmpty() )
{
if ( !fileName.toLower().endsWith( ".gpx" ) )
@@ -163,7 +163,7 @@ void QgsGPSPluginGui::on_pbnDLOutput_clicked()
QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save under" ),
dir,
tr( "GPS eXchange format (*.gpx)" ) );
tr( "GPS eXchange format" ) + " (*.gpx)" );
if ( !myFileNameQString.isEmpty() )
{
if ( !myFileNameQString.toLower().endsWith( ".gpx" ) )
@@ -256,7 +256,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked()
this,
tr( "Select GPX file" ),
dir,
tr( "GPS eXchange format (*.gpx)" ) );
tr( "GPS eXchange format" ) + " (*.gpx)" );
if ( !myFileNameQString.isEmpty() )
{
leGPXFile->setText( myFileNameQString );
@@ -313,7 +313,7 @@ void QgsGPSPluginGui::on_pbnIMPOutput_clicked()
QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save under" ),
dir,
tr( "GPS eXchange format (*.gpx)" ) );
tr( "GPS eXchange format" ) + " (*.gpx)" );
if ( !myFileNameQString.isEmpty() )
{
if ( !myFileNameQString.toLower().endsWith( ".gpx" ) )
@@ -420,7 +420,7 @@ void QgsGPSPluginGui::on_pbnCONVOutput_clicked()
QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save under" ),
dir,
tr( "GPS eXchange format (*.gpx)" ) );
tr( "GPS eXchange format" ) + " (*.gpx)" );
if ( !myFileNameQString.isEmpty() )
{
if ( !myFileNameQString.toLower().endsWith( ".gpx" ) )
@@ -99,8 +99,8 @@ void QgsOfflineEditingPluginGui::on_butBrowse_clicked()
QString fileName = QFileDialog::getSaveFileName( this,
tr( "Select target database for offline data" ),
QDir( mOfflineDataPath ).absoluteFilePath( mOfflineDbFile ),
tr( "SpatiaLite DB(*.sqlite);;All files(*.*)" )
);
tr( "SpatiaLite DB" ) + " (*.sqlite);;"
tr( "All files" ) + " (*.*)" );

if ( !fileName.isEmpty() )
{
@@ -165,7 +165,7 @@ void QgsSpit::addFile()
QgsEncodingFileDialog dlg( this,
tr( "Add Shapefiles" ),
settings.value( "/Plugin-Spit/last_directory" ).toString(),
tr( "Shapefiles (*.shp);;All files (*)" ),
tr( "Shapefiles" ) + " (*.shp);;" + tr( "All files" ) + " (*)",
settings.value( "/Plugin-Spit/last_encoding" ).toString() );
dlg.setFileMode( QFileDialog::ExistingFiles );

0 comments on commit 0752176

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