Browse Source

Reinitialize list after package remove.

Herby Vojčík 4 years ago
parent
commit
88493b63d8
2 changed files with 52 additions and 3 deletions
  1. 41 3
      src/Helios-Browser.js
  2. 11 0
      src/Helios-Browser.st

+ 41 - 3
src/Helios-Browser.js

@@ -4870,8 +4870,8 @@ selector: "observeSystem",
 protocol: "actions",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "observeSystem\x0a    self model systemAnnouncer \x0a\x09\x09on: ClassAdded \x0a\x09\x09send: #onClassAdded:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageAdded\x0a\x09\x09send: #onPackageAdded:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageClean\x0a\x09\x09send: #onPackageStateChanged\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageDirty\x0a\x09\x09send: #onPackageStateChanged\x0a\x09\x09to: self.",
-referencedClasses: ["ClassAdded", "PackageAdded", "PackageClean", "PackageDirty"],
+source: "observeSystem\x0a    self model systemAnnouncer \x0a\x09\x09on: ClassAdded \x0a\x09\x09send: #onClassAdded:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageAdded\x0a\x09\x09send: #onPackageAdded:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageRemoved\x0a\x09\x09send: #onPackageRemoved:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageClean\x0a\x09\x09send: #onPackageStateChanged\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageDirty\x0a\x09\x09send: #onPackageStateChanged\x0a\x09\x09to: self.",
+referencedClasses: ["ClassAdded", "PackageAdded", "PackageRemoved", "PackageClean", "PackageDirty"],
 //>>excludeEnd("ide");
 pragmas: [],
 messageSends: ["on:send:to:", "systemAnnouncer", "model"]
@@ -4914,11 +4914,24 @@ return $core.withContext(function($ctx1) {
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["systemAnnouncer"]=3
 //>>excludeEnd("ctx");
-][0])._on_send_to_($globals.PackageClean,"onPackageStateChanged",self)
+][0])._on_send_to_($globals.PackageRemoved,"onPackageRemoved:",self)
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["on:send:to:"]=3
 //>>excludeEnd("ctx");
 ][0];
+[$recv([$recv([$self._model()
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+,$ctx1.sendIdx["model"]=4
+//>>excludeEnd("ctx");
+][0])._systemAnnouncer()
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+,$ctx1.sendIdx["systemAnnouncer"]=4
+//>>excludeEnd("ctx");
+][0])._on_send_to_($globals.PackageClean,"onPackageStateChanged",self)
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+,$ctx1.sendIdx["on:send:to:"]=4
+//>>excludeEnd("ctx");
+][0];
 $recv($recv($self._model())._systemAnnouncer())._on_send_to_($globals.PackageDirty,"onPackageStateChanged",self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -4979,6 +4992,31 @@ return self;
 }; }),
 $globals.HLPackagesListWidget);
 
+$core.addMethod(
+$core.method({
+selector: "onPackageRemoved:",
+protocol: "reactions",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anAnnouncement"],
+source: "onPackageRemoved: anAnnouncement\x0a\x09self \x0a\x09\x09initializeItems;\x0a\x09\x09refresh",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["initializeItems", "refresh"]
+}, function ($methodClass){ return function (anAnnouncement){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$self._initializeItems();
+$self._refresh();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"onPackageRemoved:",{anAnnouncement:anAnnouncement})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.HLPackagesListWidget);
+
 $core.addMethod(
 $core.method({
 selector: "onPackageSelected:",

+ 11 - 0
src/Helios-Browser.st

@@ -1231,6 +1231,11 @@ observeSystem
 		send: #onPackageAdded:
 		to: self.
 		
+	self model systemAnnouncer
+		on: PackageRemoved
+		send: #onPackageRemoved:
+		to: self.
+		
 	self model systemAnnouncer
 		on: PackageClean
 		send: #onPackageStateChanged
@@ -1275,6 +1280,12 @@ onPackageAdded: anAnnouncement
 		refresh
 !
 
+onPackageRemoved: anAnnouncement
+	self 
+		initializeItems;
+		refresh
+!
+
 onPackageSelected: anAnnouncement
 	| package |