[QGIS Commit] r10949 - in trunk/qgis/src: app core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Jun 18 07:59:25 EDT 2009


Author: mhugent
Date: 2009-06-18 07:59:25 -0400 (Thu, 18 Jun 2009)
New Revision: 10949

Modified:
   trunk/qgis/src/app/qgsattributedialog.cpp
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
   trunk/qgis/src/core/qgsvectorlayer.h
Log:
Added new edit type for attributes that are not recommended to change

Modified: trunk/qgis/src/app/qgsattributedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributedialog.cpp	2009-06-18 11:05:41 UTC (rev 10948)
+++ trunk/qgis/src/app/qgsattributedialog.cpp	2009-06-18 11:59:25 UTC (rev 10949)
@@ -238,10 +238,15 @@
 
       case QgsVectorLayer::LineEdit:
       case QgsVectorLayer::UniqueValuesEditable:
+      case QgsVectorLayer::Immutable:
       default:
       {
         QLineEdit *le = new QLineEdit( myFieldValue.toString() );
 
+        if ( editType == QgsVectorLayer::Immutable)
+        {
+          le->setEnabled(false);
+        }
         if ( editType == QgsVectorLayer::UniqueValuesEditable )
         {
           QList<QVariant> values;

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2009-06-18 11:05:41 UTC (rev 10948)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2009-06-18 11:59:25 UTC (rev 10949)
@@ -189,6 +189,7 @@
   cb->addItem( tr( "range (slider)" ), QgsVectorLayer::SliderRange );
   cb->addItem( tr( "file name" ), QgsVectorLayer::FileName );
   cb->addItem( tr( "enumeration" ), QgsVectorLayer::Enumeration);
+  cb->addItem( tr( "immutable" ), QgsVectorLayer::Immutable);
   cb->setSizeAdjustPolicy( QComboBox::AdjustToContentsOnFirstShow );
   cb->setCurrentIndex( layer->editType( idx ) );
 

Modified: trunk/qgis/src/core/qgsvectorlayer.h
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.h	2009-06-18 11:05:41 UTC (rev 10948)
+++ trunk/qgis/src/core/qgsvectorlayer.h	2009-06-18 11:59:25 UTC (rev 10949)
@@ -74,7 +74,8 @@
       EditRange,
       SliderRange,
       FileName,
-      Enumeration
+      Enumeration,
+      Immutable /*The attribute value should not be changed in the attribute form*/
     };
 
     struct RangeData



More information about the QGIS-commit mailing list