[squeak-dev] The Trunk: PreferenceBrowser-mt.137.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 21 11:43:52 UTC 2022


Marcel Taeumel uploaded a new version of PreferenceBrowser to project The Trunk:
http://source.squeak.org/trunk/PreferenceBrowser-mt.137.mcz

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

Name: PreferenceBrowser-mt.137
Author: mt
Time: 21 March 2022, 12:43:50.34283 pm
UUID: 68ab245a-8abb-2743-ada2-8cf5018e43eb
Ancestors: PreferenceBrowser-mt.136

In the preference wizard, avoid polling internet availability right away but wait for the user to explicitely show interest in installing any extra packages. So, any platform firewall tools will only complain *after* the user clicked on the "Yes, install" button.

=============== Diff against PreferenceBrowser-mt.136 ===============

Item was changed:
  ----- Method: PreferenceWizardMorph>>checkInternetOn: (in category 'updating') -----
  checkInternetOn: button
  
  	self isInWorld ifFalse: [^ self].
  	(self hasProperty: #checkInternet) ifFalse: [^ self].
  	
  	self hasInternetConnection
  		ifFalse: [button enabled: false; label: 'Please check your internet connection...' translated]
  		ifTrue: [^ self hasSecureInternetConnection
  			ifFalse: [button enabled: false; label: 'Secure https not available, possible virtual machine issue' translated]
+ 			ifTrue: [button enabled: true; label: (button valueOfProperty: #label)]].
- 			ifTrue: [button enabled: true; label: 'Yes, install selected packages.' translated]].
  
  	(self future: 1000) checkInternetOn: button.!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage99ExtraPackages (in category 'initialization - pages') -----
  initializePage99ExtraPackages
  	"Let the user install extra packages."
  
  	| currentPage packagesList installButton |
  	currentPage := self createPage.
  	currentPage
  		cellPositioning: #topCenter;
  		addMorphBack: self createHorizontalSpacer;
  		addMorphBack: ((self createLabel: 'Do you want to install extra packages?' color: Color white)
  			hResizing: #shrinkWrap;
  			yourself);
  		addMorphBack: ((self createLabel: 'Note that the installation process requires a network connection with Internet access and might take several minutes.' color: (Color gray: 0.9))
  			hResizing: #rigid;
  			vResizing: #shrinkWrap;
  			width: (self defaultFont widthOf: $x) * 55;
  			yourself).
  	
  	currentPage submorphs last text addAttribute: TextAlignment centered.
  	currentPage submorphs last layoutChanged.
  	
  	currentPage addMorphBack: (self createVerticalSpace height: self layoutInset).
  	
  	packagesList := self createScrollPane.
  	packagesList
  		width: (self defaultFont widthOf: $x) * 40;
  		hResizing: #rigid;
  		vResizing: #spaceFill.
  
  	packagesList scroller firstSubmorph addAllMorphsBack: {
  		self createCheckbox: 'Latest system updates' translated for: #InstallLatestUpdates help: 'Install the latest patches for ' translated, SystemVersion current version.
  		self createCheckbox: 'Refactoring support in code browsers' translated for: #InstallRefactoringTools help: 'Refactoring is a process of re-writing or re-organizing text or code. The purpose of a refactor is to make the code or text more understandable and readable while exactly preserving its meaning and behavior' translated.
  		self createCheckbox: 'Autocomplete in code editors' translated for: #InstallAutoComplete help: 'Package that provides interactive, context-sensitive auto-completion for Squeak' translated.
  		self createCheckbox: 'Git support and browser' translated for: #InstallGitInfrastructure help: 'From the Git Browser, you can create new commits, synchronize with remote repositories (fetch, pull, push), manage and merge branches, switch between them, and compare different versions' translated.
  		self createCheckbox: 'Foreign function interface (FFI)' translated for: #InstallFFI help: 'FFI, the Squeak Foreign Function Interface, is used to call functions located in shared libraries that are not part of the Squeak VM nor its plugins' translated.
  		self createCheckbox: 'Access OS functions' translated for: #InstallOSProcess help: 'OSProcess provides access to operating system functions, including pipes and child process creation' translated.
  		self createCheckbox: 'Integrate Squeak''s mailing lists' translated for: #InstallSqueakInboxTalk help: 'Through Squeak Inbox Talk, you can engage with our community from within Squeak using tools that integrate our mailing lists such as squeak-dev and vm-dev' translated.
  	}.
  		
  	currentPage addMorphBack: packagesList.
  
  	currentPage addMorphBack: ((self createLabel: 'Find more on www.squeak.org/projects' color: (Color gray: 0.9))
  		hResizing: #shrinkWrap; yourself).
  	
+ 	installButton := self createButton
+ 		action: #installExtraPackagesVia:;
+ 		label: 'Yes, install selected packages.' translated;
+ 		yourself.
+ 	installButton
+ 		setProperty: #label toValue: installButton label;
+ 		arguments: {installButton}.
+ 	
- 	installButton := (self createButton action: #installExtraPackages).
  	currentPage addMorphBack: installButton.
  	currentPage addMorphBack: (self createButton action: #showSqueak; label: 'No, maybe later.' translated).
  	
- 	self setProperty: #checkInternet toValue: true.
- 	self checkInternetOn: installButton.
- 	
  	^ currentPage!

Item was added:
+ ----- Method: PreferenceWizardMorph>>installExtraPackagesVia: (in category 'actions') -----
+ installExtraPackagesVia: installButton
+ 	"The user requested to install extra packages. Now we can check whether we have access to the internet. If so, install right away. If not, we start polling until it becomes available. Then the user can click again on that button. NOTE THAT we do this extra step so that users do not get annoyed by any platform's firewall tools complaining -- even if users do not want to install extra packages in the first place."
+ 	
+ 	installButton
+ 		action: #installExtraPackages;
+ 		arguments: #().
+ 
+ 	self setProperty: #checkInternet toValue: true.
+ 	self checkInternetOn: installButton.
+ 
+ 	installButton enabled ifTrue: [installButton performAction].!



More information about the Squeak-dev mailing list