Changeset 1686
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/comp.c
r1685 r1686 88 88 06 Mar 13 SHL ActionCnrThread: need to strdup pszFmtFileSize to avoid aliased pointers 89 89 09 Mar 13 SHL SetButtonEnables: correct enable support for newish buttons 90 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 91 Added saymsg2 for this purpose 92 10 Mar 13 GKY Fixes to snapshot file. 90 93 91 94 ***********************************************************************/ -
trunk/dll/copyf.c
r1664 r1686 33 33 04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog for delete of 34 34 readonly files 35 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 35 36 36 37 ***********************************************************************/ … … 531 532 DosError(FERR_DISABLEHARDERR); 532 533 if (DosDeleteDir(dir)) { 533 make_deleteable(dir, 0);534 make_deleteable(dir, -1, TRUE); 534 535 DosDeleteDir(dir); 535 536 } … … 541 542 error = DosForceDelete(dir); 542 543 if (error) { 543 make_deleteable(dir, error );544 make_deleteable(dir, error, FALSE); 544 545 DosForceDelete(dir); 545 546 } … … 618 619 DosError(FERR_DISABLEHARDERR); 619 620 if (DosDeleteDir(oldname)) { 620 make_deleteable(oldname, 0);621 make_deleteable(oldname, -1, TRUE); 621 622 DosDeleteDir(oldname); 622 623 } … … 675 676 } 676 677 677 INT make_deleteable(CHAR * filename, INT error )678 INT make_deleteable(CHAR * filename, INT error, BOOL Dontcheckreadonly) 678 679 { 679 680 APIRET rc; … … 682 683 FILESTATUS3 fsi; 683 684 685 //DbgMsg(pszSrcFile, __LINE__, "error %i ", error); 686 DosError(FERR_DISABLEHARDERR); 687 rc = DosQueryPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi)); 688 if (!rc) { 689 if (fsi.attrFile & 0x00000001) { 690 if (fWarnReadOnly && !Dontcheckreadonly) { 691 retrn = saymsg2(NULL, 0, 692 HWND_DESKTOP, 693 GetPString(IDS_READONLYFILEWARNINGTITLE), 694 GetPString(IDS_READONLYFILEWARNING), 695 filename); 696 if (retrn == 3) 697 ret = 3; 698 else if (retrn == 4) 699 ret = 2; 700 else { 701 fsi.attrFile = 0; 702 DosError(FERR_DISABLEHARDERR); 703 if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0)) 704 if (retrn == 1) 705 ret = 0; 706 else 707 ret = 1; 708 } 709 } 710 else 711 fsi.attrFile = 0; 712 DosError(FERR_DISABLEHARDERR); 713 if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0)) 714 ret = 0; 715 } 716 } 684 717 if (error == ERROR_SHARING_VIOLATION && fUnlock) { 685 718 retrn = saymsg(MB_YESNO | MB_DEFBUTTON2, … … 694 727 } 695 728 } 696 DosError(FERR_DISABLEHARDERR);697 rc = DosQueryPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi));698 if (!rc) {699 if (fsi.attrFile & 0x00000001) {700 if (fWarnReadOnly && error != -1) {701 retrn = saymsg(MB_YESNO | MB_DEFBUTTON2,702 HWND_DESKTOP,703 GetPString(IDS_READONLYFILEWARNINGTITLE),704 GetPString(IDS_READONLYFILEWARNING),705 filename);706 if (retrn == MBID_YES) {707 fsi.attrFile = 0;708 DosError(FERR_DISABLEHARDERR);709 if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))710 ret = 0;711 }712 else713 ret = 0;714 }715 else716 fsi.attrFile = 0;717 DosError(FERR_DISABLEHARDERR);718 if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))719 ret = 0;720 }721 }722 729 723 730 return ret; … … 737 744 va_list ap; 738 745 INT rc; 746 static BOOL ignorereadonly = FALSE; 739 747 740 748 va_start(ap, string); … … 815 823 // remove directory 816 824 if (DosDeleteDir(ss)) { 817 make_deleteable(ss, 0); // Try harder825 make_deleteable(ss, -1, TRUE); // Try harder 818 826 DosError(FERR_DISABLEHARDERR); 819 827 DosDeleteDir(ss); … … 826 834 DosError(FERR_DISABLEHARDERR); 827 835 error = DosForceDelete(ss); 828 if (error) { 829 make_deleteable(ss, error); 836 if (error) { 837 INT retrn = 0; 838 839 retrn = make_deleteable(ss, error, ignorereadonly); 840 if (retrn == 3) 841 continue; 842 else if (retrn == 1) 843 ignorereadonly = TRUE; 830 844 DosError(FERR_DISABLEHARDERR); 831 845 rc = (INT) DosForceDelete(ss); … … 844 858 free(ss); 845 859 free(str); 860 ignorereadonly = FALSE; 846 861 return 0; 847 862 } … … 930 945 DosError(FERR_DISABLEHARDERR); 931 946 if (DosDelete(string)) { 932 make_deleteable(string, -1 );947 make_deleteable(string, -1, TRUE); 933 948 DosError(FERR_DISABLEHARDERR); 934 949 return DosDelete(string); … … 941 956 error = DosForceDelete(string); 942 957 if (error) { 943 make_deleteable(string, error );958 make_deleteable(string, error, FALSE); 944 959 DosError(FERR_DISABLEHARDERR); 945 960 return DosForceDelete(string); -
trunk/dll/copyf.h
r1664 r1686 15 15 04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog 16 16 for delete of readonly files 17 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 17 18 18 19 ***********************************************************************/ … … 26 27 BOOL WriteLongName(CHAR * filename, CHAR * longname); 27 28 APIRET docopyf(INT type, CHAR * oldname, CHAR * newname); 28 INT make_deleteable(CHAR * filename, INT error );29 INT make_deleteable(CHAR * filename, INT error, BOOL Dontcheckreadonly); 29 30 INT unlinkf(CHAR * string); 30 31 INT wipeallf(CHAR * string, ...); -
trunk/dll/errutil.c
r1673 r1686 36 36 works in HIMEM builds 37 37 01 Dec 10 SHL Dos_Error - remap API errors code that with odd oso001*.msg messages 38 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 39 Added saymsg2 for this purpose 38 40 39 41 ***********************************************************************/ … … 42 44 #include <string.h> 43 45 #include <stdarg.h> 46 #include <stdlib.h> 44 47 45 48 #define INCL_DOS … … 54 57 #include "notebook.h" // fErrorBeepOff 55 58 #include "init.h" // Data declares 59 #include "wrappers.h" // xmallocz 56 60 57 61 #pragma data_seg(DATA1) … … 348 352 } // saymsg 349 353 354 APIRET saymsg2(PCSZ pszButtonNames, int DefaultButton, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...) 355 { 356 ULONG i; 357 APIRET rc; 358 CHAR szMsg[4096]; 359 va_list va; 360 MB2INFO *pmbInfo; 361 MB2D mb2dBut[4]; 362 ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * 3)); 363 364 va_start(va, pszFmt); 365 szMsg[sizeof(szMsg) - 1] = 0; 366 vsprintf(szMsg, pszFmt, va); 367 va_end(va); 368 369 if (szMsg[sizeof(szMsg) - 1]) { 370 fprintf(stderr, "Buffer overflow in saymsg2 - need %u bytes\n", strlen(szMsg) + 1); 371 fflush(stderr); 372 } 373 374 memset(mb2dBut, 0, sizeof(MB2D) * 4); 375 //fixme to use GetPString 376 strcpy(mb2dBut[0].achText, /*pszButtonNames[0] ? &pszButtonNames[0] :*/ GetPString(IDS_MB2DYES)); 377 strcpy(mb2dBut[1].achText, /*pszButtonNames[1] ? &pszButtonNames[1] :*/ GetPString(IDS_MB2DYESDONTASK)); 378 strcpy(mb2dBut[2].achText, /*pszButtonNames[2] ? &pszButtonNames[2] :*/ GetPString(IDS_MB2DNO)); 379 strcpy(mb2dBut[3].achText,/* pszButtonNames[3] ? &pszButtonNames[3] :*/ GetPString(IDS_MB2DCANCELOP)); 380 mb2dBut[0].idButton = 1; 381 mb2dBut[1].idButton = 2; 382 mb2dBut[2].idButton = 3; 383 mb2dBut[3].idButton = 4; 384 if (DefaultButton) 385 mb2dBut[DefaultButton - 1].flStyle = BS_DEFAULT; 386 pmbInfo = xmallocz(ulInfoSize, pszSrcFile, __LINE__); 387 if (pmbInfo) { 388 pmbInfo->cb = ulInfoSize; 389 pmbInfo->hIcon = 0; 390 pmbInfo->cButtons = 4; 391 pmbInfo->flStyle = MB_MOVEABLE; 392 pmbInfo->hwndNotify = NULLHANDLE; 393 for (i = 0; i < 4; i++) { 394 memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D)); 395 } 396 rc = WinMessageBox2(HWND_DESKTOP, hwnd, 397 szMsg, pszTitle, 1234, 398 pmbInfo); 399 free(pmbInfo); 400 return rc; 401 } 402 return MBID_ERROR; 403 } 404 350 405 //=== showMsg: display error popup === 351 406 -
trunk/dll/errutil.h
r1558 r1686 12 12 07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error 13 13 08 Mar 09 GKY Remove Dos_Error2 (unused) and Runtime_Error2 (no advantage over using Runtime_Error) 14 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 15 Added saymsg2 for this purpose 14 16 15 17 ***********************************************************************/ … … 29 31 VOID Runtime_Error2(PCSZ pszSrcFile, UINT uSrcLineNo, UINT idMsg); 30 32 APIRET saymsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...); 33 APIRET saymsg2(PCSZ pszButtonNames, int DefaultButton, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...); 31 34 VOID Win_Error(HWND hwndErr, HWND hwndOwner, 32 35 PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...); -
trunk/dll/fm3res.rc
r1682 r1686 10 10 11 11 08 Feb 03 SHL Enable SYS_FRAME 12 17 Feb 07 GKY Add Make direc roy to white space directory container menu12 17 Feb 07 GKY Add Make directory to white space directory container menu 13 13 17 Feb 07 GKY Additional drive type icons 14 14 15 Jun 07 SHL Update for OpenWatcom … … 40 40 22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button 41 41 loads drive root directory in directory container or expands drive tree 42 and rescans drive in tree container depending on container focus, gr eyed out42 and rescans drive in tree container depending on container focus, grayed out 43 43 inappropriate menu context choices 44 44 12 Sep 09 GKY Add FM3.INI User ini and system ini to submenu for view ini … … 62 62 copy, move and delete operations 63 63 05 Sep 12 SHL Sync collector menu with docs 64 30 Dec 12 GKY Enhance t raget directory drop to give the option of changing the directory or carrying out an64 30 Dec 12 GKY Enhance target directory drop to give the option of changing the directory or carrying out an 65 65 operation to the current target; Added an error message for target = None; 66 66 06 Jan 13 GKY Added EA compare option to compare dir Ticket 80 67 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 68 Added saymsg2 for this purpose 67 69 68 70 ***********************************************************************/ … … 3377 3379 IDS_READONLYFILEWARNING "The file %s is Read Only! Do you wish continue the requested operation" 3378 3380 IDS_READONLYFILEWARNINGTITLE "Read Only file!" 3381 IDS_NOTARGETSET "A target directory has not been set" 3382 IDS_LEFTRIGHTOUTOFSYNC "pcil and pcir out of sync" 3383 IDS_CONFIRMDELETE "Confirm Delete" 3384 IDS_DOYOUWISHTODELETE "Do you wish to delete %s" 3385 IDS_DROPSETSTARGET "Do you wish to use this directory as the new target directory? \nYes sets target\nNo proceeds with drag/drop operation to current target" 3386 IDS_MB2DYES "Yes" 3387 IDS_MB2DYESDONTASK "Yes don't ask again" 3388 IDS_MB2DNO "No" 3389 IDS_MB2DCANCELOP "Cancel operation" 3390 IDS_SNAPSHOTFILEBADFORMAT "The snapshot file lists no files or is not formatted correctly" 3391 IDS_SNAPSHOTFILELOADFAILED "The snapshot file %s failed to load" 3392 3379 3393 3380 3394 // Add strings that need to be combined by GetPString here … … 3407 3421 IDS_FM2CMDHELPTEXT2 "\r\rType ""/SAVE"" or ""/NOSAVE"" to save (or not) cmd lines between sessions.\r\r[Up arrow] or [down arrow] or [+] button for listbox of previous command lines, then [Delete] to remove one or [Enter] to reuse.\r\rOr type a command to be executed" 3408 3422 IDS_FM2CMDHELPTEXT3 " (metastrings like %%a available.)\r\rDouble-click entry field to simulate hitting [Enter].\r\rF5 is the accelerator for this mini-command line." 3409 IDS_DROPSETSTARGET "Do you wish to use this directory as the new target directory? \nYes sets target\nNo proceeds with drag/drop operation to current target"3410 IDS_NOTARGETSET "A target directory has not been set"3411 IDS_LEFTRIGHTOUTOFSYNC "pcil and pcir out of sync"3412 3423 END 3413 3424 -
trunk/dll/fm3str.h
r1682 r1686 48 48 30 Dec 12 GKY Enhance traget directory drop to give the option of changing the directory or carrying out an 49 49 operation to the current target; Added an error message for target = None; 50 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 51 Added saymsg2 for this purpose 52 10 Mar 13 GKY Fixes to snapshot file. 50 53 51 54 ***********************************************************************/ … … 258 261 #define IDS_COMPCOPYFAILEDTEXT 202 259 262 #define IDS_EASDIFFERTEXT 203 263 #define IDS_SNAPSHOTFILEBADFORMAT 204 260 264 #define IDS_LARGERTEXT 205 261 265 #define IDS_SMALLERTEXT 206 … … 882 886 #define IDS_PLEASEWAITCOUNTINGTEXT 859 883 887 #define IDS_SPARE_860 860 888 #define IDS_CONFIRMDELETE 861 889 #define IDS_DOYOUWISHTODELETE 862 890 #define IDS_MB2DYES 863 891 #define IDS_MB2DYESDONTASK 864 892 #define IDS_MB2DNO 865 893 #define IDS_MB2DCANCELOP 866 884 894 885 895 #define IDS_ARCCNRFILTERMENUHELP 867 … … 1011 1021 #define IDS_CANTFINDDRIVETEXT 995 1012 1022 #define IDS_CANTDRAGROOTDIR 996 1013 //#define IDS_DOSQAPPTYPEFAILEDTEXT moved to 10179971023 #define IDS_SNAPSHOTFILELOADFAILED 997 1014 1024 #define IDS_APPTYPEUNEXPECTEDTEXT 998 1015 1025 #define IDS_PATHTODESKTOP 999 -
trunk/dll/seeall.c
r1682 r1686 55 55 04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog 56 56 for delete of readonly files 57 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 58 Added saymsg2 for this purpose 57 59 58 60 ***********************************************************************/ … … 974 976 CHAR prompt[CCHMAXPATH * 3]; 975 977 APIRET error; 978 BOOL ignorereadonly = FALSE; 976 979 977 980 for (x = 0; list[x]; x++) { … … 1082 1085 DosDeleteDir(list[x]); 1083 1086 } 1084 else { 1087 else { 1088 INT retrn = 0; 1089 1085 1090 DosError(FERR_DISABLEHARDERR); 1086 1091 if (SHORT1FROMMP(mp1) == IDM_DELETE) … … 1090 1095 if (error) { 1091 1096 DosError(FERR_DISABLEHARDERR); 1092 make_deleteable(list[x], error); 1097 retrn = make_deleteable(list[x], error, ignorereadonly); 1098 if (retrn == 2) 1099 break; 1100 if (retrn == 1) 1101 ignorereadonly = TRUE; 1102 if (retrn == 3) 1103 continue; 1093 1104 if (SHORT1FROMMP(mp1) == IDM_DELETE) 1094 1105 error = DosDelete(list[x]); -
trunk/dll/worker.c
r1682 r1686 53 53 04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog 54 54 for delete of readonly files 55 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 56 Added saymsg2 for this purpose 55 57 56 58 ***********************************************************************/ … … 874 876 rc = docopyf(type, wk->li->list[x], newname); 875 877 if (rc == ERROR_ACCESS_DENIED || rc == ERROR_SHARING_VIOLATION) { 876 if (rc == ERROR_ACCESS_DENIED && noreadonlywarn) 877 rc = -1; 878 ret = make_deleteable(newname, rc); 878 ret = make_deleteable(newname, rc, noreadonlywarn); 879 879 rc = docopyf(type, wk->li->list[x], newname); 880 880 } 881 if ( !ret && (rc == ERROR_ACCESS_DENIED || (rc == ERROR_SHARING_VIOLATION && fUnlock)))881 if (rc == ERROR_ACCESS_DENIED || (rc == ERROR_SHARING_VIOLATION && fUnlock)) 882 882 rc = NO_ERROR; 883 883 if (fResetVerify) { … … 1588 1588 HOBJECT hObjectdest, hObjectofObject; 1589 1589 BYTE G_abSupportedDrives[24] = {0}; 1590 ULONG cbSupportedDrives = sizeof(G_abSupportedDrives); 1590 ULONG cbSupportedDrives = sizeof(G_abSupportedDrives); 1591 BOOL ignorereadonly = FALSE; 1591 1592 1592 1593 for (x = 0; wk->li->list[x]; x++) { … … 1732 1733 error = DosForceDelete(wk->li->list[x]); ; 1733 1734 } 1734 if (error) { 1735 if (error) { 1736 INT retrn = 0; 1737 1735 1738 DosError(FERR_DISABLEHARDERR); 1736 make_deleteable(wk->li->list[x], error); 1739 retrn = make_deleteable(wk->li->list[x], error, ignorereadonly); 1740 if (retrn == 2) 1741 break; 1742 if (retrn == 1) 1743 ignorereadonly = TRUE; 1744 if (retrn == 3) 1745 continue; 1737 1746 if (wk->li->type == IDM_DELETE){ 1738 1747 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); … … 1791 1800 UM_UPDATERECORD, 1792 1801 MPFROMP(wk->li->list[x]), MPVOID); 1793 } 1802 } ; 1794 1803 } // for 1795 1804 }
Note:
See TracChangeset
for help on using the changeset viewer.