The Inbox: PreferenceBrowser-ct.163.mcz

[email protected] Fri, 19 Jun 2026 18:55:34 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
Christoph Thiede uploaded a new version of PreferenceBrowser to project The Inbox:
http://source.squeak.org/inbox/PreferenceBrowser-ct.163.mcz

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

Name: PreferenceBrowser-ct.163
Author: ct
Time: 19 June 2026, 8:55:33.86724 pm
UUID: 15a6daf0-6bbf-418d-a4a3-d4530066e5ba
Ancestors: PreferenceBrowser-codefrau.159

Adds a menu item to copy a preference reference (sic) to the clipboard. Requires System-ct.1517.

=============== Diff against PreferenceBrowser-codefrau.159 ===============

Item was changed:
  ----- Method: PBPreferenceView>>offerPreferenceNameMenu: (in category 'user interface') -----
  offerPreferenceNameMenu: aPreferenceBrowser
  	"the user clicked on a preference name -- put up a menu"
  
  	| aMenu readableName |
  	readableName := self preference readableName.
  	aMenu := MenuMorph new 
  		defaultTarget: self preference;
  		addTitle: readableName.
  
  	(Preferences okayToChangeProjectLocalnessOf: self preference name) ifTrue:
  		[aMenu
  			addUpdating: #isProjectLocalString target: self preference action: #toggleProjectLocalness;
  			balloonTextForLastItem: 'Some preferences are best applied uniformly to all projects, and others are best set by each individual project.  If this item is checked, then this preference will be printed in bold and will have a separate value for each project' translated].
  
  	aMenu
  		addLine;
  		add: 'browse senders (n)' translated
  			action: #browseSenders;
  		balloonTextForLastItem: ('This will open a method-list browser on all methods that the send the preference "{1}".' translated format: {readableName}).
  	self preference provider ifNotNil: [
  		aMenu
  			add: 'browse implementation (m)' translated
  				action: #browse;
  			balloonTextForLastItem: ('This will open a browser on the method that stores the preference "{1}".' translated format: {readableName})].
  	aMenu
  		add: 'inspect preference (i)' translated
  			action: #inspect;
  		balloonTextForLastItem: ('This will open an inspector on the preference "{1}".' translated format: {readableName}).
  	aMenu
  		addLine;
  		add: 'show category (b)' translated
  			target: aPreferenceBrowser
  			selector: #findCategoryFromPreference:
  			argument: self preference;
  		balloonTextForLastItem: 'Allows you to find out which category, or categories, this preference belongs to.' translated.
  
  	Smalltalk isMorphic ifTrue:
  		[aMenu
  			add: 'hand me a button for this preference' translated
  				target: self
  				selector: #tearOffButton;
  			balloonTextForLastItem: 'Will give you a button that governs this preference, which you may deposit wherever you wish' translated].
  
  	aMenu
  		add: 'copy name to clipboard (c)' translated
  			action: #copyName;
  		balloonTextForLastItem: 'Copy the name of the preference to the text clipboard, so that you can paste into code somewhere' translated.
  	aMenu
  		add: 'copy code to clipboard (C)' translated
  			action: #copyCode;
  		balloonTextForLastItem: 'Copy the code to access the current preference value to the clipboard, so that you can paste into code somewhere' translated.
+ 	aMenu
+ 		add: 'copy reference to clipboard' translated
+ 			action: #copyReference;
+ 		balloonTextForLastItem: 'Copy the code to reference the current preference object to the clipboard' translated.
  
  	aMenu popUpInWorld!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]