Changeset 1444
- Timestamp:
- Jul 23, 2009, 1:24:23 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/common.c
r1438 r1444 26 26 07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error 27 27 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 28 33 29 34 ***********************************************************************/ … … 260 265 hwnd, 261 266 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); 264 270 break; 265 271 case IDM_SIZES: … … 377 383 (fEjectFlpyScan ? TRUE : parm[1] > 1) && 378 384 (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); 381 424 } 382 425 break; -
trunk/dll/comp.c
r1438 r1444 67 67 15 Mar 09 GKY Use WriteDetailsSwitchs to save detail switch changes to the ini file. 68 68 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 69 13 Jul 09 SHL Sync with renames 69 70 70 71 ***********************************************************************/ … … 766 767 SleepIfNeeded(&itdSleep, 0); 767 768 } // while 768 WinPostMsg(cmp->hwnd, WM_TIMER, MPFROMLONG(ID_ TIMER), 0); // Force update769 WinPostMsg(cmp->hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0); // Force update 769 770 Abort: 770 771 WinDestroyMsgQueue(hmq); … … 822 823 823 824 default: 825 // 08 Feb 09 SHL fixme to support Ctrl-click for ANDed select 824 826 // 13 Jan 08 SHL fixme to decide if cmp->reset can ever get set 825 827 // if not lots of code can disappear … … 1402 1404 } 1403 1405 1404 WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_ TIMER), 0); // Force update1406 WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0); // Force update 1405 1407 DosPostEventSem(CompactSem); 1406 1408 } … … 1883 1885 pcil->pszDispAttr = FileAttrToString(pcil->attrFile); 1884 1886 pcil->cbFile = filesl[l]->cbFile; 1885 // 12 Jan 08 SHL fixme to use dcached size here too1887 // 12 Jan 08 SHL fixme to use cached size here too 1886 1888 CommaFmtULL(szBuf, sizeof(szBuf), pcil->cbFile, ' '); 1887 1889 pcil->pszFmtFileSize = xstrdup(szBuf, pszSrcFile, __LINE__); … … 2246 2248 } 2247 2249 } 2248 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_ TIMER, 500);2250 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_COMP_TIMER, 500); 2249 2251 } 2250 2252 break; … … 2457 2459 WinEnableWindowUpdate(hwndLeft, TRUE); 2458 2460 WinEnableWindowUpdate(hwndRight, TRUE); 2459 WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_ TIMER), 0); // Force update2461 WinPostMsg(hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0); // Force update 2460 2462 // 12 Jan 08 SHL fixme to have SetButtonEnables(COMPARE* pcmp, BOOL fEnable) 2461 2463 // to replace duplicated code here and elsewhere … … 2884 2886 2885 2887 case WM_COMMAND: 2888 // 29 Apr 09 SHL fixme to support more context menu items - IDM_EDIT, IDM_DELETE etc. 2886 2889 switch (SHORT1FROMMP(mp1)) { 2887 2890 case IDM_COMPARE: … … 3364 3367 if (cmp) { 3365 3368 // 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); 3367 3370 if (cmp->dcd.hwndLastMenu) 3368 3371 WinDestroyWindow(cmp->dcd.hwndLastMenu); -
trunk/dll/copyf.c
r1443 r1444 24 24 12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory 25 25 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. 26 27 27 28 ***********************************************************************/ … … 422 423 } 423 424 /* 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 } 428 431 } 429 432 … … 518 521 DosForceDelete(dir); 519 522 } 520 if (zaplong) 521 ZapLongName(dir); 523 if (zaplong) { 524 ret = ZapLongName(dir); 525 } 522 526 Broadcast((HAB) 0, hwndMain, UM_UPDATERECORD, MPFROMP(dir), MPVOID); 523 527 } -
trunk/dll/dircnrs.c
r1439 r1444 65 65 29 Mar 09 SHL Increase extended search timeout to 3 seconds 66 66 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 67 69 68 70 ***********************************************************************/ … … 805 807 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 806 808 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); 814 810 } 815 811 } … … 859 855 } 860 856 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); 862 858 dcd->ullTotalBytes = dcd->totalfiles = 863 859 dcd->selectedfiles = dcd->selectedbytes = 0; … … 1348 1344 1349 1345 case WM_SETFOCUS: 1350 /* 1351 * put name of our window (directory name) on status line1352 */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 */ 1355 1351 PCNRITEM pci = NULL; 1356 1357 1352 if (fAutoView && hwndMain) { 1358 1353 pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST), … … 1374 1369 PostMsg(hwndMain, UM_ADVISEFOCUS, MPFROMLONG(dcd->hwndFrame), MPVOID); 1375 1370 } 1376 if (mp2) { 1371 1377 1372 LastDir = hwnd; 1378 1373 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1374 1379 1375 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) { 1380 1376 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1381 1382 1377 if (pszTempDir) { 1383 1378 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 1384 free(pszTempDir); 1379 free(pszTempDir); // Failed 1385 1380 } 1386 1381 } … … 1451 1446 CM_QUERYRECORDEMPHASIS, 1452 1447 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED)); 1453 1448 if (pci && (INT) pci != -1) { 1454 1449 if (fSplitStatus && hwndStatus2) { 1455 1450 CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' '); … … 1601 1596 WinEnableMenuItem(DirCnrMenu, IDM_FINDINTREE, (hwndTree != (HWND) 0)); 1602 1597 } 1603 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 1598 if (!fInitialDriveScan) 1599 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 1604 1600 } 1605 1601 else { … … 1618 1614 SayView(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1619 1615 DIR_VIEW), dcd->flWindowAttr); 1620 //DbgMsg(pszSrcFile, __LINE__, "UM_SETUP2 %p pci %p", hwnd, dcd);1621 1616 } else 1622 1617 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); … … 2424 2419 2425 2420 case IDM_SWITCH: 2426 2421 if (mp2) { 2427 2422 strcpy(dcd->previous, dcd->directory); 2428 2423 strcpy(dcd->directory, (CHAR *)mp2); 2429 2424 //DosEnterCritSec(); // GKY 11-27-08 2430 2425 dcd->stopflag++; 2431 2426 //DosExitCritSec(); 2432 2427 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2433 2428 strcpy(dcd->directory, dcd->previous); … … 3484 3479 break; 3485 3480 3481 case WM_TIMER: 3482 return ActionWMTimer(hwnd, mp1, mp2); 3483 3486 3484 case WM_CLOSE: 3487 3485 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); … … 3629 3627 /* Got match make found item current item */ 3630 3628 USHORT attrib = CRA_CURSORED; 3629 // 29 Mar 09 SHL fixme to clear other object select if not extended select 3631 3630 if (!stricmp(pci->pszDisplayName, dcd->szCommonName)) 3632 3631 attrib |= CRA_SELECTED; -
trunk/dll/filldir.c
r1440 r1444 75 75 for tree container 76 76 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 77 80 78 81 ***********************************************************************/ … … 132 135 PCSZ FM3Tools = "<FM3_Tools>"; 133 136 PCSZ WPProgram = "WPProgram"; 134 volatile INT StubbyScanCount;135 volatile INT ProcessDirCount;136 137 137 138 typedef struct { … … 220 221 hmq = WinCreateMsgQueue(thab, 0); 221 222 if (hmq) { 222 StubbyScanCount++;223 223 IncrThreadUsage(); 224 224 priority_normal(); 225 225 ret = Stubby(StubbyScan->hwndCnr, StubbyScan->pci); 226 //DbgMsg(pszSrcFile, __LINE__, "Stubby %i ", ret);227 226 if (ret == 1) { 228 227 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); 248 237 } 249 238 } 250 239 } 251 240 } 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--;259 241 WinDestroyMsgQueue(hmq); 260 242 } … … 268 250 # endif 269 251 270 // _endthread(); // 10 Dec 08 SHL271 252 } 272 253 … … 276 257 HAB thab; 277 258 HMQ hmq = (HMQ) 0; 278 //BOOL ret;279 259 280 260 DosError(FERR_DISABLEHARDERR); … … 290 270 hmq = WinCreateMsgQueue(thab, 0); 291 271 if (hmq) { 292 ProcessDirCount ++;293 272 IncrThreadUsage(); 294 273 priority_normal(); … … 303 282 ProcessDir->pulTotalFiles, // Optional 304 283 ProcessDir->pullTotalBytes); // Optional 305 ProcessDirCount --;306 284 WinDestroyMsgQueue(hmq); 307 285 } … … 315 293 # endif 316 294 317 // _endthread(); // 10 Dec 08 SHL318 295 } 319 296 … … 433 410 ULONG flags = driveflags[toupper(*pci->pszFileName) - 'A']; 434 411 BOOL fLoadSubjectForDrive = fLoadSubject && ~flags & DRIVE_NOLOADSUBJS; 435 BOOL fLoadLongNameForDrive = fLoadLongnames && ~flags & DRIVE_NOLONGNAMES &&412 BOOL fLoadLongNameForDrive = fLoadLongnames && //~flags & DRIVE_NOLONGNAMES && 436 413 ~flags & DRIVE_NOLOADLONGS; 437 414 if (fLoadSubjectForDrive || fLoadLongNameForDrive) { … … 580 557 581 558 // 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)) 583 561 FetchCommonEAs(pci); 584 562 … … 741 719 // 13 Jul 09 SHL fixme to know if fetch can be bypassed if pszFSType already filled 742 720 // 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)) 744 723 FetchCommonEAs(pci); 745 724 … … 827 806 # endif 828 807 } 829 else 808 else { 830 809 pci->pszFmtFileSize = NullStr; 810 //DbgMsg(pszSrcFile, __LINE__, "Bypassed Format size %s", pci->pszDisplayName); 811 } 831 812 pci->date.day = pfsa4->fdateLastWrite.day; 832 813 pci->date.month = pfsa4->fdateLastWrite.month; … … 1182 1163 while (pci && (INT)pci != -1) { 1183 1164 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); 1191 1166 pci = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), 1192 1167 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); … … 1236 1211 ULONG ulDriveType; 1237 1212 PCNRITEM pci, pciFirst = NULL, pciNext, pciParent = NULL; 1238 INT x ,removable;1213 INT x;// removable; 1239 1214 CHAR suggest[32]; 1240 1215 CHAR szDrive[] = " :\\"; … … 1303 1278 ULONG flags = 0; 1304 1279 ULONG size = sizeof(ULONG); 1305 BOOL FSInfo = FALSE;1306 1280 struct { 1307 1281 ULONG serial; … … 1321 1295 if (!(driveflags[x] & DRIVE_NOPRESCAN)) { 1322 1296 *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; 1338 1301 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 }1376 1302 if (!fVerifyOffChecked[x]) { 1377 1303 if (driveflags[x] & DRIVE_REMOVABLE) … … 1385 1311 } 1386 1312 } 1387 if (str cmp(volser.volumelabel, NullStr) != 0 && FSInfo&& fShowDriveLabelInTree)1313 if (stricmp(volser.volumelabel, NullStr) != 0 && fShowDriveLabelInTree) 1388 1314 strcpy(szFSType, volser.volumelabel); 1389 1315 pci->rc.flRecordAttr |= CRA_RECORDREADONLY; … … 1391 1317 pci->rc.flRecordAttr |= (CRA_CURSORED | CRA_SELECTED); 1392 1318 1393 if ( removable == 0) {1319 if (!(driveflags[x] & DRIVE_REMOVABLE)) { 1394 1320 // Fixed volume 1395 1321 pci->attrFile |= FILE_DIRECTORY; … … 1622 1548 MPVOID, 1623 1549 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 1624 StubbyScanCount ++;1625 1550 while (pci && (INT)pci != -1) { 1626 1551 stubbyScan = xmallocz(sizeof(STUBBYSCAN), pszSrcFile, __LINE__); … … 1630 1555 stubbyScan->hwndCnr = hwndCnr; 1631 1556 stubbyScan->hwndDrivesList = hwndDrivesList; 1632 //stubbyScan->RamDrive = FALSE;1633 1557 pciNext = (PCNRITEM) WinSendMsg(hwndCnr, 1634 1558 CM_QUERYRECORD, … … 1650 1574 { 1651 1575 xfree(stubbyScan, pszSrcFile, __LINE__); 1652 1576 } 1653 1577 } // if drive for scanning 1654 1578 else … … 1671 1595 pci = pciNext; 1672 1596 } // while 1673 StubbyScanCount--;1674 1597 } 1675 1598 if (hwndParent) … … 1766 1689 } 1767 1690 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 }1777 1691 } // FillTreeCnr 1778 1692 -
trunk/dll/filldir.h
r1430 r1444 13 13 08 Mar 09 GKY Additional strings move to PCSZs 14 14 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 15 16 16 17 ***********************************************************************/ … … 61 62 extern HPOINTER hptrReadonly; 62 63 extern HPOINTER hptrSystem; 63 extern volatile INT StubbyScanCount;64 extern volatile INT ProcessDirCount;65 64 66 65 typedef struct { -
trunk/dll/fm3dlg.h
r1431 r1444 32 32 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook. 33 33 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 34 36 35 37 ***********************************************************************/ … … 920 922 #define DVS_SLOW 27014 921 923 #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 929 933 #define MRG_LISTBOX 27101 930 934 #define MRG_TOP 27102 -
trunk/dll/fm3dll.h
r1403 r1444 90 90 25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session 91 91 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 92 96 93 97 ***********************************************************************/ … … 151 155 #define DRIVE_WRITEVERIFYOFF 0x00040000 152 156 #define DRIVE_RSCANNED 0x00080000 157 #define DRIVE_LOCALHD 0x00200000 158 #define DRIVE_NOEASUPPORT 0x00400000 153 159 154 160 #define SORT_FIRSTEXTENSION 0x00000001 -
trunk/dll/fm3dll2.h
r1437 r1444 26 26 28 Dec 08 GKY Added Databar to utilities menu 27 27 27 Jun 09 GKY Remove IDM_DRIVEATEXT (3950) Drivebar update 28 13 Jul 09 SHL Rename timer ids 28 29 29 30 Align with spaces only - no tabs please … … 53 54 #define MAIN_TRASHCAN 98 54 55 55 #define ID_TIMER 456 56 #define ID_STICK1 5 57 57 #define ID_STICK2 6 … … 64 64 #define ID_STICK42 13 65 65 #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 72 77 73 78 #define MAIN_STATUS2 19 … … 202 207 #define VIRTUAL_ICON 925 203 208 #define RAMDISK_ICON 926 209 #define DONNO_ICON 927 204 210 205 211 #define IDM_HELPMOUSE 987 … … 560 566 #define IDM_LOADTOOLS 6013 561 567 568 #define IDM_RESCANALL 7000 569 #define IDM_REFRESHREMOVABLE 7001 570 562 571 #define IDM_WINDOWSMENU 9000 563 572 #define IDM_TILE 9001 … … 692 701 // #define UM_BUTTON2UP (WM_USER + 33) // Unused, 13 Sep 08 JBS 693 702 #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 695 704 // #define UM_HELPON (WM_USER + 36) // Unused, 13 Sep 08 JBS 696 705 #define UM_SETUP2 (WM_USER + 37) -
trunk/dll/fm3res.dlg
r1435 r1444 45 45 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook. 46 46 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) 47 49 48 50 ***********************************************************************/ … … 2015 2017 DLGTEMPLATE DVS_FRAME LOADONCALL MOVEABLE DISCARDABLE 2016 2018 BEGIN 2017 DIALOG "FM/2: Drive flags", DVS_FRAME, 12, 6, 218, 1 36, WS_VISIBLE,2019 DIALOG "FM/2: Drive flags", DVS_FRAME, 12, 6, 218, 156, WS_VISIBLE, 2018 2020 FCF_TITLEBAR 2019 2021 BEGIN 2020 CHECKBOX " Virtual Drive", DVS_VIRTUAL, 4, 126, 94, 10,2022 CHECKBOX "Local Hard Drive", DVS_LOCALHD, 4, 142, 94, 10, 2021 2023 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2022 2024 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2023 CHECKBOX "Removable", DVS_REMOVABLE, 4, 114, 94, 10,2025 CHECKBOX "Virtual Drive", DVS_VIRTUAL, 4, 130, 94, 10, 2024 2026 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2025 2027 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2026 CHECKBOX "R AMDISK", DVS_RAMDISK, 4, 102, 98, 10,2028 CHECKBOX "Removable", DVS_REMOVABLE, 4, 118, 94, 10, 2027 2029 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2028 2030 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2029 CHECKBOX "R emote Drive", DVS_REMOTE, 4, 90, 94, 10,2031 CHECKBOX "RAMDISK", DVS_RAMDISK, 4, 106, 94, 10, 2030 2032 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2031 2033 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2032 CHECKBOX " CD-ROM", DVS_CDROM, 4, 78, 94, 10,2034 CHECKBOX "Remote Drive", DVS_REMOTE, 4, 94, 94, 10, 2033 2035 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2034 2036 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2035 CHECKBOX " Zipstream", DVS_ZIPSTREAM, 4, 66, 94, 10,2037 CHECKBOX "CD-ROM", DVS_CDROM, 4, 82, 94, 10, 2036 2038 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2037 2039 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2038 CHECKBOX " Ignore", DVS_IGNORE, 4, 54, 94, 10,2040 CHECKBOX "Zipstream", DVS_ZIPSTREAM, 4, 70, 94, 10, 2039 2041 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2040 2042 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2041 CHECKBOX " Boot drive", DVS_BOOT, 4, 42, 94, 10,2043 CHECKBOX "Ignore", DVS_IGNORE, 4, 58, 94, 10, 2042 2044 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2043 2045 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2044 CHECKBOX " Invalid", DVS_INVALID, 4, 30, 94, 10,2046 CHECKBOX "Boot drive", DVS_BOOT, 4, 46, 94, 10, 2045 2047 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2046 2048 PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L 2047 CHECKBOX " Recursive scan done", DVS_RSCANNED, 4, 18, 94, 10,2049 CHECKBOX "Invalid", DVS_INVALID, 4, 34, 94, 10, 2048 2050 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2049 2051 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, 2051 2053 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2052 2054 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, 2054 2059 BS_NOPOINTERFOCUS | NOT WS_TABSTOP 2055 2060 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 2065 2073 DEFPUSHBUTTON "Okay", DID_OK, 4, 4, 40, 14, BS_NOPOINTERFOCUS | WS_GROUP 2066 2074 PUSHBUTTON "~Help", IDM_HELP, 64, 4, 40, 14, BS_NOPOINTERFOCUS -
trunk/dll/fm3res.rc
r1439 r1444 49 49 06 Jun 09 GKY Status line to show file sys/label not shown in tree; shortened to fit split status 50 50 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 51 55 52 56 ***********************************************************************/ … … 389 393 MENUITEM "", -1, MIS_SEPARATOR 390 394 MENUITEM "~Rescan\tCtrl + R", IDM_RESCAN 391 MENUITEM " ~Refresh Removable Media", IDM_REFRESHREMOVABLES395 MENUITEM "Refresh Remo~vable Media", IDM_REFRESHREMOVABLES 392 396 MENUITEM "", -1, MIS_SEPARATOR 393 397 MENUITEM "~.Parent\tCtrl + .", IDM_PARENT … … 1036 1040 MENUITEM "", -1, MIS_SEPARATOR 1037 1041 MENUITEM "~Rescan\tCtrl + R", IDM_RESCAN 1038 MENUITEM " ~Refresh Removable Media", IDM_REFRESHREMOVABLES1042 MENUITEM "Refresh Remo~vable Media", IDM_REFRESHREMOVABLES 1039 1043 MENUITEM "", -1, MIS_SEPARATOR 1040 1044 MENUITEM "~Filter...\tCtrl + f",IDM_FILTER … … 1340 1344 MENUITEM "", -1, MIS_SEPARATOR 1341 1345 MENUITEM "~Rescan", IDM_UPDATE 1342 MENUITEM " ~Refresh Removable Media", IDM_REFRESHREMOVABLES1346 MENUITEM "Refresh Remo~vable Media", IDM_REFRESHREMOVABLES 1343 1347 MENUITEM "", -1, MIS_SEPARATOR 1344 1348 SUBMENU "E~xpand/Collapse", IDM_EXPANDSUBMENU … … 1395 1399 MENUITEM "~Lock", IDM_LOCK 1396 1400 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 1397 1404 } 1398 1405 … … 3277 3284 IDS_DRAGDROPDIALOGTEXT "Drag & Drop Dialog" 3278 3285 IDS_ERROREATYPETEXT "EA type 0x%x unexpected for %.*s" 3286 IDS_RESCANALLDRIVESTEXT "Rescan all drives" 3287 IDS_REFRESHREMOVABLESTEXT "Refresh removable media" 3279 3288 3280 3289 // Add strings that need to be combined by GetPString here -
trunk/dll/fm3str.h
r1439 r1444 32 32 06 Jun 09 GKY Status line to show file sys/label not shown in tree; shortened to fit split status 33 33 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 34 38 35 39 ***********************************************************************/ … … 1002 1006 #define IDS_DRAGDROPDIALOGTEXT 1013 1003 1007 #define IDS_ERROREATYPETEXT 1014 1008 #define IDS_RESCANALLDRIVESTEXT 1015 1009 #define IDS_REFRESHREMOVABLESTEXT 1016 1004 1010 1005 1011 //The following strings were cut up form the string of the root name (ie IDS_SUGGEST1TEXT) -
trunk/dll/info.c
r1439 r1444 34 34 12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory 35 35 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 36 38 37 39 ***********************************************************************/ … … 929 931 sprintf(s, GetPString(IDS_DRIVEFLAGSTITLETEXT), toupper(*(CHAR *)mp2)); 930 932 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 */945 933 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 946 934 } … … 989 977 ((driveflags[drive] & DRIVE_WRITEVERIFYOFF) != 0)); 990 978 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)); 992 984 } 993 985 return 0; -
trunk/dll/init.c
r1439 r1444 82 82 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 83 83 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 84 86 85 87 ***********************************************************************/ … … 180 182 HMTX hmtxFM2Delete; 181 183 HMTX hmtxFM2Globals; 184 HMTX hmtFillingTreeCnr; 185 HEV hevInitialCnrScanComplete; 182 186 ULONG OS2ver[2]; 183 187 PFNWP PFNWPCnr; … … 1088 1092 if (DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE)) 1089 1093 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); 1091 1101 1092 1102 /* … … 1382 1392 size = sizeof(BOOL); 1383 1393 PrfQueryProfileData(fmprof, appname, "ConfirmDelete", &fConfirmDelete, &size); 1384 /*size = sizeof(BOOL); Replaced by UM_SHOWME check 3/14/09 GKY1394 size = sizeof(BOOL); 1385 1395 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 else1395 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 } */1402 1396 size = sizeof(BOOL); 1403 1397 PrfQueryProfileData(fmprof, appname, "SyncUpdates", &fSyncUpdates, &size); -
trunk/dll/init.h
r1438 r1444 18 18 07 Feb 09 GKY Add *DateFormat functions to format dates based on locale 19 19 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 20 24 21 25 ***********************************************************************/ … … 172 176 extern BOOL fReminimize; 173 177 extern BOOL fWantFirstTimeInit; 174 // extern BOOL fDrivetoSkip[26];175 178 extern HPOINTER hptrApp; 176 179 extern HPOINTER hptrArc; … … 195 198 extern HMTX hmtxFM2Globals; 196 199 extern HMTX hmtxFM2Delete; 197 //extern HEV DriveScanStart; 200 extern HMTX hmtFillingTreeCnr; 201 extern HEV hevInitialCnrScanComplete; 198 202 199 203 #endif // INIT_H -
trunk/dll/key.c
r1224 r1444 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004 Steven H. Levine9 Copyright (c) 2004, 2009 Steven H. Levine 10 10 11 11 Revisions … … 13 13 06 Aug 07 GKY Reduce DosSleep times (ticket 148) 14 14 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 15 15 13 Jul 09 SHL Sync with renames 16 16 17 17 ***********************************************************************/ … … 51 51 static HAB hab = 0; 52 52 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; 55 55 static HPOINTER stick1, stick2, stick3, stick4, stick12, stick22, stick32, 56 56 stick42, stick5, stick52; … … 63 63 } 64 64 if (mp2) 65 pause= TRUE;65 noanimation = TRUE; 66 66 else 67 pause= FALSE;67 noanimation = FALSE; 68 68 AboutBox = hwnd; 69 69 hab = WinQueryAnchorBlock(hwnd); … … 80 80 if (!strcmp(realappname, "FM/4")) 81 81 WinSetDlgItemText(hwnd, ABT_PROGNAME, GetPString(IDS_FM2LITETEXT)); 82 if (! pause) {82 if (!noanimation) { 83 83 stick1 = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ID_STICK1); 84 84 stick2 = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ID_STICK2); … … 93 93 direction = 2; 94 94 ticktock = 0; 95 WinStartTimer(hab, hwnd, ID_ TIMER, 164);95 WinStartTimer(hab, hwnd, ID_ABOUT_TIMER, 164); 96 96 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID); 97 97 } … … 299 299 case WM_DESTROY: 300 300 if (hab) { 301 if (! pause) {302 WinStopTimer(hab, hwnd, ID_ TIMER);301 if (!noanimation) { 302 WinStopTimer(hab, hwnd, ID_ABOUT_TIMER); 303 303 WinDestroyPointer(stick1); 304 304 WinDestroyPointer(stick2); -
trunk/dll/mainwnd.c
r1442 r1444 92 92 listings in tree 93 93 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 94 99 95 100 ***********************************************************************/ … … 171 176 #include "wrappers.h" // xfree 172 177 #include "fortify.h" 173 #include "filldir.h" // StubbyScanCount174 178 #include "excputil.h" // xbeginthread 175 179 … … 256 260 HWND hwndB = (HWND) mp1; 257 261 USHORT id; 262 CHAR s[90]= {0}; 258 263 259 264 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); 290 306 } 291 307 return 0; … … 323 339 RestoreDirCnrState(hwndMain, (char *)mp1, FALSE); 324 340 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; ; 329 342 break; 330 343 default: 331 344 Runtime_Error(pszSrcFile, __LINE__, "%u unexpected", mp2); 345 } 346 if (fInitialDriveScan) { 347 DosPostEventSem(hevInitialCnrScanComplete); 348 DosCloseEventSem(hevInitialCnrScanComplete); 349 fInitialDriveScan = FALSE; 332 350 } 333 351 return 0; … … 1835 1853 1836 1854 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 } 1853 1902 } 1854 1903 } … … 1877 1926 switch (msg) { 1878 1927 case WM_MOUSEMOVE: 1879 if (fDrivebarHelp && 1880 (!hwndBubble || 1928 if (fDrivebarHelp && (!hwndBubble || 1881 1929 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1882 1930 !WinQueryCapture(HWND_DESKTOP)) { 1883 1931 id = WinQueryWindowUShort(hwnd, QWS_ID); 1884 1932 if (helpid != id) { 1885 1933 helpid = id; 1886 1934 PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID); 1887 1935 } … … 1905 1953 1906 1954 id = WinQueryWindowUShort(hwnd, QWS_ID); 1955 if (id == IDM_REFRESHREMOVABLES || id == IDM_RESCAN) 1956 break; 1907 1957 *szDrv = 0; 1908 1958 x = id - IDM_DRIVEA; … … 1922 1972 RAMDISK_ICON : 1923 1973 (driveflags[x] & DRIVE_ZIPSTREAM) ? 1924 ZIPSTREAM_ICON : DRIVE_ICON; 1974 ZIPSTREAM_ICON : 1975 (driveflags[x] & DRIVE_LOCALHD) ? 1976 DRIVE_ICON : DONNO_ICON; 1925 1977 } 1926 1978 else … … 2000 2052 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MAIN_DRIVES); 2001 2053 if (hwndMenu) { 2002 BOOL rdy ;2054 BOOL rdy, local; 2003 2055 CHAR chDrv = *szDrv; 2004 2056 UINT iDrv; … … 2006 2058 strcat(szDrv, PCSZ_BACKSLASH); 2007 2059 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; 2009 2063 rdy = toupper(*szDrv) == toupper(chDrv); 2010 2064 iDrv = toupper(*szDrv) - 'A'; 2011 2065 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) { 2016 2072 WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE); 2017 2073 WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE); … … 2027 2083 WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE); 2028 2084 WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE); 2029 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE); 2085 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE); 2086 2087 if (!rdy || !local) 2030 2088 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE); 2031 2089 } … … 2301 2359 if (!hwndB) 2302 2360 Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2303 2361 PCSZ_WINCREATEWINDOW); 2304 2362 else { 2305 2363 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); … … 2307 2365 } 2308 2366 } // 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); 2309 2391 } // if drivebar 2310 2392 PostMsg(WinQueryWindow(hwndT, QW_PARENT), … … 3328 3410 } 3329 3411 } 3330 //if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) //These were being called twice3331 // WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); //causing dup dir names in tree3412 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) 3413 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); 3332 3414 } 3333 3415 } … … 5726 5808 if (!add_setup(pszStatename)) 5727 5809 save_setups(); 5728 } else { 5810 } 5811 else { 5729 5812 load_tools(NULL); 5730 5813 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5814 if (fInitialDriveScan) { 5815 DosPostEventSem(hevInitialCnrScanComplete); 5816 DosCloseEventSem(hevInitialCnrScanComplete); 5817 } 5731 5818 } 5732 5819 PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2); -
trunk/dll/mainwnd2.c
r1438 r1444 31 31 21 Jun 09 GKY Added drive letter to bitmap buttons in drive bar; Eliminate static drive 32 32 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 33 34 34 35 ***********************************************************************/ … … 880 881 save_dir(s); 881 882 pd->hwndDir2 = StartDirCnr(hwnd, s, (HWND) 0, 3); 883 if (fInitialDriveScan) { 884 DosPostEventSem(hevInitialCnrScanComplete); 885 DosCloseEventSem(hevInitialCnrScanComplete); 886 fInitialDriveScan = FALSE; 887 } 882 888 WinSetFocus(HWND_DESKTOP, pd->hwndCurr); 883 889 -
trunk/dll/misc.c
r1439 r1444 61 61 add State.version key for check 62 62 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. 63 65 64 66 ***********************************************************************/ … … 480 482 } 481 483 482 VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds)484 VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, BOOL compare) 483 485 { 484 486 CHAR FileSystem[CCHMAXPATH]; … … 487 489 BOOL hasAccessDT; 488 490 BOOL hasLongNames; 491 BOOL hasSubjects; 489 492 490 493 if (!directory || !*directory) … … 492 495 x = CheckDrive(toupper(*directory), FileSystem, NULL); 493 496 if (x != -1) { 497 x = toupper(*directory) - 'A'; 494 498 if (!stricmp(FileSystem, HPFS) || 495 499 !stricmp(FileSystem, JFS) || … … 501 505 hasCreateDT = TRUE; 502 506 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 } 504 515 } 505 516 else if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) { 506 517 hasCreateDT = TRUE; 507 518 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 } 509 527 } 510 528 else { … … 512 530 hasCreateDT = FALSE; 513 531 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 } 515 540 } 516 541 } … … 519 544 hasCreateDT = FALSE; 520 545 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 } 522 554 } 523 555 AdjustCnrColVis(hwndCnr, … … 536 568 GetPString(IDS_CRTIME), 537 569 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); 539 587 AdjustCnrColVis(hwndCnr, 540 GetPString(IDS_LNAME),541 pds->detailslongname ? hasLongNames : FALSE,542 588 compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ), 589 pds->detailssubject ? hasSubjects : FALSE, 590 FALSE); 543 591 WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID); 544 592 } 545 593 546 VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * 594 VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, 547 595 BOOL compare) 548 596 { 549 550 AdjustCnrColVis(hwndCnr,551 compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),552 pds->detailssubject,553 FALSE);554 555 597 AdjustCnrColVis(hwndCnr, GetPString(IDS_ATTR), pds->detailsattr, FALSE); 556 598 AdjustCnrColVis(hwndCnr, GetPString(IDS_ICON), pds->detailsicon, FALSE); … … 561 603 562 604 if (!directory) { 605 AdjustCnrColVis(hwndCnr, 606 compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ), 607 pds->detailssubject, 608 FALSE); 563 609 AdjustCnrColVis(hwndCnr, GetPString(IDS_LADATE), pds->detailsladate, FALSE); 564 610 AdjustCnrColVis(hwndCnr, GetPString(IDS_LATIME), pds->detailslatime, FALSE); … … 568 614 WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID); 569 615 } 570 else 571 AdjustCnrColsForFSType(hwndCnr, directory, pds); 616 else { 617 AdjustCnrColsForFSType(hwndCnr, directory, pds, compare); 618 } 572 619 } 573 620 … … 619 666 620 667 pfi = pfi->pNextFieldInfo; 621 pfi->flData = CFA_STRING | CFA_LEFT ;668 pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR; 622 669 pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY; 623 670 pfi->pTitleData = (PSZ)GetPString(IDS_LNAME); 624 671 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; 625 680 626 681 // 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; 659 691 660 692 // Fill in column information for the file size 661 662 693 663 694 pfi = pfi->pNextFieldInfo; -
trunk/dll/misc.h
r1410 r1444 11 11 17 Jul 08 SHL Baseline 12 12 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. 13 15 14 16 ***********************************************************************/ … … 31 33 BOOL AdjustCnrColRO(HWND hwndCnr, PCSZ title, BOOL readonly, BOOL toggle); 32 34 BOOL 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 * 35 VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, BOOL compare); 36 VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, 35 37 BOOL compare); 36 38 VOID AdjustDetailsSwitches(HWND hwnd, HWND hwndMenu, USHORT cmd, -
trunk/dll/newview.c
r1433 r1444 38 38 08 Mar 09 GKY Renamed commafmt.h i18nutil.h 39 39 08 Mar 09 GKY Additional strings move to PCSZs in init.c 40 13 Jul 09 SHL Sync with renames 40 41 41 42 ***********************************************************************/ … … 1848 1849 (PVOID) FNT_8HELVETICA); 1849 1850 } 1850 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_ TIMER5, 1000L);1851 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NEWVIEW_TIMER, 1000L); 1851 1852 } 1852 1853 break; … … 4007 4008 HWND hwndRestore = (HWND) 0; 4008 4009 4009 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_ TIMER5);4010 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NEWVIEW_TIMER); 4010 4011 if (ad) { 4011 4012 ad->stopflag = 1; -
trunk/dll/notify.c
r1395 r1444 3 3 $Id$ 4 4 5 Thread notes window and popup notification status line5 Thread notes window and popup notifications over status line 6 6 7 7 Copyright (c) 1993-98 M. Kimes … … 18 18 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook. 19 19 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 20 22 21 23 ***********************************************************************/ … … 25 27 #include <ctype.h> 26 28 #include <stddef.h> // _threadid 27 // #include <process.h> // _beginthread28 29 29 30 #define INCL_DOS … … 55 56 static PSZ pszSrcFile = __FILE__; 56 57 static volatile HWND hwndNotify; // 16 Apr 08 SHL 58 static volatile PCSZ pszCachedNote; // 16 Jul 09 SHL 57 59 58 60 #pragma data_seg(GLOBAL1) 59 61 BOOL fThreadNotes; 60 62 61 VOID StartNotes(CHAR * s);62 63 /** 64 * Popup notification message window procedure65 * Display timed message over status line63 static VOID StartNotes(PCSZ pszNote); 64 65 /** 66 * Notification message window procedure 67 * Displays timed message over status line 66 68 */ 67 69 … … 76 78 MRESULT rc = PFNWPStatic(hwnd, msg, mp1, mp2); 77 79 78 if (!WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_ TIMER2, 5000)) {80 if (!WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NOTIFY_TIMER, 5000)) { 79 81 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, "WinStartTimer"); 80 82 WinDestroyWindow(hwnd); … … 144 146 case WM_TIMER: 145 147 case WM_CLOSE: 146 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_ TIMER2);148 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_NOTIFY_TIMER); 147 149 WinDestroyWindow(hwnd); 148 150 return 0; … … 162 164 163 165 /** 164 * Display timed notification windowover status line166 * Process UM_NOTIFY message to display timed message over status line 165 167 */ 166 168 … … 213 215 SS_TEXT | DT_LEFT | DT_VCENTER | WS_VISIBLE, 214 216 x, y, cx, cy, hwndP, HWND_TOP, id++, NULL, NULL); 215 if (!hwnd P)217 if (!hwnd) 216 218 Win_Error(hwndP, hwndP, pszSrcFile, __LINE__, 217 219 PCSZ_WINCREATEWINDOW); … … 220 222 free(p); 221 223 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 226 228 227 229 return hwnd; … … 229 231 230 232 /** 231 * Add message to thread notes window233 * Display timed notification window over status line 232 234 */ 233 235 … … 238 240 239 241 /** 240 * Add error message to thread notes window 242 * Notify on error 243 * Format message and pass to Notify 241 244 */ 242 245 … … 247 250 if (!filename) 248 251 return; 252 249 253 sprintf(errortext, GetPString(IDS_ERRORACCESSTEXT), status, filename); 250 254 if (toupper(*filename) > 'B') { … … 281 285 282 286 /** 283 * Thread notes dialogwindow dialog procedure287 * Thread notes window dialog procedure 284 288 */ 285 289 286 290 MRESULT EXPENTRY NoteWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 287 291 { 288 static HPOINTER hptrIcon = (HPOINTER) 0;292 static HPOINTER hptrIcon; 289 293 290 294 switch (msg) { … … 293 297 // Already have notes dialog - pass message on 294 298 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__); 300 301 } 301 302 WinDismissDlg(hwnd, 0); … … 303 304 } 304 305 hwndNotify = hwnd; 305 fThreadNotes = FALSE; 306 // Remember showing 307 { 308 BOOL dummy = TRUE; 306 // Remember showing for restart 307 fThreadNotes = TRUE; 309 308 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 312 320 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); 324 330 325 331 hptrIcon = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, NOTE_FRAME); … … 429 435 430 436 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 } 431 468 WinDismissDlg(hwnd, 0); 432 469 return 0; … … 434 471 case WM_DESTROY: 435 472 if (hwndNotify == hwnd) { 473 // Remember not open 436 474 fThreadNotes = FALSE; 437 475 PrfWriteProfileData(fmprof, … … 439 477 hwndNotify = (HWND) 0; 440 478 } 441 if (hptrIcon) 479 if (hptrIcon) { 442 480 WinDestroyPointer(hptrIcon); 481 hptrIcon = (HPOINTER)0; // 16 Jul 09 SHL 482 } 443 483 if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID)) 444 484 WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID); … … 464 504 WinDlgBox(HWND_DESKTOP, 465 505 HWND_DESKTOP, 466 NoteWndProc, FM3ModHandle, NOTE_FRAME, (CHAR *)args);506 NoteWndProc, FM3ModHandle, NOTE_FRAME, args); 467 507 WinDestroyMsgQueue(hmq); 468 508 } … … 478 518 */ 479 519 480 VOID StartNotes(CHAR *note)520 static VOID StartNotes(PCSZ note) 481 521 { 482 522 if (!hwndNotify) { 483 523 if (xbeginthread(NoteThread, 484 524 65536, 485 note,525 (VOID*)note, 486 526 pszSrcFile, 487 527 __LINE__) != -1) … … 498 538 /** 499 539 * 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 544 VOID AddNote(PCSZ note) 503 545 { 504 546 PSZ s; 505 547 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 512 554 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 } 513 572 if (!hwndNotify) { 514 fThreadNotes = FALSE; 573 fThreadNotes = FALSE; // 16 Jul 09 SHL fixme to be gone? 515 574 StartNotes(NULL); 516 575 } … … 525 584 MPFROM2SHORT(LIT_END, 0), 526 585 MPFROMP(s)) >= 0) { 527 ret = TRUE;528 586 PostMsg(hwndNotify, UM_NOTIFY, MPVOID, MPVOID); 529 587 break; … … 537 595 } 538 596 } 539 return ret;540 597 } 541 598 -
trunk/dll/notify.h
r1394 r1444 17 17 #define NOTIFY_H 18 18 19 BOOL AddNote(PCSZ note); 19 VOID AddNote(PCSZ note); // 16 Jul 09 SHL 20 20 HWND DoNotify(PCSZ text); 21 21 VOID EndNote(VOID); -
trunk/dll/treecnr.c
r1439 r1444 72 72 12 Jul 09 GKY Add option to show file system type or drive label in tree 73 73 (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 74 77 75 78 ***********************************************************************/ … … 629 632 Fortify_BecomeOwner(mp1); 630 633 # endif 631 if (StubbyScanCount != 0) { //prevent treeswitch from hanging fm2 during startup GKY 3-14-09632 DosSleep(50);633 PostMsg(hwndTree, UM_SHOWME, mp1, MPVOID);634 }635 634 dcd = INSTDATA(hwnd); 636 635 if (dcd) { … … 644 643 temptop = fTopDir; 645 644 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); 648 648 dcd->suspendview = tempsusp; 649 649 fFollowTree = tempfollow; … … 849 849 Runtime_Error(pszSrcFile, __LINE__, NULL); 850 850 else { 851 while (StubbyScanCount != 0)852 DosSleep(50);853 851 RemoveCnrItems(dcd->hwndCnr, NULL, 0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE); 854 852 WinSendMsg(dcd->hwndCnr, … … 856 854 WinSendMsg(dcd->hwndCnr, 857 855 CM_SCROLLWINDOW, 858 MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(-1)); 856 MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(-1)); 857 DosRequestMutexSem(hmtFillingTreeCnr, SEM_INDEFINITE_WAIT); 859 858 FillTreeCnr(dcd->hwndCnr, dcd->hwndParent); 859 DosReleaseMutexSem(hmtFillingTreeCnr); 860 860 if (fOkayMinimize) { 861 861 PostMsg(dcd->hwndCnr, UM_MINIMIZE, MPVOID, MPVOID); … … 1093 1093 WinSetWindowText(hwndStatus2, NullStr); 1094 1094 } 1095 // 13 Jul 09 SHL fixme to make sense 1095 1096 if (msg == UM_TIMER) 1096 1097 return 0; … … 1887 1888 PCNRITEM pciP, pciL, pci; 1888 1889 ULONG fl = SWP_ACTIVATE; 1889 1890 INT x; 1891 1892 DosRequestMutexSem(hmtFillingTreeCnr, SEM_INDEFINITE_WAIT); 1890 1893 if (fFollowTree) 1891 1894 fl = 0; … … 1895 1898 (INT) pci != -1 && 1896 1899 !(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) { 1899 1903 if (!fAlertBeepOff) 1900 1904 DosBeep(50, 100); … … 1905 1909 DosError(FERR_DISABLEHARDERR); 1906 1910 if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) { 1907 if (!(ulDriveMap & 1 << (toupper(*pci->pszFileName) - 'A'))) {1911 if (!(ulDriveMap & 1 << x)) { 1908 1912 pciL = pciP = pci; 1909 1913 for (;;) { … … 1923 1927 } 1924 1928 } 1925 if (driveflags[toupper(*pci->pszFileName) - 'A'] & 1926 (DRIVE_REMOVABLE | DRIVE_NOPRESCAN)) { 1929 if (driveflags[x] & (DRIVE_REMOVABLE | DRIVE_NOPRESCAN)) { 1927 1930 1928 1931 struct … … 1949 1952 } 1950 1953 } 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); 2005 1960 } 2006 1961 memset(&volser, 0, sizeof(volser)); … … 2010 1965 (ULONG) sizeof(volser)); 2011 1966 if (!status) { 2012 if (!volser.serial || 2013 driveserial[toupper(*pci->pszFileName) - 'A'] != 2014 volser.serial) { 1967 if (!volser.serial || driveserial[x] != volser.serial) { 2015 1968 UnFlesh(hwnd, pciP); 2016 1969 Flesh(hwnd, pciP); 2017 driveserial[ toupper(*pci->pszFileName) - 'A'] = volser.serial;1970 driveserial[x] = volser.serial; 2018 1971 } 2019 1972 pciL = WinSendMsg(hwnd, … … 2023 1976 if (!pciL) 2024 1977 Flesh(hwnd, pciP); 2025 if (fShowFSTypeInTree ) {2026 strcpy(szBuf, pci P->pszFileName);1978 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 1979 strcpy(szBuf, pci->pszFileName); 2027 1980 strcat(szBuf, " ["); 2028 strcat(szBuf, FileSystem);1981 strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel); 2029 1982 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__); 2038 1984 } 2039 1985 pciP->rc.pszIcon = pciP->pszDisplayName; … … 2044 1990 } 2045 1991 else { 2046 driveserial[ toupper(*pci->pszFileName) - 'A'] = -1;1992 driveserial[x] = -1; 2047 1993 UnFlesh(hwnd, pci); 2048 1994 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); … … 2120 2066 } 2121 2067 else { 2122 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 2123 DRIVE_INCLUDEFILES)) 2068 if (!(driveflags[x] & DRIVE_INCLUDEFILES)) 2124 2069 RemoveCnrItems(hwnd, pci, 1, CMA_FREE | CMA_INVALIDATE); 2125 2070 else { … … 2144 2089 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_MKDIR, 0), MPVOID); 2145 2090 if (fFollowTree) 2146 WinSetFocus(HWND_DESKTOP, hwnd); 2091 WinSetFocus(HWND_DESKTOP, hwnd); 2092 DosReleaseMutexSem(hmtFillingTreeCnr); 2147 2093 } 2148 2094 return 0; … … 2367 2313 2368 2314 case UM_DRIVECMD: 2369 if (mp1) 2315 if (mp1) { 2370 2316 ShowTreeRec(hwnd, (CHAR *)mp1, FALSE, TRUE); 2317 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 2318 } 2371 2319 return 0; 2372 2320 … … 2386 2334 *s = info->device; 2387 2335 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] & 2392 2343 (DRIVE_INVALID | DRIVE_IGNORE)) 2393 2344 RemoveCnrItems(hwnd, pci, 1, CMA_FREE); … … 2789 2740 2790 2741 case IDM_UPDATE: 2791 2742 { 2792 2743 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]; 2795 2756 if (pci->attrFile & FILE_DIRECTORY) { 2796 2757 if (pci->flags & RECFLAGS_UNDERENV) 2797 break; 2758 break; 2759 DosRequestMutexSem(hmtFillingTreeCnr, SEM_INDEFINITE_WAIT); 2798 2760 UnFlesh(hwnd, pci); 2799 2761 // Check if drive type might need update 2800 2762 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]; 2809 2766 if (driveflag & DRIVE_INVALID) 2810 2767 pci->rc.hptrIcon = hptrDunno; 2811 2768 else { 2812 2769 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; 2814 2779 WinSendMsg(hwnd, 2815 2780 CM_INVALIDATERECORD, … … 2820 2785 } 2821 2786 if (~driveflag & DRIVE_INVALID) 2822 Flesh(hwnd, pci); 2787 Flesh(hwnd, pci); 2788 DosReleaseMutexSem(hmtFillingTreeCnr); 2823 2789 } 2824 2790 } … … 3029 2995 return 0; 3030 2996 2997 case WM_TIMER: 2998 return ActionWMTimer(hwnd, mp1, mp2); 2999 3031 3000 case WM_SAVEAPPLICATION: 3032 3001 if (dcd && !ParentIsDesktop(hwnd, dcd->hwndParent)) { … … 3260 3229 NULL, 3261 3230 CCS_AUTOPOSITION | CCS_MINIICONS | 3262 CCS_MINIRECORDCORE, //| WS_VISIBLE,3231 CCS_MINIRECORDCORE, 3263 3232 0, 3264 3233 0, … … 3279 3248 if (ParentIsDesktop(hwndFrame, hwndParent)) { 3280 3249 WinSetWindowText(WinWindowFromID(hwndFrame, FID_TITLEBAR), "VTree"); 3281 FixSwitchList(hwndFrame, "VTree"); 3250 FixSwitchList(hwndFrame, "VTree"); 3251 DosPostEventSem(hevInitialCnrScanComplete); 3252 DosCloseEventSem(hevInitialCnrScanComplete); 3253 fInitialDriveScan = FALSE; 3282 3254 } 3283 3255 else { -
trunk/dll/update.c
r1439 r1444 20 20 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 21 21 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 22 23 23 24 ***********************************************************************/ … … 191 192 PostMsg(hwndCnr, UM_RESCAN, MPVOID, MPVOID); 192 193 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); 200 195 } 201 196 } … … 291 286 dcd->ullTotalBytes += ullTotalBytes; 292 287 } 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); 300 289 } 301 290 } … … 465 454 repos = TRUE; 466 455 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); 474 457 } 475 458 } … … 570 553 } 571 554 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); 579 556 } 580 557 else -
trunk/dll/valid.c
r1439 r1444 36 36 08 Mar 09 GKY Additional strings move to PCSZs 37 37 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 38 42 39 43 ***********************************************************************/ … … 79 83 PCSZ RAMFS = "RAMFS"; 80 84 PCSZ NTFS = "NTFS"; 85 PCSZ LAN = "LAN"; 81 86 BOOL fVerifyOffChecked[26]; 82 87 … … 256 261 INT CheckDrive(CHAR chDrive, CHAR * pszFileSystem, ULONG * pulType) 257 262 { 258 CHAR szPath[ 3];263 CHAR szPath[4]; 259 264 VOID *pvBuffer = NULL; 260 265 CHAR *pfsn; … … 266 271 ULONG clDataBytes; 267 272 HFILE hDev; 273 EASIZEBUF easize = {0}; 274 ULONG ulDataLen = sizeof(EASIZEBUF); 275 ULONG ulParmLen = 0; 268 276 269 277 # pragma pack(1) … … 322 330 pfsn = (PCHAR)(pfsq->szName) + pfsq->cbName + 1; 323 331 pfsd = pfsn + pfsq->cbFSDName + 1; 332 strupr(pfsn); 324 333 325 334 if (pszFileSystem) { … … 327 336 pszFileSystem[CCHMAXPATH - 1] = 0; 328 337 } 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; 330 346 if (pulType && (!strcmp(pfsn, CDFS) || !strcmp(pfsn, ISOFS))) 331 347 *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE; 332 348 if (pulType && !strcmp(pfsn, NTFS)) 333 349 *pulType |= DRIVE_NOTWRITEABLE; … … 338 354 *pulType |= DRIVE_RAMDISK; 339 355 } 340 if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV && 341 (strcmp(pfsn, CDFS) || strcmp(pfsn, ISOFS))) { 356 if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV) { 342 357 if (pulType) 343 358 *pulType |= DRIVE_REMOTE; … … 360 375 } 361 376 if (pulType && 362 (!strcmp(pfsn, HPFS) || 363 !strcmp(pfsn, JFS) || 364 !strcmp(pfsn, FAT32) || 377 (!strcmp(pfsn, LAN) || 365 378 !strcmp(pfsn, RAMFS) || 366 !strcmp(pfsn, NDFS32) || 367 !strcmp(pfsn, NTFS) || 368 !strcmp(pfsn, HPFS386))) { 379 !strcmp(pfsn, NDFS32))) { 369 380 *pulType &= ~DRIVE_NOLONGNAMES; 370 381 } … … 376 387 // Local drive 377 388 if (strcmp(pfsn, HPFS) && 378 strcmp(pfsn, JFS) &&379 389 strcmp(pfsn, CDFS) && 380 390 strcmp(pfsn, ISOFS) && 381 strcmp(pfsn, RAMFS) &&391 strcmp(pfsn, JFS) && 382 392 strcmp(pfsn, FAT32) && 383 strcmp(pfsn, NDFS32) &&384 393 strcmp(pfsn, NTFS) && 385 394 strcmp(pfsn, HPFS386)) { … … 387 396 (*pulType) |= DRIVE_NOLONGNAMES; // Others can not have long names 388 397 } 389 390 398 391 399 DosError(FERR_DISABLEHARDERR); … … 725 733 } 726 734 727 VOID DriveFlagsOne(INT x )735 VOID DriveFlagsOne(INT x, CHAR *FileSystem, VOID *volser) 728 736 { 729 737 INT removable; 730 CHAR szDrive[] = " :\\" , FileSystem[CCHMAXPATH];738 CHAR szDrive[] = " :\\"; 731 739 ULONG drvtype; 732 740 … … 735 743 drvtype = 0; 736 744 removable = CheckDrive(*szDrive, FileSystem, &drvtype); 745 strupr(FileSystem); 737 746 driveserial[x] = -1; 738 747 driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS | … … 741 750 DRIVE_WRITEVERIFYOFF); 742 751 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 755 761 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 } 756 773 } 757 774 else 758 775 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); 761 777 if (drvtype & DRIVE_REMOTE) 762 778 driveflags[x] |= DRIVE_REMOTE; 763 if(!stricmp(FileSystem,NDFS32)){ 779 if (drvtype & DRIVE_NOEASUPPORT) 780 driveflags[x] |= DRIVE_NOEASUPPORT; 781 if(!strcmp(FileSystem,NDFS32)){ 764 782 driveflags[x] |= DRIVE_VIRTUAL; 765 783 driveflags[x] &= (~DRIVE_REMOTE); 766 784 } 767 if(!str icmp(FileSystem,RAMFS)){785 if(!strcmp(FileSystem,RAMFS)){ 768 786 driveflags[x] |= DRIVE_RAMDISK; 769 787 driveflags[x] &= (~DRIVE_REMOTE); 770 788 } 771 if(!str icmp(FileSystem,NTFS))789 if(!strcmp(FileSystem,NTFS)) 772 790 driveflags[x] |= DRIVE_NOTWRITEABLE; 773 791 if (strcmp(FileSystem, HPFS) && 774 strcmp(FileSystem, JFS) &&775 792 strcmp(FileSystem, CDFS) && 776 793 strcmp(FileSystem, ISOFS) && 794 strcmp(FileSystem, JFS) && 795 strcmp(FileSystem, LAN) && 777 796 strcmp(FileSystem, RAMFS) && 778 797 strcmp(FileSystem, FAT32) && … … 782 801 driveflags[x] |= DRIVE_NOLONGNAMES; 783 802 } 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 } 785 810 if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) { 786 removable = 1;787 811 driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM); 788 812 } 789 if (!str icmp(FileSystem, CBSIFS)) {813 if (!strcmp(FileSystem, CBSIFS)) { 790 814 driveflags[x] |= DRIVE_ZIPSTREAM; 791 815 driveflags[x] &= (~DRIVE_REMOTE); … … 823 847 824 848 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 } 827 853 else 828 854 driveserial[x] = -1; -
trunk/dll/valid.h
r1402 r1444 12 12 25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis 13 13 08 Mar 09 GKY Additional strings move to PCSZs 14 22 Jul 09 GKY Consolidated driveflag setting code in DriveFlagsOne 14 15 15 16 ***********************************************************************/ … … 21 22 VOID ArgDriveFlags(INT argc, CHAR ** argv); 22 23 INT CheckDrive(CHAR Drive, CHAR * FileSystem, ULONG * type); 23 VOID DriveFlagsOne(INT x );24 VOID DriveFlagsOne(INT x, CHAR *FileSystem, VOID *volser); 24 25 VOID FillInDriveFlags(VOID * dummy); 25 26 VOID GetDesktopName(CHAR * objectpath, ULONG size); … … 54 55 extern PCSZ RAMFS; 55 56 extern PCSZ CBSIFS; 57 extern PCSZ LAN; 56 58 extern BOOL fVerifyOffChecked[26]; 57 59 -
trunk/dll/worker.c
r1438 r1444 54 54 #define INCL_DOS 55 55 #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 58 58 #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 62 64 63 65 #include "fm3dll.h" … … 103 105 #include "avl.h" // SBoxDlgProc 104 106 #include "subj.h" // Subject 107 #include "grep.h" // hwndStatus 105 108 #include "stristr.h" // stristr 106 109 #include "wrappers.h" // xfopen … … 195 198 INT plen = 0; 196 199 CHAR *p, *pp; 200 ULONG idTimerStarted = 0; 201 BOOL fActionPosted = FALSE; 202 HAB habForActions; 203 HWND hwndForActions; 197 204 CHAR szQuotedDirName[CCHMAXPATH]; 198 205 CHAR szQuotedFileName[CCHMAXPATH]; … … 216 223 IncrThreadUsage(); 217 224 *wildname = 0; 225 // Do action specific preprocessing 218 226 switch (wk->li->type) { 219 227 case IDM_MERGE: … … 322 330 break; 323 331 } 332 // Process each list item 324 333 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 } 325 361 for (x = 0; wk->li->list[x]; x++) { 326 362 switch (wk->li->type) { … … 829 865 if (fRealIdle) 830 866 priority_idle(); 867 831 868 rc = docopyf(type, wk->li->list[x], newname); 832 869 if (fResetVerify) { … … 892 929 } 893 930 else { 894 if (LogFileHandle) 931 if (LogFileHandle) { 895 932 fprintf(LogFileHandle, 896 933 GetPString(IDS_LOGTOFAILEDTEXT), 897 934 move, wk->li->list[x], newname, rc); 935 } 898 936 rc = Dos_Error(MB_ENTERCANCEL, 899 937 rc, … … 912 950 } 913 951 else { 914 if (LogFileHandle) 952 if (LogFileHandle) { 915 953 fprintf(LogFileHandle, 916 954 "%s \"%s\" %s\"%s\"\n", … … 918 956 wk->li->list[x], 919 957 GetPString(IDS_TOTEXT), newname); 958 } 920 959 if ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) && 921 960 AddToList(wk->li->list[x], … … 984 1023 } // for list 985 1024 1025 // Do actio specific post-processing 986 1026 switch (wk->li->type) { 987 1027 case IDM_MOVE: … … 1026 1066 break; 1027 1067 } 1028 } 1068 if (idTimerStarted) 1069 WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER); // 13 Jul 09 SHL 1070 } // if have non-empty list 1029 1071 1030 1072 Abort: … … 1048 1090 } 1049 1091 1092 if (fActionPosted) 1093 DosSleep(2000); // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL 1050 1094 if (wk->li) 1051 1095 FreeListInfo(wk->li); … … 1763 1807 } 1764 1808 } 1809 1810 // We can use static buffer for all in progress actions because we have only 1 status line 1811 static WORKER *pCachedActionWorker; // Sent from Action thread via UM_ACTIONSTATE 1812 static PSZ pszCachedActionListItem; // Sent from Action thread via UM_ACTIONSTATE 1813 1814 MRESULT 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 1832 MRESULT 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 1765 1841 #pragma alloc_text(MASSACTION,MassAction) 1766 1842 #pragma alloc_text(ACTION,Action) -
trunk/dll/worker.h
r1228 r1444 45 45 WORKER; 46 46 47 // Data declarations 48 extern FILE *LogFileHandle; 49 47 50 VOID Action(VOID * args); 48 51 VOID MassAction(VOID * args); 49 52 50 // Data declarations 51 extern FILE *LogFileHandle;53 MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2); 54 MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2); 52 55 53 56 #endif // WORKER_H -
trunk/fm3.rc
r1423 r1444 16 16 16 Aug 07 SHL Document AUTHOR_PICTURE 17 17 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 19 23 20 24 ***********************************************************************/ … … 100 104 BITMAP VIRTUAL_ICON bitmaps\VIRTUAL.BMP 101 105 BITMAP RAMDISK_ICON bitmaps\RAMDISK.BMP 106 BITMAP DONNO_ICON bitmaps\DONNO.BMP 107 BITMAP IDM_RESCANALL bitmaps\rescanhd2.bmp 108 BITMAP IDM_REFRESHREMOVABLE bitmaps\refremov.bmp 102 109 BITMAP 65534 bitmaps\EMPTY.BMP 103 110 BITMAP LEDON_BMP bitmaps\LEDON.BMP -
trunk/fm4.rc
r1423 r1444 15 15 04 Jan 08 SHL Sync with fm3dll.h mods 16 16 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 18 22 ***********************************************************************/ 19 23 … … 97 101 BITMAP VIRTUAL_ICON bitmaps\VIRTUAL.BMP 98 102 BITMAP RAMDISK_ICON bitmaps\RAMDISK.BMP 103 BITMAP DONNO_ICON bitmaps\DONNO.BMP 104 BITMAP IDM_RESCANALL bitmaps\rescanhd2.bmp 105 BITMAP IDM_REFRESHREMOVABLE bitmaps\refremov.bmp 99 106 BITMAP 65534 bitmaps\EMPTY.BMP 100 107 BITMAP LEDON_BMP bitmaps\LEDON.BMP
Note:
See TracChangeset
for help on using the changeset viewer.