Changeset 1444


Ignore:
Timestamp:
Jul 23, 2009, 1:24:23 AM (16 years ago)
Author:
Gregg Young
Message:

Rework of drivebar to rescan all drives and refresh media buttons and menu items grey out inappropriate menu items. Streamline Tree scan code and use semaphores to serialize access. Add NOEASUPPORT and LOCALHD driveflag; .LONGNAME usage fixes; (Tickets 377-386)

Location:
trunk
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/common.c

    r1438 r1444  
    2626  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    2727  08 Mar 09 GKY Additional strings move to PCSZs in init.c
     28  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     29                loads drive root directory in directory container or expands drive tree
     30                and rescans drive in tree container depending on container focus, greyed out
     31                inappropriate menu context choices
     32
    2833
    2934***********************************************************************/
     
    260265                  hwnd,
    261266                  SetDrvProc,
    262                   FM3ModHandle, DVS_FRAME, MPFROMP(dv)) && hwndTree)
    263       PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID);
     267                  FM3ModHandle, DVS_FRAME, MPFROMP(dv)) && hwndTree)
     268      if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(dv), MPVOID))
     269        PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID);
    264270    break;
    265271  case IDM_SIZES:
     
    377383          (fEjectFlpyScan ? TRUE : parm[1] > 1) &&
    378384          (fEjectCDScan ? TRUE : !(driveflags[parm[1]] & DRIVE_CDROM)) &&
    379           (fEjectRemovableScan ? TRUE : (parm[1] < 2 || driveflags[parm[1]] & DRIVE_CDROM)))
    380         PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     385          (fEjectRemovableScan ? TRUE : (parm[1] < 2 || driveflags[parm[1]] & DRIVE_CDROM))) {
     386        BOOL toggleTree = FALSE;
     387 
     388        if (!hwndTree) {
     389          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     390          toggleTree = TRUE;
     391        }
     392        WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     393        if (toggleTree)
     394          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     395      }
     396    }
     397    break;
     398
     399  case IDM_RESCAN:
     400    {
     401      BOOL toggleTree = FALSE;
     402
     403      if (!hwndTree) {
     404        WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     405        toggleTree = TRUE;
     406      }
     407      WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     408      if (toggleTree)
     409        WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     410    }
     411    break;
     412
     413  case IDM_REFRESHREMOVABLES:
     414    {
     415      BOOL toggleTree = FALSE;
     416
     417      if (!hwndTree) {
     418        WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     419        toggleTree = TRUE;
     420      }
     421      WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_REFRESHREMOVABLES, 0), MPVOID);
     422      if (toggleTree)
     423        WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
    381424    }
    382425    break;
  • trunk/dll/comp.c

    r1438 r1444  
    6767  15 Mar 09 GKY Use WriteDetailsSwitchs to save detail switch changes to the ini file.
    6868  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
     69  13 Jul 09 SHL Sync with renames
    6970
    7071***********************************************************************/
     
    766767        SleepIfNeeded(&itdSleep, 0);
    767768      } // while
    768       WinPostMsg(cmp->hwnd, WM_TIMER, MPFROMLONG(ID_TIMER), 0); // Force update
     769      WinPostMsg(cmp->hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0);    // Force update
    769770    Abort:
    770771      WinDestroyMsgQueue(hmq);
     
    822823
    823824      default:
     825        // 08 Feb 09 SHL fixme to support Ctrl-click for ANDed select
    824826        // 13 Jan 08 SHL fixme to decide if cmp->reset can ever get set
    825827        // if not lots of code can disappear
     
    14021404  }
    14031405
    1404   WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_TIMER), 0);  // Force update
     1406  WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0);     // Force update
    14051407  DosPostEventSem(CompactSem);
    14061408}
     
    18831885            pcil->pszDispAttr = FileAttrToString(pcil->attrFile);
    18841886            pcil->cbFile = filesl[l]->cbFile;
    1885             // 12 Jan 08 SHL fixme to used cached size here too
     1887            // 12 Jan 08 SHL fixme to use cached size here too
    18861888            CommaFmtULL(szBuf, sizeof(szBuf), pcil->cbFile, ' ');
    18871889            pcil->pszFmtFileSize = xstrdup(szBuf, pszSrcFile, __LINE__);
     
    22462248        }
    22472249      }
    2248       WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER, 500);
     2250      WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_COMP_TIMER, 500);
    22492251    }
    22502252    break;
     
    24572459      WinEnableWindowUpdate(hwndLeft, TRUE);
    24582460      WinEnableWindowUpdate(hwndRight, TRUE);
    2459       WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_TIMER), 0);      // Force update
     2461      WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0); // Force update
    24602462      // 12 Jan 08 SHL fixme to have SetButtonEnables(COMPARE* pcmp, BOOL fEnable)
    24612463      // to replace duplicated code here and elsewhere
     
    28842886
    28852887  case WM_COMMAND:
     2888    // 29 Apr 09 SHL  fixme to support more context menu items - IDM_EDIT, IDM_DELETE etc.
    28862889    switch (SHORT1FROMMP(mp1)) {
    28872890    case IDM_COMPARE:
     
    33643367    if (cmp) {
    33653368      // 17 Jan 08 SHL fixme to know if stop really needed?
    3366       WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER);
     3369      WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_COMP_TIMER);
    33673370      if (cmp->dcd.hwndLastMenu)
    33683371        WinDestroyWindow(cmp->dcd.hwndLastMenu);
  • trunk/dll/copyf.c

    r1443 r1444  
    2424  12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
    2525  13 Jul 09 SHL Drop obsolete code
     26  22 Jul 09 GKY Delete .LONGNAME EA if it becomes the filename on a copy or move.
    2627
    2728***********************************************************************/
     
    422423  }
    423424  /* If root name changed make sure longname EA goes away */
    424   p = RootName(oldname);
    425   pp = RootName(newname);
    426   if (stricmp(p, pp)) {
    427     zaplong = TRUE;
     425  if (*longname) {
     426    p = RootName(oldname);
     427    pp = RootName(longname);
     428    if (stricmp(p, pp)) {
     429      zaplong = TRUE;
     430    }
    428431  }
    429432
     
    518521            DosForceDelete(dir);
    519522          }
    520           if (zaplong)
    521             ZapLongName(dir);
     523          if (zaplong) {
     524            ret = ZapLongName(dir);
     525          }
    522526          Broadcast((HAB) 0, hwndMain, UM_UPDATERECORD, MPFROMP(dir), MPVOID);
    523527        }
  • trunk/dll/dircnrs.c

    r1439 r1444  
    6565  29 Mar 09 SHL Increase extended search timeout to 3 seconds
    6666  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
     67  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
     68  22 Jul 09 SHL Cleanup of SETFOCUS code
    6769
    6870***********************************************************************/
     
    805807                            MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    806808          if (!pciC) {
    807             if (fInitialDriveScan)
    808               Stubby(dcd->hwndCnr, pci);
    809             else {
    810               while (StubbyScanCount != 0)
    811                 DosSleep(50);
    812               Stubby(dcd->hwndCnr, pci);
    813             }
     809            Stubby(dcd->hwndCnr, pci);
    814810          }
    815811        }
     
    859855      }
    860856      RemoveCnrItems(dcd->hwndCnr, NULL, 0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE);
    861       AdjustCnrColsForFSType(dcd->hwndCnr, dcd->directory, &dcd->ds);
     857      AdjustCnrColsForFSType(dcd->hwndCnr, dcd->directory, &dcd->ds, FALSE);
    862858      dcd->ullTotalBytes = dcd->totalfiles =
    863859        dcd->selectedfiles = dcd->selectedbytes = 0;
     
    13481344
    13491345  case WM_SETFOCUS:
    1350     /*
    1351      * put name of our window (directory name) on status line
    1352      */
    1353     if (dcd && hwndStatus && mp2) {
    1354 
     1346    /* put name of our window (directory name) on status line */
     1347    if (mp2) {
     1348      // Getting focus
     1349      if (dcd && hwndStatus) {
     1350        /* put name of our window (directory name) on status line */
    13551351      PCNRITEM pci = NULL;
    1356 
    13571352      if (fAutoView && hwndMain) {
    13581353        pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
     
    13741369        PostMsg(hwndMain, UM_ADVISEFOCUS, MPFROMLONG(dcd->hwndFrame), MPVOID);
    13751370    }
    1376     if (mp2) {
     1371
    13771372      LastDir = hwnd;
    13781373      PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     1374
    13791375      if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) {
    13801376        PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
    1381 
    13821377        if (pszTempDir) {
    13831378          if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))
    1384             free(pszTempDir);
     1379            free(pszTempDir);           // Failed
    13851380        }
    13861381      }
     
    14511446                           CM_QUERYRECORDEMPHASIS,
    14521447                           MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
    1453           if (pci && (INT) pci != -1) {
     1448          if (pci && (INT) pci != -1) {
    14541449            if (fSplitStatus && hwndStatus2) {
    14551450              CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
     
    16011596        WinEnableMenuItem(DirCnrMenu, IDM_FINDINTREE, (hwndTree != (HWND) 0));
    16021597      }
    1603       PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
     1598      if (!fInitialDriveScan)
     1599        PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
    16041600    }
    16051601    else {
     
    16181614      SayView(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
    16191615                              DIR_VIEW), dcd->flWindowAttr);
    1620       //DbgMsg(pszSrcFile, __LINE__, "UM_SETUP2 %p pci %p", hwnd, dcd);
    16211616    } else
    16221617      PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
     
    24242419
    24252420      case IDM_SWITCH:
    2426         if (mp2) {
     2421        if (mp2) {
    24272422          strcpy(dcd->previous, dcd->directory);
    2428           strcpy(dcd->directory, (CHAR *)mp2);
     2423          strcpy(dcd->directory, (CHAR *)mp2);
    24292424          //DosEnterCritSec(); // GKY 11-27-08
    24302425          dcd->stopflag++;
    2431           //DosExitCritSec();
     2426          //DosExitCritSec();
    24322427          if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    24332428            strcpy(dcd->directory, dcd->previous);
     
    34843479    break;
    34853480
     3481  case WM_TIMER:
     3482    return ActionWMTimer(hwnd, mp1, mp2);
     3483
    34863484  case WM_CLOSE:
    34873485    WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID);
     
    36293627      /* Got match make found item current item */
    36303628      USHORT attrib = CRA_CURSORED;
     3629      // 29 Mar 09 SHL fixme to clear other object select if not extended select
    36313630      if (!stricmp(pci->pszDisplayName, dcd->szCommonName))
    36323631        attrib |= CRA_SELECTED;
  • trunk/dll/filldir.c

    r1440 r1444  
    7575                for tree container
    7676  13 Jul 09 SHL Avoid trap in FillInRecordFromFSA if pszFSType NULL
     77  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
     78  22 Jul 09 GKY Consolidated driveflag setting code in DriveFlagsOne
     79  22 Jul 09 GKY Streamline scanning code for faster Tree rescans
    7780
    7881***********************************************************************/
     
    132135PCSZ FM3Tools   = "<FM3_Tools>";
    133136PCSZ WPProgram  = "WPProgram";
    134 volatile INT StubbyScanCount;
    135 volatile INT ProcessDirCount;
    136137
    137138typedef struct {
     
    220221      hmq = WinCreateMsgQueue(thab, 0);
    221222      if (hmq) {
    222         StubbyScanCount++;
    223223        IncrThreadUsage();
    224224        priority_normal();
    225225        ret = Stubby(StubbyScan->hwndCnr, StubbyScan->pci);
    226         //DbgMsg(pszSrcFile, __LINE__, "Stubby %i ", ret);
    227226        if (ret == 1) {
    228227          if (WinIsWindow((HAB)0, StubbyScan->hwndCnr)) {
    229             WinSendMsg(StubbyScan->hwndCnr,
    230                        CM_INVALIDATERECORD,
    231                        MPFROMP(&StubbyScan->pci),
    232                        MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION));
    233             if ((fRScanLocal &&
    234                 (!(driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A'] &
    235                    ((DRIVE_REMOTE | DRIVE_VIRTUAL)))) ||
    236                  (fRScanRemote &&
    237                   (driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A'] &
    238                    DRIVE_REMOTE)) ||
    239                  (fRScanVirtual &&
    240                   (driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A'] &
    241                    DRIVE_VIRTUAL))) && fInitialDriveScan) {
    242               if (!(driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A'] &
    243                     ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) |
    244                      (fRScanSlow ? 0 : DRIVE_SLOW)))) {
    245                 WinSendMsg(StubbyScan->hwndCnr, CM_EXPANDTREE, MPFROMP(StubbyScan->pci), MPVOID);
    246                 //DbgMsg(pszSrcFile, __LINE__, "expanded %x %p", StubbyScan->hwndCnr, StubbyScan->pci);
    247                 WinSendMsg(StubbyScan->hwndCnr, CM_COLLAPSETREE, MPFROMP(StubbyScan->pci), MPVOID);
     228            ULONG flags = driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A'];
     229
     230            if (((fRScanLocal && ~flags & DRIVE_REMOTE && ~flags & DRIVE_VIRTUAL) ||
     231                 (fRScanRemote && flags & DRIVE_REMOTE) ||
     232                 (fRScanVirtual && flags & DRIVE_VIRTUAL)) && fInitialDriveScan) {
     233              if (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) |
     234                             (fRScanSlow ? 0 : DRIVE_SLOW)))) {
     235                UnFlesh(StubbyScan->hwndCnr, StubbyScan->pci);
     236                Flesh(StubbyScan->hwndCnr, StubbyScan->pci);
    248237              }
    249238            }
    250239          }
    251240        }
    252         if (WinIsWindow((HAB)0, StubbyScan->hwndDrivesList)) {
    253           WinSendMsg(StubbyScan->hwndDrivesList,
    254                      LM_INSERTITEM,
    255                      MPFROM2SHORT(LIT_SORTASCENDING, 0),
    256                      MPFROMP(StubbyScan->pci->pszFileName));
    257         }
    258         StubbyScanCount--;
    259241        WinDestroyMsgQueue(hmq);
    260242      }
     
    268250#  endif
    269251
    270   // _endthread();                      // 10 Dec 08 SHL
    271252}
    272253
     
    276257  HAB thab;
    277258  HMQ hmq = (HMQ) 0;
    278   //BOOL ret;
    279259
    280260  DosError(FERR_DISABLEHARDERR);
     
    290270      hmq = WinCreateMsgQueue(thab, 0);
    291271      if (hmq) {
    292         ProcessDirCount ++;
    293272        IncrThreadUsage();
    294273        priority_normal();
     
    303282                         ProcessDir->pulTotalFiles,     // Optional
    304283                         ProcessDir->pullTotalBytes);   // Optional
    305         ProcessDirCount --;
    306284        WinDestroyMsgQueue(hmq);
    307285      }
     
    315293#  endif
    316294
    317   // _endthread();                      // 10 Dec 08 SHL
    318295}
    319296
     
    433410  ULONG flags = driveflags[toupper(*pci->pszFileName) - 'A'];
    434411  BOOL fLoadSubjectForDrive = fLoadSubject && ~flags & DRIVE_NOLOADSUBJS;
    435   BOOL fLoadLongNameForDrive = fLoadLongnames &&  ~flags & DRIVE_NOLONGNAMES &&
     412  BOOL fLoadLongNameForDrive = fLoadLongnames &&  //~flags & DRIVE_NOLONGNAMES &&
    436413                               ~flags & DRIVE_NOLOADLONGS;
    437414  if (fLoadSubjectForDrive || fLoadLongNameForDrive) {
     
    580557
    581558  // load Subject and/or Longname EAs, if required and have EAs
    582   if (pffb->cbList > 4L && dcd)
     559  if (pffb->cbList > 4L && dcd &&
     560      !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOEASUPPORT))
    583561    FetchCommonEAs(pci);
    584562
     
    741719  // 13 Jul 09 SHL fixme to know if fetch can be bypassed if pszFSType already filled
    742720  // If FSType not supplied, assume don't need EAs either
    743   if (pfsa4->cbList > 4L && dcd && pszFSType)
     721  if (pfsa4->cbList > 4L && dcd &&
     722      !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOEASUPPORT))
    744723    FetchCommonEAs(pci);
    745724
     
    827806#   endif
    828807  }
    829   else
     808  else {
    830809    pci->pszFmtFileSize = NullStr;
     810    //DbgMsg(pszSrcFile, __LINE__, "Bypassed Format size %s", pci->pszDisplayName);
     811  }
    831812  pci->date.day = pfsa4->fdateLastWrite.day;
    832813  pci->date.month = pfsa4->fdateLastWrite.month;
     
    11821163    while (pci && (INT)pci != -1) {
    11831164      if ((pci->attrFile & FILE_DIRECTORY))
    1184         if (!fInitialDriveScan)
    1185           Stubby(hwndCnr, pci);
    1186         else {
    1187           while (StubbyScanCount != 0)
    1188             DosSleep(50);
    1189           Stubby(hwndCnr, pci);
    1190         }
     1165        Stubby(hwndCnr, pci);
    11911166      pci = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
    11921167                       MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
     
    12361211  ULONG ulDriveType;
    12371212  PCNRITEM pci, pciFirst = NULL, pciNext, pciParent = NULL;
    1238   INT x, removable;
     1213  INT x;// removable;
    12391214  CHAR suggest[32];
    12401215  CHAR szDrive[] = " :\\";
     
    13031278      ULONG flags = 0;
    13041279      ULONG size = sizeof(ULONG);
    1305       BOOL FSInfo = FALSE;
    13061280      struct {
    13071281              ULONG serial;
     
    13211295        if (!(driveflags[x] & DRIVE_NOPRESCAN)) {
    13221296          *szFSType = 0;
    1323           ulDriveType = 0;
    1324           removable = CheckDrive(*szDrive, szFSType, &ulDriveType);
    1325           driveserial[x] = -1;
    1326           if (removable != -1) {
    1327             DosError(FERR_DISABLEHARDERR);
    1328             if (!DosQueryFSInfo((ULONG) x + 1,
    1329                                 FSIL_VOLSER, &volser, sizeof(volser))) {
    1330               driveserial[x] = volser.serial;
    1331               FSInfo = TRUE;
    1332             }
    1333 
    1334           }
    1335           else
    1336             driveflags[x] |= DRIVE_INVALID;
    1337 
     1297          ulDriveType = 0;
     1298          memset(&volser, 0, sizeof(volser));
     1299          DriveFlagsOne(x, szFSType, &volser);
     1300          driveserial[x] = volser.serial;
    13381301          memset(&fsa4, 0, sizeof(FILESTATUS4L));
    1339           driveflags[x] |= removable == -1 || removable == 1 ? DRIVE_REMOVABLE : 0;
    1340           if (ulDriveType & DRIVE_REMOTE)
    1341             driveflags[x] |= DRIVE_REMOTE;
    1342           if (!stricmp(szFSType,RAMFS)) {
    1343             driveflags[x] |= DRIVE_RAMDISK;
    1344             driveflags[x] &= ~DRIVE_REMOTE;
    1345           }
    1346           if (!stricmp(szFSType,NDFS32)) {
    1347             driveflags[x] |= DRIVE_VIRTUAL;
    1348             driveflags[x] &= ~DRIVE_REMOTE;
    1349           }
    1350           if (!stricmp(szFSType,NTFS))
    1351             driveflags[x] |= DRIVE_NOTWRITEABLE;
    1352           if (strcmp(szFSType, HPFS) &&
    1353               strcmp(szFSType, JFS) &&
    1354               strcmp(szFSType, ISOFS) &&
    1355               strcmp(szFSType, CDFS) &&
    1356               strcmp(szFSType, FAT32) &&
    1357               strcmp(szFSType, NDFS32) &&
    1358               strcmp(szFSType, RAMFS) &&
    1359               strcmp(szFSType, NTFS) &&
    1360               strcmp(szFSType, HPFS386)) {
    1361             driveflags[x] |= DRIVE_NOLONGNAMES;
    1362           }
    1363 
    1364           if (!strcmp(szFSType, CDFS) || !strcmp(szFSType,ISOFS)) {
    1365             removable = 1;
    1366             driveflags[x] |= DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM;
    1367           }
    1368           if (!stricmp(szFSType, CBSIFS)) {
    1369             driveflags[x] |= DRIVE_ZIPSTREAM;
    1370             driveflags[x] &= ~DRIVE_REMOTE;
    1371             if (ulDriveType & DRIVE_REMOVABLE)
    1372               driveflags[x] |= DRIVE_REMOVABLE;
    1373             if (!(ulDriveType & DRIVE_NOLONGNAMES))
    1374               driveflags[x] &= ~DRIVE_NOLONGNAMES;
    1375           }
    13761302          if (!fVerifyOffChecked[x]) {
    13771303            if (driveflags[x] & DRIVE_REMOVABLE)
     
    13851311            }
    13861312          }
    1387           if (strcmp(volser.volumelabel, NullStr) != 0 && FSInfo && fShowDriveLabelInTree)
     1313          if (stricmp(volser.volumelabel, NullStr) != 0 && fShowDriveLabelInTree)
    13881314            strcpy(szFSType, volser.volumelabel);
    13891315          pci->rc.flRecordAttr |= CRA_RECORDREADONLY;
     
    13911317            pci->rc.flRecordAttr |= (CRA_CURSORED | CRA_SELECTED);
    13921318
    1393           if (removable == 0) {
     1319          if (!(driveflags[x] & DRIVE_REMOVABLE)) {
    13941320            // Fixed volume
    13951321            pci->attrFile |= FILE_DIRECTORY;
     
    16221548                                MPVOID,
    16231549                                MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    1624     StubbyScanCount ++;
    16251550    while (pci && (INT)pci != -1) {
    16261551      stubbyScan = xmallocz(sizeof(STUBBYSCAN), pszSrcFile, __LINE__);
     
    16301555      stubbyScan->hwndCnr = hwndCnr;
    16311556      stubbyScan->hwndDrivesList = hwndDrivesList;
    1632       //stubbyScan->RamDrive = FALSE;
    16331557      pciNext = (PCNRITEM) WinSendMsg(hwndCnr,
    16341558                                      CM_QUERYRECORD,
     
    16501574            {
    16511575              xfree(stubbyScan, pszSrcFile, __LINE__);
    1652             }
     1576            }
    16531577          } // if drive for scanning
    16541578          else
     
    16711595      pci = pciNext;
    16721596    } // while
    1673     StubbyScanCount--;
    16741597  }
    16751598  if (hwndParent)
     
    17661689  }
    17671690  didonce = TRUE;
    1768   if (fInitialDriveScan) {
    1769     HWND hwndDrivesList = WinWindowFromID(WinQueryWindow(hwndParent, QW_PARENT),
    1770                                           MAIN_DRIVELIST);
    1771     while (StubbyScanCount != 0 || ProcessDirCount != 0)
    1772       DosSleep(50);
    1773     WinShowWindow(hwndCnr, TRUE);
    1774     WinShowWindow(hwndDrivesList, TRUE);
    1775     fInitialDriveScan = FALSE;
    1776   }
    17771691} // FillTreeCnr
    17781692
  • trunk/dll/filldir.h

    r1430 r1444  
    1313  08 Mar 09 GKY Additional strings move to PCSZs
    1414  06 Jun 09 GKY Add option to show file system type or drive label in tree
     15  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
    1516
    1617***********************************************************************/
     
    6162extern HPOINTER hptrReadonly;
    6263extern HPOINTER hptrSystem;
    63 extern volatile INT StubbyScanCount;
    64 extern volatile INT ProcessDirCount;
    6564
    6665typedef struct {
  • trunk/dll/fm3dlg.h

    r1431 r1444  
    3232  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    3333  06 Jun 09 GKY Add option to show file system type or drive label in tree
     34  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     35  22 Jul 09 GKY Add LocalHD driveflag
    3436
    3537***********************************************************************/
     
    920922#define DVS_SLOW                                                                                        27014
    921923#define DVS_INCLUDEFILES                                                                27015
    922 #define DVS_VIRTUAL                                                                             27016
    923 #define DVS_NOSTATS                                                                             27017
    924 #define DVS_RAMDISK                                                                             27018
    925 #define DVS_WRITEVERIFYOFF                                                                      27019
    926 #define DVS_RSCANNED                                                                            27020
    927 
    928 #define MRG_FRAME                                                                                       27100
     924#define DVS_VIRTUAL                                                                     27016
     925#define DVS_NOSTATS                                                                     27017
     926#define DVS_RAMDISK                                                                     27018
     927#define DVS_WRITEVERIFYOFF                                                              27019
     928#define DVS_RSCANNED                                                                    27020
     929#define DVS_LOCALHD                                                                     27021
     930#define DVS_NOEASUPPORT                                                                 27022
     931
     932#define MRG_FRAME                                                                       27100
    929933#define MRG_LISTBOX                                                                             27101
    930934#define MRG_TOP                                                                                 27102
  • trunk/dll/fm3dll.h

    r1403 r1444  
    9090  25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session
    9191                to prevent duplicate directory names in tree following a copy before initial scan.
     92  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     93                loads drive root directory in directory container or expands drive tree
     94                and rescans drive in tree container depending on container focus, greyed out
     95                inappropriate menu context choices
    9296
    9397***********************************************************************/
     
    151155#define DRIVE_WRITEVERIFYOFF 0x00040000
    152156#define DRIVE_RSCANNED      0x00080000
     157#define DRIVE_LOCALHD       0x00200000
     158#define DRIVE_NOEASUPPORT   0x00400000
    153159
    154160#define SORT_FIRSTEXTENSION 0x00000001
  • trunk/dll/fm3dll2.h

    r1437 r1444  
    2626  28 Dec 08 GKY Added Databar to utilities menu
    2727  27 Jun 09 GKY Remove IDM_DRIVEATEXT (3950) Drivebar update
     28  13 Jul 09 SHL Rename timer ids
    2829
    2930  Align with spaces only - no tabs please
     
    5354#define MAIN_TRASHCAN       98
    5455
    55 #define ID_TIMER            4
    5656#define ID_STICK1           5
    5757#define ID_STICK2           6
     
    6464#define ID_STICK42          13
    6565#define ID_STICK52          14
    66 #define ID_TIMER2           15
    67 #define ID_TIMER3           16
    68 
    69 #define ID_TIMER4           19
    70 #define ID_TIMER5           20
    71 #define ID_TIMER6           21
     66
     67// 13 Jul 09 SHL fixme to know if timer ids unique to queue or window
     68// WM_TIMER timer ids - assume ids can be shared
     69#define ID_ABOUT_TIMER      4
     70#define ID_COMP_TIMER       4
     71#define ID_NOTIFY_TIMER     15
     72// #define ID_TIMER3           16       // 13 Jul 09 SHL Dropped
     73#define ID_ACTION_TIMER     16          // 13 Jul 09 SHL Added
     74// #define ID_TIMER4           19       // 13 Jul 09 SHL Dropped
     75#define ID_NEWVIEW_TIMER    20
     76// #define ID_TIMER6           21       // 13 Jul 09 SHL Dropped
    7277
    7378#define MAIN_STATUS2        19
     
    202207#define VIRTUAL_ICON        925
    203208#define RAMDISK_ICON        926
     209#define DONNO_ICON          927
    204210
    205211#define IDM_HELPMOUSE       987
     
    560566#define IDM_LOADTOOLS       6013
    561567
     568#define IDM_RESCANALL       7000
     569#define IDM_REFRESHREMOVABLE 7001
     570
    562571#define IDM_WINDOWSMENU     9000
    563572#define IDM_TILE            9001
     
    692701// #define UM_BUTTON2UP        (WM_USER + 33)           // Unused, 13 Sep 08 JBS
    693702#define UM_COLLECTFROMFILE  (WM_USER + 34)
    694 #define UM_TIMER            (WM_USER + 35)
     703#define UM_TIMER            (WM_USER + 35)              // 13 Jul 09 SHL fixme to have better name
    695704// #define UM_HELPON           (WM_USER + 36)           // Unused, 13 Sep 08 JBS
    696705#define UM_SETUP2           (WM_USER + 37)
  • trunk/dll/fm3res.dlg

    r1435 r1444  
    4545  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    4646  06 Jun 09 GKY Add option to show file system type or drive label in tree
     47  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     48  22 Jul 09 GKY Add LocalHD driveflag (enlarge draveflag dialog)
    4749
    4850***********************************************************************/
     
    20152017DLGTEMPLATE DVS_FRAME LOADONCALL MOVEABLE DISCARDABLE
    20162018BEGIN
    2017     DIALOG  "FM/2: Drive flags", DVS_FRAME, 12, 6, 218, 136, WS_VISIBLE,
     2019    DIALOG  "FM/2: Drive flags", DVS_FRAME, 12, 6, 218, 156, WS_VISIBLE,
    20182020            FCF_TITLEBAR
    20192021    BEGIN
    2020         CHECKBOX       "Virtual Drive", DVS_VIRTUAL, 4, 126, 94, 10,
     2022        CHECKBOX       "Local Hard Drive", DVS_LOCALHD, 4, 142, 94, 10,
    20212023                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20222024                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2023         CHECKBOX        "Removable", DVS_REMOVABLE, 4, 114, 94, 10,
     2025        CHECKBOX       "Virtual Drive", DVS_VIRTUAL, 4, 130, 94, 10,
    20242026                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20252027                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2026         CHECKBOX        "RAMDISK", DVS_RAMDISK, 4, 102, 98, 10,
     2028        CHECKBOX        "Removable", DVS_REMOVABLE, 4, 118, 94, 10,
    20272029                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20282030                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2029         CHECKBOX        "Remote Drive", DVS_REMOTE, 4, 90, 94, 10,
     2031        CHECKBOX        "RAMDISK", DVS_RAMDISK, 4, 106, 94, 10,
    20302032                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20312033                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2032         CHECKBOX        "CD-ROM", DVS_CDROM, 4, 78, 94, 10,
     2034        CHECKBOX        "Remote Drive", DVS_REMOTE, 4, 94, 94, 10,
    20332035                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20342036                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2035         CHECKBOX        "Zipstream", DVS_ZIPSTREAM, 4, 66, 94, 10,
     2037        CHECKBOX        "CD-ROM", DVS_CDROM, 4, 82, 94, 10,
    20362038                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20372039                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2038         CHECKBOX        "Ignore", DVS_IGNORE, 4, 54, 94, 10,
     2040        CHECKBOX        "Zipstream", DVS_ZIPSTREAM, 4, 70, 94, 10,
    20392041                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20402042                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2041         CHECKBOX        "Boot drive", DVS_BOOT, 4, 42, 94, 10,
     2043        CHECKBOX        "Ignore", DVS_IGNORE, 4, 58, 94, 10,
    20422044                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20432045                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2044         CHECKBOX        "Invalid", DVS_INVALID, 4, 30, 94, 10,
     2046        CHECKBOX        "Boot drive", DVS_BOOT, 4, 46, 94, 10,
    20452047                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20462048                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2047         CHECKBOX        "Recursive scan done", DVS_RSCANNED, 4, 18, 94, 10,
     2049        CHECKBOX        "Invalid", DVS_INVALID, 4, 34, 94, 10,
    20482050                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20492051                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2050         CHECKBOX        "Not writeable", DVS_NOTWRITEABLE, 106, 126, 94, 10,
     2052        CHECKBOX        "Recursive scan done", DVS_RSCANNED, 4, 22, 94, 10,
    20512053                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20522054                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2053         CHECKBOX        "~No longnames", DVS_NOLONGNAMES, 106, 114, 94, 10,
     2055        CHECKBOX       "No EA support", DVS_NOEASUPPORT, 106, 142, 94, 10,
     2056                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     2057                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L               
     2058        CHECKBOX        "Not writeable", DVS_NOTWRITEABLE, 106, 130, 94, 10,
    20542059                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    20552060                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2056         AUTOCHECKBOX    "No ~Prescan", DVS_NOPRESCAN, 106, 102, 94, 10,
    2057                         BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    2058         AUTOCHECKBOX    "~Don't load icons", DVS_NOLOADICONS, 106, 90, 94,10, BS_NOPOINTERFOCUS
    2059         AUTOCHECKBOX    "Don't load ~subjects", DVS_NOLOADSUBJS, 106, 78, 94,10, BS_NOPOINTERFOCUS
    2060         AUTOCHECKBOX    "Don't load ~longnames", DVS_NOLOADLONGS, 106, 66,106, 10, BS_NOPOINTERFOCUS
    2061         AUTOCHECKBOX    "Slo~w drive", DVS_SLOW, 106, 54, 94, 10, BS_NOPOINTERFOCUS
    2062         AUTOCHECKBOX    "Include ~files in tree", DVS_INCLUDEFILES, 106, 42,106, 10, BS_NOPOINTERFOCUS
    2063         AUTOCHECKBOX    "~No drive stats", DVS_NOSTATS, 106, 30, 106, 10, BS_NOPOINTERFOCUS
    2064         AUTOCHECKBOX    "Write ~verify off", DVS_WRITEVERIFYOFF, 106, 18, 106, 10, BS_NOPOINTERFOCUS
     2061        CHECKBOX        "~No longnames", DVS_NOLONGNAMES, 106, 118, 94, 10,
     2062                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     2063                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
     2064        AUTOCHECKBOX    "No ~Prescan", DVS_NOPRESCAN, 106, 106, 94, 10,
     2065                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     2066        AUTOCHECKBOX    "~Don't load icons", DVS_NOLOADICONS, 106, 94, 94,10, BS_NOPOINTERFOCUS
     2067        AUTOCHECKBOX    "Don't load ~subjects", DVS_NOLOADSUBJS, 106, 82, 94,10, BS_NOPOINTERFOCUS
     2068        AUTOCHECKBOX    "Don't load ~longnames", DVS_NOLOADLONGS, 106, 70,106, 10, BS_NOPOINTERFOCUS
     2069        AUTOCHECKBOX    "Slo~w drive", DVS_SLOW, 106, 58, 94, 10, BS_NOPOINTERFOCUS
     2070        AUTOCHECKBOX    "Include ~files in tree", DVS_INCLUDEFILES, 106, 46,106, 10, BS_NOPOINTERFOCUS
     2071        AUTOCHECKBOX    "~No drive stats", DVS_NOSTATS, 106, 34, 106, 10, BS_NOPOINTERFOCUS
     2072        AUTOCHECKBOX    "Write ~verify off", DVS_WRITEVERIFYOFF, 106, 22, 106, 10, BS_NOPOINTERFOCUS
    20652073        DEFPUSHBUTTON   "Okay", DID_OK, 4, 4, 40, 14, BS_NOPOINTERFOCUS | WS_GROUP
    20662074        PUSHBUTTON      "~Help", IDM_HELP, 64, 4, 40, 14, BS_NOPOINTERFOCUS
  • trunk/dll/fm3res.rc

    r1439 r1444  
    4949  06 Jun 09 GKY Status line to show file sys/label not shown in tree; shortened to fit split status
    5050  06 Jul 09 SHL Error message for Refactor .LONGNAME and .SUBJECT EA fetch to FetchCommonEAs
     51  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     52                loads drive root directory in directory container or expands drive tree
     53                and rescans drive in tree container depending on container focus, greyed out
     54                inappropriate menu context choices
    5155
    5256***********************************************************************/
     
    389393         MENUITEM "",                -1,       MIS_SEPARATOR
    390394         MENUITEM "~Rescan\tCtrl + R",       IDM_RESCAN
    391          MENUITEM "~Refresh Removable Media",  IDM_REFRESHREMOVABLES
     395         MENUITEM "Refresh Remo~vable Media",  IDM_REFRESHREMOVABLES
    392396         MENUITEM "",                  -1,                 MIS_SEPARATOR
    393397         MENUITEM "~.Parent\tCtrl + .",      IDM_PARENT
     
    10361040  MENUITEM "",                -1,       MIS_SEPARATOR
    10371041  MENUITEM "~Rescan\tCtrl + R",   IDM_RESCAN
    1038   MENUITEM "~Refresh Removable Media",  IDM_REFRESHREMOVABLES
     1042  MENUITEM "Refresh Remo~vable Media",  IDM_REFRESHREMOVABLES
    10391043  MENUITEM "",                -1,       MIS_SEPARATOR
    10401044  MENUITEM "~Filter...\tCtrl + f",IDM_FILTER
     
    13401344  MENUITEM "",                -1,       MIS_SEPARATOR
    13411345  MENUITEM "~Rescan",           IDM_UPDATE
    1342   MENUITEM "~Refresh Removable Media",  IDM_REFRESHREMOVABLES
     1346  MENUITEM "Refresh Remo~vable Media",  IDM_REFRESHREMOVABLES
    13431347  MENUITEM "",                -1,       MIS_SEPARATOR
    13441348  SUBMENU  "E~xpand/Collapse",  IDM_EXPANDSUBMENU
     
    13951399  MENUITEM "~Lock",           IDM_LOCK
    13961400  MENUITEM "U~nlock",         IDM_UNLOCK
     1401  MENUITEM "",                -1,       MIS_SEPARATOR
     1402  MENUITEM "Re~scan all drives",           IDM_RESCAN
     1403  MENUITEM "Refresh Remo~vable Media",  IDM_REFRESHREMOVABLES
    13971404}
    13981405
     
    32773284    IDS_DRAGDROPDIALOGTEXT                "Drag & Drop Dialog"
    32783285    IDS_ERROREATYPETEXT                   "EA type 0x%x unexpected for %.*s"
     3286    IDS_RESCANALLDRIVESTEXT               "Rescan all drives"
     3287    IDS_REFRESHREMOVABLESTEXT             "Refresh removable media"
    32793288
    32803289    // Add strings that need to be combined by GetPString here
  • trunk/dll/fm3str.h

    r1439 r1444  
    3232  06 Jun 09 GKY Status line to show file sys/label not shown in tree; shortened to fit split status
    3333  06 Jul 09 SHL Error message for Refactor .LONGNAME and .SUBJECT EA fetch to FetchCommonEAs
     34  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     35                loads drive root directory in directory container or expands drive tree
     36                and rescans drive in tree container depending on container focus, greyed out
     37                inappropriate menu context choices
    3438
    3539***********************************************************************/
     
    10021006#define IDS_DRAGDROPDIALOGTEXT                               1013
    10031007#define IDS_ERROREATYPETEXT                                  1014
     1008#define IDS_RESCANALLDRIVESTEXT                              1015
     1009#define IDS_REFRESHREMOVABLESTEXT                            1016
    10041010
    10051011//The following strings were cut up form the string of the root name (ie IDS_SUGGEST1TEXT)
  • trunk/dll/info.c

    r1439 r1444  
    3434  12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
    3535  12 Jul 09 GKY Remove code to update recursive scan setting which isn't user setable
     36  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     37  22 Jul 09 GKY Add LocalHD driveflag
    3638
    3739***********************************************************************/
     
    929931      sprintf(s, GetPString(IDS_DRIVEFLAGSTITLETEXT), toupper(*(CHAR *)mp2));
    930932      WinSetWindowText(hwnd, s);
    931 /*
    932         WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOVABLE),FALSE);
    933         WinEnableWindow(WinWindowFromID(hwnd,DVS_NOTWRITEABLE),FALSE);
    934         WinEnableWindow(WinWindowFromID(hwnd,DVS_IGNORE),FALSE);
    935         WinEnableWindow(WinWindowFromID(hwnd,DVS_CDROM),FALSE);
    936         WinEnableWindow(WinWindowFromID(hwnd,DVS_NOLONGNAMES),FALSE);
    937         WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOTE),FALSE);
    938         WinEnableWindow(WinWindowFromID(hwnd,DVS_VIRTUAL),FALSE);
    939         WinEnableWindow(WinWindowFromID(hwnd,DVS_RAMDISK),FALSE);
    940         WinEnableWindow(WinWindowFromID(hwnd,DVS_BOOT),FALSE);
    941         WinEnableWindow(WinWindowFromID(hwnd,DVS_INVALID),FALSE);
    942         WinEnableWindow(WinWindowFromID(hwnd,DVS_ZIPSTREAM),FALSE);
    943         WinEnableWindow(WinWindowFromID(hwnd,DVS_NOSTATS),FALSE);
    944 */
    945933      PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
    946934    }
     
    989977                     ((driveflags[drive] & DRIVE_WRITEVERIFYOFF) != 0));
    990978      WinCheckButton(hwnd,DVS_RSCANNED,
    991                      ((driveflags[drive] & DRIVE_RSCANNED) != 0));
     979                     ((driveflags[drive] & DRIVE_RSCANNED) != 0));
     980      WinCheckButton(hwnd,DVS_LOCALHD,
     981                     ((driveflags[drive] & DRIVE_LOCALHD) != 0));
     982      WinCheckButton(hwnd,DVS_NOEASUPPORT,
     983                     ((driveflags[drive] & DRIVE_NOEASUPPORT) != 0));
    992984    }
    993985    return 0;
  • trunk/dll/init.c

    r1439 r1444  
    8282  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
    8383  12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
     84  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
     85  22 Jul 09 GKY Fix failure to restore the notebook setting for saving container states or not
    8486
    8587***********************************************************************/
     
    180182HMTX hmtxFM2Delete;
    181183HMTX hmtxFM2Globals;
     184HMTX hmtFillingTreeCnr;
     185HEV  hevInitialCnrScanComplete;
    182186ULONG OS2ver[2];
    183187PFNWP PFNWPCnr;
     
    10881092  if (DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE))
    10891093    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    1090               PCSZ_DOSCREATEMUTEXSEM);
     1094              PCSZ_DOSCREATEMUTEXSEM);
     1095  if (DosCreateMutexSem(NULL, &hmtFillingTreeCnr, 0L, FALSE))
     1096    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     1097              PCSZ_DOSCREATEMUTEXSEM);
     1098  if (DosCreateEventSem(NULL, &hevInitialCnrScanComplete, 0L, FALSE))
     1099    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     1100              PCSZ_DOSCREATEMUTEXSEM);
    10911101
    10921102  /*
     
    13821392  size = sizeof(BOOL);
    13831393  PrfQueryProfileData(fmprof, appname, "ConfirmDelete", &fConfirmDelete, &size);
    1384   /*size = sizeof(BOOL);   Replaced by UM_SHOWME check 3/14/09 GKY
     1394  size = sizeof(BOOL); 
    13851395  PrfQueryProfileData(fmprof, FM3Str, "SaveState", &fSaveState, &size);
    1386   if (fSaveState && (fSwitchTreeOnFocus || fSwitchTree) &&
    1387       (!strcmp(realappname, FM3Str) || !strcmp(realappname, "FM/4"))) {
    1388     CHAR szKey[STATE_NAME_MAX_BYTES + 80];
    1389     CHAR szDir[CCHMAXPATH];
    1390     ULONG drvNum;
    1391 
    1392     if (!strcmp(realappname, "FM/4"))
    1393       strcpy(szKey, "FM/4 Dir1");
    1394     else
    1395       sprintf(szKey, "%s.DirCnrDir.0", PCSZ_SHUTDOWNSTATE);
    1396     size = sizeof(szDir);
    1397     if (PrfQueryProfileData(fmprof, appname, szKey, szDir, &size)) {
    1398       drvNum = toupper(*szDir) - 'A';
    1399       fDrivetoSkip[drvNum] = TRUE;
    1400     }
    1401   } */
    14021396  size = sizeof(BOOL);
    14031397  PrfQueryProfileData(fmprof, appname, "SyncUpdates", &fSyncUpdates, &size);
  • trunk/dll/init.h

    r1438 r1444  
    1818  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    1919  08 Mar 09 GKY Additional strings move to PCSZs in init.c
     20  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     21                loads drive root directory in directory container or expands drive tree
     22                and rescans drive in tree container depending on container focus, greyed out
     23                inappropriate menu context choices
    2024
    2125***********************************************************************/
     
    172176extern BOOL fReminimize;
    173177extern BOOL fWantFirstTimeInit;
    174 // extern BOOL fDrivetoSkip[26];
    175178extern HPOINTER hptrApp;
    176179extern HPOINTER hptrArc;
     
    195198extern HMTX hmtxFM2Globals;
    196199extern HMTX hmtxFM2Delete;
    197 //extern HEV  DriveScanStart;
     200extern HMTX hmtFillingTreeCnr;
     201extern HEV  hevInitialCnrScanComplete;
    198202
    199203#endif // INIT_H
  • trunk/dll/key.c

    r1224 r1444  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004 Steven H. Levine
     9  Copyright (c) 2004, 2009 Steven H. Levine
    1010
    1111  Revisions
     
    1313  06 Aug 07 GKY Reduce DosSleep times (ticket 148)
    1414  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
    15 
     15  13 Jul 09 SHL Sync with renames
    1616
    1717***********************************************************************/
     
    5151  static HAB hab = 0;
    5252  BOOL no = FALSE;
    53   static BOOL pause = FALSE;
    54   static INT width, direction, ticktock, counter = 0;
     53  static BOOL noanimation;
     54  static INT width, direction, ticktock, counter;
    5555  static HPOINTER stick1, stick2, stick3, stick4, stick12, stick22, stick32,
    5656    stick42, stick5, stick52;
     
    6363    }
    6464    if (mp2)
    65       pause = TRUE;
     65      noanimation = TRUE;
    6666    else
    67       pause = FALSE;
     67      noanimation = FALSE;
    6868    AboutBox = hwnd;
    6969    hab = WinQueryAnchorBlock(hwnd);
     
    8080    if (!strcmp(realappname, "FM/4"))
    8181      WinSetDlgItemText(hwnd, ABT_PROGNAME, GetPString(IDS_FM2LITETEXT));
    82     if (!pause) {
     82    if (!noanimation) {
    8383      stick1 = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ID_STICK1);
    8484      stick2 = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ID_STICK2);
     
    9393      direction = 2;
    9494      ticktock = 0;
    95       WinStartTimer(hab, hwnd, ID_TIMER, 164);
     95      WinStartTimer(hab, hwnd, ID_ABOUT_TIMER, 164);
    9696      PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
    9797    }
     
    299299  case WM_DESTROY:
    300300    if (hab) {
    301       if (!pause) {
    302         WinStopTimer(hab, hwnd, ID_TIMER);
     301      if (!noanimation) {
     302        WinStopTimer(hab, hwnd, ID_ABOUT_TIMER);
    303303        WinDestroyPointer(stick1);
    304304        WinDestroyPointer(stick2);
  • trunk/dll/mainwnd.c

    r1442 r1444  
    9292                listings in tree
    9393  13 Jul 09 GKY Fixed under allocation of memory in the paint code for the drivebar bitmap buttons
     94  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     95                loads drive root directory in directory container or expands drive tree
     96                and rescans drive in tree container depending on container focus, greyed out
     97                inappropriate menu context choices
     98  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
    9499
    95100***********************************************************************/
     
    171176#include "wrappers.h"                   // xfree
    172177#include "fortify.h"
    173 #include "filldir.h"                    // StubbyScanCount
    174178#include "excputil.h"                   // xbeginthread
    175179
     
    256260      HWND hwndB = (HWND) mp1;
    257261      USHORT id;
     262      CHAR s[90]= {0};
    258263
    259264      id = WinQueryWindowUShort(hwndB, QWS_ID);
    260       *dv = 0;
    261       *dv = id - IDM_DRIVEA + 'A';
    262       strcpy(dv + 1, ":");
    263       d = toupper(*dv);
    264       if (isalpha(d) && d > 'B' &&
    265           !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID |
    266                                    DRIVE_SLOW)) &&
    267           (!hwndBubble ||
    268            WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
    269           !WinQueryCapture(HWND_DESKTOP)) {
    270 
    271         FSALLOCATE fsa;
    272         CHAR s[90], szQty[38];
    273         ULONG ulPctFree;
    274         ULONGLONG ullFreeQty;
    275 
    276         if (!DosQueryFSInfo((d - 'A') + 1,
    277                             FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {
    278           ullFreeQty = (ULONGLONG) fsa.cUnitAvail *
    279             (fsa.cSectorUnit * fsa.cbSector);
    280           ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ?
    281             (fsa.cUnitAvail * 100) / fsa.cUnit : 0;
    282           CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' ');
    283           sprintf(s, "%s %s (%lu%%) %s", dv, szQty, ulPctFree, GetPString(IDS_FREETEXT));
    284         }
    285         if ((!hwndBubble ||
    286              WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
    287             !WinQueryCapture(HWND_DESKTOP))
    288           WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID);
    289       }
     265      switch (id) {
     266      case IDM_RESCAN:
     267        strcpy(s, GetPString(IDS_RESCANALLDRIVESTEXT));
     268        break;
     269
     270      case IDM_REFRESHREMOVABLES:
     271        strcpy(s, GetPString(IDS_REFRESHREMOVABLESTEXT));
     272        break;
     273
     274      default:
     275        *dv = 0;
     276        *dv = id - IDM_DRIVEA + 'A';
     277        strcpy(dv + 1, ":");
     278        d = toupper(*dv);
     279        if (isalpha(d) && d > 'B' &&
     280            !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID |
     281                                     DRIVE_SLOW)) &&
     282            (!hwndBubble ||
     283             WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
     284            !WinQueryCapture(HWND_DESKTOP)) {
     285 
     286          FSALLOCATE fsa;
     287          CHAR szQty[38];
     288          ULONG ulPctFree;
     289          ULONGLONG ullFreeQty;
     290 
     291          if (!DosQueryFSInfo((d - 'A') + 1,
     292                              FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {
     293            ullFreeQty = (ULONGLONG) fsa.cUnitAvail *
     294              (fsa.cSectorUnit * fsa.cbSector);
     295            ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ?
     296              (fsa.cUnitAvail * 100) / fsa.cUnit : 0;
     297            CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' ');
     298            sprintf(s, "%s %s (%lu%%) %s", dv, szQty, ulPctFree, GetPString(IDS_FREETEXT));
     299          }
     300        }
     301      }
     302      if ((!hwndBubble ||
     303           WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
     304          !WinQueryCapture(HWND_DESKTOP))
     305        WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID);
    290306    }
    291307    return 0;
     
    323339      RestoreDirCnrState(hwndMain, (char *)mp1, FALSE);
    324340      WinEnableWindow(WinQueryWindow(hwndMain, QW_PARENT), TRUE);
    325       fNoTileUpdate = FALSE;
    326       //xfree((char *)mp1, pszSrcFile, __LINE__);
    327 //       if (fAutoTile)
    328 //         TileChildren(hwndMain, TRUE);
     341      fNoTileUpdate = FALSE; ;
    329342      break;
    330343    default:
    331344      Runtime_Error(pszSrcFile, __LINE__, "%u unexpected", mp2);
     345    }
     346    if (fInitialDriveScan) {
     347      DosPostEventSem(hevInitialCnrScanComplete);
     348      DosCloseEventSem(hevInitialCnrScanComplete);
     349      fInitialDriveScan = FALSE;
    332350    }
    333351    return 0;
     
    18351853
    18361854  case WM_COMMAND:
    1837     {
    1838       CHAR dv[4];
    1839 
    1840       *dv = SHORT1FROMMP(mp1) - IDM_DRIVEA + 'A';
    1841       strcpy(dv + 1, ":\\");
    1842       if (isalpha(*dv)) {
    1843 
    1844         HWND hwndActive;
    1845 
    1846         dv[1] = ':';
    1847         dv[2] = '\\';
    1848         dv[3] = 0;
    1849         hwndActive = TopWindow(hwnd, (HWND) 0);
    1850         if (hwndActive)
    1851           WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT),
    1852                      UM_DRIVECMD, MPFROMP(dv), MPVOID);
     1855    if (fInitialDriveScan)
     1856      DosWaitEventSem(hevInitialCnrScanComplete, SEM_INDEFINITE_WAIT);
     1857    switch(SHORT1FROMMP(mp1)) {
     1858    case IDM_RESCAN:
     1859      {
     1860        BOOL toggleTree = FALSE;
     1861 
     1862        if (!hwndTree) {
     1863          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1864          toggleTree = TRUE;
     1865        }
     1866        WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     1867        if (toggleTree)
     1868          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1869      }
     1870      break;
     1871    case IDM_REFRESHREMOVABLES:
     1872      {
     1873        BOOL toggleTree = FALSE;
     1874 
     1875        if (!hwndTree) {
     1876          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1877          toggleTree = TRUE;
     1878        }
     1879        WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_REFRESHREMOVABLES, 0), MPVOID);
     1880        if (toggleTree)
     1881          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1882      }
     1883      break;
     1884    default:
     1885      {
     1886        CHAR dv[4];
     1887 
     1888        *dv = SHORT1FROMMP(mp1) - IDM_DRIVEA + 'A';
     1889        strcpy(dv + 1, ":\\");
     1890        if (isalpha(*dv)) {
     1891 
     1892          HWND hwndActive;
     1893 
     1894          dv[1] = ':';
     1895          dv[2] = '\\';
     1896          dv[3] = 0;
     1897          hwndActive = TopWindow(hwnd, (HWND) 0);
     1898          if (hwndActive)
     1899            WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT),
     1900                       UM_DRIVECMD, MPFROMP(dv), MPVOID);
     1901        }
    18531902      }
    18541903    }
     
    18771926  switch (msg) {
    18781927  case WM_MOUSEMOVE:
    1879     if (fDrivebarHelp &&
    1880         (!hwndBubble ||
     1928    if (fDrivebarHelp && (!hwndBubble ||
    18811929         WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&
    18821930        !WinQueryCapture(HWND_DESKTOP)) {
    18831931      id = WinQueryWindowUShort(hwnd, QWS_ID);
    18841932      if (helpid != id) {
    1885         helpid = id;
     1933        helpid = id;
    18861934        PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID);
    18871935      }
     
    19051953
    19061954      id = WinQueryWindowUShort(hwnd, QWS_ID);
     1955      if (id == IDM_REFRESHREMOVABLES || id == IDM_RESCAN)
     1956        break;
    19071957      *szDrv = 0;
    19081958      x = id - IDM_DRIVEA;
     
    19221972                      RAMDISK_ICON :
    19231973                     (driveflags[x] & DRIVE_ZIPSTREAM) ?
    1924                       ZIPSTREAM_ICON : DRIVE_ICON;
     1974                      ZIPSTREAM_ICON :
     1975                     (driveflags[x] & DRIVE_LOCALHD) ?
     1976                      DRIVE_ICON : DONNO_ICON;
    19251977        }
    19261978        else
     
    20002052      hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MAIN_DRIVES);
    20012053      if (hwndMenu) {
    2002         BOOL rdy;
     2054        BOOL rdy, local;
    20032055        CHAR chDrv = *szDrv;
    20042056        UINT iDrv;
     
    20062058        strcat(szDrv, PCSZ_BACKSLASH);
    20072059        MakeValidDir(szDrv);
    2008         // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c
     2060        // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c
     2061        local = ~driveflags[iDrv] & DRIVE_REMOTE && ~driveflags[iDrv] & DRIVE_VIRTUAL &&
     2062                ~driveflags[iDrv] & DRIVE_RAMDISK;
    20092063        rdy = toupper(*szDrv) == toupper(chDrv);
    20102064        iDrv = toupper(*szDrv) - 'A';
    20112065        if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE)
    2012           WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE);
    2013 
    2014         if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE) {
    2015           WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE);
     2066          WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE);
     2067
     2068        if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE)
     2069          WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE);
     2070
     2071        if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE || !local) {
    20162072          WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE);
    20172073          WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE);
     
    20272083          WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE);
    20282084          WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE);
    2029           WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE);
     2085          WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE);
     2086
     2087        if (!rdy || !local)
    20302088          WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE);
    20312089        }
     
    23012359        if (!hwndB)
    23022360          Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    2303                     PCSZ_WINCREATEWINDOW);
     2361                    PCSZ_WINCREATEWINDOW);
    23042362        else {
    23052363          WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);
     
    23072365      }
    23082366    }                                   // for
     2367    hwndB = WinCreateWindow(hwndT,
     2368                            WC_DRIVEBUTTONS,
     2369                            "#7001",
     2370                            BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,
     2371                            0,
     2372                            0,
     2373                            DRIVE_BUTTON_WIDTH,
     2374                            DRIVE_BUTTON_HEIGHT,
     2375                            hwndT, HWND_TOP, IDM_REFRESHREMOVABLES, NULL, NULL);
     2376  if (!hwndB)
     2377    Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     2378              PCSZ_WINCREATEWINDOW);
     2379  hwndB = WinCreateWindow(hwndT,
     2380                          WC_DRIVEBUTTONS,
     2381                          "#7000",
     2382                          BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,
     2383                          0,
     2384                          0,
     2385                          DRIVE_BUTTON_WIDTH,
     2386                          DRIVE_BUTTON_HEIGHT,
     2387                          hwndT, HWND_TOP, IDM_RESCAN, NULL, NULL);
     2388  if (!hwndB)
     2389    Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     2390              PCSZ_WINCREATEWINDOW);
    23092391  }                                     // if drivebar
    23102392  PostMsg(WinQueryWindow(hwndT, QW_PARENT),
     
    33283410                  }
    33293411                }
    3330                 //if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) //These were being called twice
    3331                 //  WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); //causing dup dir names in tree
     3412                if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL))
     3413                  WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL);
    33323414              }
    33333415            }
     
    57265808      if (!add_setup(pszStatename))
    57275809        save_setups();
    5728     } else {
     5810    }
     5811    else {
    57295812      load_tools(NULL);
    57305813      PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);
     5814      if (fInitialDriveScan) {
     5815        DosPostEventSem(hevInitialCnrScanComplete);
     5816        DosCloseEventSem(hevInitialCnrScanComplete);
     5817      }
    57315818    }
    57325819    PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2);
  • trunk/dll/mainwnd2.c

    r1438 r1444  
    3131  21 Jun 09 GKY Added drive letter to bitmap buttons in drive bar; Eliminate static drive
    3232                letter windows; Use button ID to identify drive letter for processing.
     33  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
    3334
    3435***********************************************************************/
     
    880881        save_dir(s);
    881882      pd->hwndDir2 = StartDirCnr(hwnd, s, (HWND) 0, 3);
     883      if (fInitialDriveScan) {
     884        DosPostEventSem(hevInitialCnrScanComplete);
     885        DosCloseEventSem(hevInitialCnrScanComplete);
     886        fInitialDriveScan = FALSE;
     887      }
    882888      WinSetFocus(HWND_DESKTOP, pd->hwndCurr);
    883889
  • trunk/dll/misc.c

    r1439 r1444  
    6161                add State.version key for check
    6262  12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
     63  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     64  22 Jul 09 GKY Allow .LONGNAME to be displayed for FAT drives.
    6365
    6466***********************************************************************/
     
    480482}
    481483
    482 VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds)
     484VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, BOOL compare)
    483485{
    484486  CHAR FileSystem[CCHMAXPATH];
     
    487489  BOOL hasAccessDT;
    488490  BOOL hasLongNames;
     491  BOOL hasSubjects;
    489492
    490493  if (!directory || !*directory)
     
    492495  x = CheckDrive(toupper(*directory), FileSystem, NULL);
    493496  if (x != -1) {
     497    x = toupper(*directory) - 'A';
    494498    if (!stricmp(FileSystem, HPFS) ||
    495499        !stricmp(FileSystem, JFS) ||
     
    501505      hasCreateDT = TRUE;
    502506      hasAccessDT = TRUE;
    503       hasLongNames = TRUE;
     507      if (driveflags[x] & DRIVE_NOEASUPPORT) {
     508        hasSubjects  = FALSE;
     509        hasLongNames = FALSE;
     510      }
     511      else {
     512        hasSubjects  = TRUE;
     513        hasLongNames = TRUE;
     514      }
    504515    }
    505516    else if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) {
    506517      hasCreateDT = TRUE;
    507518      hasAccessDT = FALSE;
    508       hasLongNames = FALSE;
     519      if (driveflags[x] & DRIVE_NOEASUPPORT) {
     520        hasSubjects  = FALSE;
     521        hasLongNames = FALSE;
     522      }
     523      else {
     524        hasSubjects  = TRUE;
     525        hasLongNames = TRUE;
     526      }
    509527    }
    510528    else {
     
    512530      hasCreateDT = FALSE;
    513531      hasAccessDT = FALSE;
    514       hasLongNames = FALSE;
     532      if (driveflags[x] & DRIVE_NOEASUPPORT) {
     533        hasSubjects  = FALSE;
     534        hasLongNames = FALSE;
     535      }
     536      else {
     537        hasSubjects  = TRUE;
     538        hasLongNames = TRUE;
     539      }
    515540    }
    516541  }
     
    519544    hasCreateDT = FALSE;
    520545    hasAccessDT = FALSE;
    521     hasLongNames = FALSE;
     546    if (driveflags[x] & DRIVE_NOEASUPPORT) {
     547      hasSubjects  = FALSE;
     548      hasLongNames = FALSE;
     549    }
     550    else {
     551      hasSubjects  = TRUE;
     552      hasLongNames = TRUE;
     553    }
    522554  }
    523555  AdjustCnrColVis(hwndCnr,
     
    536568                  GetPString(IDS_CRTIME),
    537569                  pds->detailscrtime ? hasCreateDT : FALSE,
    538                   FALSE);
     570                  FALSE);
     571  if (pds->detailslongname && !pds->detailssubject && hasSubjects) {
     572    AdjustCnrColVis(hwndCnr,
     573                    compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
     574                    TRUE,
     575                    FALSE);
     576    AdjustCnrColVis(hwndCnr,
     577                    GetPString(IDS_LNAME),
     578                    pds->detailslongname ? hasLongNames : FALSE,
     579                    FALSE);
     580    WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID);
     581  }
     582  else
     583    AdjustCnrColVis(hwndCnr,
     584                    GetPString(IDS_LNAME),
     585                    pds->detailslongname ? hasLongNames : FALSE,
     586                    FALSE);
    539587  AdjustCnrColVis(hwndCnr,
    540                   GetPString(IDS_LNAME),
    541                   pds->detailslongname ? hasLongNames : FALSE,
    542                   FALSE);
     588                  compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
     589                  pds->detailssubject ? hasSubjects : FALSE,
     590                  FALSE);
    543591  WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID);
    544592}
    545593
    546 VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds,
     594VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds,
    547595                          BOOL compare)
    548596{
    549 
    550   AdjustCnrColVis(hwndCnr,
    551                   compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
    552                   pds->detailssubject,
    553                   FALSE);
    554 
    555597  AdjustCnrColVis(hwndCnr, GetPString(IDS_ATTR), pds->detailsattr, FALSE);
    556598  AdjustCnrColVis(hwndCnr, GetPString(IDS_ICON), pds->detailsicon, FALSE);
     
    561603
    562604  if (!directory) {
     605    AdjustCnrColVis(hwndCnr,
     606                    compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
     607                    pds->detailssubject,
     608                    FALSE);
    563609    AdjustCnrColVis(hwndCnr, GetPString(IDS_LADATE), pds->detailsladate, FALSE);
    564610    AdjustCnrColVis(hwndCnr, GetPString(IDS_LATIME), pds->detailslatime, FALSE);
     
    568614    WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID);
    569615  }
    570   else
    571     AdjustCnrColsForFSType(hwndCnr, directory, pds);
     616  else {
     617    AdjustCnrColsForFSType(hwndCnr, directory, pds, compare);
     618  }
    572619}
    573620
     
    619666
    620667    pfi = pfi->pNextFieldInfo;
    621     pfi->flData = CFA_STRING | CFA_LEFT;
     668    pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
    622669    pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
    623670    pfi->pTitleData = (PSZ)GetPString(IDS_LNAME);
    624671    pfi->offStruct = FIELDOFFSET(CNRITEM, pszLongName);
     672    pfiLastLeftCol = pfi;
     673
     674    // Store the current pfi value as that will be used to indicate the
     675    // last column in the lefthand container window (we have a splitbar)
     676    if (!dsDirCnrDefault.fSubjectInLeftPane)
     677      pfiLastLeftCol = pfi;
     678    else
     679      pfiLastLeftCol = pfi->pNextFieldInfo;
    625680
    626681    // Fill in column info for subjects
    627 
    628     if (dsDirCnrDefault.fSubjectInLeftPane) {
    629       pfi = pfi->pNextFieldInfo;
    630       pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
    631       if (isCompCnr)
    632         pfi->flData |= CFA_FIREADONLY;
    633       pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
    634       pfi->pTitleData = isCompCnr ? (PSZ)GetPString(IDS_STATUS) :
    635                                     (PSZ)GetPString(IDS_SUBJ);
    636       pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject);
    637       pfi->cxWidth = dsDirCnrDefault.SubjectDisplayWidth;
    638 
    639       // Store the current pfi value as that will be used to indicate the
    640       // last column in the lefthand container window (we have a splitbar)
    641 
    642       pfiLastLeftCol = pfi;
    643     }
    644     else {
    645       // Store the current pfi value as that will be used to indicate the
    646       // last column in the lefthand container window (we have a splitbar)
    647 
    648       pfiLastLeftCol = pfi;
    649       pfi = pfi->pNextFieldInfo;
    650       pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
    651       if (isCompCnr)
    652         pfi->flData |= CFA_FIREADONLY;
    653       pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
    654       pfi->pTitleData = isCompCnr ? (PSZ)GetPString(IDS_STATUS) :
    655                                     (PSZ)GetPString(IDS_SUBJ);
    656       pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject);
    657       pfi->cxWidth = dsDirCnrDefault.SubjectDisplayWidth;
    658     }
     682    pfi = pfi->pNextFieldInfo;
     683    pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
     684    if (isCompCnr)
     685      pfi->flData |= CFA_FIREADONLY;
     686    pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
     687    pfi->pTitleData = isCompCnr ? (PSZ)GetPString(IDS_STATUS) :
     688                                  (PSZ)GetPString(IDS_SUBJ);
     689    pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject);
     690    pfi->cxWidth = dsDirCnrDefault.SubjectDisplayWidth;
    659691
    660692    // Fill in column information for the file size
    661 
    662693
    663694    pfi = pfi->pNextFieldInfo;
  • trunk/dll/misc.h

    r1410 r1444  
    1111  17 Jul 08 SHL Baseline
    1212  08 Mar 09 GKY Add WriteDetailsSwitches and use LoadDetailsSwitches to replace in line code
     13  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     14  22 Jul 09 GKY Allow .LONGNAME to be displayed for FAT drives.
    1315
    1416***********************************************************************/
     
    3133BOOL AdjustCnrColRO(HWND hwndCnr, PCSZ title, BOOL readonly, BOOL toggle);
    3234BOOL AdjustCnrColVis(HWND hwndCnr, PCSZ title, BOOL visible, BOOL toggle);
    33 VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds);
    34 VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds,
     35VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, BOOL compare);
     36VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds,
    3537                          BOOL compare);
    3638VOID AdjustDetailsSwitches(HWND hwnd, HWND hwndMenu, USHORT cmd,
  • trunk/dll/newview.c

    r1433 r1444  
    3838  08 Mar 09 GKY Renamed commafmt.h i18nutil.h
    3939  08 Mar 09 GKY Additional strings move to PCSZs in init.c
     40  13 Jul 09 SHL Sync with renames
    4041
    4142***********************************************************************/
     
    18481849                        (PVOID) FNT_8HELVETICA);
    18491850      }
    1850       WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER5, 1000L);
     1851      WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NEWVIEW_TIMER, 1000L);
    18511852    }
    18521853    break;
     
    40074008      HWND hwndRestore = (HWND) 0;
    40084009
    4009       WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER5);
     4010      WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NEWVIEW_TIMER);
    40104011      if (ad) {
    40114012        ad->stopflag = 1;
  • trunk/dll/notify.c

    r1395 r1444  
    33  $Id$
    44
    5   Thread notes window and popup notification status line
     5  Thread notes window and popup notifications over status line
    66
    77  Copyright (c) 1993-98 M. Kimes
     
    1818  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1919  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     20  13 Jul 09 SHL Sync with renames
     21  16 Jul 09 SHL Stop leaking hptrIcon
    2022
    2123***********************************************************************/
     
    2527#include <ctype.h>
    2628#include <stddef.h>                     // _threadid
    27 // #include <process.h>                 // _beginthread
    2829
    2930#define INCL_DOS
     
    5556static PSZ pszSrcFile = __FILE__;
    5657static volatile HWND hwndNotify;        // 16 Apr 08 SHL
     58static volatile PCSZ pszCachedNote;     // 16 Jul 09 SHL
    5759
    5860#pragma data_seg(GLOBAL1)
    5961BOOL fThreadNotes;
    6062
    61 VOID StartNotes(CHAR * s);
    62 
    63 /**
    64  * Popup notification message window procedure
    65  * Display timed message over status line
     63static VOID StartNotes(PCSZ pszNote);
     64
     65/**
     66 * Notification message window procedure
     67 * Displays timed message over status line
    6668 */
    6769
     
    7678      MRESULT rc = PFNWPStatic(hwnd, msg, mp1, mp2);
    7779
    78       if (!WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER2, 5000)) {
     80      if (!WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NOTIFY_TIMER, 5000)) {
    7981        Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, "WinStartTimer");
    8082        WinDestroyWindow(hwnd);
     
    144146  case WM_TIMER:
    145147  case WM_CLOSE:
    146     WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER2);
     148    WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NOTIFY_TIMER);
    147149    WinDestroyWindow(hwnd);
    148150    return 0;
     
    162164
    163165/**
    164  * Display timed notification window over status line
     166 * Process UM_NOTIFY message to display timed message over status line
    165167 */
    166168
     
    213215                           SS_TEXT | DT_LEFT | DT_VCENTER | WS_VISIBLE,
    214216                           x, y, cx, cy, hwndP, HWND_TOP, id++, NULL, NULL);
    215     if (!hwndP)
     217    if (!hwnd)
    216218      Win_Error(hwndP, hwndP, pszSrcFile, __LINE__,
    217219                PCSZ_WINCREATEWINDOW);
     
    220222      free(p);
    221223    if (id > NOTE_MAX)
    222       id = NOTE_FRAME;
    223   }
    224 
    225   AddNote(str);
     224      id = NOTE_FRAME;                  // Wrap
     225  }
     226
     227  AddNote(str);                         // Add thread notes window
    226228
    227229  return hwnd;
     
    229231
    230232/**
    231  * Add message to thread notes window
     233 * Display timed notification window over status line
    232234 */
    233235
     
    238240
    239241/**
    240  * Add error message to thread notes window
     242 * Notify on error
     243 * Format message and pass to Notify
    241244 */
    242245
     
    247250  if (!filename)
    248251    return;
     252
    249253  sprintf(errortext, GetPString(IDS_ERRORACCESSTEXT), status, filename);
    250254  if (toupper(*filename) > 'B') {
     
    281285
    282286/**
    283  * Thread notes dialog window dialog procedure
     287 * Thread notes window dialog procedure
    284288 */
    285289
    286290MRESULT EXPENTRY NoteWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    287291{
    288   static HPOINTER hptrIcon = (HPOINTER) 0;
     292  static HPOINTER hptrIcon;
    289293
    290294  switch (msg) {
     
    293297      // Already have notes dialog - pass message on
    294298      if (mp2) {
    295         WinSendDlgItemMsg(hwndNotify,
    296                           NOTE_LISTBOX,
    297                           LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0), mp2);
    298         PostMsg(hwndNotify, UM_NOTIFY, MPVOID, MPVOID);
    299         free((CHAR *)mp2);
     299        AddNote((PCSZ)mp2);             // 16 Jul 09 SHL was direct LM_INSERTITEM
     300        xfree((PSZ)mp2, pszSrcFile, __LINE__);
    300301      }
    301302      WinDismissDlg(hwnd, 0);
     
    303304    }
    304305    hwndNotify = hwnd;
    305     fThreadNotes = FALSE;
    306     // Remember showing
    307     {
    308       BOOL dummy = TRUE;
     306    // Remember showing for restart
     307    fThreadNotes = TRUE;
    309308      PrfWriteProfileData(fmprof,
    310                           FM3Str, "ThreadNotes", &dummy, sizeof(BOOL));
    311     }
     309                          FM3Str, "ThreadNotes", &fThreadNotes, sizeof(BOOL));
     310    fThreadNotes = FALSE;               // Optimize
     311
     312    // 16 Jul 09 SHL Added
     313    if (pszCachedNote) {
     314      PCSZ p = pszCachedNote;
     315      pszCachedNote = NULL;
     316      AddNote(p);
     317      xfree((PSZ)p, pszSrcFile, __LINE__);
     318    }
     319
    312320    if (mp2) {
    313       WinSendDlgItemMsg(hwnd,
    314                         NOTE_LISTBOX,
    315                         LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0), mp2);
    316       free((CHAR *)mp2);
    317     }
    318 
    319     {
    320       // Return focus
    321       HWND hwndActive = WinQueryActiveWindow(HWND_DESKTOP);
    322       PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(hwndActive), MPVOID);
    323     }
     321      AddNote((PCSZ)mp2);               // 16 Jul 09 SHL was direct LM_INSERTITEM
     322      xfree((PSZ)mp2, pszSrcFile, __LINE__);
     323    }
     324
     325    // Grab focus
     326    PostMsg(hwnd,
     327            UM_FOCUSME,
     328            MPFROMLONG(WinQueryActiveWindow(HWND_DESKTOP)),
     329            MPVOID);
    324330
    325331    hptrIcon = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, NOTE_FRAME);
     
    429435
    430436  case WM_CLOSE:
     437    if (pszCachedNote)
     438      DbgMsg(pszSrcFile, __LINE__, "pszCachedNote %p unexpected", pszCachedNote);       // 18 Jul 08 SHL fixme to be Runtime_Error
     439    else {
     440      // Cache last item for next open
     441      SHORT ndx = (SHORT)WinSendDlgItemMsg(hwnd, NOTE_LISTBOX,
     442                                           LM_QUERYITEMCOUNT, MPVOID, MPVOID);
     443      if (ndx != LIT_NONE) {
     444        SHORT len;
     445        ndx--;
     446        len = (SHORT)WinSendDlgItemMsg(hwnd, NOTE_LISTBOX,
     447                                       LM_QUERYITEMTEXTLENGTH,
     448                                       MPFROMSHORT(ndx), MPVOID);
     449        if (len != LIT_ERROR) {
     450          PSZ p;
     451          len++;
     452          p = xmalloc(len, pszSrcFile, __LINE__);
     453          if (p) {
     454            SHORT len2 = (SHORT)WinSendDlgItemMsg(hwnd, NOTE_LISTBOX,
     455                                           LM_QUERYITEMTEXT,
     456                                           MPFROM2SHORT(ndx, len), MPFROMP(p));
     457            len--;
     458            if (len2 != len) {
     459              DbgMsg(pszSrcFile, __LINE__, "len %u unexpected - should be %u", len2, len);      // 18 Jul 08 SHL fixme to be Runtime_Error
     460              xfree((PSZ)p, pszSrcFile, __LINE__);
     461            }
     462            else
     463              pszCachedNote = p;
     464          }
     465        }
     466      }
     467    }
    431468    WinDismissDlg(hwnd, 0);
    432469    return 0;
     
    434471  case WM_DESTROY:
    435472    if (hwndNotify == hwnd) {
     473      // Remember not open
    436474      fThreadNotes = FALSE;
    437475      PrfWriteProfileData(fmprof,
     
    439477      hwndNotify = (HWND) 0;
    440478    }
    441     if (hptrIcon)
     479    if (hptrIcon) {
    442480      WinDestroyPointer(hptrIcon);
     481      hptrIcon = (HPOINTER)0;           // 16 Jul 09 SHL
     482    }
    443483    if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
    444484      WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
     
    464504        WinDlgBox(HWND_DESKTOP,
    465505                  HWND_DESKTOP,
    466                   NoteWndProc, FM3ModHandle, NOTE_FRAME, (CHAR *)args);
     506                  NoteWndProc, FM3ModHandle, NOTE_FRAME, args);
    467507      WinDestroyMsgQueue(hmq);
    468508    }
     
    478518 */
    479519
    480 VOID StartNotes(CHAR * note)
     520static VOID StartNotes(PCSZ note)
    481521{
    482522  if (!hwndNotify) {
    483523    if (xbeginthread(NoteThread,
    484524                     65536,
    485                      note,
     525                     (VOID*)note,
    486526                     pszSrcFile,
    487527                     __LINE__) != -1)
     
    498538/**
    499539 * Add note to thread notes window or popup status window
    500  */
    501 
    502 BOOL AddNote(PCSZ note)
     540 * Open window if was open and first messages after restart
     541 * Cache last note until window opened
     542 */
     543
     544VOID AddNote(PCSZ note)
    503545{
    504546  PSZ s;
    505547  PCSZ p;
    506   BOOL once = FALSE, ret = FALSE;
    507 
    508   if ((fThreadNotes || hwndNotify) && note && *note) {
    509     p = note;
    510     while (*p == ' ')
    511       p++;
     548  BOOL once = FALSE;
     549
     550  // Cache last note until window opened
     551  // 16 Jul 09 SHL fixme to avoid FORTIFY complaints
     552  if (!fThreadNotes && !hwndNotify && note) {
     553    p = note + strspn(note, " \t");     // Skip leading white
    512554    if (*p) {
     555      if (pszCachedNote)
     556        xfree((PSZ)pszCachedNote, pszSrcFile, __LINE__);
     557      pszCachedNote = xstrdup(p, pszSrcFile, __LINE__);
     558    }
     559    return;
     560  }
     561
     562  if ((fThreadNotes || hwndNotify) && note) {
     563    p = note + strspn(note, " \t");     // Skip leading white
     564    if (*p) {
     565      // If have cached note, output it first
     566      if (pszCachedNote) {
     567        PCSZ psz = pszCachedNote;
     568        pszCachedNote = NULL;
     569        AddNote(psz);
     570        free((VOID*)psz);
     571      }
    513572      if (!hwndNotify) {
    514         fThreadNotes = FALSE;
     573        fThreadNotes = FALSE;           // 16 Jul 09 SHL fixme to be gone?
    515574        StartNotes(NULL);
    516575      }
     
    525584                                          MPFROM2SHORT(LIT_END, 0),
    526585                                          MPFROMP(s)) >= 0) {
    527               ret = TRUE;
    528586              PostMsg(hwndNotify, UM_NOTIFY, MPVOID, MPVOID);
    529587              break;
     
    537595    }
    538596  }
    539   return ret;
    540597}
    541598
  • trunk/dll/notify.h

    r1394 r1444  
    1717#define NOTIFY_H
    1818
    19 BOOL AddNote(PCSZ note);
     19VOID AddNote(PCSZ note);                // 16 Jul 09 SHL
    2020HWND DoNotify(PCSZ text);
    2121VOID EndNote(VOID);
  • trunk/dll/treecnr.c

    r1439 r1444  
    7272  12 Jul 09 GKY Add option to show file system type or drive label in tree
    7373                (get NOPRESCAN drives working)
     74  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
     75  22 Jul 09 GKY Consolidated driveflag setting code in DriveFlagsOne
     76  22 Jul 09 GKY Streamline scanning code for faster Tree rescans
    7477
    7578***********************************************************************/
     
    629632      Fortify_BecomeOwner(mp1);
    630633#     endif
    631       if (StubbyScanCount != 0) { //prevent treeswitch from hanging fm2 during startup GKY 3-14-09
    632         DosSleep(50);
    633         PostMsg(hwndTree, UM_SHOWME, mp1, MPVOID);
    634       }
    635634      dcd = INSTDATA(hwnd);
    636635      if (dcd) {
     
    644643          temptop = fTopDir;
    645644          fTopDir = TRUE;
    646         }
    647         ShowTreeRec(dcd->hwndCnr, (CHAR *)mp1, fCollapseFirst, TRUE);
     645        }
     646        ShowTreeRec(dcd->hwndCnr, (CHAR *)mp1, fCollapseFirst, TRUE);
     647        PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID);
    648648        dcd->suspendview = tempsusp;
    649649        fFollowTree = tempfollow;
     
    849849      Runtime_Error(pszSrcFile, __LINE__, NULL);
    850850    else {
    851       while (StubbyScanCount != 0)
    852         DosSleep(50);
    853851      RemoveCnrItems(dcd->hwndCnr, NULL, 0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE);
    854852      WinSendMsg(dcd->hwndCnr,
     
    856854      WinSendMsg(dcd->hwndCnr,
    857855                 CM_SCROLLWINDOW,
    858                  MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(-1));
     856                 MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(-1));
     857      DosRequestMutexSem(hmtFillingTreeCnr, SEM_INDEFINITE_WAIT);
    859858      FillTreeCnr(dcd->hwndCnr, dcd->hwndParent);
     859      DosReleaseMutexSem(hmtFillingTreeCnr);
    860860      if (fOkayMinimize) {
    861861        PostMsg(dcd->hwndCnr, UM_MINIMIZE, MPVOID, MPVOID);
     
    10931093        WinSetWindowText(hwndStatus2, NullStr);
    10941094    }
     1095    // 13 Jul 09 SHL fixme to make sense
    10951096    if (msg == UM_TIMER)
    10961097      return 0;
     
    18871888      PCNRITEM pciP, pciL, pci;
    18881889      ULONG fl = SWP_ACTIVATE;
    1889 
     1890      INT x;
     1891
     1892      DosRequestMutexSem(hmtFillingTreeCnr, SEM_INDEFINITE_WAIT);
    18901893      if (fFollowTree)
    18911894        fl = 0;
     
    18951898          (INT) pci != -1 &&
    18961899          !(pci->rc.flRecordAttr & CRA_INUSE) &&
    1897           !(pci->flags & RECFLAGS_ENV) && IsFullName(pci->pszFileName)) {
    1898         if (driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_INVALID) {
     1900          !(pci->flags & RECFLAGS_ENV) && IsFullName(pci->pszFileName)) {
     1901        x = (INT) (toupper(*pci->pszFileName) - 'A');
     1902        if (driveflags[x] & DRIVE_INVALID) {
    18991903          if (!fAlertBeepOff)
    19001904            DosBeep(50, 100);
     
    19051909        DosError(FERR_DISABLEHARDERR);
    19061910        if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) {
    1907           if (!(ulDriveMap & 1 << (toupper(*pci->pszFileName) - 'A'))) {
     1911          if (!(ulDriveMap & 1 << x)) {
    19081912            pciL = pciP = pci;
    19091913            for (;;) {
     
    19231927          }
    19241928        }
    1925         if (driveflags[toupper(*pci->pszFileName) - 'A'] &
    1926             (DRIVE_REMOVABLE | DRIVE_NOPRESCAN)) {
     1929        if (driveflags[x] & (DRIVE_REMOVABLE | DRIVE_NOPRESCAN)) {
    19271930
    19281931          struct
     
    19491952            }
    19501953          }
    1951           if ((driveflags[toupper(*pci->pszFileName) - 'A'] &
    1952                DRIVE_NOPRESCAN) ||
    1953               (toupper(*pci->pszFileName) > 'B' &&
    1954                !(driveflags[toupper(*pci->pszFileName) - 'A'] &
    1955                  DRIVE_CDROM))) {
    1956 
    1957             INT removable, x = (INT) (toupper(*pci->pszFileName) - 'A');
    1958             ULONG drvtype;
    1959 
    1960             DosError(FERR_DISABLEHARDERR);
    1961             removable = CheckDrive(toupper(*pciP->pszFileName),
    1962                                    FileSystem, &drvtype);
    1963             if (removable != -1) {
    1964               driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN |
    1965                                 DRIVE_NOLOADICONS | DRIVE_NOLOADSUBJS |
    1966                                 DRIVE_NOLOADLONGS | DRIVE_INCLUDEFILES |
    1967                                 DRIVE_SLOW | DRIVE_NOSTATS |
    1968                                 DRIVE_WRITEVERIFYOFF);
    1969 
    1970               if (removable == 1)
    1971                 driveflags[x] |= DRIVE_REMOVABLE;
    1972               if (drvtype & DRIVE_REMOTE)
    1973                 driveflags[x] |= DRIVE_REMOTE;
    1974               if (!strcmp(FileSystem, CBSIFS)) {
    1975                 driveflags[x] |= DRIVE_ZIPSTREAM;
    1976                 driveflags[x] &= (~DRIVE_REMOTE);
    1977               }
    1978               if(!strcmp(FileSystem,NDFS32)) {
    1979                 driveflags[x] |= DRIVE_VIRTUAL;
    1980                 driveflags[x] &= (~DRIVE_REMOTE);
    1981               }
    1982               if(!strcmp(FileSystem,RAMFS)) {
    1983                 driveflags[x] |= DRIVE_RAMDISK;
    1984                 driveflags[x] &= (~DRIVE_REMOTE);
    1985               }
    1986               if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS))
    1987                 driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM);
    1988               if(!strcmp(FileSystem,NTFS))
    1989                 driveflags[x] |= DRIVE_NOTWRITEABLE;
    1990               if (strcmp(FileSystem, HPFS) &&
    1991                   strcmp(FileSystem, JFS) &&
    1992                   strcmp(FileSystem, CDFS) &&
    1993                   strcmp(FileSystem, ISOFS) &&
    1994                   strcmp(FileSystem, RAMFS) &&
    1995                   strcmp(FileSystem, FAT32) &&
    1996                   strcmp(FileSystem, NDFS32) &&
    1997                   strcmp(FileSystem, NTFS) &&
    1998                   strcmp(FileSystem, HPFS386)) {
    1999                 driveflags[x] |= DRIVE_NOLONGNAMES;
    2000               }
    2001               SelectDriveIcon(pciP);
    2002               if (hwndMain)
    2003                 PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID);
    2004             }
     1954          if ((driveflags[x] & DRIVE_NOPRESCAN) || (toupper(*pci->pszFileName) > 'B' &&
     1955               !(driveflags[x] & DRIVE_CDROM))) {
     1956            DriveFlagsOne(x, FileSystem, &volser);
     1957            SelectDriveIcon(pciP);
     1958            if (hwndMain)
     1959              PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID);
    20051960          }
    20061961          memset(&volser, 0, sizeof(volser));
     
    20101965                                  (ULONG) sizeof(volser));
    20111966          if (!status) {
    2012             if (!volser.serial ||
    2013                 driveserial[toupper(*pci->pszFileName) - 'A'] !=
    2014                 volser.serial) {
     1967            if (!volser.serial || driveserial[x] != volser.serial) {
    20151968              UnFlesh(hwnd, pciP);
    20161969              Flesh(hwnd, pciP);
    2017               driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial;
     1970              driveserial[x] = volser.serial;
    20181971            }
    20191972            pciL = WinSendMsg(hwnd,
     
    20231976            if (!pciL)
    20241977              Flesh(hwnd, pciP);
    2025             if (fShowFSTypeInTree) {
    2026               strcpy(szBuf, pciP->pszFileName);
     1978            if (fShowFSTypeInTree || fShowDriveLabelInTree) {
     1979              strcpy(szBuf, pci->pszFileName);
    20271980              strcat(szBuf, " [");
    2028               strcat(szBuf, FileSystem);
     1981              strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel);
    20291982              strcat(szBuf, "]");
    2030               pciP->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);
    2031               }
    2032             else if (fShowDriveLabelInTree) {
    2033               strcpy(szBuf, pciP->pszFileName);
    2034               strcat(szBuf, " [");
    2035               strcat(szBuf, volser.volumelabel);
    2036               strcat(szBuf, "]");
    2037               pciP->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);
     1983              pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);
    20381984            }
    20391985            pciP->rc.pszIcon = pciP->pszDisplayName;
     
    20441990          }
    20451991          else {
    2046             driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
     1992            driveserial[x] = -1;
    20471993            UnFlesh(hwnd, pci);
    20481994            PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     
    21202066          }
    21212067          else {
    2122             if (!(driveflags[toupper(*pci->pszFileName) - 'A'] &
    2123                   DRIVE_INCLUDEFILES))
     2068            if (!(driveflags[x] & DRIVE_INCLUDEFILES))
    21242069              RemoveCnrItems(hwnd, pci, 1, CMA_FREE | CMA_INVALIDATE);
    21252070            else {
     
    21442089        PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_MKDIR, 0), MPVOID);
    21452090      if (fFollowTree)
    2146         WinSetFocus(HWND_DESKTOP, hwnd);
     2091        WinSetFocus(HWND_DESKTOP, hwnd);
     2092      DosReleaseMutexSem(hmtFillingTreeCnr);
    21472093    }
    21482094    return 0;
     
    23672313
    23682314  case UM_DRIVECMD:
    2369     if (mp1)
     2315    if (mp1) {
    23702316      ShowTreeRec(hwnd, (CHAR *)mp1, FALSE, TRUE);
     2317      PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID);
     2318    }
    23712319    return 0;
    23722320
     
    23862334          *s = info->device;
    23872335          pci = FindCnrRecord(hwnd, s, NULL, FALSE, FALSE, TRUE);
    2388           if (pci && (INT) pci != -1) {
    2389             driveserial[info->device - 'A'] = -1;
    2390             DriveFlagsOne(info->device - 'A');
    2391             if (driveflags[info->device - 'A'] &
     2336          if (pci && (INT) pci != -1) {
     2337            INT x = info->device - 'A';
     2338            CHAR  FileSystem[CCHMAXPATH];
     2339
     2340            driveserial[x] = -1;
     2341            DriveFlagsOne(x, FileSystem, NULL);
     2342            if (driveflags[x] &
    23922343                (DRIVE_INVALID | DRIVE_IGNORE))
    23932344              RemoveCnrItems(hwnd, pci, 1, CMA_FREE);
     
    27892740
    27902741      case IDM_UPDATE:
    2791         {
     2742        {
    27922743          PCNRITEM pci = (PCNRITEM)CurrentRecord(hwnd);
    2793           if (pci && (INT)pci != -1) {
    2794             UINT driveflag = driveflags[toupper(*pci->pszFileName) - 'A'];
     2744          if (pci && (INT)pci != -1) {
     2745            struct
     2746            {
     2747              ULONG serial;
     2748              CHAR volumelength;
     2749              CHAR volumelabel[CCHMAXPATH];
     2750            }
     2751            volser;
     2752            INT x = toupper(*pci->pszFileName) - 'A';
     2753            CHAR FileSystem[CCHMAXPATH], szBuf[CCHMAXPATH];
     2754
     2755            UINT driveflag = driveflags[x];
    27952756            if (pci->attrFile & FILE_DIRECTORY) {
    27962757              if (pci->flags & RECFLAGS_UNDERENV)
    2797                 break;
     2758                break;
     2759              DosRequestMutexSem(hmtFillingTreeCnr, SEM_INDEFINITE_WAIT);
    27982760              UnFlesh(hwnd, pci);
    27992761              // Check if drive type might need update
    28002762              if ((driveflag & (DRIVE_INVALID | DRIVE_NOPRESCAN)) ||
    2801                   (~driveflag & DRIVE_NOPRESCAN && pci->rc.hptrIcon == hptrDunno))
    2802               {
    2803                 driveflags[toupper(*pci->pszFileName) - 'A'] &=
    2804                   (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    2805                    DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS | DRIVE_NOSTATS |
    2806                    DRIVE_WRITEVERIFYOFF);
    2807                 DriveFlagsOne(toupper(*pci->pszFileName) - 'A');
    2808                 driveflag = driveflags[toupper(*pci->pszFileName) - 'A'];
     2763                  (~driveflag & DRIVE_NOPRESCAN && pci->rc.hptrIcon == hptrDunno)) {
     2764                DriveFlagsOne(x, FileSystem, &volser);
     2765                driveflag = driveflags[x];
    28092766                if (driveflag & DRIVE_INVALID)
    28102767                  pci->rc.hptrIcon = hptrDunno;
    28112768                else {
    28122769                  SelectDriveIcon(pci);
    2813                 }
     2770                }
     2771                if (fShowFSTypeInTree || fShowDriveLabelInTree) {
     2772                  strcpy(szBuf, pci->pszFileName);
     2773                  strcat(szBuf, " [");
     2774                  strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel);
     2775                  strcat(szBuf, "]");
     2776                  pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);
     2777                }
     2778                pci->rc.pszIcon = pci->pszDisplayName;
    28142779                WinSendMsg(hwnd,
    28152780                           CM_INVALIDATERECORD,
     
    28202785              }
    28212786              if (~driveflag & DRIVE_INVALID)
    2822                 Flesh(hwnd, pci);
     2787                Flesh(hwnd, pci);
     2788              DosReleaseMutexSem(hmtFillingTreeCnr);
    28232789            }
    28242790          }
     
    30292995    return 0;
    30302996
     2997  case WM_TIMER:
     2998    return ActionWMTimer(hwnd, mp1, mp2);
     2999
    30313000  case WM_SAVEAPPLICATION:
    30323001    if (dcd && !ParentIsDesktop(hwnd, dcd->hwndParent)) {
     
    32603229                                     NULL,
    32613230                                     CCS_AUTOPOSITION | CCS_MINIICONS |
    3262                                      CCS_MINIRECORDCORE, //| WS_VISIBLE,
     3231                                     CCS_MINIRECORDCORE,
    32633232                                     0,
    32643233                                     0,
     
    32793248        if (ParentIsDesktop(hwndFrame, hwndParent)) {
    32803249          WinSetWindowText(WinWindowFromID(hwndFrame, FID_TITLEBAR), "VTree");
    3281           FixSwitchList(hwndFrame, "VTree");
     3250          FixSwitchList(hwndFrame, "VTree");
     3251          DosPostEventSem(hevInitialCnrScanComplete);
     3252          DosCloseEventSem(hevInitialCnrScanComplete);
     3253          fInitialDriveScan = FALSE;
    32823254        }
    32833255        else {
  • trunk/dll/update.c

    r1439 r1444  
    2020  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
    2121  14 Mar 09 GKY Prevent execution of UM_SHOWME while drive scan is occuring
     22  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
    2223
    2324***********************************************************************/
     
    191192            PostMsg(hwndCnr, UM_RESCAN, MPVOID, MPVOID);
    192193            if (pci->attrFile & FILE_DIRECTORY) {
    193               if (fInitialDriveScan)
    194                 Stubby(hwndCnr, pci);
    195               else {
    196                 while (StubbyScanCount != 0)
    197                   DosSleep(50);
    198               //Stubby(hwndCnr, pci);
    199               }
     194              Stubby(hwndCnr, pci);
    200195            }
    201196          }
     
    291286              dcd->ullTotalBytes += ullTotalBytes;
    292287            }
    293             if (fInitialDriveScan)
    294               Stubby(hwndCnr, pci);
    295             else {
    296               while (StubbyScanCount != 0)
    297                 DosSleep(50);
    298             //Stubby(hwndCnr, pci);
    299             }
     288            Stubby(hwndCnr, pci);
    300289          }
    301290        }
     
    465454                repos = TRUE;
    466455                if (pci->attrFile & FILE_DIRECTORY) {
    467                   if (fInitialDriveScan)
    468                     Stubby(hwndCnr, pci);
    469                   else {
    470                     while (StubbyScanCount != 0)
    471                       DosSleep(50);
    472                 //Stubby(hwndCnr, pci);
    473                   }
     456                  Stubby(hwndCnr, pci);
    474457                }
    475458              }
     
    570553                  }
    571554                  repos = TRUE;
    572                   if (fInitialDriveScan)
    573                     Stubby(hwndCnr, pci);
    574                   else {
    575                     while (StubbyScanCount != 0)
    576                       DosSleep(50);
    577                   //Stubby(hwndCnr, pci);
    578                   }
     555                  Stubby(hwndCnr, pci);
    579556                }
    580557                else
  • trunk/dll/valid.c

    r1439 r1444  
    3636  08 Mar 09 GKY Additional strings move to PCSZs
    3737  12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
     38  22 Jul 09 GKY Consolidated driveflag setting code in DriveFlagsOne
     39  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     40  22 Jul 09 GKY Add LocalHD driveflag
     41  22 Jul 09 GKY Streamline scanning code for faster Tree rescans
    3842
    3943***********************************************************************/
     
    7983PCSZ RAMFS = "RAMFS";
    8084PCSZ NTFS = "NTFS";
     85PCSZ LAN = "LAN";
    8186BOOL fVerifyOffChecked[26];
    8287
     
    256261INT CheckDrive(CHAR chDrive, CHAR * pszFileSystem, ULONG * pulType)
    257262{
    258   CHAR szPath[3];
     263  CHAR szPath[4];
    259264  VOID *pvBuffer = NULL;
    260265  CHAR *pfsn;
     
    266271  ULONG clDataBytes;
    267272  HFILE hDev;
     273  EASIZEBUF easize = {0};
     274  ULONG   ulDataLen        = sizeof(EASIZEBUF); 
     275  ULONG   ulParmLen        = 0;
    268276
    269277# pragma pack(1)
     
    322330  pfsn = (PCHAR)(pfsq->szName) + pfsq->cbName + 1;
    323331  pfsd = pfsn + pfsq->cbFSDName + 1;
     332  strupr(pfsn);
    324333
    325334  if (pszFileSystem) {
     
    327336    pszFileSystem[CCHMAXPATH - 1] = 0;
    328337  }
    329 
     338  szPath[2] = '\\';
     339  szPath[3] = 0;
     340  DosFSCtl(&easize, sizeof(EASIZEBUF), &ulDataLen, NULL, ulParmLen,
     341           &ulParmLen, FSCTL_MAX_EASIZE, szPath, -1, FSCTL_PATHNAME);
     342  //DbgMsg(pszSrcFile, __LINE__, "%i %i %s %s", easize.cbMaxEASize, easize.cbMaxEAListSize, szPath, pfsn);
     343  szPath[2] = 0;
     344  if (pulType && easize.cbMaxEASize == 0)
     345    *pulType |= DRIVE_NOEASUPPORT;
    330346  if (pulType && (!strcmp(pfsn, CDFS) || !strcmp(pfsn, ISOFS)))
    331       *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE;
     347    *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE;
    332348  if (pulType && !strcmp(pfsn, NTFS))
    333349    *pulType |= DRIVE_NOTWRITEABLE;
     
    338354        *pulType |= DRIVE_RAMDISK;
    339355    }
    340   if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV &&
    341       (strcmp(pfsn, CDFS) || strcmp(pfsn, ISOFS))) {
     356  if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV) {
    342357    if (pulType)
    343358      *pulType |= DRIVE_REMOTE;
     
    360375    }
    361376    if (pulType &&
    362         (!strcmp(pfsn, HPFS) ||
    363          !strcmp(pfsn, JFS) ||
    364          !strcmp(pfsn, FAT32) ||
     377        (!strcmp(pfsn, LAN) ||
    365378         !strcmp(pfsn, RAMFS) ||
    366          !strcmp(pfsn, NDFS32) ||
    367          !strcmp(pfsn, NTFS) ||
    368          !strcmp(pfsn, HPFS386))) {
     379         !strcmp(pfsn, NDFS32))) {
    369380      *pulType &= ~DRIVE_NOLONGNAMES;
    370381    }
     
    376387  // Local drive
    377388  if (strcmp(pfsn, HPFS) &&
    378       strcmp(pfsn, JFS) &&
    379389      strcmp(pfsn, CDFS) &&
    380390      strcmp(pfsn, ISOFS) &&
    381       strcmp(pfsn, RAMFS) &&
     391      strcmp(pfsn, JFS) &&
    382392      strcmp(pfsn, FAT32) &&
    383       strcmp(pfsn, NDFS32) &&
    384393      strcmp(pfsn, NTFS) &&
    385394      strcmp(pfsn, HPFS386)) {
     
    387396      (*pulType) |= DRIVE_NOLONGNAMES;  // Others can not have long names
    388397  }
    389 
    390398
    391399  DosError(FERR_DISABLEHARDERR);
     
    725733}
    726734
    727 VOID DriveFlagsOne(INT x)
     735VOID DriveFlagsOne(INT x, CHAR *FileSystem, VOID *volser)
    728736{
    729737  INT removable;
    730   CHAR szDrive[] = " :\\", FileSystem[CCHMAXPATH];
     738  CHAR szDrive[] = " :\\";
    731739  ULONG drvtype;
    732740
     
    735743  drvtype = 0;
    736744  removable = CheckDrive(*szDrive, FileSystem, &drvtype);
     745  strupr(FileSystem);
    737746  driveserial[x] = -1;
    738747  driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
     
    741750                    DRIVE_WRITEVERIFYOFF);
    742751  if (removable != -1) {
    743     struct
    744     {
    745       ULONG serial;
    746       CHAR volumelength;
    747       CHAR volumelabel[CCHMAXPATH];
    748     }
    749     volser;
    750 
    751     DosError(FERR_DISABLEHARDERR);
    752     if (!DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, &volser, sizeof(volser)))
    753       driveserial[x] = volser.serial;
    754     else
     752    if (!volser) {
     753      struct
     754      {
     755        ULONG serial;
     756        CHAR volumelength;
     757        CHAR volumelabel[CCHMAXPATH];
     758      }
     759      volserl;
     760 
    755761      DosError(FERR_DISABLEHARDERR);
     762      if (!DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, &volserl, sizeof(volserl)))
     763        driveserial[x] = volserl.serial;
     764      else
     765        DosError(FERR_DISABLEHARDERR);
     766    }
     767    else {
     768      DosError(FERR_DISABLEHARDERR);
     769      if (DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, volser,
     770                         sizeof(ULONG) + sizeof(CHAR) + CCHMAXPATH))
     771        DosError(FERR_DISABLEHARDERR);
     772    }
    756773  }
    757774  else
    758775    driveflags[x] |= DRIVE_INVALID;
    759   driveflags[x] |= ((removable == -1 || removable == 1) ?
    760                     DRIVE_REMOVABLE : 0);
     776  driveflags[x] |= ((removable == -1 || removable == 1) ? DRIVE_REMOVABLE : 0);
    761777  if (drvtype & DRIVE_REMOTE)
    762778    driveflags[x] |= DRIVE_REMOTE;
    763   if(!stricmp(FileSystem,NDFS32)){
     779  if (drvtype & DRIVE_NOEASUPPORT)
     780    driveflags[x] |= DRIVE_NOEASUPPORT;
     781  if(!strcmp(FileSystem,NDFS32)){
    764782    driveflags[x] |= DRIVE_VIRTUAL;
    765783    driveflags[x] &= (~DRIVE_REMOTE);
    766784  }
    767   if(!stricmp(FileSystem,RAMFS)){
     785  if(!strcmp(FileSystem,RAMFS)){
    768786    driveflags[x] |= DRIVE_RAMDISK;
    769787    driveflags[x] &= (~DRIVE_REMOTE);
    770788  }
    771   if(!stricmp(FileSystem,NTFS))
     789  if(!strcmp(FileSystem,NTFS))
    772790    driveflags[x] |= DRIVE_NOTWRITEABLE;
    773791  if (strcmp(FileSystem, HPFS) &&
    774       strcmp(FileSystem, JFS) &&
    775792      strcmp(FileSystem, CDFS) &&
    776793      strcmp(FileSystem, ISOFS) &&
     794      strcmp(FileSystem, JFS) &&
     795      strcmp(FileSystem, LAN) &&
    777796      strcmp(FileSystem, RAMFS) &&
    778797      strcmp(FileSystem, FAT32) &&
     
    782801    driveflags[x] |= DRIVE_NOLONGNAMES;
    783802  }
    784 
     803  if ((!strcmp(FileSystem, HPFS) ||
     804       !strcmp(FileSystem, JFS) ||
     805       !strcmp(FileSystem, FAT32) ||
     806       !strcmp(FileSystem, NTFS) ||
     807       !strcmp(FileSystem, HPFS386)) && ~driveflags[x] & DRIVE_REMOVABLE) {
     808    driveflags[x] |= DRIVE_LOCALHD;
     809  }
    785810  if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) {
    786     removable = 1;
    787811    driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM);
    788812  }
    789   if (!stricmp(FileSystem, CBSIFS)) {
     813  if (!strcmp(FileSystem, CBSIFS)) {
    790814    driveflags[x] |= DRIVE_ZIPSTREAM;
    791815    driveflags[x] &= (~DRIVE_REMOTE);
     
    823847
    824848      if (x > 1) {
    825         if (!(driveflags[x] & DRIVE_NOPRESCAN))
    826           DriveFlagsOne(x);
     849        if (!(driveflags[x] & DRIVE_NOPRESCAN)) {
     850          CHAR FileSystem[CCHMAXPATH];
     851          DriveFlagsOne(x, FileSystem, NULL);
     852        }
    827853        else
    828854          driveserial[x] = -1;
  • trunk/dll/valid.h

    r1402 r1444  
    1212  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
    1313  08 Mar 09 GKY Additional strings move to PCSZs
     14  22 Jul 09 GKY Consolidated driveflag setting code in DriveFlagsOne
    1415
    1516***********************************************************************/
     
    2122VOID ArgDriveFlags(INT argc, CHAR ** argv);
    2223INT CheckDrive(CHAR Drive, CHAR * FileSystem, ULONG * type);
    23 VOID DriveFlagsOne(INT x);
     24VOID DriveFlagsOne(INT x, CHAR *FileSystem, VOID *volser);
    2425VOID FillInDriveFlags(VOID * dummy);
    2526VOID GetDesktopName(CHAR * objectpath, ULONG size);
     
    5455extern PCSZ RAMFS;
    5556extern PCSZ CBSIFS;
     57extern PCSZ LAN;
    5658extern BOOL fVerifyOffChecked[26];
    5759
  • trunk/dll/worker.c

    r1438 r1444  
    5454#define INCL_DOS
    5555#define INCL_DOSERRORS
    56 #define INCL_WINPROGRAMLIST
    57 #define INCL_WINHELP
     56// #define INCL_WINPROGRAMLIST          // 13 Jul 09 SHL dropped
     57// #define INCL_WINHELP                 // 13 Jul 09 SHL dropped
    5858#define INCL_LONGLONG
    59 #define INCL_WINPOINTERS
    60 #define INCL_WINWORKPLACE
    61 #define INCL_WINSHELLDATA
     59#define INCL_WINPOINTERS                // WinSetFileIcon
     60// #define INCL_WINWORKPLACE            // 13 Jul 09 SHL dropped
     61#define INCL_WINSHELLDATA               // PrfQueryProfileData
     62#define INCL_WINTIMER                   // WinStarTimer
     63#define INCL_WININPUT                   // WinQueryFocus
    6264
    6365#include "fm3dll.h"
     
    103105#include "avl.h"                        // SBoxDlgProc
    104106#include "subj.h"                       // Subject
     107#include "grep.h"                       // hwndStatus
    105108#include "stristr.h"                    // stristr
    106109#include "wrappers.h"                   // xfopen
     
    195198  INT plen = 0;
    196199  CHAR *p, *pp;
     200  ULONG idTimerStarted = 0;
     201  BOOL fActionPosted = FALSE;
     202  HAB habForActions;
     203  HWND hwndForActions;
    197204  CHAR szQuotedDirName[CCHMAXPATH];
    198205  CHAR szQuotedFileName[CCHMAXPATH];
     
    216223          IncrThreadUsage();
    217224          *wildname = 0;
     225          // Do action specific preprocessing
    218226          switch (wk->li->type) {
    219227          case IDM_MERGE:
     
    322330            break;
    323331          }
     332          // Process each list item
    324333          if (wk->li && wk->li->list && wk->li->list[0]) {
     334            // char ucClassname[8];
     335            if (hwndStatus) {
     336              // Send update request to source window or container
     337              // 13 Jul 09 SHL fixme to be sure we pick window that understand UM_ACTIONSTATE wk->dcd->hwndCnr?
     338              // 13 Jul 09 SHL fixme to ensure focus window is one that understands UM_ACTIONSTATE
     339              HWND hwndFocus = WinQueryFocus(HWND_DESKTOP);
     340              DbgMsg(pszSrcFile, __LINE__, "hwndFocus %lx", hwndFocus); // 13 Jul 09 SHL fixme debug
     341              DbgMsg(pszSrcFile, __LINE__, "hwndCnr %lx", wk->hwndCnr); // 13 Jul 09 SHL fixme debug
     342              // DbgMsg(pszSrcFile, __LINE__, "hwndS %lx", wk->li->hwndS);      // 13 Jul 09 SHL fixme debug
     343              DbgMsg(pszSrcFile, __LINE__, "hwnd %lx", wk->li->hwnd);   // 13 Jul 09 SHL fixme debug
     344              // DbgMsg(pszSrcFile, __LINE__, "hwndParent %lx", wk->hwndParent);        // 13 Jul 09 SHL fixme debug
     345              // DbgMsg(pszSrcFile, __LINE__, "hwndClient %lx", wk->hwndClient);        // 13 Jul 09 SHL fixme debug
     346              // DbgMsg(pszSrcFile, __LINE__, "hwndFrame %lx", wk->hwndFrame);  // 13 Jul 09 SHL fixme debug
     347              // hwndForActions = wk->li->hwnd == hwndFocus ? hwndFocus : wk->hwndCnr;
     348              hwndForActions = WinQueryFocus(HWND_DESKTOP);
     349#if 0 // 14 Jul 09 SHL fixme
     350              hwndForActions = WinQueryFocus(HWND_DESKTOP);
     351              if (WinQueryClassName(hwndForActions, sizeof(ucClassname), ucClassname)) {
     352                // If not a container fall back to worker
     353                if (strcmp(ucClassname, "#25"));
     354              }
     355#endif
     356              habForActions = WinQueryAnchorBlock(hwndForActions);
     357              DbgMsg(pszSrcFile, __LINE__, "habForActions %lx hwndForActions %lx", habForActions, hwndForActions);      // 13 Jul 09 SHL fixme debug
     358              // Ask container window to update status line every 5 seconds in case action is time intensive
     359              idTimerStarted = WinStartTimer(habForActions, hwndForActions, ID_ACTION_TIMER, 2000);     // 13 Jul 09 SHL fixme 5 sec
     360            }
    325361            for (x = 0; wk->li->list[x]; x++) {
    326362              switch (wk->li->type) {
     
    829865                    if (fRealIdle)
    830866                      priority_idle();
     867
    831868                    rc = docopyf(type, wk->li->list[x], newname);
    832869                    if (fResetVerify) {
     
    892929                      }
    893930                      else {
    894                         if (LogFileHandle)
     931                        if (LogFileHandle) {
    895932                          fprintf(LogFileHandle,
    896933                                  GetPString(IDS_LOGTOFAILEDTEXT),
    897934                                  move, wk->li->list[x], newname, rc);
     935                        }
    898936                        rc = Dos_Error(MB_ENTERCANCEL,
    899937                                       rc,
     
    912950                    }
    913951                    else {
    914                       if (LogFileHandle)
     952                      if (LogFileHandle) {
    915953                        fprintf(LogFileHandle,
    916954                                "%s \"%s\" %s\"%s\"\n",
     
    918956                                wk->li->list[x],
    919957                                GetPString(IDS_TOTEXT), newname);
     958                      }
    920959                      if ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
    921960                          AddToList(wk->li->list[x],
     
    9841023            } // for list
    9851024
     1025            // Do actio specific post-processing
    9861026            switch (wk->li->type) {
    9871027            case IDM_MOVE:
     
    10261066              break;
    10271067            }
    1028           }
     1068            if (idTimerStarted)
     1069              WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER);     // 13 Jul 09 SHL
     1070          } // if have non-empty list
    10291071
    10301072        Abort:
     
    10481090    }
    10491091
     1092    if (fActionPosted)
     1093      DosSleep(2000);                   // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL
    10501094    if (wk->li)
    10511095      FreeListInfo(wk->li);
     
    17631807  }
    17641808}
     1809
     1810// We can use static buffer for all in progress actions because we have only 1 status line
     1811static WORKER *pCachedActionWorker;     // Sent from Action thread via UM_ACTIONSTATE
     1812static PSZ pszCachedActionListItem;     // Sent from Action thread via UM_ACTIONSTATE
     1813
     1814MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2)
     1815{
     1816  if (pCachedActionWorker != NULL && pszCachedActionListItem != NULL) {
     1817    DbgMsg(pszSrcFile, __LINE__, "Using hWndStatus %lx pCachedActionWorker %p pszCachedActionListItem %s", hwndStatus, pCachedActionWorker, pszCachedActionListItem);   // 13 Jul 09 SHL fixme debug
     1818    if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd) {
     1819      CHAR s[CCHMAXPATH + 64];
     1820      sprintf(s, "%s %s",
     1821              pCachedActionWorker->li->type == IDM_MOVE ?
     1822                GetPString(IDS_MOVINGTEXT) :
     1823                GetPString(IDS_COPYINGTEXT),
     1824              pszCachedActionListItem);
     1825      // sprintf(s, "Moving/copying %s", pszCachedActionListItem);      // 14 Jul 09 SHL fixme
     1826      WinSetWindowText(hwndStatus, s);
     1827    }
     1828  }
     1829  return 0;
     1830}
     1831
     1832MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2) {
     1833  pCachedActionWorker = PVOIDFROMMP(mp1);
     1834  pszCachedActionListItem = PVOIDFROMMP(mp2);
     1835  DbgMsg(pszSrcFile, __LINE__, "Setting pCachedActionWorker %p pszCachedActionListItem %s", pCachedActionWorker, pszCachedActionListItem);      // 13 Jul 09 SHL fixme debug
     1836  if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd)
     1837    WinPostMsg(hwnd, WM_SETFOCUS, MPFROMLONG(hwnd), MPFROMLONG(TRUE));  // 14 Jul 09 SHL Force status line update
     1838  return 0;
     1839}
     1840
    17651841#pragma alloc_text(MASSACTION,MassAction)
    17661842#pragma alloc_text(ACTION,Action)
  • trunk/dll/worker.h

    r1228 r1444  
    4545WORKER;
    4646
     47// Data declarations
     48extern FILE *LogFileHandle;
     49
    4750VOID Action(VOID * args);
    4851VOID MassAction(VOID * args);
    4952
    50 // Data declarations
    51 extern FILE *LogFileHandle;
     53MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2);
     54MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2);
    5255
    5356#endif  // WORKER_H
  • trunk/fm3.rc

    r1423 r1444  
    1616  16 Aug 07 SHL Document AUTHOR_PICTURE
    1717  04 Jan 08 SHL Sync with fm3dll.h mods
    18   29 Aug 08 GKY Add bmps from David for the 7 predefined toolbars
     18  29 Aug 08 GKY Add bmps from David for the 7 predefined toolbars
     19  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     20                loads drive root directory in directory container or expands drive tree
     21                and rescans drive in tree container depending on container focus, greyed out
     22                inappropriate menu context choices
    1923
    2024***********************************************************************/
     
    100104BITMAP VIRTUAL_ICON         bitmaps\VIRTUAL.BMP
    101105BITMAP RAMDISK_ICON         bitmaps\RAMDISK.BMP
     106BITMAP DONNO_ICON           bitmaps\DONNO.BMP
     107BITMAP IDM_RESCANALL        bitmaps\rescanhd2.bmp
     108BITMAP IDM_REFRESHREMOVABLE bitmaps\refremov.bmp
    102109BITMAP 65534                bitmaps\EMPTY.BMP
    103110BITMAP LEDON_BMP            bitmaps\LEDON.BMP
  • trunk/fm4.rc

    r1423 r1444  
    1515  04 Jan 08 SHL Sync with fm3dll.h mods
    1616  29 Aug 08 GKY Add bmps from David for the 7 predefined toolbars
    17 
     17  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
     18                loads drive root directory in directory container or expands drive tree
     19                and rescans drive in tree container depending on container focus, greyed out
     20                inappropriate menu context choices
     21               
    1822***********************************************************************/
    1923
     
    97101BITMAP VIRTUAL_ICON         bitmaps\VIRTUAL.BMP
    98102BITMAP RAMDISK_ICON         bitmaps\RAMDISK.BMP
     103BITMAP DONNO_ICON           bitmaps\DONNO.BMP
     104BITMAP IDM_RESCANALL        bitmaps\rescanhd2.bmp
     105BITMAP IDM_REFRESHREMOVABLE bitmaps\refremov.bmp
    99106BITMAP 65534                bitmaps\EMPTY.BMP
    100107BITMAP LEDON_BMP            bitmaps\LEDON.BMP
Note: See TracChangeset for help on using the changeset viewer.