Skip to content

Commit

Permalink
Merge pull request #6467 from DelazJ/QMessageBoxTitles
Browse files Browse the repository at this point in the history
More dialog caption fixes
  • Loading branch information
nyalldawson committed Feb 27, 2018
2 parents 13c3522 + 3701d64 commit 9ee35ad
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions src/gui/symbology/qgssymbolslistwidget.cpp
Expand Up @@ -439,15 +439,15 @@ void QgsSymbolsListWidget::symbolAddedToStyle( const QString &name, QgsSymbol *s
void QgsSymbolsListWidget::addSymbolToStyle()
{
bool ok;
QString name = QInputDialog::getText( this, tr( "Symbol name" ),
QString name = QInputDialog::getText( this, tr( "Save Symbol" ),
tr( "Please enter name for the symbol:" ), QLineEdit::Normal, tr( "New symbol" ), &ok );
if ( !ok || name.isEmpty() )
return;

// check if there is no symbol with same name
if ( mStyle->symbolNames().contains( name ) )
{
int res = QMessageBox::warning( this, tr( "Save symbol" ),
int res = QMessageBox::warning( this, tr( "Save Symbol" ),
tr( "Symbol with name '%1' already exists. Overwrite?" )
.arg( name ),
QMessageBox::Yes | QMessageBox::No );
Expand Down Expand Up @@ -477,7 +477,7 @@ void QgsSymbolsListWidget::saveSymbol()
// check if there is no symbol with same name
if ( mStyle->symbolNames().contains( saveDlg.name() ) )
{
int res = QMessageBox::warning( this, tr( "Save symbol" ),
int res = QMessageBox::warning( this, tr( "Save Symbol" ),
tr( "Symbol with name '%1' already exists. Overwrite?" )
.arg( saveDlg.name() ),
QMessageBox::Yes | QMessageBox::No );
Expand Down
14 changes: 7 additions & 7 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Expand Up @@ -248,13 +248,13 @@ bool eVisGenericEventBrowserGui::initBrowser()
}
else
{
QMessageBox::warning( this, tr( "Warning" ), tr( "This tool only supports vector data" ) );
QMessageBox::warning( this, tr( "Generic Event Browser" ), tr( "This tool only supports vector data." ) );
return false;
}
}
else
{
QMessageBox::warning( this, tr( "Warning" ), tr( "No active layers found" ) );
QMessageBox::warning( this, tr( "Generic Event Browser" ), tr( "No active layers found." ) );
return false;
}
}
Expand All @@ -271,19 +271,19 @@ bool eVisGenericEventBrowserGui::initBrowser()
}
else
{
QMessageBox::warning( this, tr( "Warning" ), tr( "This tool only supports vector data" ) );
QMessageBox::warning( this, tr( "Generic Event Browser" ), tr( "This tool only supports vector data." ) );
return false;
}
}
else
{
QMessageBox::warning( this, tr( "Warning" ), tr( "No active layers found" ) );
QMessageBox::warning( this, tr( "Generic Event Browser" ), tr( "No active layers found." ) );
return false;
}
}
else
{
QMessageBox::warning( this, tr( "Error" ), tr( "Unable to connect to either the map canvas or application interface" ) );
QMessageBox::warning( this, tr( "Generic Event Browser" ), tr( "Unable to connect to either the map canvas or application interface." ) );
return false;
}

Expand All @@ -310,11 +310,11 @@ bool eVisGenericEventBrowserGui::initBrowser()
if ( 0 == mFeatureIds.size() )
return false;

//get the first feature in the list so we can set the field in the pulldown menues
//get the first feature in the list so we can set the field in the pull-down menus
QgsFeature *myFeature = featureAtId( mFeatureIds.at( mCurrentFeatureIndex ) );
if ( !myFeature )
{
QMessageBox::warning( this, tr( "Error" ), tr( "An invalid feature was received during initialization" ) );
QMessageBox::warning( this, tr( "Generic Event Browser" ), tr( "An invalid feature was received during initialization." ) );
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/evis/idtool/eviseventidtool.cpp
Expand Up @@ -72,12 +72,12 @@ void eVisEventIdTool::canvasReleaseEvent( QgsMapMouseEvent *mouseEvent )
}
else
{
QMessageBox::warning( mCanvas, QObject::tr( "Warning" ), QObject::tr( "This tool only supports vector data" ) );
QMessageBox::warning( mCanvas, QObject::tr( "eVis Event Id Tool" ), QObject::tr( "This tool only supports vector data." ) );
}
}
else
{
QMessageBox::warning( mCanvas, QObject::tr( "Warning" ), QObject::tr( "No active layers found" ) );
QMessageBox::warning( mCanvas, QObject::tr( "eVis Event Id Tool" ), QObject::tr( "No active layers found." ) );
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
Expand Up @@ -481,7 +481,7 @@ void QgsGeometryCheckerResultTab::fixErrors( bool prompt )
{
return;
}
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Fix errors?" ), tr( "Do you want to fix %1 errors?" ).arg( errors.size() ), QMessageBox::Yes, QMessageBox::No ) )
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Fix Errors" ), tr( "Do you want to fix %1 errors?" ).arg( errors.size() ), QMessageBox::Yes, QMessageBox::No ) )
{
return;
}
Expand Down Expand Up @@ -626,7 +626,7 @@ void QgsGeometryCheckerResultTab::checkRemovedLayer( const QStringList &ids )
{
if ( mTabWidget->currentWidget() == this )
{
QMessageBox::critical( this, tr( "Layer removed" ), tr( "One or more layers have been removed." ) );
QMessageBox::critical( this, tr( "Remove Layer" ), tr( "One or more layers have been removed." ) );
}
setEnabled( false );
qDeleteAll( mCurrentRubberBands );
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/geometry_checker/qgsgeometrycheckersetuptab.cpp
Expand Up @@ -246,7 +246,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
{
if ( layer->dataProvider()->dataSourceUri().startsWith( ui.lineEditOutputDirectory->text() ) )
{
QMessageBox::critical( this, tr( "Invalid Output Directory" ), tr( "The chosen output directory contains one or more input layers." ) );
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "The chosen output directory contains one or more input layers." ) );
return;
}
}
Expand All @@ -255,15 +255,15 @@ void QgsGeometryCheckerSetupTab::runChecks()
QgsVectorLayer *followBoundaryCheckLayer = ui.comboBoxFollowBoundaries->isEnabled() ? dynamic_cast<QgsVectorLayer *>( QgsProject::instance()->mapLayer( ui.comboBoxFollowBoundaries->currentData().toString() ) ) : nullptr;
if ( layers.contains( lineLayerCheckLayer ) || layers.contains( followBoundaryCheckLayer ) )
{
QMessageBox::critical( this, tr( "Error" ), tr( "The test layer set contains a layer selected for a topology check." ) );
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "The test layer set contains a layer selected for a topology check." ) );
return;
}

