[squeak-dev] [FIX] cleanUpChangeSorterSetMenu

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Tue Apr 5 18:32:18 UTC 2022


Send from MVC. :-)

=============== Summary ===============

Change Set:		cleanUpChangeSorterSetMenu
Date:			5 April 2022
Author:			Christoph Thiede

Cleans up change set menu of change sorter. Remove Morphic-specific hack for controlling the position of Monticello item and split up the main menu to user pragma priorities instead. In particular, this fixes the menuBuilder failure in MVC.

=============== Diff ===============

ChangeSorter>>monticelloChangeSetMenu: {*Monticello-changeSet menu} · ct 4/5/2022 19:26 (changed)
monticelloChangeSetMenu: aMenu
	<changeSetMenuShifted: false>
	<menuPriority: 600>
- 	"Sigh, when implementing menu pragmas this is not what I had in mind..."
- 	aMenu add: 'delete Monticello load change sets' action: #deleteMonticelloChangeSets.
- 	(aMenu submorphs
- 						detect: [:m| m isMenuItemMorph and: [m contents beginsWith: 'destroy change set']]
- 						ifNone: []) ifNotNil:
- 		[:destroyItem| | item |
- 		aMenu removeMorph: (item := aMenu submorphs last).
- 		aMenu addMorph: item after: destroyItem].
+ 	aMenu add: 'delete Monticello load change sets' translated action: #deleteMonticelloChangeSets.
	^aMenu

ChangeSorter>>shiftedChangeSetMenu: {changeSet menu} · ct 4/5/2022 20:26 (changed)
shiftedChangeSetMenu: aMenu
	"Set up aMenu to hold items relating to the change-set-list pane when the shift key is down"

	<changeSetMenuShifted: true>

	aMenu title: 'Change set (shifted)' translated.
	aMenu addStayUpItemSpecial.

	"CONFLICTS SECTION"
	aMenu add: 'conflicts with other change sets' translated action: #browseMethodConflicts.
	aMenu balloonTextForLastItem: 
'Browse all methods that occur both in this change set and in at least one other change set.' translated.
	self changeSetMenuForOpposite: aMenu.
	aMenu addLine.

	"CHECKS SECTION"
	aMenu add: 'check for slips' translated action: #lookForSlips.
	aMenu balloonTextForLastItem: 
'Check this change set for halts and references to Transcript.' translated.

	aMenu add: 'check for unsent messages' translated action: #checkForUnsentMessages.
	aMenu balloonTextForLastItem:
'Check this change set for messages that are not sent anywhere in the system' translated.

	aMenu add: 'check for uncommented methods' translated action: #checkForUncommentedMethods.
	aMenu balloonTextForLastItem:
'Check this change set for methods that do not have comments' translated.

	aMenu add: 'check for uncommented classes' translated action: #checkForUncommentedClasses.
	aMenu balloonTextForLastItem:
'Check for classes with code in this changeset which lack class comments' translated.

	Utilities authorInitialsPerSe isEmptyOrNil ifFalse:
		[aMenu add: 'check for other authors' translated action: #checkForAlienAuthorship.
		aMenu balloonTextForLastItem:
('Check this change set for methods whose current authoring stamp does not start with "{1}"' translated format: {Utilities authorInitials}).

	aMenu add: 'check for any other authors' translated action: #checkForAnyAlienAuthorship.
	aMenu balloonTextForLastItem:
('Check this change set for methods any of whose authoring stamps do not start with "{1}"' translated format: {Utilities authorInitials})].

	aMenu add: 'check for uncategorized methods' translated action: #checkForUnclassifiedMethods.
	aMenu balloonTextForLastItem:
'Check to see if any methods in the selected change set have not yet been assigned to a category.  If any are found, open a browser on them.' translated.
	aMenu addLine.

	aMenu add: 'inspect change set' translated action: #inspectChangeSet.
	aMenu balloonTextForLastItem: 
'Open an inspector on this change set. (There are some details in a change set which you don''t see in a change sorter.)' translated.

	aMenu add: 'update' translated action: #update.
	aMenu balloonTextForLastItem: 
'Update the display for this change set.  (This is done automatically when you activate this window, so is seldom needed.)' translated.

	aMenu add: 'go to change set''s project' translated action: #goToChangeSetsProject.
	aMenu balloonTextForLastItem: 
'If this change set is currently associated with a Project, go to that project right now.' translated.

	self changeSetMenuForPromote: aMenu.

	aMenu add: 'trim history' translated action: #trimHistory.
	aMenu balloonTextForLastItem: 
