[squeak-dev] The Inbox: Morphic-ct.1958.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 1 16:16:32 UTC 2022


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1958.mcz

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

Name: Morphic-ct.1958
Author: ct
Time: 1 April 2022, 6:16:24.044058 pm
UUID: dbc1bb59-95b0-bf46-9cc5-d6c6a58bc1c4
Ancestors: Morphic-ul.1956

Proposal: Add "select change set..." item to the new changes menu in the docking bar.

=============== Diff against Morphic-ul.1956 ===============

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listChangesOn: (in category 'submenu - changes') -----
  listChangesOn: menu
  
  	| fetchChangesBlock |
+ 	menu addItem: [:item | item
+ 		contents: 'Select change set...' translated;
+ 		help: 'Switch to another change set or create a new one' translated;
+ 		target: self;
+ 		selector: #selectChangeSet;
+ 		arguments: #()].
  	{
  		'Browse current change set' translated. #browseChangeSet. nil.
  		'Browse changed methods' translated. #browseChangedMethods. nil.
  		nil. nil. nil.
  		'Simple Change Sorter' translated.	#browseChanges. ChangeSorter.
  		'Dual Change Sorter' translated. #browseChangesDual. DualChangeSorter.
  		nil. nil. nil.
  	} groupsDo: [:label :selector :modelClass |
  		label ifNil: [menu addLine] ifNotNil: [
  			menu addItem: [:item |
  				item
  					contents: label;
  					icon: ((modelClass ifNotNil: [self colorIcon: modelClass basicNew windowColorToUse])
  						ifNil: [MenuIcons blankIcon]);
  					target: self;
  					selector: selector]] ].
  
  	fetchChangesBlock := [ | latestMethodChanges latestClassChanges updateBlock |
  		self flag: #concurrency. "mt: Is this safe enough given the current update frequency of change sets and when this code is executed?"
  		latestMethodChanges := (Array streamContents: [:s |
  			ChangeSet current changedMethodsDo: [:method :changeType :dateAndTime :category |
  				s nextPut: { dateAndTime. method. changeType. category }]])
  				sorted: [:a :b | a first >= b first].
  		latestClassChanges := (Array streamContents: [:s |
  			ChangeSet current changedClassesDo: [:class :changeTypes :dateAndTime :category |
  				"We are not interested in classes whose method's did only change."
  				changeTypes ifNotEmpty: [s nextPut: { dateAndTime. class. changeTypes. category }]]])
  				sorted: [:a :b | a first >= b first].
  		updateBlock := [self listMethodChanges: latestMethodChanges andClassChanges: latestClassChanges on: menu].
  		Project current uiProcess == Processor activeProcess
  			ifTrue: updateBlock
  			ifFalse: [Project current addDeferredUIMessage: [
  				menu isInWorld ifTrue: [menu lastItem delete. updateBlock value]] ]].
  
  	ChangeSet current numberOfChanges <= 30
  		ifTrue: fetchChangesBlock ifFalse: [
  			"We have too much data to process. Do it in the background to keep the UI responsive."
  			menu add: '... fetching changes ...' translated action: nil.
  			menu lastItem isEnabled: false.
  			fetchChangesBlock forkAt: Processor userBackgroundPriority].!

Item was added:
+ ----- Method: TheWorldMainDockingBar>>selectChangeSet (in category 'submenu - changes') -----
+ selectChangeSet
+ 
+ 	| changeSets choice set |
+ 	changeSets := ChangeSet allChangeSetNames reverse.
+ 	choice := Project uiManager chooseFromOrAddTo: changeSets lines: #() title: 'Select or add change set...' translated.
+ 	choice ifNil: [^ self].
+ 	set := ChangeSet assuredChangeSetNamed: choice.
+ 	set ifNotNil: [ChangeSet newChanges: set].!



More information about the Squeak-dev mailing list