Browse Source

Setting: 'helios.inspector.refreshMillis'.

If set to 0, inspectors won't be refreshed.
Herby Vojčík 4 years ago
parent
commit
d2be9b17a8
2 changed files with 17 additions and 8 deletions
  1. 12 6
      src/Helios-Inspector.js
  2. 5 2
      src/Helios-Inspector.st

+ 12 - 6
src/Helios-Inspector.js

@@ -2013,9 +2013,14 @@ selector: "watchChanges",
 protocol: "initialization",
 fn: function (){
 var self=this,$self=this;
+var refreshInterval;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
+var $1;
+refreshInterval="helios.inspector.refreshMillis"._settingValueIfAbsent_((500));
+$1=$recv(refreshInterval).__gt((0));
+if($core.assert($1)){
 $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -2026,25 +2031,26 @@ return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return $recv(each)._refresh();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
+}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,3)});
 //>>excludeEnd("ctx");
 }));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
-}))._valueWithInterval_((500));
+}))._valueWithInterval_(refreshInterval);
+}
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"watchChanges",{})});
+}, function($ctx1) {$ctx1.fill(self,"watchChanges",{refreshInterval:refreshInterval})});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "watchChanges\x0a\x09[ self inspectors do: [ :each | each refresh ] ]\x0a\x09\x09valueWithInterval: 500",
+source: "watchChanges\x0a\x09| refreshInterval |\x0a\x09refreshInterval := 'helios.inspector.refreshMillis' settingValueIfAbsent: 500.\x0a\x09refreshInterval > 0 ifTrue: [\x0a\x09\x09[ self inspectors do: [ :each | each refresh ] ]\x0a\x09\x09\x09valueWithInterval: refreshInterval ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["valueWithInterval:", "do:", "inspectors", "refresh"]
+messageSends: ["settingValueIfAbsent:", "ifTrue:", ">", "valueWithInterval:", "do:", "inspectors", "refresh"]
 }),
 $globals.HLInspector.a$cls);
 

+ 5 - 2
src/Helios-Inspector.st

@@ -430,8 +430,11 @@ initialize
 !
 
 watchChanges
-	[ self inspectors do: [ :each | each refresh ] ]
-		valueWithInterval: 500
+	| refreshInterval |
+	refreshInterval := 'helios.inspector.refreshMillis' settingValueIfAbsent: 500.
+	refreshInterval > 0 ifTrue: [
+		[ self inspectors do: [ :each | each refresh ] ]
+			valueWithInterval: refreshInterval ]
 ! !
 
 !HLInspector class methodsFor: 'registration'!