Skip to content

Commit

Permalink
cleanup separate file type names from extensions in translations
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 29, 2012
1 parent eae552f commit 0752176
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -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;
Expand Down
12 changes: 9 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsconfigureshortcutsdialog.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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() )
{
Expand Down
5 changes: 4 additions & 1 deletion src/app/qgsembedlayerdialog.cpp
Expand Up @@ -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 );
Expand Down
18 changes: 11 additions & 7 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -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 ) )
Expand Down Expand Up @@ -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 ) )
{
Expand Down Expand Up @@ -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 ) )
Expand Down Expand Up @@ -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 ) )
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgssinglesymboldialog.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgssearchquerybuilder.cpp
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Expand Up @@ -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() )
{
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
Expand Up @@ -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 );
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/dxf2shp_converter/dxf2shpconvertergui.cpp
Expand Up @@ -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() )
{
Expand All @@ -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() )
{
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/globe/globe_plugin_dialog.cpp
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/gps_importer/qgsgpsplugin.cpp
Expand Up @@ -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" ) )
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/gps_importer/qgsgpsplugingui.cpp
Expand Up @@ -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" ) )
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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" ) )
Expand Down Expand Up @@ -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" ) )
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/offline_editing/offline_editing_plugin_gui.cpp
Expand Up @@ -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() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spit/qgsspit.cpp
Expand Up @@ -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 );

Expand Down

0 comments on commit 0752176

Please sign in to comment.