save-rollback_deselect-tool_patch.diff

Larry Shaffer, 2013-01-10 02:00 AM

Download (3.03 KB)

View differences:

src/app/qgisapp.cpp
516 516
  updateProjectFromTemplates();
517 517
  legendLayerSelectionChanged();
518 518
  activateDeactivateLayerRelatedActions( NULL );
519
  mSaveRollbackInProgress = false;
519 520

  
520 521
  addDockWidget( Qt::LeftDockWidgetArea, mUndoWidget );
521 522
  mUndoWidget->hide();
......
5248 5249
  if ( !vlayer || !vlayer->isEditable() || !vlayer->isModified() )
5249 5250
    return;
5250 5251

  
5252
  if ( vlayer == activeLayer() )
5253
    mSaveRollbackInProgress = true;
5254

  
5251 5255
  if ( !vlayer->commitChanges() )
5252 5256
  {
5257
    mSaveRollbackInProgress = false;
5253 5258
    QMessageBox::information( 0,
5254 5259
                              tr( "Error" ),
5255 5260
                              tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
......
5270 5275
  if ( !vlayer || !vlayer->isEditable() )
5271 5276
    return;
5272 5277

  
5278
  if ( vlayer == activeLayer() && leaveEditable )
5279
    mSaveRollbackInProgress = true;
5280

  
5273 5281
  if ( !vlayer->rollBack() )
5274 5282
  {
5283
    mSaveRollbackInProgress = false;
5275 5284
    QMessageBox::information( 0,
5276 5285
                              tr( "Error" ),
5277 5286
                              tr( "Could not %1 changes to layer %2\n\nErrors: %3\n" )
......
7309 7318
  if ( layer && layer == activeLayer() )
7310 7319
  {
7311 7320
    activateDeactivateLayerRelatedActions( layer );
7321
    mSaveRollbackInProgress = false;
7312 7322
  }
7313 7323
}
7314 7324

  
......
7449 7459
    mActionCopyFeatures->setEnabled( layerHasSelection );
7450 7460
    mActionFeatureAction->setEnabled( layerHasActions );
7451 7461

  
7452
    if ( !vlayer->isEditable() && mMapCanvas->mapTool() && mMapCanvas->mapTool()->isEditTool() )
7462
    if ( !vlayer->isEditable() && mMapCanvas->mapTool()
7463
         && mMapCanvas->mapTool()->isEditTool() && !mSaveRollbackInProgress )
7453 7464
    {
7454 7465
      mMapCanvas->setMapTool( mNonEditMapTool );
7455 7466
    }
src/app/qgisapp.h
1284 1284
    //!flag to indicate that the previous screen mode was 'maximised'
1285 1285
    bool mPrevScreenModeMaximized;
1286 1286

  
1287
    /** Flag to indicate an edits save/rollback for active layer is in progress
1288
     * @note added in QGIS 1.9
1289
     */
1290
    bool mSaveRollbackInProgress;
1291

  
1287 1292
    QgsPythonUtils* mPythonUtils;
1288 1293

  
1289 1294
    static QgisApp *smInstance;
1290
-