Default Package Loader (Re: [ANN] CategoricalSMLoader on SqueakMap)

goran.hultgren at bluefish.se goran.hultgren at bluefish.se
Mon Dec 9 12:40:51 UTC 2002


"PhiHo Hoang" <phiho.hoang at rogers.com> wrote:
> > As ned said, I'm not sure what you mean. In the current version, you'll
> > get a open menu item CPackage Loader which opens the simple version,
> > currently. If you want that menu item to open the Fancy Window one, you'll
> > have to tweak the #open method.
> 
>     CPackage Loader is only available after it is installed.
> 
>     Can we have a truly mini, tiny loader
>     that will install any of the full loaders.

Well, personally I agree with Daniel on this, no need to confuse the
users here. And if you want a "minimal loader" - here you go:

| ps p |
Cursor wait showWhile: [
	ps _ ((SMSqueakMap default) loadUpdates;
			cardsByName) select: [:c |
				c isUpgradeableAndOld or: [c isInstallableAndNotInstalled]].
	p _ (SelectionMenu labelList: (ps collect: [:x | x name]) selections:
ps)
			startUpWithCaption: 'Select package to install'..
	p ifNotNil: [SMSqueakMap default installPackageWithId: p id]
]

:-)

The above snippet will update the map, show a menu with all
autoinstallable packages that have a new version available or are not
installed yet, sorted by name. If one is selected it is installed.

Found a bug when hacking this btw... The wonderfully named but sofar not
used message: #upgradeableAndOldOrInstallableAndNotInstalledPackages has
an "and" instead of an "or".

regards, Göran

PS. I don't really see the need for this kind of "minimal loader". Just
use the SM API then - you can't get more minimal than that.




More information about the Squeak-dev mailing list