' Drops any methods added and then removed, as well as renaming and reorganization of newly-added classes.  NOTE: can cause confusion if later filed in over an earlier version of these changes' translated.

	self changeSetMenuForDropInClassCats: aMenu.
	
	aMenu add: 'clear this change set' translated action: #clearChangeSet.
	aMenu balloonTextForLastItem: 
'Reset this change set to a pristine state where it holds no information. CAUTION: this is destructive and irreversible!' translated.
	aMenu add: 'expunge uniclasses' translated action: #expungeUniclasses.
	aMenu balloonTextForLastItem:
'Remove from the change set all memory of uniclasses, e.g. classes added on behalf of etoys, fabrik, etc., whose classnames end with a digit.' translated.

	aMenu add: 'uninstall this change set' translated action: #uninstallChangeSet.
	aMenu balloonTextForLastItem: 
'Attempt to uninstall this change set. CAUTION: this may not work completely and is irreversible!' translated.

	self changeSetMenuForModification: aMenu.
- 
- 	aMenu addLine.
- 
- 	aMenu add: 'more...' translated action: #offerUnshiftedChangeSetMenu.
- 	aMenu balloonTextForLastItem: 
- 'Takes you back to the primary change-set menu.' translated.
- 
+ 	
	^ aMenu

ChangeSorter>>shiftedChangeSetMore: {changeSet menu} · ct 4/5/2022 20:11
+ shiftedChangeSetMore: aMenu
+ 	<changeSetMenuShifted: false>
+ 	<menuPriority: 1000>
+ 	^ aMenu addTranslatedList: #(
+ 			-
+ 			('more...'				offerShiftedChangeSetMenu));
+ 		yourself

ChangeSorter>>unshiftedChangeSetMenu: {changeSet menu} · ct 4/5/2022 19:24 (changed)
unshiftedChangeSetMenu: aMenu
	"Set up aMenu to hold commands for the change-set-list pane.  This could be for a single or double changeSorter"
	<changeSetMenuShifted: false>
	Smalltalk isMorphic
		ifTrue:
			[aMenu title: 'Change Set' translated]
		ifFalse:
			[aMenu title: 'Change Set:
' translated , myChangeSet name].
	aMenu addStayUpItemSpecial.

	aMenu add: 'make changes go to me (m)' translated action: #newCurrent.
	aMenu addLine.
	aMenu add: 'new change set... (n)' translated action: #newSet.
	aMenu add: 'find...(f)' translated action: #findCngSet.
	aMenu add: 'select change set...' translated action: #chooseCngSet.
	aMenu addLine.
	aMenu add: 'rename change set (r)' translated action: #rename.
	aMenu add: 'file out (o)' translated action: #fileOut.
	aMenu add: 'mail to list' translated action: #mailOut.
	aMenu add: 'browse methods (b)' translated action: #browseChangeSet.
	aMenu add: 'browse change set (B)' translated action: #openChangeSetBrowser.
	aMenu addLine.
	parent
		ifNotNil: 
			[aMenu add: 'copy all to other side (c)' translated action: #copyAllToOther.
			aMenu add: 'submerge into other side' translated action: #submergeIntoOtherSide.
			aMenu add: 'subtract other side (-)' translated action: #subtractOtherSide.
			aMenu addLine].
	myChangeSet hasPreamble
		ifTrue: 
			[aMenu add: 'edit preamble... (p)' translated action: #editPreamble.
			aMenu add: 'remove preamble' translated action: #removePreamble]
		ifFalse: [aMenu add: 'add preamble... (p)' translated action: #editPreamble].
	myChangeSet hasPostscript
		ifTrue: 
			[aMenu add: 'edit postscript...' translated action: #editPostscript.
			aMenu add: 'remove postscript' translated action: #removePostscript]
		ifFalse: [aMenu add: 'add postscript...' translated action: #editPostscript].
	aMenu addLine.

	aMenu add: 'destroy change set (x)' translated action: #remove.
- 	aMenu addLine.
- 	aMenu add: 'more...' translated action: #offerShiftedChangeSetMenu.
	^ aMenu

ChangeSorter>>unshiftedChangeSetMore: {changeSet menu} · ct 4/5/2022 20:25
+ unshiftedChangeSetMore: aMenu
+ 	<changeSetMenuShifted: true>
+ 	<menuPriority: 1000>
+ 	^ aMenu addTranslatedList: #(
+ 			-
+ 			('more...'				offerUnshiftedChangeSetMenu	'Takes you back to the primary change-set menu.'));
+ 		yourself


["cleanUpChangeSorterSetMenu.cs.gz"]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanUpChangeSorterSetMenu.cs.gz
Type: application/octet-stream
Size: 2205 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220405/153a6531/attachment.obj>


More information about the Squeak-dev mailing list