Changeset 1664


Ignore:
Timestamp:
Aug 5, 2012, 2:11:07 AM (13 years ago)
Author:
Gregg Young
Message:

Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of copy, move and delete operations. Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog for delete of readonly files

Location:
trunk
Files:
1 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r1615 r1664  
    7979  08 Aug 11 SHL Rework UM_COLLECT to avoid spurious container items free
    8080  13 Aug 11 GKY Have file count and KIBs update at the same time
     81  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu and as part of copy, move and
     82                delete operations
    8183
    8284***********************************************************************/
     
    23462348      case IDM_MCIPLAY:
    23472349      case IDM_UUDECODE:
     2350      case IDM_UNLOCKFILE:
    23482351      case IDM_MERGE:
    23492352        {
  • trunk/dll/copyf.c

    r1628 r1664  
    2929  26 Aug 11 GKY Add a low mem version of xDosAlloc* wrappers; move error checking into all the
    3030                xDosAlloc* wrappers.
     31  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of copy, move and
     32                delete operations
     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                readonly files
    3135
    3236***********************************************************************/
     
    6064#include "fortify.h"
    6165#include "pathutil.h"                   // AddBackslashToPath
     66#include "worker.h"
     67#include "systemf.h"
    6268
    6369static PSZ pszSrcFile = __FILE__;
     
    525531          DosError(FERR_DISABLEHARDERR);
    526532          if (DosDeleteDir(dir)) {
    527             make_deleteable(dir);
     533            make_deleteable(dir, 0);
    528534            DosDeleteDir(dir);
    529535          }
    530536        }
    531         else if (IsFile(dir) > 0) {
    532           DosError(FERR_DISABLEHARDERR);
    533           if (DosForceDelete(dir)) {
    534             make_deleteable(dir);
     537        else if (IsFile(dir) > 0) {
     538          APIRET error;
     539
     540          DosError(FERR_DISABLEHARDERR);
     541          error = DosForceDelete(dir);
     542          if (error) {
     543            make_deleteable(dir, error);
    535544            DosForceDelete(dir);
    536545          }
     
    609618            DosError(FERR_DISABLEHARDERR);
    610619            if (DosDeleteDir(oldname)) {
    611               make_deleteable(oldname);
     620              make_deleteable(oldname, 0);
    612621              DosDeleteDir(oldname);
    613622            }
     
    666675}
    667676
    668 INT make_deleteable(CHAR * filename)
    669 {
     677INT make_deleteable(CHAR * filename, INT error)
     678{
     679  APIRET rc;
    670680  INT ret = -1;
     681  INT retrn;
    671682  FILESTATUS3 fsi;
    672683
     684  if (error ==  ERROR_SHARING_VIOLATION && fUnlock) {
     685    retrn = saymsg(MB_YESNO | MB_DEFBUTTON2,
     686                 HWND_DESKTOP,
     687                 GetPString(IDS_LOCKEDFILEWARNINGTITLE),
     688                 GetPString(IDS_LOCKEDFILEWARNING),
     689                 filename);
     690    if (retrn == MBID_YES) {
     691      runemf2(SEPARATE | INVISIBLE | BACKGROUND | WAIT,
     692              HWND_DESKTOP, pszSrcFile, __LINE__,
     693              NULL, NULL, "%s %s", PCSZ_UNLOCKEXE, filename);
     694    }
     695  }
    673696  DosError(FERR_DISABLEHARDERR);
    674   if (!DosQueryPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi))) {
    675     fsi.attrFile = 0;
    676     DosError(FERR_DISABLEHARDERR);
    677     if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))
    678       ret = 0;
    679   }
     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        else
     713          ret = 0;
     714      }
     715      else
     716        fsi.attrFile = 0;
     717        DosError(FERR_DISABLEHARDERR);
     718        if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))
     719          ret = 0;
     720    }
     721  }
     722
    680723  return ret;
    681724}
     
    772815          // remove directory
    773816          if (DosDeleteDir(ss)) {
    774             make_deleteable(ss);        // Try harder
     817            make_deleteable(ss, 0);     // Try harder
    775818            DosError(FERR_DISABLEHARDERR);
    776819            DosDeleteDir(ss);
     
    779822      }
    780823      else {
    781         DosError(FERR_DISABLEHARDERR);
    782         if (DosForceDelete(ss)) {
    783           make_deleteable(ss);
     824        APIRET error;
     825
     826        DosError(FERR_DISABLEHARDERR);
     827        error = DosForceDelete(ss);
     828        if (error) {
     829          make_deleteable(ss, error);
    784830          DosError(FERR_DISABLEHARDERR);
    785831          rc = (INT) DosForceDelete(ss);
     
    884930    DosError(FERR_DISABLEHARDERR);
    885931    if (DosDelete(string)) {
    886       make_deleteable(string);
     932      make_deleteable(string, -1);
    887933      DosError(FERR_DISABLEHARDERR);
    888934      return DosDelete(string);
     
    890936  }
    891937  else {
     938    APIRET error;
     939
    892940    DosError(FERR_DISABLEHARDERR);
    893     if (DosForceDelete(string)) {
    894       make_deleteable(string);
     941    error = DosForceDelete(string);
     942    if (error) {
     943      make_deleteable(string, error);
    895944      DosError(FERR_DISABLEHARDERR);
    896945      return DosForceDelete(string);
  • trunk/dll/copyf.h

    r1402 r1664  
    1111  05 Sep 08 JBS Ticket 187: Refactor FM3DLL.H
    1212  08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used)
     13  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     14                copy, move and delete operations
     15  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     16                for delete of readonly files
    1317
    1418***********************************************************************/
     
    2226BOOL WriteLongName(CHAR * filename, CHAR * longname);
    2327APIRET docopyf(INT type, CHAR * oldname, CHAR * newname);
    24 INT make_deleteable(CHAR * filename);
     28INT make_deleteable(CHAR * filename, INT error);
    2529INT unlinkf(CHAR * string);
    2630INT wipeallf(CHAR * string, ...);
  • trunk/dll/dircnrs.c

    r1571 r1664  
    8181                entries in the tree container, fix related semaphore performance using
    8282                combination of event and mutex semaphores
     83  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     84                copy, move and delete operations
    8385
    8486***********************************************************************/
     
    17221724            WinEnableMenuItem((HWND) mp2, IDM_ATTRS, TRUE);
    17231725          }
     1726        WinEnableMenuItem((HWND) mp2, IDM_UNLOCKFILE, fUnlock);
    17241727        }
    17251728        break;
     
    17381741        WinEnableMenuItem((HWND) mp2,
    17391742                          IDM_SELECTCOMPAREMENU,
    1740                           (CountDirCnrs(dcd->hwndParent) > 1));
     1743                          (CountDirCnrs(dcd->hwndParent) > 1));
    17411744        break;
    17421745
     
    26202623      case IDM_COLLECTFROMFILE:
    26212624      case IDM_UUDECODE:
     2625      case IDM_UNLOCKFILE:
    26222626      case IDM_MERGE:
    26232627        {
  • trunk/dll/fm3dlg.h

    r1546 r1664  
    77
    88  Copyright (c) 1993-02 M. Kimes
    9   Copyright (c) 2002, 2008 Steven H.Levine
     9  Copyright (c) 2002-2012 Steven H.Levine
    1010
    1111  15 Oct 02 MK Baseline
     
    3838  27 Dec 09 GKY Made command hotkeys user selectable.
    3939  23 Oct 10 GKY Added button to allow opening of a new file's eas from the EA dialog.
     40  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     41                copy, move and delete operations
     42  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     43                for delete of readonly files
    4044
    4145***********************************************************************/
     
    430434#define REN_OVERNEW                                                                             22310
    431435#define REN_RENEXIST                                                                            22311
     436#define REN_NOROWARN                                                                            22312
    432437
    433438#define FLE_FRAME                                                                                       22400
     
    665670#define CFGG_ALERTBEEPOFF                                                               25218
    666671#define CFGG_ERRORBEEPOFF                                                               25219
     672#define CFGG_WARNREADONLY                                                               25220
    667673
    668674#define CFGB_FRAME                                                                      25250
  • trunk/dll/fm3dll2.h

    r1547 r1664  
    3333  21 Dec 09 GKY Added 20 new hot keys for commands.
    3434  23 Oct 10 GKY Changes to populate and utilize a HELPTABLE for context specific help
     35  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     36                copy, move and delete operations
    3537
    3638  Align with spaces only - no tabs please
     
    401403#define IDM_OPENDIRTREE     1168
    402404#define IDM_OPENDIRWINDOW   1169
     405#define IDM_UNLOCKFILE      1170
    403406
    404407#define IDM_UTILITIESMENU   2000
  • trunk/dll/fm3res.dlg

    r1637 r1664  
    5252  23 Oct 10 GKY Added button to allow opening of a new file's eas from the EA dialog.
    5353  09 Oct 11 GKY Eliminate overlap of check box names; improve readability
     54  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     55                for delete of readonly files
    5456 
    5557***********************************************************************/
     
    623625        PUSHBUTTON      "~Rename existing", REN_RENEXIST, 260, 110, 88, 12
    624626        AUTOCHECKBOX    "Overwrite if target ~older or same", REN_OVEROLD,
    625                         30, 20, 158, 10
    626         AUTOCHECKBOX    "Overwrite if target ~newer", REN_OVERNEW, 194, 20,
    627                         152, 10, WS_GROUP
     627                        4, 20, 100, 10
     628        AUTOCHECKBOX    "Overwrite if target ~newer", REN_OVERNEW, 110, 20,
     629                        80, 10, WS_GROUP
     630        AUTOCHECKBOX    "Overwrite if target is readonly (no warning)", REN_NOROWARN, 200, 20,
     631                        140, 10, WS_GROUP               
    628632        DEFPUSHBUTTON   "Okay", DID_OK, 4, 4, 40, 14, BS_NOPOINTERFOCUS |
    629633                        WS_GROUP
     
    27792783        LTEXT           "Target directory:", -1, 4, 34, 102, 8
    27802784        ENTRYFIELD      "", CFGG_TARGETDIR, 6, 22, 246, 8, ES_MARGIN
     2785        AUTOCHECKBOX    "~Warn if file is readonly", CFGG_WARNREADONLY, 122, 140, 106,
     2786                        10
    27812787        AUTOCHECKBOX    "~Link drag sets icon", CFGG_LINKSETSICON, 122, 128, 106,
    27822788                        10
  • trunk/dll/fm3res.rc

    r1604 r1664  
    5959  23 Oct 10 GKY Changes to populate and utilize a HELPTABLE for context specific help.
    6060  21 Nov 10 GKY Check if archiver.bb2 has been changed on disk before editing
     61  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     62                copy, move and delete operations
    6163 
    6264***********************************************************************/
     
    12701272  }
    12711273  MENUITEM "",                  -1,             MIS_SEPARATOR
     1274  MENUITEM "Make ~directory...\tCtrl + M",IDM_MKDIR
     1275  MENUITEM "",                  -1,             MIS_SEPARATOR
    12721276  MENUITEM "Archive...\tCtrl + A",IDM_ARCHIVE
    1273   MENUITEM "Make ~directory...\tCtrl + M",IDM_MKDIR
    12741277  MENUITEM "Extract...\tCtrl + x",IDM_EXTRACT
    12751278  MENUITEM "UUDecode...\tCtrl + U", IDM_UUDECODE
     1279  MENUITEM "UnLock file", IDM_UNLOCKFILE
    12761280  MENUITEM "",                  -1,                   MIS_SEPARATOR
    12771281  SUBMENU "~Delete",            IDM_DELETESUBMENU
     
    15631567  MENUITEM "Extract...\tCtrl + x",  IDM_EXTRACT
    15641568  MENUITEM "UUDecode...\tCtrl + U", IDM_UUDECODE
     1569  MENUITEM "UnLock file", IDM_UNLOCKFILE
    15651570  MENUITEM "",                  -1,                   MIS_SEPARATOR
    15661571  SUBMENU "~Delete",            IDM_DELETESUBMENU
     
    21572162         MENUITEM "Extract from selected...\tCtrl + x",IDM_EXTRACT
    21582163         MENUITEM "UUDecode selected...\tCtrl + U",IDM_UUDECODE
     2164         MENUITEM "UnLock file", IDM_UNLOCKFILE
    21592165         MENUITEM "Co~llect selected\tCtrl + C", IDM_COLLECT
    21602166         MENUITEM "Save full path(s) to ~clipboard\tCtrl + [",IDM_SAVETOCLIP
     
    22372243  MENUITEM "Extract from selected...\tCtrl + x",IDM_EXTRACT
    22382244  MENUITEM "UUDecode selected...\tCtrl + U",IDM_UUDECODE
     2245  MENUITEM "UnLock file", IDM_UNLOCKFILE
    22392246  MENUITEM "Co~llect selected\tCtrl + C", IDM_COLLECT
    22402247  MENUITEM "Save full path(s) to ~clipboard\tCtrl + [",IDM_SAVETOCLIP
     
    33583365    IDS_DOSQAPPTYPEFAILEDTEXT2            "The program %s was not found on the PATH or is not an executible file type."
    33593366    IDS_DOSQAPPTYPEFAILEDTEXT3            "The drive specified in %s is locked or invalid."
    3360 
     3367    IDS_LOCKEDFILEWARNING                 "The file %s is locked! Do you wish to unlock it and complete the requested operation"
     3368    IDS_LOCKEDFILEWARNINGTITLE            "Locked file!"
     3369    IDS_READONLYFILEWARNING               "The file %s is Read Only! Do you wish continue the requested operation"
     3370    IDS_READONLYFILEWARNINGTITLE          "Read Only file!"
     3371   
    33613372    // Add strings that need to be combined by GetPString here
    33623373    IDS_SUGGEST1TEXT1                     "Based on this scan of your drives, I would like to suggest the following parameters for your FM/2 program object (each letter following the '/' character is a drive that probably should be excluded from viewing by FM/2 (see README), and the '%%*' on the"
  • trunk/dll/fm3str.h

    r1604 r1664  
    4242  27 Dec 09 GKY Added IDS_DUPLICATEHOTKEYTEXT for command.c changes
    4343  21 Nov 10 GKY Check if archiver.bb2 has been changed on disk before editing
     44  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     45                copy, move and delete operations
     46  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     47                for delete of readonly files
    4448
    4549***********************************************************************/
     
    10241028#define IDS_DOSQAPPTYPEFAILEDTEXT2                           1018
    10251029#define IDS_DOSQAPPTYPEFAILEDTEXT3                           1019
     1030#define IDS_LOCKEDFILEWARNING                                1020
     1031#define IDS_LOCKEDFILEWARNINGTITLE                           1021
     1032#define IDS_READONLYFILEWARNING                              1022
     1033#define IDS_READONLYFILEWARNINGTITLE                         1023
    10261034
    10271035//The following strings were cut up form the string of the root name (ie IDS_SUGGEST1TEXT)
  • trunk/dll/init.c

    r1654 r1664  
    109109  22 Oct 11 GKY Thread notes dialog now reopens on startup if it was open on shutdown.
    110110  08 Jan 12 GKY Add support for changing PresParams in the notify status window
     111  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     112                copy, move and delete operations
     113  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     114                for delete of readonly files
    111115
    112116***********************************************************************/
     
    267271PCSZ PCSZ_FDISKPMEXE  = "FDISKPM.EXE";
    268272PCSZ PCSZ_LVMEXE      = "LVM.EXE";
     273PCSZ PCSZ_UNLOCKEXE   = "UNLOCK.EXE";
    269274PCSZ PCSZ_ARCCNR      = "ArcCnr";
    270275PCSZ PCSZ_COLLECTOR   = "Collector";
     
    11631168    fAutoAddDirs = fUseNewViewer = fDataToFore = fDataShowDrives = fDataMin =
    11641169    fSplitStatus = fDragndropDlg = fQuickArcFind = fKeepCmdLine =
    1165     fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree =
     1170    fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree = fWarnReadOnly =
    11661171    fSwitchTreeExpand = fNoSearch = fCustomFileDlg = fOtherHelp =
    11671172    fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget =
     
    12211226    if (!xDosQueryAppType(PCSZ_LVMEXE, &ulAppType))
    12221227      fLVM = TRUE;
     1228
     1229    //Check for unlock.exe
     1230    if (!xDosQueryAppType(PCSZ_UNLOCKEXE, &ulAppType))
     1231      fUnlock = TRUE;
    12231232
    12241233    // Check to see if we are running protect only
     
    14931502  size = sizeof(BOOL);
    14941503  PrfQueryProfileData(fmprof, appname, "LinkSetsIcon", &fLinkSetsIcon, &size);
     1504  size = sizeof(BOOL);
     1505  PrfQueryProfileData(fmprof, appname, "WarnReadOnly", &fWarnReadOnly, &size);
    14951506  size = sizeof(INT);
    14961507  PrfQueryProfileData(fmprof, appname, "Sort", &sortFlags, &size);
  • trunk/dll/init.h

    r1654 r1664  
    2929                combination of event and mutex semaphores
    3030  08 Jan 12 GKY Add support for changing PresParams in the notify status window
     31  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     32                copy, move and delete operations
     33  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     34                for delete of readonly files
    3135
    3236***********************************************************************/
     
    5963extern PCSZ PCSZ_IMAGEEXE;
    6064extern PCSZ PCSZ_LVMEXE;
     65extern PCSZ PCSZ_UNLOCKEXE;
    6166extern PCSZ PCSZ_ARCCNR;
    6267extern PCSZ PCSZ_COLLECTOR;
  • trunk/dll/ipf/fm3.ipf

    r1518 r1664  
    1212.* 01 Sep 08 GKY Change User-defined bmp (renamed) checkbox info to better describe what it does
    1313.* 29 Apr 09 SHL Start usinging nameits to ensure standard formatting
     14.* 04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     15.*               copy, move and delete operations
    1416.*
    1517.***********************************************************************
     
    6836851153   WPS Copy Files/Directories                           Y
    6846861154   Set Target Directory                                 N
     6871170   Unlock Files                                         Y
    6856882001   View INI Files                                       Y
    6866892003   Kill Process                                         N
  • trunk/dll/ipf/notebook.ipf

    r1493 r1664  
    2020.* 13 Dec 09 GKY Updated Quick page "Default" to match current defaults; added Gregg's way
    2121.*               option to Quick page.
     22.* 04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     23.*               for delete of readonly files
    2224.*
    2325.***********************************************************************
     
    656658from one dialog, so it has minimal impact and provides a safety net.
    657659:p.
     660:hp6.Warn if file is readonly:ehp6. If selected a warning dialog will
     661appear when you attempt to delete a readonly file or copy/move a file
     662over a readony file. Otherwise the file will be deleted/overwritten which
     663is what FM/2 always did for delete but not for copy/move which failed with
     664an error message.
     665:p.
    658666The :hp6.Verify disk writes:ehp6. toggle turns system-level write
    659667verification on and off. This is like typing :link reftype=launch
  • trunk/dll/ipf/rename.ipf

    r1419 r1664  
     1.***********************************************************************
     2.*
     3.* $Id$
     4.*
     5.* fm/2 help - Configuration dialogs usage
     6.*
     7.* Copyright (c) 1993-98 M. Kimes
     8.* Copyright (c) 2002-2012 Steven H.Levine
     9.*
     10.*
     11.* 04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     12.*               for delete of readonly files
     13.*
     14.***********************************************************************
     15.*
    116:h2 res=91400 name=PANEL_RENAME.Renaming
    217:i1 id=aboutRenaming.Renaming
     
    4257:p.
    4358The :hp1.Overwrite if target older or same:ehp1., :hp1. Overwrite if
    44 target newer:ehp1. and :hp1.Don't ask again:ehp1. checkboxes can be used
    45 in combination to avoid seeing this screen again for naming conflicts.
     59target newer:ehp1. :hp1.Overwrite if target is readonly (no warning):ehp1. and
     60:hp1.Don't ask again:ehp1. checkboxes can be used in combination to avoid seeing
     61this screen again for naming conflicts and to supress to readonly warning dialog
     62(it just overwrites the readonly files).
    4663Files which have existing targets that do not match an overwrite
    4764characteristic will be automatically skipped. For example, if you don't
  • trunk/dll/notebook.c

    r1574 r1664  
    6262  24 OCT 10 GKY Fixed spurious error message when labels in tree are changed with a
    6363                "not ready" drive selected
     64  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     65                for delete of readonly files
    6466
    6567***********************************************************************/
     
    188190BOOL fVerify;
    189191BOOL fViewChild;
     192BOOL fWarnReadOnly;
    190193HINI fmprof;
    191194ULONG fwsAnimate;
     
    15511554    WinCheckButton(hwnd, CFGG_ERRORBEEPOFF, fErrorBeepOff);
    15521555    WinCheckButton(hwnd, CFGG_ALERTBEEPOFF, fAlertBeepOff);
     1556    WinCheckButton(hwnd, CFGG_WARNREADONLY, fWarnReadOnly);
    15531557    {
    15541558      long th = fNoFinger ? 2 : (fNoDead ? 1 : 0);
     
    16751679    fErrorBeepOff = WinQueryButtonCheckstate(hwnd, CFGG_ERRORBEEPOFF);
    16761680    PrfWriteProfileData(fmprof, appname, "ErrorBeepOff",
    1677                         &fErrorBeepOff, sizeof(BOOL));
     1681                        &fErrorBeepOff, sizeof(BOOL));
     1682    fWarnReadOnly = WinQueryButtonCheckstate(hwnd, CFGG_WARNREADONLY);
     1683    PrfWriteProfileData(fmprof, appname, "WarnReadOnly",
     1684                        &fWarnReadOnly, sizeof(BOOL));
    16781685    {
    16791686      WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_QUERYVALUE,
  • trunk/dll/notebook.h

    r1434 r1664  
    1616  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1717  06 Jun 09 GKY Add option to show file system type or drive label in tree
     18  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     19                for delete of readonly files
    1820
    1921***********************************************************************/
     
    110112extern BOOL fVerify;
    111113extern BOOL fViewChild;
     114extern BOOL fWarnReadOnly;
    112115extern HINI fmprof;
    113116extern ULONG fwsAnimate;
  • trunk/dll/rename.c

    r1545 r1664  
    2020  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
    2121  23 Oct 10 GKY Add ForwardslashToBackslash function to streamline code
     22  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     23                for delete of readonly files
    2224
    2325***********************************************************************/
     
    8789      WinShowWindow(WinWindowFromID(hwnd, REN_OVEROLD), FALSE);
    8890      WinShowWindow(WinWindowFromID(hwnd, REN_OVERNEW), FALSE);
     91      WinShowWindow(WinWindowFromID(hwnd, REN_NOROWARN), FALSE);
    8992    }
    9093    break;
     
    310313          mv->overold = TRUE;
    311314        if (WinQueryButtonCheckstate(hwnd, REN_OVERNEW))
    312           mv->overnew = TRUE;
     315          mv->overnew = TRUE;
     316        if (WinQueryButtonCheckstate(hwnd,REN_NOROWARN))
     317          mv->noreadonlywarn = TRUE;
    313318        *mv->target = 0;
    314319        WinQueryDlgItemText(hwnd, REN_TARGET, CCHMAXPATH, mv->target);
  • trunk/dll/seeall.c

    r1559 r1664  
    5151  17 Jan 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
    5252  01 Dec 10 SHL Ensure FindAllThread thread quits fast when requested
     53  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     54                copy, move and delete operations
     55  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     56                for delete of readonly files
    5357
    5458***********************************************************************/
     
    870874        for (x = 0; list[x]; x++)
    871875          UUD(list[x], NULL);
    872         break;
     876        break;
     877
     878      case IDM_UNLOCKFILE:
     879        for (x = 0; list[x]; x++) {
     880          if (IsFile(list[x]) > 0 && fUnlock) {
     881            runemf2(SEPARATE | INVISIBLE | BACKGROUND | WAIT,
     882                    HWND_DESKTOP, pszSrcFile, __LINE__,
     883                    NULL, NULL, "%s %s", PCSZ_UNLOCKEXE, list[x]);
     884          }
     885        }
     886        break;
    873887
    874888      case IDM_EXTRACT:
     
    10771091              if (error) {
    10781092                DosError(FERR_DISABLEHARDERR);
    1079                 make_deleteable(list[x]);
     1093                make_deleteable(list[x], error);
    10801094                if (SHORT1FROMMP(mp1) == IDM_DELETE)
    10811095                  error = DosDelete(list[x]);
     
    33873401                                                    pAD->selected != 0));
    33883402        WinEnableMenuItem(pAD->hwndPopup, IDM_UUDECODE, (rc == 0 &&
     3403                                                         pAD->selected != 0));
     3404        WinEnableMenuItem(pAD->hwndPopup, IDM_UNLOCKFILE, (rc == 0 && fUnlock &&
    33893405                                                         pAD->selected != 0));
    33903406        WinEnableMenuItem(pAD->hwndPopup, IDM_EXTRACT, (rc == 0 &&
     
    38623878                            (rc == 0 && pAD->selected != 0));
    38633879          WinEnableMenuItem((HWND) mp2, IDM_UUDECODE,
    3864                             (rc == 0 && pAD->selected != 0));
     3880                            (rc == 0 && pAD->selected != 0));
     3881          WinEnableMenuItem((HWND) mp2, IDM_UNLOCKFILE,
     3882                            (rc == 0 && fUnlock && pAD->selected != 0));
    38653883          WinEnableMenuItem((HWND) mp2, IDM_EXTRACT,
    38663884                            (rc == 0 && pAD->selected != 0));
     
    42164234    case IDM_EXTRACT:
    42174235    case IDM_UUDECODE:
     4236    case IDM_UNLOCKFILE:
    42184237    case IDM_SHADOW:
    42194238    case IDM_OBJECT:
     
    42754294        case IDM_OPENSETTINGS:
    42764295        case IDM_OPENDEFAULT:
    4277         case IDM_UUDECODE:
     4296        case IDM_UUDECODE:
     4297        case IDM_UNLOCKFILE:
    42784298          {
    42794299            CHAR **list = BuildAList(hwnd);
     
    43074327              case IDM_ARCHIVE:
    43084328              case IDM_EXTRACT:
    4309               case IDM_UUDECODE:
     4329              case IDM_UUDECODE:
     4330              case IDM_UNLOCKFILE:
    43104331              case IDM_OBJECT:
    43114332              case IDM_SHADOW:
  • trunk/dll/worker.c

    r1646 r1664  
    4949                by temp file creation failures.
    5050  12 Nov 11 GKY Fixed extract failure caused by spaces in the arc file name.
     51  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     52                copy, move and delete operations
     53  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     54                for delete of readonly files
    5155
    5256***********************************************************************/
     
    118122#pragma data_seg(GLOBAL2)
    119123FILE *LogFileHandle;
     124BOOL fUnlock;
    120125
    121126#pragma data_seg(DATA2)
     
    222227          UINT x;
    223228          BOOL dontask = FALSE, wildcarding = FALSE, overold =
    224             FALSE, overnew = FALSE, usedtarget;
     229            FALSE, overnew = FALSE, noreadonlywarn = FALSE, usedtarget;
    225230
    226231          WinCancelShutdown(hmq2, TRUE);
     
    455460                  }
    456461                }
    457                 break;
     462                break;
     463
     464              case IDM_UNLOCKFILE:
     465                runemf2(SEPARATE | KEEP | WINDOWED//| INVISIBLE | BACKGROUND
     466                        | WAIT,
     467                        HWND_DESKTOP, pszSrcFile, __LINE__,
     468                        NULL, NULL, "%s %s", PCSZ_UNLOCKEXE, wk->li->list[x]);
     469                break;
    458470
    459471              case IDM_VIEWARCHIVE:
     
    707719                    // Target OK so far
    708720                    CHAR newname[CCHMAXPATH];
    709                     APIRET rc;
     721                    APIRET rc;
     722                    INT ret;
    710723                    FILESTATUS4L fs4;
    711724                    BOOL isnewer;
     
    793806                        overold = TRUE;
    794807                      if (mv.overnew)
    795                         overnew = TRUE;
     808                        overnew = TRUE;
     809                      if (mv.noreadonlywarn)
     810                        noreadonlywarn = TRUE;
    796811                      if (wildcarding || wk->li->type == IDM_RENAME) {
    797812                        p = strrchr(mv.target, '\\');
     
    856871                      priority_idle();
    857872
    858                     rc = docopyf(type, wk->li->list[x], newname);
     873                    rc = docopyf(type, wk->li->list[x], newname);
     874                    if (rc == ERROR_ACCESS_DENIED || rc == ERROR_SHARING_VIOLATION) {
     875                      if (rc == ERROR_ACCESS_DENIED && noreadonlywarn)
     876                        rc = -1;
     877                      ret = make_deleteable(newname, rc);
     878                      rc = docopyf(type, wk->li->list[x], newname);
     879                    }
     880                    if (!ret && (rc == ERROR_ACCESS_DENIED || (rc == ERROR_SHARING_VIOLATION && fUnlock)))
     881                      rc = NO_ERROR;
     882                    //if (fTurnOffReadOnly)
     883                    //  make_deleteable(newname, rc);
    859884                    if (fResetVerify) {
    860885                      DosSetVerify(fVerify);
    861886                      fResetVerify = FALSE;
    862887                    }
    863                     priority_normal();
     888                    priority_normal();
    864889                    if (rc) {
    865890                      if ((rc == ERROR_DISK_FULL ||
     
    17151740                  if (error) {
    17161741                    DosError(FERR_DISABLEHARDERR);
    1717                     make_deleteable(wk->li->list[x]);
     1742                    make_deleteable(wk->li->list[x], error);
    17181743                    if (wk->li->type == IDM_DELETE){
    17191744                      hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
  • trunk/dll/worker.h

    r1455 r1664  
    1111  05 Sep 08 JBS Ticket 187: Refactor FM3DLL.H
    1212  14 Sep 09 SHL Drop experimental code
     13  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     14                copy, move and delete operations
     15  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     16                for delete of readonly files
    1317
    1418***********************************************************************/
     
    3034  BOOL overnew;
    3135  BOOL overwrite;
     36  BOOL noreadonlywarn;
    3237}
    3338MOVEIT;
     
    4853// Data declarations
    4954extern FILE *LogFileHandle;
     55extern BOOL fUnlock;
    5056
    5157VOID Action(VOID * args);
  • trunk/fm3.rc

    r1444 r1664  
    2121                and rescans drive in tree container depending on container focus, greyed out
    2222                inappropriate menu context choices
     23  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     24                copy, move and delete operations
    2325
    2426***********************************************************************/
     
    138140BITMAP IDM_WPSMOVE          bitmaps\WPSMOVEB.BMP
    139141BITMAP IDM_UUDECODE         bitmaps\UDECODE.BMP
     142BITMAP IDM_UNLOCKFILE       bitmaps\UNLOCK.BMP
    140143
    141144#define AUTHOR_PICTURE           26102               /* fm3dlg.h */
  • trunk/fm4.rc

    r1444 r1664  
    1919                and rescans drive in tree container depending on container focus, greyed out
    2020                inappropriate menu context choices
     21  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     22                copy, move and delete operations
    2123               
    2224***********************************************************************/
     
    136138BITMAP IDM_WPSMOVE          bitmaps\WPSMOVEB.BMP
    137139BITMAP IDM_UUDECODE         bitmaps\UDECODE.BMP
     140BITMAP IDM_UNLOCKFILE       bitmaps\UNLOCK.BMP
    138141
    139142#define AUTHOR_PICTURE           26102               /* fm3dlg.h */
Note: See TracChangeset for help on using the changeset viewer.