[QGIS Commit] r8137 - in trunk/qgis/src/app: . legend
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Mon Feb 11 12:55:16 EST 2008
Author: mhugent
Date: 2008-02-11 12:55:16 -0500 (Mon, 11 Feb 2008)
New Revision: 8137
Modified:
trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
trunk/qgis/src/app/qgsattributetabledisplay.cpp
Log:
Insert a 'Cancel' button to the dialogs when stop editing, fix for bug #944
Modified: trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayerfile.cpp 2008-02-11 17:18:22 UTC (rev 8136)
+++ trunk/qgis/src/app/legend/qgslegendlayerfile.cpp 2008-02-11 17:55:16 UTC (rev 8137)
@@ -438,9 +438,7 @@
{
// commit or roll back?
- QMessageBox::StandardButton commit = QMessageBox::information(0,tr("Stop editing"),
- tr("Do you want to save the changes?"),
- QMessageBox::Save | QMessageBox::Discard);
+ QMessageBox::StandardButton commit = QMessageBox::information(0,tr("Stop editing"), tr("Do you want to save the changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
if(commit==QMessageBox::Save)
{
@@ -461,6 +459,10 @@
tr("Problems during roll back"));
}
}
+ else //cancel
+ {
+ return;
+ }
}
else //layer not modified
{
Modified: trunk/qgis/src/app/qgsattributetabledisplay.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributetabledisplay.cpp 2008-02-11 17:18:22 UTC (rev 8136)
+++ trunk/qgis/src/app/qgsattributetabledisplay.cpp 2008-02-11 17:55:16 UTC (rev 8137)
@@ -192,7 +192,7 @@
//commit or roll back?
QMessageBox::StandardButton commit=QMessageBox::information(this,tr("Stop editing"),
tr("Do you want to save the changes?"),
- QMessageBox::Save | QMessageBox::Discard);
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
if(commit==QMessageBox::Save)
{
if(!table()->commitChanges(mLayer))
@@ -200,10 +200,14 @@
QMessageBox::information(this,tr("Error"),tr("Could not commit changes"));
}
}
- else
+ else if(commit == QMessageBox::Discard)
{
table()->rollBack(mLayer);
}
+ else //cancel
+ {
+ return;
+ }
}
btnStartEditing->setEnabled(true);
btnStopEditing->setEnabled(false);
More information about the QGIS-commit
mailing list