[BUG] Project>>okToChange

Marcus Denker marcus at ira.uka.de
Sun Dec 19 10:01:02 UTC 1999


--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii


On Sat, Dec 18, 1999 at 10:33:32PM -0500, Andrew C. Greenberg wrote:
> In the most current 2.7 image (updated today), I opened a new morphic 
> project, did nothing, and jumped back to MVC.  When I tried to delete 
> the new morphic project, I got a notifier announcing that 
> #copyWithout: was not understood in the following segment:
> 
> 	"Remove Player classes and metaclasses owned by project"
> (1)	is _ ImageSegment new arrayOfRoots: (Array with: self).
> (2)	(is rootsIncludingPlayers copyWithout: self) do: [:playerCls | . . .
> 
> I inserted an:
> 
> 	is rootsIncludingPlayers ifNil: [^true].
> 
> between lines (1) and (2), and I was able to close the project, but I 
> have no idea if this was a useful "solution" at all.
> 
One problem with this solution is that the empty changeset of your deleted
project won't get deleted. So it may be better do do something like

 "Remove Player classes and metaclasses owned by project"
  roots _ (ImageSegment new arrayOfRoots: (Array with: self)) rootsIncludingPlayers.
  roots ifNotNil: [
		(roots copyWithout: self) do: 

so the code at the end of the method will be executed and the empty
changeset will be deleted.

And there is an other problem: deleting MVC-project windows won't work
at all. So I did the following:

 -> added ControllManager>>presenter (simply returns nil)

Now there remains the problem that Project>>okToChange allways returns
false for MVC projects.

 -> change Project>>okToChange:

old:

	ok _ world isMorph not and: [world scheduledControllers size <= 1].
	ok ifFalse: [self isMorphic ifTrue: [
		self parent == Project current 
			ifTrue: [ok _ (self confirm:
	'Really delete the project
	', self name printString, '
	and all its windows?')]
			ifFalse: [^ true]]].	"view from elsewhere.  just
	delete it."
	ok ifFalse: [^ false].


new:


	ok _ world isMorph not and: [world scheduledControllers size <= 1].
	ok ifFalse: [self isMorphic ifTrue: [
					self parent == Project current 
					ifFalse: [^true]]].  "view from
	elsewhere.  just delete it."
	ok _ (self confirm:
	'Really delete the project
	', self name printString, '
	and all its windows?').
			
	ok ifFalse: [^ false].


This seems to work...

I posted a fix for this to the list yesterday... I've attached it to
this massage, too.


      Marcus  


-- 
Marcus Denker marcus at ira.uka.de phone at home:(0721)614235 @work:(0721)608-2749
The Difference between today and yesterday is not so much what has changed
between then and now as what I hope to change by tomorrow.

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; name="Project-okToChangefix-md.1.cs.b"
 ; x-mac-type="65417070"
 ; x-mac-creator="43534F6D"
Content-Disposition: attachment; filename="Project-okToChangefix-md.1.cs.b"
Content-Transfer-Encoding: imap_stub

0,2502,2,2549,0,

--Nq2Wo0NMKNjxTN9z--





More information about the Squeak-dev mailing list