for ( QgsVectorLayer *layer : layers )
{
if ( layer->isEditable() )
{
QMessageBox::critical( this, tr( "Editable Input Layer" ), tr( "Input layer '%1' is not allowed to be in editing mode." ).arg( layer->name() ) );
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "Input layer '%1' is not allowed to be in editing mode." ).arg( layer->name() ) );
return;
}
}
Expand All @@ -285,7 +285,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
QgsVectorFileWriter::MetaData metadata;
if ( !QgsVectorFileWriter::driverMetadata( outputDriverName, metadata ) )
{
QMessageBox::critical( this, tr( "Unknown Output Format" ), tr( "The specified output format cannot be recognized." ) );
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "The specified output format cannot be recognized." ) );
mRunButton->setEnabled( true );
ui.labelStatus->hide();
unsetCursor();
Expand Down Expand Up @@ -355,7 +355,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
// Error if an output layer could not be created
if ( !createErrors.isEmpty() )
{
QMessageBox::critical( this, tr( "Layer Creation Failed" ), tr( "Failed to create one or more output layers:\n%1" ).arg( createErrors.join( "\n" ) ) );
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "Failed to create one or more output layers:\n%1" ).arg( createErrors.join( "\n" ) ) );
mRunButton->setEnabled( true );
ui.labelStatus->hide();
unsetCursor();
Expand Down Expand Up @@ -383,7 +383,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
{
nonEditableLayerNames.append( layer->name() );
}
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Non-editable Output Layers" ), tr( "The following output layers are in a format that does not support editing features:\n%1\n\nThe geometry check can be performed, but it will not be possible to fix any errors. Do you want to continue?" ).arg( nonEditableLayerNames.join( "\n" ) ), QMessageBox::Yes, QMessageBox::No ) )
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Check Geometries" ), tr( "The following output layers are in a format that does not support editing features:\n%1\n\nThe geometry check can be performed, but it will not be possible to fix any errors. Do you want to continue?" ).arg( nonEditableLayerNames.join( "\n" ) ), QMessageBox::Yes, QMessageBox::No ) )
{
if ( ui.radioButtonOutputNew->isChecked() )
{
Expand Down
26 changes: 13 additions & 13 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -247,7 +247,7 @@ void QgsGeorefPluginGui::openRaster()
QString filters = QgsProviderRegistry::instance()->fileRasterFilters();
filters.prepend( otherFiles + ";;" );
filters.chop( otherFiles.size() + 2 );
mRasterFileName = QFileDialog::getOpenFileName( this, tr( "Open raster" ), dir, filters, &lastUsedFilter );
mRasterFileName = QFileDialog::getOpenFileName( this, tr( "Open Raster" ), dir, filters, &lastUsedFilter );
mModifiedRasterFileName.clear();

if ( mRasterFileName.isEmpty() )
Expand All @@ -256,12 +256,12 @@ void QgsGeorefPluginGui::openRaster()
QString errMsg;
if ( !QgsRasterLayer::isValidRasterFileName( mRasterFileName, errMsg ) )
{
QString msg = tr( "%1 is not a supported raster data source" ).arg( mRasterFileName );
QString msg = tr( "%1 is not a supported raster data source." ).arg( mRasterFileName );

if ( !errMsg.isEmpty() )
msg += '\n' + errMsg;

QMessageBox::information( this, tr( "Unsupported Data Source" ), msg );
QMessageBox::information( this, tr( "Open Raster" ), msg );
return;
}

Expand Down Expand Up @@ -594,31 +594,31 @@ void QgsGeorefPluginGui::showCoordDialog( const QgsPointXY &pixelCoords )
void QgsGeorefPluginGui::loadGCPsDialog()
{
QString selectedFile = mRasterFileName.isEmpty() ? QLatin1String( "" ) : mRasterFileName + ".points";
mGCPpointsFileName = QFileDialog::getOpenFileName( this, tr( "Load GCP points" ),
mGCPpointsFileName = QFileDialog::getOpenFileName( this, tr( "Load GCP Points" ),
selectedFile, tr( "GCP file" ) + " (*.points)" );
if ( mGCPpointsFileName.isEmpty() )
return;

if ( !loadGCPs() )
{
mMessageBar->pushMessage( tr( "Invalid GCP file" ), tr( "GCP file could not be read." ), Qgis::Warning, messageTimeout() );
mMessageBar->pushMessage( tr( "Load GCP Points" ), tr( "Invalid GCP file. File could not be read." ), Qgis::Warning, messageTimeout() );
}
else
{
mMessageBar->pushMessage( tr( "GCPs loaded" ), tr( "GCP file successfully loaded." ), Qgis::Info, messageTimeout() );
mMessageBar->pushMessage( tr( "Load GCP Points" ), tr( "GCP file successfully loaded." ), Qgis::Info, messageTimeout() );
}
}

void QgsGeorefPluginGui::saveGCPsDialog()
{
if ( mPoints.isEmpty() )
{
mMessageBar->pushMessage( tr( "No GCP Points" ), tr( "No GCP points are available to save." ), Qgis::Warning, messageTimeout() );
mMessageBar->pushMessage( tr( "Save GCP Points" ), tr( "No GCP points are available to save." ), Qgis::Warning, messageTimeout() );
return;
}

QString selectedFile = mRasterFileName.isEmpty() ? QLatin1String( "" ) : mRasterFileName + ".points";
mGCPpointsFileName = QFileDialog::getSaveFileName( this, tr( "Save GCP points" ),
mGCPpointsFileName = QFileDialog::getSaveFileName( this, tr( "Save GCP Points" ),
selectedFile,
tr( "GCP file" ) + " (*.points)" );

Expand Down Expand Up @@ -1352,7 +1352,7 @@ bool QgsGeorefPluginGui::georeference()
{
if ( QFile::exists( mWorldFileName ) )
{
int r = QMessageBox::question( this, tr( "World file exists" ),
int r = QMessageBox::question( this, tr( "Georeference" ),
tr( "<p>The selected file already seems to have a "
"world file! Do you want to replace it with the "
"new world file?</p>" ),
Expand Down Expand Up @@ -1422,7 +1422,7 @@ bool QgsGeorefPluginGui::writeWorldFile( const QgsPointXY &origin, double pixelX
QFile file( mWorldFileName );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
{
mMessageBar->pushMessage( tr( "Error" ), tr( "Could not write to %1." ).arg( mWorldFileName ), Qgis::Critical, messageTimeout() );
mMessageBar->pushMessage( tr( "Save World File" ), tr( "Could not write to %1." ).arg( mWorldFileName ), Qgis::Critical, messageTimeout() );
return false;
}

Expand Down Expand Up @@ -1915,21 +1915,21 @@ bool QgsGeorefPluginGui::checkReadyGeoref()
{
if ( mRasterFileName.isEmpty() )
{
mMessageBar->pushMessage( tr( "No Raster Loaded" ), tr( "Please load raster to be georeferenced" ), Qgis::Warning, messageTimeout() );
mMessageBar->pushMessage( tr( "No Raster Loaded" ), tr( "Please load raster to be georeferenced." ), Qgis::Warning, messageTimeout() );
return false;
}

if ( QgsGeorefTransform::InvalidTransform == mTransformParam )
{
QMessageBox::information( this, tr( "Info" ), tr( "Please set transformation type" ) );
QMessageBox::information( this, tr( "Georeferencer" ), tr( "Please set transformation type." ) );
getTransformSettings();
return false;
}

//MH: helmert transformation without warping disabled until qgis is able to read rotated rasters efficiently
if ( mModifiedRasterFileName.isEmpty() && QgsGeorefTransform::Linear != mTransformParam /*&& QgsGeorefTransform::Helmert != mTransformParam*/ )
{
QMessageBox::information( this, tr( "Info" ), tr( "Please set output raster name" ) );
QMessageBox::information( this, tr( "Georeferencer" ), tr( "Please set output raster name." ) );
getTransformSettings();
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/globe/qgsglobeplugindialog.cpp
Expand Up @@ -341,7 +341,7 @@ void QgsGlobePluginDialog::addCustomTMSImagery()
QString validationError;
if ( !validateRemoteUri( url, validationError ) )
{
QMessageBox::warning( this, tr( "Invalid URL" ), validationError );
QMessageBox::warning( this, tr( "Add TMS Imagery" ), validationError );
}
else
{
Expand All @@ -358,7 +358,7 @@ void QgsGlobePluginDialog::addCustomWMSImagery()
QString validationError;
if ( !validateRemoteUri( url, validationError ) )
{
QMessageBox::warning( this, tr( "Invalid URL" ), validationError );
QMessageBox::warning( this, tr( "Add WMS Imagery" ), validationError );
}
else
{
Expand Down Expand Up @@ -402,7 +402,7 @@ void QgsGlobePluginDialog::addCustomTMSElevation()
QString validationError;
if ( !validateRemoteUri( url, validationError ) )
{
QMessageBox::warning( this, tr( "Invalid URL" ), validationError );
QMessageBox::warning( this, tr( "Add TMS Elevation" ), validationError );
}
else
{
Expand Down

0 comments on commit 9ee35ad

Please sign in to comment.