Changeset 1360


Ignore:
Timestamp:
Dec 28, 2008, 9:35:00 PM (17 years ago)
Author:
Gregg Young
Message:

Conditionally enable Refresh removable media and individual partition menu items based on availability of required tool in PATH. (Tickets 36 & 54)

Location:
trunk/dll
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/fm3dll2.h

    r1359 r1360  
    2323                to save/append just filename to clipboard
    2424  01 Sep 08 GKY Add IDM_*TLS for icon resources for the default toolbars
     25  27 Dec 08 GKY Add refresh removable media to tree container menus
    2526
    2627  Align with spaces only - no tabs please
  • trunk/dll/fm3res.rc

    r1359 r1360  
    4040  21 Nov 08 JBS Ticket 297: Added STRINGTABLE with COPYRIGHT_STRING
    4141  26 Dec 08 GKY Rework MLE menus (add "view") so toggle word wrap isn't buried on a submenu.
     42  27 Dec 08 GKY Add refresh removable media to tree container menus
    4243
    4344***********************************************************************/
     
    452453         SUBMENU "~Partition disks", IDM_PARTITIONSMENU
    453454{
    454                   MENUITEM "~MiniLVM - eCS only", IDM_PARTITION
    455                   MENUITEM "~DFSee - If installed in System Path",   IDM_PARTITIONDF
     455                  MENUITEM "~MiniLVM", IDM_PARTITION
     456                  MENUITEM "~DFSee",   IDM_PARTITIONDF
    456457                  MENUITEM "~LVMGUI", IDM_PARTITIONLVMG
    457                   MENUITEM "~FDisk - Do not use on LVM systems", IDM_PARTITIONFD
     458                  MENUITEM "~FDisk", IDM_PARTITIONFD
    458459}
    459460         MENUITEM "",                  -1,   MIS_SEPARATOR
     
    10601061  SUBMENU "~Partition disks", IDM_PARTITIONSMENU
    10611062          {
    1062                   MENUITEM "~MiniLVM - eCS only", IDM_PARTITION
    1063                   MENUITEM "~DFSee - If installed in System Path",   IDM_PARTITIONDF
     1063                  MENUITEM "~MiniLVM", IDM_PARTITION
     1064                  MENUITEM "~DFSee",   IDM_PARTITIONDF
    10641065                  MENUITEM "~LVMGUI", IDM_PARTITIONLVMG
    1065                   MENUITEM "~FDisk - Do not use on LVM systems", IDM_PARTITIONFD
     1066                  MENUITEM "~FDisk", IDM_PARTITIONFD
    10661067                }
    10671068  MENUITEM "",                  -1,                 MIS_SEPARATOR
     
    13471348         SUBMENU "~Partition disks", IDM_PARTITIONSMENU
    13481349         {
    1349                 MENUITEM "~MiniLVM - eCS only", IDM_PARTITION
    1350                 MENUITEM "~DFSee - If installed in System Path",   IDM_PARTITIONDF
     1350                MENUITEM "~MiniLVM", IDM_PARTITION
     1351                MENUITEM "~DFSee",   IDM_PARTITIONDF
    13511352                MENUITEM "~LVMGUI", IDM_PARTITIONLVMG
    1352                 MENUITEM "~FDisk - Do not use on LVM systems", IDM_PARTITIONFD
     1353                MENUITEM "~FDisk", IDM_PARTITIONFD
    13531354         }
    13541355         MENUITEM "",                -1,       MIS_SEPARATOR
  • trunk/dll/init.c

    r1358 r1360  
    6262  10 Dec 08 SHL Integrate exception handler support
    6363  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
     64  28 Dec 08 GKY Check for LVM.EXE and remove Refresh removable media menu item as appropriate
     65  28 Dec 08 GKY Rework partition submenu to gray out unavailable items (check for existence of files)
     66                and have no default choice.
    6467
    6568***********************************************************************/
     
    12321235  *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
    12331236  }
     1237  { // Check for the existance of various partitioning tools to set up menu items
     1238    CHAR *FullPath;
     1239    ULONG ulAppType;
     1240
     1241    FullPath = searchapath("PATH", "LVMGUI.CMD");
     1242    if (*FullPath)
     1243      fLVMGui = TRUE;
     1244    if (!DosQueryAppType("DFSOS2.EXE", &ulAppType))
     1245      fDFSee = TRUE;
     1246    if (!DosQueryAppType("MINILVM.EXE", &ulAppType))
     1247      fMiniLVM = TRUE;
     1248    if (!DosQueryAppType("FDISK.EXE", &ulAppType))
     1249      fFDisk = TRUE;
     1250    if (!DosQueryAppType("LVM.EXE", &ulAppType))
     1251      fLVM = TRUE;
     1252  }
    12341253
    12351254  // load preferences from profile (INI) file
  • trunk/dll/misc.c

    r1358 r1360  
    5252  23 Aug 08 GKY Add CheckDriveSpaceAvail To pre check drive space to prevent failures
    5353  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
     54  28 Dec 08 GKY Check for LVM.EXE and remove Refresh removable media menu item as appropriate
    5455
    5556***********************************************************************/
     
    17291730                   MPFROM2SHORT(IDM_OBJECTSUBMENU, TRUE), MPVOID);
    17301731      }
     1732      if (!fLVM)
     1733        WinSendMsg(TreeMenu, MM_DELETEITEM,
     1734                   MPFROM2SHORT(IDM_REFRESHREMOVABLES, TRUE), MPVOID);
    17311735    }
    17321736    else if (hwndMenu == &ArcMenu) {
     
    17581762                   MPFROM2SHORT(IDM_OBJECTSUBMENU, TRUE), MPVOID);
    17591763      }
     1764      if (!fLVM)
     1765        WinSendMsg(FileMenu, MM_DELETEITEM,
     1766                   MPFROM2SHORT(IDM_REFRESHREMOVABLES, TRUE), MPVOID);
    17601767    }
    17611768    else if (hwndMenu == &DirCnrMenu) {
     
    17691776    else if (hwndMenu == &TreeCnrMenu) {
    17701777      WinSetWindowUShort(TreeCnrMenu, QWS_ID, IDM_VIEWSMENU);
    1771       SetConditionalCascade(TreeCnrMenu, IDM_PARTITIONSMENU, IDM_PARTITION);
     1778      if (!fLVM)
     1779        WinSendMsg(TreeCnrMenu, MM_DELETEITEM,
     1780                   MPFROM2SHORT(IDM_REFRESHREMOVABLES, TRUE), MPVOID);
    17721781    }
    17731782    else if (hwndMenu == &ArcCnrMenu) {
  • trunk/dll/treecnr.c

    r1359 r1360  
    5454  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
    5555  26 Dec 08 GKY Implemented DROPHELP for the tree container
     56  27 Dec 08 GKY Add refresh removable media to tree container menus
     57  28 Dec 08 GKY Rework partition submenu to gray out unavailable items (check for existence of files)
     58                and have no default choice.
    5659
    5760***********************************************************************/
     
    132135BOOL fFollowTree;
    133136BOOL fTopDir;
     137BOOL fLVMGui;
     138BOOL fDFSee;
     139BOOL fFDisk;
     140BOOL fMiniLVM;
     141BOOL fLVM;
    134142HPOINTER hptrDunno;
    135143HWND hwndMainMenu;
     
    21982206  case WM_INITMENU:
    21992207    if (dcd) {
     2208
    22002209      switch (SHORT1FROMMP(mp1)) {
    22012210      case IDM_FILESMENU:
     
    22082217            BOOL writeable;
    22092218            BOOL removable;
    2210             BOOL remote;
     2219            BOOL local;
    22112220            BOOL underenv;
    22122221            CHAR chDrvU;
     
    22222231            writeable = rdy
    22232232              && !(driveflags[chDrvU - 'A'] & DRIVE_NOTWRITEABLE);
    2224             remote = rdy && (driveflags[chDrvU - 'A'] & (DRIVE_REMOTE || DRIVE_VIRTUAL)) == 0;
     2233            local = rdy && (!(driveflags[chDrvU - 'A'] & (DRIVE_REMOTE | DRIVE_VIRTUAL)));
    22252234            underenv = (pci->flags & RECFLAGS_UNDERENV) != 0;
    22262235
     
    22452254            WinEnableMenuItem((HWND) mp2, IDM_UNDELETE, writeable);
    22462255
    2247             WinEnableMenuItem((HWND) mp2, IDM_CHKDSK, writeable && !remote);
    2248             WinEnableMenuItem((HWND) mp2, IDM_FORMAT, writeable && !remote);
    2249             WinEnableMenuItem((HWND) mp2, IDM_OPTIMIZE, writeable && !remote);
    2250             WinEnableMenuItem((HWND) mp2, IDM_PARTITIONSMENU, !remote);
    2251 
    2252             WinEnableMenuItem((HWND) mp2, IDM_DETACH, remote);
     2256            WinEnableMenuItem((HWND) mp2, IDM_CHKDSK, writeable && local);
     2257            WinEnableMenuItem((HWND) mp2, IDM_FORMAT, writeable && local);
     2258            WinEnableMenuItem((HWND) mp2, IDM_OPTIMIZE, writeable && local);
     2259            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONSMENU, local);
     2260            WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM);
     2261            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee);
     2262            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);
     2263            WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk);
     2264
     2265            WinEnableMenuItem((HWND) mp2, IDM_DETACH, !local);
    22532266
    22542267            WinEnableMenuItem((HWND) mp2, IDM_EJECT, removable);
     
    22752288        CopyPresParams((HWND) mp2, hwndMainMenu);
    22762289        WinEnableMenuItem((HWND) mp2, IDM_RESELECT, FALSE);
     2290        WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM);
     2291        WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee);
     2292        WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);
     2293        WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk);
    22772294        break;
    22782295
  • trunk/dll/treecnr.h

    r1213 r1360  
    1010
    1111  Change log
     12  28 Dec 08 GKY Check for LVM.EXE and remove Refresh removable media menu item as appropriate
     13  28 Dec 08 GKY Rework partition submenu to gray out unavailable items (check for existence of files)
     14                and have no default choice.
    1215
    1316***********************************************************************/
     
    3538extern BOOL fFollowTree;
    3639extern BOOL fTopDir;
     40extern BOOL fLVMGui;
     41extern BOOL fDFSee;
     42extern BOOL fFDisk;
     43extern BOOL fMiniLVM;
     44extern BOOL fLVM;
    3745extern HPOINTER hptrDunno;
    3846extern HWND hwndMainMenu;
Note: See TracChangeset for help on using the changeset viewer.