Skip to content

Commit

Permalink
error messages for copy,rename,delete
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@5058 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 18, 2006
1 parent 9e8c039 commit d121222
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/plugins/grass/qgsgrassbrowser.cpp
Expand Up @@ -275,10 +275,13 @@ void QgsGrassBrowser::copyMap()
#endif
QProcess process(this);
process.start(module, QStringList( typeName + "=" + map + "@" + mapset + "," + newName ) );
if ( !process.waitForFinished() )
if ( !process.waitForFinished() || process.exitCode() != 0 )
{
QString output ( process.readAllStandardOutput () );
QString error ( process.readAllStandardError () );
QMessageBox::warning( 0, "Warning", "Cannot copy map "
+ map + "@" + mapset );
+ map + "@" + mapset + "<br>" + output.replace("\n","<br>")
+ "<br>" + error.replace("\n","<br>") );
}
else
{
Expand Down Expand Up @@ -335,9 +338,13 @@ void QgsGrassBrowser::renameMap()
#endif
QProcess process(this);
process.start(module, QStringList( typeName + "=" + map + "," + newName ) );
if ( !process.waitForFinished() )
if ( !process.waitForFinished() || process.exitCode() != 0 )
{
QMessageBox::warning( 0, "Warning", "Cannot rename map " + map );
QString output ( process.readAllStandardOutput () );
QString error ( process.readAllStandardError () );
QMessageBox::warning( 0, "Warning", "Cannot rename map "
+ map + "<br>" + output.replace("\n","<br>")
+ "<br>" + error.replace("\n","<br>") );
}
else
{
Expand Down Expand Up @@ -383,10 +390,13 @@ void QgsGrassBrowser::deleteMap()
#endif
QProcess process(this);
process.start(module, QStringList( typeName + "=" + map ) );
if ( !process.waitForFinished() )
if ( !process.waitForFinished() || process.exitCode() != 0 )
{
QString output ( process.readAllStandardOutput () );
QString error ( process.readAllStandardError () );
QMessageBox::warning( 0, "Warning", "Cannot delete map "
+ map );
+ map + "<br>" + output.replace("\n","<br>")
+ "<br>" + error.replace("\n","<br>") );
}
else
{
Expand Down

0 comments on commit d121222

Please sign in to comment.