소스 검색

helios: fixes inspector refresh to only update when actually needed

Nicolas Petton 11 년 전
부모
커밋
9f0c9b7eef
6개의 변경된 파일74개의 추가작업 그리고 23개의 파일을 삭제
  1. 12 0
      js/Helios-Debugger.deploy.js
  2. 17 0
      js/Helios-Debugger.js
  3. 14 7
      js/Helios-Inspector.deploy.js
  4. 18 11
      js/Helios-Inspector.js
  5. 5 0
      st/Helios-Debugger.st
  6. 8 5
      st/Helios-Inspector.st

+ 12 - 0
js/Helios-Debugger.deploy.js

@@ -252,6 +252,18 @@ return $1;
 messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"]}),
 smalltalk.HLDebugger);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
+_st(_st(self)._inspectorWidget())._unregister();
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
+messageSends: ["unregister", "inspectorWidget"]}),
+smalltalk.HLDebugger);
+
 
 smalltalk.addMethod(
 smalltalk.method({

+ 17 - 0
js/Helios-Debugger.js

@@ -328,6 +328,23 @@ referencedClasses: ["HLStackListWidget"]
 }),
 smalltalk.HLDebugger);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
+_st(_st(self)._inspectorWidget())._unregister();
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
+args: [],
+source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
+messageSends: ["unregister", "inspectorWidget"],
+referencedClasses: []
+}),
+smalltalk.HLDebugger);
+
 
 smalltalk.addMethod(
 smalltalk.method({

+ 14 - 7
js/Helios-Inspector.deploy.js

@@ -376,10 +376,10 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(_st(self)._model())._variables())._keys();
+$1=_st(self)._variables();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLInspectorVariablesWidget)})},
-messageSends: ["keys", "variables", "model"]}),
+messageSends: ["variables"]}),
 smalltalk.HLInspectorVariablesWidget);
 
 smalltalk.addMethod(
@@ -425,10 +425,14 @@ selector: "refresh",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._variables()).__eq(_st(self)._items());
+if(! smalltalk.assert($1)){
 _st(self)._resetItems();
 smalltalk.HLNavigationListWidget.fn.prototype._refresh.apply(_st(self), []);
+};
 return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLInspectorVariablesWidget)})},
-messageSends: ["resetItems", "refresh"]}),
+messageSends: ["ifFalse:", "resetItems", "refresh", "=", "items", "variables"]}),
 smalltalk.HLInspectorVariablesWidget);
 
 smalltalk.addMethod(
@@ -520,10 +524,10 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self["@model"])._variables();
+$1=_st(_st(_st(self)._model())._variables())._keys();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"variables",{},smalltalk.HLInspectorVariablesWidget)})},
-messageSends: ["variables"]}),
+messageSends: ["keys", "variables", "model"]}),
 smalltalk.HLInspectorVariablesWidget);
 
 
@@ -796,9 +800,12 @@ selector: "refresh",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._inspect_(_st(self)._inspectee());
+var $1,$2;
+$1=self;
+_st($1)._refreshVariablesWidget();
+$2=_st($1)._refreshDisplayWidget();
 return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLInspectorWidget)})},
-messageSends: ["inspect:", "inspectee"]}),
+messageSends: ["refreshVariablesWidget", "refreshDisplayWidget"]}),
 smalltalk.HLInspectorWidget);
 
 smalltalk.addMethod(

+ 18 - 11
js/Helios-Inspector.js

@@ -497,12 +497,12 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(_st(self)._model())._variables())._keys();
+$1=_st(self)._variables();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLInspectorVariablesWidget)})},
 args: [],
-source: "defaultItems\x0a\x09^ self model variables keys",
-messageSends: ["keys", "variables", "model"],
+source: "defaultItems\x0a\x09^ self variables",
+messageSends: ["variables"],
 referencedClasses: []
 }),
 smalltalk.HLInspectorVariablesWidget);
@@ -566,12 +566,16 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._variables()).__eq(_st(self)._items());
+if(! smalltalk.assert($1)){
 _st(self)._resetItems();
 smalltalk.HLNavigationListWidget.fn.prototype._refresh.apply(_st(self), []);
+};
 return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLInspectorVariablesWidget)})},
 args: [],
-source: "refresh\x0a\x09self resetItems.\x0a    super refresh\x0a    ",
-messageSends: ["resetItems", "refresh"],
+source: "refresh\x0a\x09self variables = self items ifFalse: [\x0a\x09\x09self resetItems.\x0a    \x09super refresh ]",
+messageSends: ["ifFalse:", "resetItems", "refresh", "=", "items", "variables"],
 referencedClasses: []
 }),
 smalltalk.HLInspectorVariablesWidget);
@@ -696,12 +700,12 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self["@model"])._variables();
+$1=_st(_st(_st(self)._model())._variables())._keys();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"variables",{},smalltalk.HLInspectorVariablesWidget)})},
 args: [],
-source: "variables\x0a\x09^ model variables",
-messageSends: ["variables"],
+source: "variables\x0a\x09^ self model variables keys",
+messageSends: ["keys", "variables", "model"],
 referencedClasses: []
 }),
 smalltalk.HLInspectorVariablesWidget);
@@ -1067,11 +1071,14 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._inspect_(_st(self)._inspectee());
+var $1,$2;
+$1=self;
+_st($1)._refreshVariablesWidget();
+$2=_st($1)._refreshDisplayWidget();
 return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLInspectorWidget)})},
 args: [],
-source: "refresh\x0a\x09self inspect: self inspectee",
-messageSends: ["inspect:", "inspectee"],
+source: "refresh\x0a\x09self \x0a\x09\x09refreshVariablesWidget;\x0a\x09\x09refreshDisplayWidget",
+messageSends: ["refreshVariablesWidget", "refreshDisplayWidget"],
 referencedClasses: []
 }),
 smalltalk.HLInspectorWidget);

+ 5 - 0
st/Helios-Debugger.st

@@ -89,6 +89,11 @@ observeModel
 		on: HLDebuggerContextSelected
 		send: #onContextSelected:
 		to: self
+!
+
+unregister
+	super unregister.
+	self inspectorWidget unregister
 ! !
 
 !HLDebugger methodsFor: 'keybindings'!

+ 8 - 5
st/Helios-Inspector.st

@@ -170,14 +170,15 @@ selection
 !
 
 variables
-	^ model variables
+	^ self model variables keys
 ! !
 
 !HLInspectorVariablesWidget methodsFor: 'actions'!
 
 refresh
-	self resetItems.
-    super refresh
+	self variables = self items ifFalse: [
+		self resetItems.
+    	super refresh ]
 !
 
 resetItems
@@ -187,7 +188,7 @@ resetItems
 !HLInspectorVariablesWidget methodsFor: 'defaults'!
 
 defaultItems
-	^ self model variables keys
+	^ self variables
 ! !
 
 !HLInspectorVariablesWidget methodsFor: 'reactions'!
@@ -315,7 +316,9 @@ open
 !
 
 refresh
-	self inspect: self inspectee
+	self 
+		refreshVariablesWidget;
+		refreshDisplayWidget
 !
 
 refreshDisplayWidget