|
From: creedon <icr...@us...> - 2005-11-01 19:12:06
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1835 Modified Files: shellmenu.c shellverbs.c Log Message: Fix for File menu Save As menu item problem and Frontier script based File menu items. See < http://sourceforge.net/tracker/index.php?func=detail&aid=1339237&group_id=120666&atid=687798 >. Index: shellmenu.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellmenu.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shellmenu.c 2 Oct 2005 18:19:29 -0000 1.6 --- shellmenu.c 1 Nov 2005 19:11:57 -0000 1.7 *************** *** 1021,1024 **** --- 1021,1026 ---- /* + 2005-10-26 creedon: the file menu item that provides save as functionality now reads Save As... for database or file-object save for Frontier + 2005-09-25 creedon: added open recent menu changed to support calling script for some file/edit menu commands on all targets *************** *** 1181,1190 **** shellsetmenuitemstring (hmenu, saveitem, savedatabaseitemstring); // "Save Database"); ! shellsetmenuitemstring (hmenu, saveasitem, saveacopyitemstring); // "Save a CopyÉ"); } else { shellsetmenuitemstring (hmenu, saveitem, saveitemstring); // "\x07" "Save"); ! shellsetmenuitemstring (hmenu, saveasitem, saveasitemstring); // "\x07" "Save AsÉ"); } --- 1183,1192 ---- shellsetmenuitemstring (hmenu, saveitem, savedatabaseitemstring); // "Save Database"); ! // shellsetmenuitemstring (hmenu, saveasitem, saveacopyitemstring); // "Save a CopyÉ"); } else { shellsetmenuitemstring (hmenu, saveitem, saveitemstring); // "\x07" "Save"); ! // shellsetmenuitemstring (hmenu, saveasitem, saveasitemstring); // "\x07" "Save AsÉ"); } *************** *** 1467,1471 **** /* ! 2005-09-25 creedon: changed so that all targets can call script for some file/edit menu commands added open recent menu --- 1469,1473 ---- /* ! 2005-09-25 creedon: changed so that all targets can call scripts for some file/edit menu commands added open recent menu *************** *** 2333,2337 **** /* ! 2005-10-01 creedon: when no files are listed in the menu, disable al menu items made more accessible to windows platform --- 2335,2339 ---- /* ! 2005-10-01 creedon: when no files are listed in the menu, disable all menu items made more accessible to windows platform Index: shellverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellverbs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shellverbs.c 1 Oct 2005 17:22:48 -0000 1.5 --- shellverbs.c 1 Nov 2005 19:11:57 -0000 1.6 *************** *** 56,59 **** --- 56,60 ---- #include "cancoon.h" #include "resources.h" + #include "file.h" /* 2005-10-26 creedon */ #ifdef WIN95VERSION *************** *** 95,99 **** savefunc, ! savecopyfunc, revertfunc, --- 96,100 ---- savefunc, ! // savecopyfunc, /* 2005-11-01 creedon */ revertfunc, *************** *** 103,106 **** --- 104,109 ---- quitfunc, + saveasfunc, /* 2005-10-26 creedon */ + ctfilemenuverbs } tyfilemenutoken; *************** *** 1254,1257 **** --- 1257,1265 ---- switch (token) { /*these verbs assume that the frontmost window's globals are pushed*/ + + /* + 2005-10-26 creedon: disabled savecopyfunc case, saveasfunc can do it all + added saveasfunc case, it wasn't possible to do a save as for a file-object + */ case savefunc: { /*save the frontmost window*/ *************** *** 1284,1288 **** } ! case savecopyfunc: { tyfilespec fs; --- 1292,1296 ---- } ! /* case savecopyfunc: { tyfilespec fs; *************** *** 1297,1301 **** break; ! } case revertfunc: --- 1305,1309 ---- break; ! } */ case revertfunc: *************** *** 1321,1324 **** --- 1329,1360 ---- break; + case saveasfunc: { + tyfilespec fs; + short ctconsumed = 0; + short ctpositional = 0; + tyvaluerecord val; + + initvalue (&val, stringvaluetype); + + flnextparamislast = true; + + if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, "\x04""path", &val)) + return (false); + + if (val.data.stringvalue) { + bigstring bs; + + texthandletostring (val.data.stringvalue, bs); + pathtofilespec (bs, &fs); + (*v).data.flvalue = shellsaveas (shellwindow, &fs, false); + } + else + (*v).data.flvalue = shellsaveas (shellwindow, nil, false); + + fl = true; + + break; + } + } /*switch -- funcs with front globals pushed*/ |