[Commits] r204 - sandbox/opengeo/drake/trunk/apps/drake

commits at geoext.org commits at geoext.org
Thu Feb 19 18:32:47 CET 2009


Author: tcoulter
Date: 2009-02-19 18:32:47 +0100 (Thu, 19 Feb 2009)
New Revision: 204

Modified:
   sandbox/opengeo/drake/trunk/apps/drake/MaxFeaturesWarning.js
   sandbox/opengeo/drake/trunk/apps/drake/index.html
Log:
Rather crude "do not show this again" functionality.

Modified: sandbox/opengeo/drake/trunk/apps/drake/MaxFeaturesWarning.js
===================================================================
--- sandbox/opengeo/drake/trunk/apps/drake/MaxFeaturesWarning.js	2009-02-19 16:53:46 UTC (rev 203)
+++ sandbox/opengeo/drake/trunk/apps/drake/MaxFeaturesWarning.js	2009-02-19 17:32:47 UTC (rev 204)
@@ -11,7 +11,25 @@
     title: "Warning: Maximum Features Encountered",
 
     initComponent: function() {
-        this.html = "You have encountered the maximum allowed features for the active layer (" + this.maxFeatures + " allowed). If I was a nicer application, I'd tell you something fluffier and more caring, about how you need to refine your search to overcome some technical nonsense. But I'm not. So deal with it.";
+        
+        this.addEvents("donotshowchange");
+        
+        var checkbox = new Ext.form.Checkbox({
+            boxLabel: "Do not show this warning again."
+        });
+        
+        checkbox.on("check", function(cb, newValue, oldValue) {
+            this.fireEvent("donotshowchange", newValue);
+        }, this);
+        
+        this.items = [
+            new Ext.Panel({
+                html: "You have encountered the maximum allowed features for the active layer (" + this.maxFeatures + " allowed). If I was a nicer application, I'd tell you something fluffier and more caring, about how you need to refine your search to overcome some technical nonsense. But I'm not. So deal with it.",
+                border: false
+            }),
+            checkbox
+        ];
+        
         this.buttons = [
             new Ext.Button({
                 text: "I'll deal.",
@@ -21,5 +39,7 @@
                 scope: this
             })
         ];
+        
+        GeoExt.drake.MaxFeaturesWarning.superclass.initComponent.call(this);
     }
 });
\ No newline at end of file

Modified: sandbox/opengeo/drake/trunk/apps/drake/index.html
===================================================================
--- sandbox/opengeo/drake/trunk/apps/drake/index.html	2009-02-19 16:53:46 UTC (rev 203)
+++ sandbox/opengeo/drake/trunk/apps/drake/index.html	2009-02-19 17:32:47 UTC (rev 204)
@@ -180,12 +180,18 @@
                 reader: new Ext.data.JsonReader({}, [])
             });
             
+            var showMaxFeaturesWarning = true;
+            
             this.featureStore.on("load", function() {
-                if (this.featureStore.getTotalCount() >= this.maxFeatures) {
+                if (showMaxFeaturesWarning && this.featureStore.getTotalCount() >= this.maxFeatures) {
                     var maxFeaturesWarning = new GeoExt.drake.MaxFeaturesWarning({
                         maxFeatures: this.maxFeatures
                     });
                     
+                    maxFeaturesWarning.on("donotshowchange", function(newValue) {
+                        showMaxFeaturesWarning = !newValue;
+                    }, this);
+                    
                     maxFeaturesWarning.show();
                 }
             }, this);



More information about the Commits mailing list