|
From: creedon <icr...@us...> - 2005-10-02 20:59:36
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13698 Modified Files: open Log Message: added support for some Frontier File/Edit menu items to call scripts added support for open recent menu Index: open =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/commands/open,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** open 26 Mar 2005 19:42:54 -0000 1.1.1.1 --- open 1 Oct 2005 17:34:58 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.commands.open ! on open (f=nil) { ÇChanges: Ç12/2/01; 7:05:42 PM by JES Çif user.radio.settings.flExpired is defined, and true, open the serial number page. ÇArchive Ç07/03/01; 8:09:16 PM by JES ÇMigrated from builtins.pike.commands.open. Split out opml/outline file functionality into Frontier.tools.data.windowTypes.outlinerFile.open. Ç05/15/01; 1:33:09 AM by JES ÇFixed a bug where irrelevant whitespace would be preserved between the <?xml?> tag and the <opml> tag. If opening a .opml file, which has no contents, treat it as an empty OPML document, instead of as an empty text file. Fixed a bug where minimally represented OPML files (files with fewer than 200 characters) could not be opened. Ç03/5/01; 2:15:19 PM by JES ÇWhen opening OPML documents, set the window's timeCreated, so that it will be preserved in the dateCreated head element of the saved OPML. Ç02/21/01; 2:13:59 AM by JES ÇRecord the type and creator code when opening files on Macs. Record the line-ending format. Ç02/16/01; 1:36:30 PM by JES ÇMake sure that the window's modification time is the same as its table's lastOpened time. Prevents extraneous save-confirmation dialogs. Ç01/23/01; 7:40:05 PM by JES ÇSupport opml documents with unix line endings. Changed logic for determining if a file is an opml document so that Radio can open files that have xml headers, style sheet declarations, or comments before the <outlineDocument> element. Store the headers and comments so they can be included when the file is saved. Ç12/31/00; 5:30:33 PM by JES ÇOn Macs, convert opml to Mac text before converting to an outline. Ç12/19/00; 10:36:41 PM by JES ÇOn Macs, for text files whose extension corresponds to the type of an object database object, don't open the file in an outline. Makes it possible to import objects downloaded from apache servers which aren't configured to serve Frontier files with the correct mime type, or files copied from Windows computers. Ç12/15/00; 7:29:24 PM by PBS ÇOpen plain text files in an outline. Ç11/30/00; 12:14:58 AM by JES ÇDereference callback addresses in a try block in case a tool's odb is not opened Ç09/30/00; 12:47:45 PM by PBS ÇCall callbacks. Ç09/26/00; 3:46:09 PM by PBS ÇAdded explicit file type check for OPML in case the path is an 8.3 path or has a random suffix. Ç09/16/00; 3:35:19 PM by PBS ÇHandle .opml as well as .xml. Ç09/15/00; 1:56:44 PM by PBS ÇAllow an XML file of any type to be opened in the outliner. When it gets saved later, it's saved as raw XML, not as an outlineDocument. Ç07/23/00; 8:32:39 PM by PBS ÇCreated. Open a file. if defined (user.radio.settings.flExpired) { if user.radio.settings.flExpired { radio.menuCommands.openPage (radio.data.systemurls.serialnumber); return (true)}}; if f == nil { if not (file.getFileDialog ("Open a file:", @f, 0)) { return (false)}}; //nothing was opened on runCallbacks (adrCallback) { //call callbacks if defined (adrCallback^) { local (flConsumed = false); local (adrScript); for adrScript in adrCallback { try { //11/30/00 JES while typeOf (adrScript^) == addressType { //follow addresses adrScript = adrScript^}; flConsumed = adrScript^ (f)}; //file is parameter if flConsumed { return (true)}}}; return (false)}; if runCallbacks (@user.tools.commandCallbacks.open) { return (true)}; if system.environment.isRadio { if defined (user.pike.commandCallbacks) { if runCallbacks (@user.pike.commandCallbacks.open) { return (true)}}}; bundle { //look for a windowType that handles this command on runTypes (adrTypes) { local (adrType, flConsumed=false); for adrType in adrTypes { try { while typeOf (adrType^) == addressType { adrType = adrType^}; if defined (adrType^.open) { try { flConsumed = adrType^.open (f)}; if flConsumed { return (true)}}}}; return (false)}; if runTypes (@user.tools.windowTypes) { return (true)}; if runTypes (@Frontier.tools.data.windowTypes) { return (true)}}; fileMenu.open (f); return (true)}; bundle { //debugging open ()} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.commands.open ! on open (f = nil) { ÇChanges Ç9/24/05; 7:52:23 AM by TAC Çadded support for open recent menu Çreplicate what the kernel used to do for Frontier which was to scan the Frontier.clickers table getting the types of files that could be opened Çthe kernel now calls this script for Frontier when the Open menu item of the File menu is selected Ç2001 Ç12/2/01; 7:05:42 PM by JES Çif user.radio.settings.flExpired is defined, and true, open the serial number page. Ç07/03/01; 8:09:16 PM by JES ÇMigrated from builtins.pike.commands.open. Split out opml/outline file functionality into Frontier.tools.data.windowTypes.outlinerFile.open. Ç05/15/01; 1:33:09 AM by JES ÇFixed a bug where irrelevant whitespace would be preserved between the <?xml?> tag and the <opml> tag. If opening a .opml file, which has no contents, treat it as an empty OPML document, instead of as an empty text file. Fixed a bug where minimally represented OPML files (files with fewer than 200 characters) could not be opened. Ç03/5/01; 2:15:19 PM by JES ÇWhen opening OPML documents, set the window's timeCreated, so that it will be preserved in the dateCreated head element of the saved OPML. Ç02/21/01; 2:13:59 AM by JES ÇRecord the type and creator code when opening files on Macs. Record the line-ending format. Ç02/16/01; 1:36:30 PM by JES ÇMake sure that the window's modification time is the same as its table's lastOpened time. Prevents extraneous save-confirmation dialogs. Ç01/23/01; 7:40:05 PM by JES ÇSupport opml documents with unix line endings. Changed logic for determining if a file is an opml document so that Radio can open files that have xml headers, style sheet declarations, or comments before the <outlineDocument> element. Store the headers and comments so they can be included when the file is saved. Ç2000 Ç12/31/00; 5:30:33 PM by JES ÇOn Macs, convert opml to Mac text before converting to an outline. Ç12/19/00; 10:36:41 PM by JES ÇOn Macs, for text files whose extension corresponds to the type of an object database object, don't open the file in an outline. Makes it possible to import objects downloaded from apache servers which aren't configured to serve Frontier files with the correct mime type, or files copied from Windows computers. Ç12/15/00; 7:29:24 PM by PBS ÇOpen plain text files in an outline. Ç11/30/00; 12:14:58 AM by JES ÇDereference callback addresses in a try block in case a tool's odb is not opened Ç09/30/00; 12:47:45 PM by PBS ÇCall callbacks. Ç09/26/00; 3:46:09 PM by PBS ÇAdded explicit file type check for OPML in case the path is an 8.3 path or has a random suffix. Ç09/16/00; 3:35:19 PM by PBS ÇHandle .opml as well as .xml. Ç09/15/00; 1:56:44 PM by PBS ÇAllow an XML file of any type to be opened in the outliner. When it gets saved later, it's saved as raw XML, not as an outlineDocument. Ç07/23/00; 8:32:39 PM by PBS ÇCreated. Open a file. local (flOptionKey = kb.optionKey ()); if defined (user.radio.settings.flExpired) { if user.radio.settings.flExpired { radio.menuCommands.openPage (radio.data.systemurls.serialnumber); return (true)}}; if f == nil { local (typeList = 0); if not (system.environment.isRadio) { if not (flOptionKey) { local (adr); typeList = {'TABL'}; for adr in @Frontier.clickers { typeList = typeList + string.mid (nameOf (adr^), 5, 4)}}}; if not (file.getFileDialog ("Open a file:", @f, typeList)) { return (false)}}; //nothing was opened bundle { // user.prefs.openRecentMenu local (adr, adrFileNameTable, i, fileNamesList = {}, newFileName); if sizeOf (user.prefs.openRecentMenu.items) == user.prefs.openRecentMenu.maxNumberOfItems { delete (@user.prefs.openRecentMenu.items [1])}; for i = sizeOf (user.prefs.openRecentMenu.items) downTo 1 { adr = @user.prefs.openRecentMenu.items [i]; if adr^ == f { delete (@user.prefs.openRecentMenu.items [i]); break}}; xml.addValue (@user.prefs.openRecentMenu.items, file.fileFromPath (f), f); bundle { // duplicate file names local (adr, adrFileNameTable, duplicateFileNameTable, s); new (tableType, @duplicateFileNameTable); for i = 1 to sizeOf (user.prefs.openRecentMenu.items) { adr = @user.prefs.openRecentMenu.items [i]; s = file.fileFromPath (adr^); if not (defined (duplicateFileNameTable.[s])) { new (tableType, @duplicateFileNameTable.[s])}; duplicateFileNameTable.[s].[adr] = nil}; for adrFileNameTable in @duplicateFileNameTable { if sizeOf (adrFileNameTable^) == 1 { continue}; for adr in adrFileNameTable { s = nameOf (adr^); adr = address (s); s = string.nthField (nameOf (adr^), '\t', 1) + "\t" + file.fileFromPath (adr^) + " Ñ " + string.popTrailing (file.fileFromPath (file.folderFromPath (adr^)), file.getPathChar ()); table.rename (adr, s)}}}; fileMenu.save ()}; on runCallbacks (adrCallback) { //call callbacks if defined (adrCallback^) { local (flConsumed = false); local (adrScript); for adrScript in adrCallback { try { //11/30/00 JES while typeOf (adrScript^) == addressType { //follow addresses adrScript = adrScript^}; flConsumed = adrScript^ (f)}; //file is parameter if flConsumed { return (true)}}}; return (false)}; if runCallbacks (@user.tools.commandCallbacks.open) { return (true)}; if system.environment.isRadio { if defined (user.pike.commandCallbacks) { if runCallbacks (@user.pike.commandCallbacks.open) { return (true)}}}; bundle { //look for a windowType that handles this command on runTypes (adrTypes) { local (adrType, flConsumed=false); for adrType in adrTypes { try { while typeOf (adrType^) == addressType { adrType = adrType^}; if defined (adrType^.open) { try { flConsumed = adrType^.open (f)}; if flConsumed { return (true)}}}}; return (false)}; if runTypes (@user.tools.windowTypes) { return (true)}; if runTypes (@Frontier.tools.data.windowTypes) { return (true)}}; fileMenu.open (f); return (true)}; Çbundle // testing Çopen () \ No newline at end of file |