|
From: creedon <icr...@us...> - 2005-09-28 03:10:22
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/menus/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8142 Modified Files: addBookmarkCommand Log Message: changed to work with Booksmarks menu that is part of user menu Index: addBookmarkCommand =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/menus/scripts/addBookmarkCommand,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** addBookmarkCommand 26 Mar 2005 19:41:52 -0000 1.1.1.1 --- addBookmarkCommand 28 Sep 2005 03:10:12 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.menus.scripts.addBookmarkCommand ! ÇAdd an item to the user's Bookmarks menu. ÇChanges: Ç9/20/99; 3:26:56 PM by PBS ÇIf the item is in a guest database, strip the leading path from the title. ÇMake sure the guest database is open before editing the object. Ç10/11/99; 5:45:31 PM by PBS ÇCall string.popFileFromAddress, rather than including code for stripping the file path from the address. local (adr); bundle { //determine the object adr of the thing to be added try { adr = table.getCursorAddress ()} else { scriptError ("Can't add to the Bookmarks menu because the front window doesn't contain an addressable object.")}}; local (adrMenu = @user.menus.bookmarkMenu); local (title = string (adr)); local (logic); bundle { //PBS 9/20/99: if item is in guest database, strip the path from the address, and add fileMenu.open to the logic. if table.inGuestDatabase (adr) { ÇPBS 9/20/99: first strip the path part from the address. title = string.popFileFromAddress (adr); //PBS 10/11/99: call this verb, new in 6.1, to delete the file path part of the address local (f = window.getFile (table.getRootAddress (adr))); //get the file path to the gdb logic = "fileMenu.open (\"" + string.replaceAll (f, "\\", "\\\\") + "\", true);"}}; //open the gdb as hidden logic = logic + "edit (@" + string (adr) + ")"; local (menuName); //PBS 9/21/99: the name of the Bookmarks menu bundle { //PBS 9/21/99: get the name of the Bookmarks menu local (oldTarget = target.set (adrMenu)); op.firstSummit (); menuName = op.getLineText (); try {target.set (oldTarget)}}; if dialog.confirm ("Add \"" + title + "\" to the " + menuName + " menu?") { //PBS 9/20/99: use the title in the prompt menu.addMenuCommand (adrMenu, menuName, title, logic)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.menus.scripts.addBookmarkCommand ! ÇAdd an item to the user's Bookmarks menu. ÇChanges Ç9/14/05; 1:46:22 PM by TAC Çchanged to work with Booksmarks menu that is part of user menu Ç9/20/99; 3:26:56 PM by PBS ÇIf the item is in a guest database, strip the leading path from the title. ÇMake sure the guest database is open before editing the object. Ç10/11/99; 5:45:31 PM by PBS ÇCall string.popFileFromAddress, rather than including code for stripping the file path from the address. local (adr); bundle { //determine the object adr of the thing to be added try { adr = table.getCursorAddress ()} else { scriptError ("Can't add to the Bookmarks menu because the front window doesn't contain an addressable object.")}}; local (adrMenu = @user.menus.customMenu); local (title = string (adr)); local (logic); bundle { //PBS 9/20/99: if item is in guest database, strip the path from the address, and add fileMenu.open to the logic. if table.inGuestDatabase (adr) { ÇPBS 9/20/99: first strip the path part from the address. title = string.popFileFromAddress (adr); //PBS 10/11/99: call this verb, new in 6.1, to delete the file path part of the address local (f = window.getFile (table.getRootAddress (adr))); //get the file path to the gdb logic = "fileMenu.open (\"" + string.replaceAll (f, "\\", "\\\\") + "\", true);"}}; //open the gdb as hidden logic = logic + "edit (@" + string (adr) + ")"; Çbundle // old code Çlocal (menuName) //PBS 9/21/99: the name of the Bookmarks menu Çbundle //PBS 9/21/99: get the name of the Bookmarks menu Çlocal (oldTarget = target.set (adrMenu)) Çop.firstSummit () ÇmenuName = op.getLineText () Çtry {target.set (oldTarget)} if dialog.confirm ("Add \"" + title + "\" to your Bookmarks menu?") { //PBS 9/20/99: use the title in the prompt menu.addMenuCommand (adrMenu, "Bookmarks", title, logic)} \ No newline at end of file |