|
From: creedon <icr...@us...> - 2005-09-30 22:45:55
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/DuckTape In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16331 Modified Files: Tag: commercial_suite_project-branch initializeNewTerminologyTable Log Message: changed adrDictionaryTable to adrTerminologyTable Index: initializeNewTerminologyTable =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/suites/DuckTape/Attic/initializeNewTerminologyTable,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** initializeNewTerminologyTable 16 Sep 2005 02:52:31 -0000 1.1.2.1 --- initializeNewTerminologyTable 30 Sep 2005 21:24:29 -0000 1.1.2.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:suites.DuckTape.initializeNewTerminologyTable ! on initializeNewTerminologyTable (adrPath, adrTerminologyTable, adrTerminologyStorage = @system.verbs.apps, fileTypesList = DuckTape.data.appTypes, adrUserAfterAppInfoInitializedCallbacks = @user.DuckTape.callbacks.afterAppInfoInitialized, getFileDialogPrompt = "Select the application from which to create a new apps table item...", newTerminologyNamePrompt = "New apps table item name:", replaceTerminologyPrompt = "An apps table item with the name of \"[[terminologyname]]\" already exists. Are you sure you want to replace it?") { ÇChanges Ç9/5/05; 4:16:17 PM by TAC Çcreated if kb.shiftKey () { fileTypesList = 0}; if file.getFileDialog (getFileDialogPrompt, adrPath, fileTypesList) { if not (defined (temp.DuckTape)) { new (tableType, @temp.DuckTape)}; bundle { // terminology name local (s = file.fileFromPath (adrPath^)); s = string.replaceAll (s, " ", ""); s = string.popTrailing (s, file.getPathChar ()); // might be an Mac OS X application package if s endsWith ".app" { // might be a Mac OS X application name s = string.popSuffix (s, '.')}; if s endsWith ".osax" { // might be an osax s = string.popSuffix (s, '.')}; temp.DuckTape.terminologyName = s}; if dialog.ask (newTerminologyNamePrompt, @temp.DuckTape.terminologyName) { adrTerminologyTable^ = @adrTerminologyStorage^.[temp.DuckTape.terminologyName]; try { // notify if conflict with other than adrTerminologyStorage table, an improvement on this would be to continue to ask the user for new names until they cancel and not make them have to start over. local (adr = address (temp.DuckTape.terminologyName)); if adr != adrTerminologyTable^ { if defined (adr^) { if dialog.twoWay ("The name \"" + temp.DuckTape.terminologyName + "\" conflicts with " + string.popFileFromAddress (adr) + ". Do you want to continue?", "No", "Yes") { return (false)}}}}; if defined (adrTerminologyTable^^) { local (s = replaceTerminologyPrompt); s = string.replace (s, "[[terminologyname]]", temp.DuckTape.terminologyName); if dialog.twoWay (s, "No", "Yes") { return (false)}}; on replaceAll (searchString, replaceString) { local (numReplaced, savedParams); table.assign (@savedParams, user.prefs.search); // save off user.prefs.search.flatSearch = false; user.prefs.search.frontWindowOnly = false; user.prefs.search.regularexpression = false; user.prefs.search.wholeWords = false; user.prefs.search.searchFor = searchString; user.prefs.search.replaceWith = replaceString; search.reset (); numReplaced = search.replaceAll (); table.assign (@user.prefs.search, savedParams); // restore originals return (numReplaced)}; new (tableType, adrTerminologyTable^); if user.DuckTape.flUseEventInformationTable { new (tableType, @adrTerminologyTable^^.[user.DuckTape.eventInformationTableName])}; table.copyContents (@DuckTape.data.newTable, adrTerminologyTable^); local (adrAppInfo = @adrTerminologyTable^^.appInfo); bundle { // add appInfo table items local (creator = string4 (file.creator (adrPath^))); adrAppInfo^.creator = creator; adrAppInfo^.id = creator; adrAppInfo^.name = temp.DuckTape.terminologyName; adrAppInfo^.path = adrPath^; ÇadrAppInfo^.sharedMenus = dialog.yesNo ("Does " + temp.DuckTape.terminologyName + " support Menu Sharing?") adrAppInfo^.type = string4 (file.type (adrPath^))}; DuckTape.callbackLoop (adrUserAfterAppInfoInitializedCallbacks, adrTerminologyTable^); adrTerminologyTable^^.id = adrAppInfo^.id; bundle { // set up new table target.set (adrTerminologyTable^); replaceAll ("[[sample]]", temp.DuckTape.terminologyName); replaceAll ("[[sample.id]]", DuckTape.appIdStyle (temp.DuckTape.terminologyName, user.DuckTape.appIdStyle)); target.clear ()}; fileMenu.save (); return (true)}}; return (false)}; Çif adrAppInfo^.sharedMenus // 8/7/05; 12:32:34 PM by TAC - old code? Çlocal (adrMenuBar = @system.menus.sharedMenus.[adrAppInfo^.id]) Çif not defined (adrMenuBar^) Çif not dialog.confirm ("Create a new shared menu bar for " + temp.appname + "?") Çreturn Çon linkScript (scriptString) Çlocal (tempscript) Ç Çnew (scriptType, @tempscript) Çtarget.set (@tempscript) ÇeditMenu.setFont (user.prefs.fonts.scriptfont) ÇeditMenu.setFontSize (user.prefs.fonts.scriptfontsize) Çop.setLineText (scriptString) Çop.insert ("Frontier.bringToFront ()", down) Çtarget.clear () Ç Çtarget.set (adrMenuBar) Çmenu.setScript (@tempscript) Ç Çtable.copy (@DuckTapeData.newMenuBar, @system.menus.sharedMenus) Çtable.rename (@system.menus.sharedMenus.newMenuBar, adrAppInfo^.id) Çtarget.set (adrMenuBar) Çop.firstSummit () Çop.expand (infinity) Çop.go (right, 1) Çop.go (down, infinity) Çcursor on "Edit Scripts Table" ÇlinkScript ("edit (@" + temp.appname + ")") Çop.go (up, 1) Çcursor on "Edit Shared Menu" ÇlinkScript ("edit (@" + adrMenuBar + ")") Çop.firstSummit () Çtarget.clear () ÇsomethingCreated = true \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:suites.DuckTape.initializeNewTerminologyTable ! on initializeNewTerminologyTable (adrPath, adrTerminologyTable, adrTerminologyStorage = @system.verbs.apps, fileTypesList = DuckTape.data.appTypes, adrUserAfterAppInfoInitializedCallbacks = @user.DuckTape.callbacks.afterAppInfoInitialized, getFileDialogPrompt = "Select the application from which to create a new apps table item...", newTerminologyNamePrompt = "New apps table item name:", replaceTerminologyPrompt = "An apps table item with the name of \"[[terminologyname]]\" already exists. Are you sure you want to replace it?") { ÇChanges Ç9/17/05; 11:36:06 AM by TAC Çif a path is in adrPath^ then don't ask for a file Ç9/5/05; 4:16:17 PM by TAC Çcreated local (flPathSpecified = true); if kb.shiftKey () { fileTypesList = 0}; if adrPath^ == nil { flPathSpecified = file.getFileDialog (getFileDialogPrompt, adrPath, fileTypesList)}; if flPathSpecified { if not (defined (temp.DuckTape)) { new (tableType, @temp.DuckTape)}; bundle { // terminology name local (s = file.fileFromPath (adrPath^)); s = string.replaceAll (s, " ", ""); s = string.popTrailing (s, file.getPathChar ()); // might be an Mac OS X application package if s endsWith ".app" { // might be a Mac OS X application name s = string.popSuffix (s, '.')}; if s endsWith ".osax" { // might be an osax s = string.popSuffix (s, '.')}; temp.DuckTape.terminologyName = s}; if dialog.ask (newTerminologyNamePrompt, @temp.DuckTape.terminologyName) { adrTerminologyTable^ = @adrTerminologyStorage^.[temp.DuckTape.terminologyName]; try { // notify if conflict with other than adrTerminologyStorage table, an improvement on this would be to continue to ask the user for new names until they cancel and not make them have to start over. local (adr = address (temp.DuckTape.terminologyName)); if adr != adrTerminologyTable^ { if defined (adr^) { if dialog.twoWay ("The name \"" + temp.DuckTape.terminologyName + "\" conflicts with " + string.popFileFromAddress (adr) + ". Do you want to continue?", "No", "Yes") { return (false)}}}}; if defined (adrTerminologyTable^^) { local (s = replaceTerminologyPrompt); s = string.replace (s, "[[terminologyname]]", temp.DuckTape.terminologyName); if dialog.twoWay (s, "No", "Yes") { return (false)}}; on replaceAll (searchString, replaceString) { local (numReplaced, savedParams); table.assign (@savedParams, user.prefs.search); // save off user.prefs.search.flatSearch = false; user.prefs.search.frontWindowOnly = false; user.prefs.search.regularexpression = false; user.prefs.search.wholeWords = false; user.prefs.search.searchFor = searchString; user.prefs.search.replaceWith = replaceString; search.reset (); numReplaced = search.replaceAll (); table.assign (@user.prefs.search, savedParams); // restore originals return (numReplaced)}; new (tableType, adrTerminologyTable^); if user.DuckTape.flUseEventInformationTable { new (tableType, @adrTerminologyTable^^.[user.DuckTape.eventInformationTableName])}; table.copyContents (@DuckTape.data.newTable, adrTerminologyTable^); local (adrAppInfo = @adrTerminologyTable^^.appInfo); bundle { // add appInfo table items local (creator = string4 (file.creator (adrPath^))); adrAppInfo^.creator = creator; adrAppInfo^.id = creator; adrAppInfo^.name = temp.DuckTape.terminologyName; adrAppInfo^.path = adrPath^; ÇadrAppInfo^.sharedMenus = dialog.yesNo ("Does " + temp.DuckTape.terminologyName + " support Menu Sharing?") adrAppInfo^.type = string4 (file.type (adrPath^))}; DuckTape.callbackLoop (adrUserAfterAppInfoInitializedCallbacks, adrTerminologyTable^); adrTerminologyTable^^.id = adrAppInfo^.id; bundle { // set up new table target.set (adrTerminologyTable^); replaceAll ("[[sample]]", temp.DuckTape.terminologyName); replaceAll ("[[sample.id]]", DuckTape.appIdStyle (temp.DuckTape.terminologyName, user.DuckTape.appIdStyle)); target.clear ()}; fileMenu.save (); return (true)}}; return (false)}; Çif adrAppInfo^.sharedMenus // 8/7/05; 12:32:34 PM by TAC - old code? Çlocal (adrMenuBar = @system.menus.sharedMenus.[adrAppInfo^.id]) Çif not defined (adrMenuBar^) Çif not dialog.confirm ("Create a new shared menu bar for " + temp.appname + "?") Çreturn Çon linkScript (scriptString) Çlocal (tempscript) Ç Çnew (scriptType, @tempscript) Çtarget.set (@tempscript) ÇeditMenu.setFont (user.prefs.fonts.scriptfont) ÇeditMenu.setFontSize (user.prefs.fonts.scriptfontsize) Çop.setLineText (scriptString) Çop.insert ("Frontier.bringToFront ()", down) Çtarget.clear () Ç Çtarget.set (adrMenuBar) Çmenu.setScript (@tempscript) Ç Çtable.copy (@DuckTapeData.newMenuBar, @system.menus.sharedMenus) Çtable.rename (@system.menus.sharedMenus.newMenuBar, adrAppInfo^.id) Çtarget.set (adrMenuBar) Çop.firstSummit () Çop.expand (infinity) Çop.go (right, 1) Çop.go (down, infinity) Çcursor on "Edit Scripts Table" ÇlinkScript ("edit (@" + temp.appname + ")") Çop.go (up, 1) Çcursor on "Edit Shared Menu" ÇlinkScript ("edit (@" + adrMenuBar + ")") Çop.firstSummit () Çtarget.clear () ÇsomethingCreated = true \ No newline at end of file |