Changeset 1722


Ignore:
Timestamp:
Feb 16, 2014, 9:17:15 PM (11 years ago)
Author:
Gregg Young
Message:

The rest of the files for CS 1721

Location:
trunk/dll
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/copyf.c

    r1712 r1722  
    3636  09 Feb 14 GKY Modified wipeallf to allow suppression of the readonly warning on delete
    3737                of temporary files
     38  16 Feb 14 GKY Rework readonly check on delete code so it actually works in a logical way
     39                and so it works with move to trashcan inabled.
    3840
    3941***********************************************************************/
     
    544546          error = DosForceDelete(dir);
    545547          if (error) {
    546             make_deleteable(dir, error, FALSE);
     548            make_deleteable(dir, error, TRUE);
    547549            DosForceDelete(dir);
    548550          }
     
    691693    if (fsi.attrFile & 0x00000001) {
    692694      if (fWarnReadOnly && !Dontcheckreadonly) {
    693         retrn = saymsg2(NULL, 0,
    694                        HWND_DESKTOP,
    695                        GetPString(IDS_READONLYFILEWARNINGTITLE),
    696                        GetPString(IDS_READONLYFILEWARNING),
    697                        filename);
    698         if (retrn == 3)
    699           ret = 3;
    700         else if (retrn == 4)
    701           ret = 2;
    702         else {
    703           fsi.attrFile = 0;
    704           DosError(FERR_DISABLEHARDERR);
    705           if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))
    706             if (retrn == 1)
    707               ret = 0;
    708             else
    709               ret = 1;
    710         }
    711       }
    712       else
     695      retrn = saymsg2(NULL, 3,
     696                     HWND_DESKTOP,
     697                     GetPString(IDS_READONLYFILEWARNINGTITLE),
     698                     GetPString(IDS_READONLYFILEWARNING),
     699                      filename);
     700      //DbgMsg(pszSrcFile, __LINE__, "retrn %x ", retrn);
     701      ret = retrn;
     702      if (retrn == SM2_YES || retrn == SM2_DONTASK)
     703        fsi.attrFile = 0;
     704        DosError(FERR_DISABLEHARDERR);
     705        if (xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))
     706          ret = -1; // failed
     707      }
     708      else {
    713709        fsi.attrFile = 0;
    714710        DosError(FERR_DISABLEHARDERR);
    715711        if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))
    716712          ret = 0;
     713      }
    717714    }
    718715  }
     
    729726    }
    730727  }
    731 
     728  //DbgMsg(pszSrcFile, __LINE__, "retrn %x ", ret);
    732729  return ret;
    733730}
     
    839836
    840837          retrn = make_deleteable(ss, error, ignorereadonly);
    841           if (retrn == 3)
     838          if (retrn == SM2_NO)
    842839            continue;
    843           else if (retrn == 1)
     840          else if (retrn == SM2_DONTASK)
    844841            ignorereadonly = TRUE;
     842          else if (retrn == SM2_CANCEL)
     843            break;
    845844          DosError(FERR_DISABLEHARDERR);
    846845          rc = (INT) DosForceDelete(ss);
     
    953952  else {
    954953    APIRET error;
     954    INT ret;
    955955
    956956    DosError(FERR_DISABLEHARDERR);
    957957    error = DosForceDelete(string);
    958958    if (error) {
    959       make_deleteable(string, error, FALSE);
     959      ret = make_deleteable(string, error, FALSE);
     960      if (ret == SM2_CANCEL || ret == SM2_NO)
     961        return 0;
    960962      DosError(FERR_DISABLEHARDERR);
    961963      return DosForceDelete(string);
  • trunk/dll/errutil.c

    r1718 r1722  
    4040  07 Nov 13 SHL Update comments
    4141  15 Feb 14 GKY Improvements to saymsg2 some code cleanup
     42  16 Feb 14 GKY Rework readonly check on delete code so it actually works in a logical way
     43                and so it works with move to trashcan inabled.
    4244
    4345***********************************************************************/
     
    6062#include "init.h"                       // Data declares
    6163#include "wrappers.h"                   // xmallocz
     64#include "fm3dll2.h"
    6265
    6366#pragma data_seg(DATA1)
     
    398401  strcpy(mb2dBut[2].achText,GetPString(IDS_MB2DNO));
    399402  strcpy(mb2dBut[3].achText,GetPString(IDS_MB2DCANCELOP));
    400   mb2dBut[0].idButton = 1;
    401   mb2dBut[1].idButton = 2;
    402   mb2dBut[2].idButton = 3;
    403   mb2dBut[3].idButton = 4;
     403  mb2dBut[0].idButton = SM2_YES;
     404  mb2dBut[1].idButton = SM2_DONTASK;
     405  mb2dBut[2].idButton = SM2_NO;
     406  mb2dBut[3].idButton = SM2_CANCEL;
    404407  if (DefaultButton)
    405408    mb2dBut[DefaultButton - 1].flStyle = BS_DEFAULT;
     
    409412    pmbInfo->hIcon      = 0;
    410413    pmbInfo->cButtons   = 4;
    411     pmbInfo->flStyle    = MB_MOVEABLE | MB_SYSTEMMODAL | MB_ICONQUESTION ;
     414    pmbInfo->flStyle    = MB_MOVEABLE | MB_ICONQUESTION ;
    412415    pmbInfo->hwndNotify = NULLHANDLE;
    413416    for (i = 0; i < 4; i++) {
     
    415418    }
    416419    rc = WinMessageBox2(HWND_DESKTOP, hwnd,
    417                         szMsg, pszTitle, 1234,
     420                        szMsg, pszTitle, SM2_DIALOG,
    418421                        pmbInfo);
     422    WinSetFocus(HWND_DESKTOP, SM2_DIALOG);
    419423    free(pmbInfo);
    420424    return rc;
  • trunk/dll/fm3dll2.h

    r1682 r1722  
    3636                copy, move and delete operations
    3737  06 Jan 13 GKY Added EA compare option to compare dir Ticket 80
     38  15 Feb 14 GKY Improvements to saymsg2 some code cleanup
     39  16 Feb 14 GKY Rework readonly check on delete code so it actually works in a logical way
     40                and so it works with move to trashcan inabled.
    3841
    3942  Align with spaces only - no tabs please
     
    406409#define IDM_UNLOCKFILE      1170
    407410
     411#define SM2_DIALOG          1234
     412#define SM2_YES                1
     413#define SM2_CANCEL             2
     414#define SM2_NO                 3
     415#define SM2_DONTASK            4
     416
    408417#define IDM_UTILITIESMENU   2000
    409418#define IDM_INIVIEWER       2001
  • trunk/dll/seeall.c

    r1712 r1722  
    5959  09 Feb 14 GKY Modified wipeallf to allow suppression of the readonly warning on delete
    6060                of temporary files
     61  16 Feb 14 GKY Rework readonly check on delete code so it actually works in a logical way
     62                and so it works with move to trashcan inabled.
    6163
    6264***********************************************************************/
     
    10981100                DosError(FERR_DISABLEHARDERR);
    10991101                retrn = make_deleteable(list[x], error, ignorereadonly);
    1100                 if (retrn == 2)
     1102                if (retrn == SM2_CANCEL)
    11011103                  break;
    1102                 if (retrn == 1)
     1104                if (retrn == SM2_DONTASK)
    11031105                  ignorereadonly = TRUE;
    1104                 if (retrn == 3)
     1106                if (retrn == SM2_NO)
    11051107                  continue;
    11061108                if (SHORT1FROMMP(mp1) == IDM_DELETE)
Note: See TracChangeset for help on using the changeset viewer.