Monday, November 08, 2010 at 12:02 AM.

system.verbs.builtins.Frontier.tools.commands.updateFrontTool

on updateFrontTool (adr = window.frontmost (), flconfirm = true) {
	<<Changes
		<<12/17/07; 12:55:59 PM by DW
			<<Maintain system.temp.ctNewParts. Something with a UI that wants to log this number can do so then delete it or zero it. When it's non-zero, log it again, and zero it or delete it. 
		<<5/6/07; 12:50:29 PM by DW
			<<Pass flconfirm to Frontier.tools.data.updateCommandScript so it can disable dialogs if being called from a background script.
		<<4/22/07; 2:32:34 PM by DW
			<<Take an optional param, flconfirm, default true. If false, the update takes place with no dialogs.
		<<4/20/07; 11:59:28 AM by DW
			<<Take an optional parameter, an address in the database you want to update. Allows this script to update tools whose windows aren't open, for example the Get Latest Code command in the NewsRiver menu.
		<<4/13/07; 4:37:44 PM by DW
			<<Created.
	local (flguestdatabase);
	try {
		flguestdatabase = table.inGuestDatabase (adr)}
	else {
		scripterror ("Can't update because the front window is not a Tool.")};
	if flguestdatabase {
		local (x = string.parseAddress (adr), f = x [1], fname = file.filefrompath (f), flupdate = true);
		if flconfirm {
			flupdate = dialog.confirm ("Get the latest \"" + fname + "\" code?")};
		if flupdate {
			local (rootname = string.nthfield (fname, ".", 1));
			local (adrtable = @user.rootUpdates.servers.[rootname]);
			if not defined (adrtable^) {
				new (tabletype, adrtable)};
			if not defined (adrtable^.rssUrl) {
				adrtable^.rssUrl = "http://bits.codecasting.org/" + fname + "/rss.xml"};
			if not defined (adrtable^.lastupdate) {
				adrtable^.lastupdate = date (0)};
			if not defined (adrtable^.server) { //really shouldn't need to set this
				adrtable^.server = ""};
			local (ctparts = 0);
			rootupdates.update (adr, true, @ctparts);
			if flconfirm {
				dialog.alert (ctparts + " new or updated parts.")};
			bundle { //12/17/07 by DW
				if not defined (system.temp.ctNewParts) {
					system.temp.ctNewParts = 0};
				system.temp.ctNewParts = system.temp.ctNewParts + ctparts}}}
	else {
		Frontier.tools.data.updateCommandScript (flconfirm)}}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.