Changeset 1041


Ignore:
Timestamp:
Jul 7, 2008, 1:30:30 AM (17 years ago)
Author:
Gregg Young
Message:

Adds optional support for delete being move to X/Eworkplace trashcan (ticket 43)

Location:
trunk/dll
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r1039 r1041  
    4848  15 Feb 08 GKY Fix "collect" so it updates recollected files and unhides them if needed
    4949  29 Feb 08 GKY Use xfree where appropriate
     50  06 Jul 08 GKY Update delete/undelete to include move to and open XWP trashcan
    5051
    5152***********************************************************************/
     
    17941795
    17951796      case IDM_UNDELETE:
    1796         {
     1797        {
    17971798          PCNRITEM pci;
    1798           CHAR path[CCHMAXPATH];
    1799 
    1800           pci = (PCNRITEM) CurrentRecord(hwnd);
    1801           if (pci) {
    1802             strcpy(path, pci->pszFileName);
    1803             MakeValidDir(path);
    1804             WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
    1805                       UNDEL_FRAME, MPFROMP(path));
     1799          CHAR path[CCHMAXPATH];
     1800          HOBJECT hObject;
     1801          HWND hwndDesktop;
     1802
     1803          hObject = WinQueryObject("<XWP_TRASHCAN>");
     1804          if (hObject != NULLHANDLE && fTrashCan) {
     1805            hwndDesktop = WinQueryDesktopWindow((HAB) 0, NULLHANDLE);
     1806            WinSetFocus(HWND_DESKTOP, hwndDesktop);
     1807            WinOpenObject(hObject, 0, TRUE);
     1808          }
     1809          else {
     1810            pci = (PCNRITEM) CurrentRecord(hwnd);
     1811            if (pci && (INT) pci != -1) {
     1812              strcpy(path, pci->pszFileName);
     1813              MakeValidDir(path);
     1814              WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
     1815                        UNDEL_FRAME, MPFROMP(path));
     1816            }
    18061817          }
    18071818        }
  • trunk/dll/common.c

    r1039 r1041  
    2121  26 Aug 07 SHL Change to DosSleep(0)
    2222  29 Feb 08 GKY Use xfree where appropriate
     23  06 Jul 08 GKY Update delete/undelete to include move to and open XWP trashcan
    2324
    2425***********************************************************************/
     
    237238    break;
    238239  case IDM_UNDELETE:
    239     WinDlgBox(HWND_DESKTOP,
    240               hwnd, UndeleteDlgProc, FM3ModHandle, UNDEL_FRAME, MPFROMP(dv));
     240    {
     241      HOBJECT hObject;
     242      HWND hwndDesktop;
     243
     244      hObject = WinQueryObject("<XWP_TRASHCAN>");
     245      if (hObject != NULLHANDLE && fTrashCan) {
     246        hwndDesktop = WinQueryDesktopWindow((HAB) 0, NULLHANDLE);
     247        WinSetFocus(HWND_DESKTOP, hwndDesktop);
     248        WinOpenObject(hObject, 0, TRUE);
     249      }
     250    else
     251      WinDlgBox(HWND_DESKTOP,
     252                hwnd,
     253                UndeleteDlgProc,
     254                FM3ModHandle, UNDEL_FRAME, MPFROMP(dv));
     255    }
    241256    break;
    242257  case IDM_CHKDSK:
  • trunk/dll/dircnrs.c

    r1039 r1041  
    4040  21 Jun 08 GKY Fix columns to honor preferences on new container open.
    4141  22 Jun 08 GKY Included free_... functions for fortify checking
     42  06 Jul 08 GKY Update delete/undelete to include move to and open XWP trashcan
    4243
    4344***********************************************************************/
     
    5354#define INCL_DOSERRORS
    5455#define INCL_LONGLONG
     56#define INCL_WINWORKPLACE
    5557
    5658#include "fm3dlg.h"
     
    20352037        {
    20362038          PCNRITEM pci;
    2037           CHAR path[CCHMAXPATH];
    2038 
    2039           pci = (PCNRITEM) CurrentRecord(hwnd);
    2040           if (pci && (INT) pci != -1) {
    2041             strcpy(path, pci->pszFileName);
    2042             MakeValidDir(path);
    2043             WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
    2044                       UNDEL_FRAME, MPFROMP(path));
     2039          CHAR path[CCHMAXPATH];
     2040          HOBJECT hObject;
     2041          HWND hwndDesktop;
     2042
     2043          hObject = WinQueryObject("<XWP_TRASHCAN>");
     2044          if (hObject != NULLHANDLE && fTrashCan) {
     2045            hwndDesktop = WinQueryDesktopWindow((HAB) 0, NULLHANDLE);
     2046            WinSetFocus(HWND_DESKTOP, hwndDesktop);
     2047            WinOpenObject(hObject, 0, TRUE);
     2048          }
     2049          else {
     2050            pci = (PCNRITEM) CurrentRecord(hwnd);
     2051            if (pci && (INT) pci != -1) {
     2052              strcpy(path, pci->pszFileName);
     2053              MakeValidDir(path);
     2054              WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
     2055                        UNDEL_FRAME, MPFROMP(path));
     2056            }
    20452057          }
    20462058        }
     
    20482060
    20492061      case IDM_UNDELETESPEC:
    2050         WinDlgBox(HWND_DESKTOP,
    2051                   hwnd,
    2052                   UndeleteDlgProc,
    2053                   FM3ModHandle, UNDEL_FRAME, MPFROMP(dcd->directory));
    2054         break;
     2062        {
     2063          HOBJECT hObject;
     2064          HWND hwndDesktop;
     2065
     2066          hObject = WinQueryObject("<XWP_TRASHCAN>");
     2067          if (hObject != NULLHANDLE && fTrashCan) {
     2068            hwndDesktop = WinQueryDesktopWindow((HAB) 0, NULLHANDLE);
     2069            WinSetFocus(HWND_DESKTOP, hwndDesktop);
     2070            WinOpenObject(hObject, 0, TRUE);
     2071          }
     2072        else
     2073          WinDlgBox(HWND_DESKTOP,
     2074                    hwnd,
     2075                    UndeleteDlgProc,
     2076                    FM3ModHandle, UNDEL_FRAME, MPFROMP(dcd->directory));
     2077        }
     2078        break;
    20552079
    20562080      case IDM_RESORT:
  • trunk/dll/ipf/context.ipf

    r985 r1041  
    1111.* 03 Mar 07 GKY Update that file systems other than HPFS support long names
    1212.* 29 Feb 08 GKY Document unhide menu item
     13.* 06 Jul 08 GKY Update delete/undelete to include option of using the XWP trashcan
    1314.*
    1415.***********************************************************************
     
    363364:p.
    364365:hp6.Delete:ehp6. deletes objects. If the :link reftype=hd
    365 res=92400.Confirm Delete:elink. toggle is on or one or more directories
     366res=99950.Confirm Delete:elink. toggle is on or if one or more directories
    366367are among the selected objects, you get a dialog showing the selected
    367368objects and asking you to confirm that you really meant what you said.
    368369In that dialog you have a chance to remove some of the objects. If you
    369370have OS/2's Undelete enabled for the drive on which the objects reside, they
    370 may be recoverable. :artwork runin name='\bitmaps\file.bmp'. :artwork runin name='\bitmaps\fldr.bmp'.
     371may be recoverable. You also have the option of having the files moved to the
     372Xworkplaces/Eworkplace trahshcan from which they may be restorable.:link reftype=hd
     373res=99950.Delete = move to trashcan:elink.
     374:artwork runin name='\bitmaps\file.bmp'. :artwork runin name='\bitmaps\fldr.bmp'.
    371375:p.
    372376:artwork name='..\..\bitmaps\permdel.bmp' align=center.
     
    746750:artwork name='..\..\bitmaps\undelete.bmp' align=center.
    747751:p.
    748 This leads to a dialog that interfaces with UNDELETE.COM to allow you to
     752If you have res=99950.Delete = move to trashcan:elink. enabled undelete
     753will open the trahscan to facilitate resoring files. You will need to
     754rescan the directory containers in order to see the restored files. Otherwise,
     755this leads to a dialog that interfaces with UNDELETE.COM to allow you to
    749756undelete files. The drive that will be operated on is determined by the
    750757highlighted object in the directory tree. This dialog filters out files
  • trunk/dll/ipf/notebook.ipf

    r994 r1041  
    1212.* 20 Mar 07 DG  Add description for Mommy make it stop
    1313.* 13 Aug 07 SHL Tweak scanning page
     14.* 06 Jul 08 GKY Update delete/undelete to include the option of using the XWP trashcan
    1415.*
    1516.***********************************************************************
     
    674675the "=" is the operating system default pointer.
    675676:p.
     677:hp6.Delete = move to trashcan:ehp6. controls what happens to files when
     678they are deleted. The default (not Checked) will keep the same behavior
     679FM/2 has always had. It will move the files to the OS/2 Deldir if it is
     680specified in config.sys. Otherwise it will simply delete the files
     681permanently. If this is selected and you have the trashcan from Xworkplace
     682or Eworkplace installed the files will be moved to the trashcan for possible
     683later restore.
     684:p.
    676685If the :hp6.Confirm target:ehp6. checkbox is checked, as it is by
    677686default, FM/2 allows you to confirm the target directory to be used when
  • trunk/dll/ipf/tutor.ipf

    r1035 r1041  
    99.*
    1010.* 05 Jan 07 GKY Update extraction tutorial
     11.* 06 Jul 08 GKY Update delete tutorial to include move to trashcan
    1112.*
    1213.***********************************************************************
     
    347348:artwork name='..\..\bitmaps\permdel.bmp' align=left.
    348349:p.
    349 There are two styles of deleting under FM/2 -- a "regular" delete, that
     350There are three styles of deleting under FM/2 -- a "regular" delete, that
    350351leaves the objects capable of being undeleted using OS/2's UNDELETE
    351 command or FM/2's Undelete Utility, and a "permanent" delete that does
     352command or FM/2's Undelete Utility, or uses the Xworkplace/Eworkplace
     353trashcan for file recovery, and a "permanent" delete that does
    352354not leave the object recoverable. "Permanent" deletions are usually
    353355faster than "recoverable" deletions. You can select which type you want
     
    358360is enabled to do non-permanent deletions. See :link reftype=launch
    359361object='VIEW.EXE' data='CMDREF.INF UNDELETE'.UNDELETE:elink. in the OS/2
    360 online help. Note&colon. FM/2 does not use the "Trashcan" that comes with
    361 eWorkPlace or XWorkPlace for non-permanent deletions. If you wish to use the
    362 "Trashcan" you can drag the items directly to it from FM/2.
     362online help.
    363363:p.
    364364You can delete objects in many ways&colon.
  • trunk/dll/notebook.c

    r1039 r1041  
    3030  22 Feb 08 JBS Ticket 230: Fix/improve various code related to state or presparam values in the INI file.
    3131  29 Feb 08 GKY Changes to enable user settable command line length
    32   29 Feb 08 GKY Use xfree where appropriate
    3332  08 Mar 08 JBS Ticket 230: Replace prefixless INI keys for default directory containers with
    34                 keys using a "DirCnr." prefix
     33  keys using a "DirCnr." prefix
     34  06 Jul 08 GKY Update delete/undelete to include move to and open XWP trashcan
    3535
    3636***********************************************************************/
     
    11151115    WinCheckButton(hwnd, CFGG_CONFIRMTARGET, fConfirmTarget);
    11161116    WinSetDlgItemText(hwnd, CFGG_TARGETDIR, targetdir);
     1117    WinCheckButton(hwnd, CFGG_TRASHCAN, fTrashCan);
    11171118    WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_SETCURRENTVALUE,
    11181119                      MPFROMLONG(MaxComLineStrg), MPVOID);
     
    12171218    fFM2Deletes = WinQueryButtonCheckstate(hwnd, CFGG_FM2DELETES);
    12181219    PrfWriteProfileData(fmprof, FM3Str, "FM2Deletes",
    1219                         &fFM2Deletes, sizeof(BOOL));
     1220                        &fFM2Deletes, sizeof(BOOL));
     1221    fTrashCan = WinQueryButtonCheckstate(hwnd, CFGG_TRASHCAN);
     1222    PrfWriteProfileData(fmprof, FM3Str, "TrashCan",
     1223                        &fTrashCan, sizeof(BOOL));
    12201224    fConfirmTarget = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMTARGET);
    12211225    PrfWriteProfileData(fmprof, appname, "ConfirmTarget",
Note: See TracChangeset for help on using the changeset viewer.