Skip to content
Permalink
Browse files

fix #1678

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10748 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed May 6, 2009
1 parent b6ff318 commit acd619f7167cf39493e45b4be56a3e5022b86025
Showing with 18 additions and 16 deletions.
  1. +18 −16 src/plugins/grass/qgsgrassnewmapset.cpp
@@ -1266,26 +1266,28 @@ void QgsGrassNewMapset::createMapset()
G__setenv(( char * ) "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
#endif

int ret = 0;

QgsGrass::resetError();
int ret = G_make_location( location.toAscii().data(), &mCellHead,
mProjInfo, mProjUnits, stdout );
if ( setjmp( QgsGrass::fatalErrorEnv() ) == 0 )
{
ret = G_make_location( location.toAscii().data(), &mCellHead, mProjInfo, mProjUnits, stdout );
}
QgsGrass::clearErrorEnv();

if ( ret != 0 )
if ( QgsGrass::getError() == QgsGrass::FATAL || ret != 0 )
{
QMessageBox::warning( this, tr( "Create location" ),
tr( "Cannot create new location: %1" ).arg( QgsGrass::getErrorMessage() ) );

return;
}
else
{
// Location created -> reset widgets
setLocations();
mSelectLocationRadioButton->setChecked( true );
mLocationComboBox->setItemText( mLocationComboBox->currentIndex(), location );
mLocationLineEdit->setText( "" );
locationRadioSwitched(); // calls also checkLocation()
}

// Location created -> reset widgets
setLocations();
mSelectLocationRadioButton->setChecked( true );
mLocationComboBox->setItemText( mLocationComboBox->currentIndex(), location );
mLocationLineEdit->setText( "" );
locationRadioSwitched(); // calls also checkLocation()
}
else
{
@@ -1352,7 +1354,7 @@ void QgsGrassNewMapset::createMapset()
mPlugin->mapsetChanged();
}

delete this;
deleteLater();
}

void QgsGrassNewMapset::accept()
@@ -1388,7 +1390,7 @@ void QgsGrassNewMapset::keyPressEvent( QKeyEvent * e )

void QgsGrassNewMapset::pageSelected( int index )
{
QgsDebugMsg( QString( "title = %1" ).arg( page( index )->title() ) );
QgsDebugMsg( QString( "title = %1" ).arg( page( index ) ? page( index )->title() : "(null)" ) );

switch ( index )
{
@@ -1474,7 +1476,7 @@ void QgsGrassNewMapset::close( void )

hide();
mRunning = false;
delete this;
deleteLater();
}

void QgsGrassNewMapset::closeEvent( QCloseEvent *e )

0 comments on commit acd619f

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