Index: src/gui/qgsproject.cpp =================================================================== --- src/gui/qgsproject.cpp (revision 6983) +++ src/gui/qgsproject.cpp (working copy) @@ -1016,7 +1016,7 @@ imp_->file.close(); // even though we got an error, let's make // sure it's closed anyway - throw QgsIOException("Unable to open " + imp_->file.name()); + throw QgsIOException( QObject::tr("Unable to open ") + imp_->file.name()); return false; // XXX raise exception? Ok now superfluous // XXX because of exception. @@ -1137,7 +1137,7 @@ // doesn't *have* layers -- nor a GUI for that matter -- we'll just // leave in the whining and boldly stomp on. - throw QgsException("Cannot get extents from " + imp_->file.name()); + throw QgsException( QObject::tr("Cannot get extents from ") + imp_->file.name()); // return false; } Index: src/gui/qgisapp.cpp =================================================================== --- src/gui/qgisapp.cpp (revision 6983) +++ src/gui/qgisapp.cpp (working copy) @@ -2674,7 +2674,7 @@ { QMessageBox::critical(this, tr("QGIS Project Read Error"), - tr("") + "\n" + e.what() ); + tr("") + "\n" + QString::fromLocal8Bit( e.what() ) ); qDebug( "%s:%d %d bad layers found", __FILE__, __LINE__, e.layers().size() ); // attempt to find the new locations for missing layers @@ -2685,7 +2685,7 @@ { QMessageBox::critical(this, tr("QGIS Project Read Error"), - tr("") + "\n" + e.what() ); + tr("") + "\n" + QString::fromLocal8Bit( e.what() ) ); qDebug( "%s:%d BAD LAYERS FOUND", __FILE__, __LINE__ ); } } @@ -2756,7 +2756,7 @@ if ( QMessageBox::Yes == QMessageBox::critical( this, tr("QGIS Project Read Error"), - tr("") + "\n" + e.what() + "\n" + + tr("") + "\n" + QString::fromLocal8Bit( e.what() ) + "\n" + tr("Try to find missing layers?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) ) @@ -2774,7 +2774,7 @@ qDebug( "%s:%d BAD LAYERS FOUND", __FILE__, __LINE__ ); QMessageBox::critical( 0x0, - tr("Unable to open project"), QString::fromLocal8Bit(e.what()), QMessageBox::Ok, + tr("Unable to open project"), QString::fromLocal8Bit( e.what() ), QMessageBox::Ok, Qt::NoButton ); mMapCanvas->freeze(false); @@ -2869,7 +2869,7 @@ { QMessageBox::critical( 0x0, tr("Unable to save project ") + QgsProject::instance()->filename(), - e.what(), + QString::fromLocal8Bit( e.what() ), QMessageBox::Ok, Qt::NoButton ); @@ -2926,21 +2926,31 @@ fullPath.setFile( newFilePath ); } + try + { + QgsProject::instance()->filename( fullPath.filePath() ); - QgsProject::instance()->filename( fullPath.filePath() ); - - if ( QgsProject::instance()->write() ) - { - setTitleBarText_(*this); // update title bar - statusBar()->message(tr("Saved project to:") + " " + QgsProject::instance()->filename() ); - // add this to the list of recently used project files - saveRecentProjectPath(fullPath.filePath(), settings); + if ( QgsProject::instance()->write() ) + { + setTitleBarText_(*this); // update title bar + statusBar()->message(tr("Saved project to:") + " " + QgsProject::instance()->filename() ); + // add this to the list of recently used project files + saveRecentProjectPath(fullPath.filePath(), settings); + } + else + { + QMessageBox::critical(this, + tr("Unable to save project"), + tr("Unable to save project to ") + QgsProject::instance()->filename() ); + } } - else + catch ( std::exception & e ) { - QMessageBox::critical(this, - tr("Unable to save project"), - tr("Unable to save project to ") + QgsProject::instance()->filename() ); + QMessageBox::critical( 0x0, + tr("Unable to save project ") + QgsProject::instance()->filename(), + QString::fromLocal8Bit( e.what() ), + QMessageBox::Ok, + Qt::NoButton ); } } // QgisApp::fileSaveAs