Changeset 1778
- Timestamp:
- Jun 27, 2014, 12:30:54 AM (11 years ago)
- Location:
- trunk/dll
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dircnrs.c
r1777 r1778 85 85 22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories. 86 86 02 Mar 14 GKY Speed up intial drive scans Ticket 528 87 26 Jun 14 SHL Rework DirObjWndProc UM_RESCAN to avoid hanging FM/2 Lite when tree hidden 87 88 88 89 ***********************************************************************/ … … 761 762 dcd->hwndObject = hwnd; 762 763 if (ParentIsDesktop(hwnd, dcd->hwndParent)) 763 DosSleep(100); 764 DosSleep(100); 764 765 } 765 766 else … … 878 879 WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID); 879 880 } 880 while (fInitialDriveScan) { 881 DosSleep(100); // Allow to complete 882 } 883 if (fSwitchTree && hwndTree) { 884 // Keep drive tree in sync with directory container 885 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 886 if (pszTempDir) { 887 if (hwndMain) { 888 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame) 889 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 890 free(pszTempDir); 891 } 892 else { 893 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 894 free(pszTempDir); 895 } 896 } 897 } 881 // 2014-06-26 SHL FM/2 Lite may not have drive tree yet 882 if (hwndTree) { 883 if (fSwitchTreeOnDirChg) { 884 // Keep drive tree in sync with directory container 885 PSZ pszTempDir; 886 while (fInitialDriveScan) { 887 DosSleep(100); // Allow to complete 888 } 889 pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 890 if (pszTempDir) { 891 if (hwndMain) { 892 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame) 893 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 894 free(pszTempDir); 895 } 896 else { 897 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 898 free(pszTempDir); 899 } 900 } 901 } // fSwitchTreeOnDirChg 902 } // if hwndTree 898 903 dcd->firsttree = FALSE; 899 904 WinStartTimer(WinQueryAnchorBlock(hwnd), dcd->hwndCnr, ID_DIRCNR_TIMER, 500); … … 981 986 case IDM_MCIPLAY: 982 987 case IDM_UPDATE: 983 984 988 if (li->type == IDM_DELETE) 989 ignorereadonly = FALSE; 985 990 if (PostMsg(hwnd, UM_MASSACTION, mp1, mp2)) 986 991 return (MRESULT) TRUE; … … 1395 1400 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1396 1401 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) { 1397 1398 1402 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1403 if (pszTempDir) { 1399 1404 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 1400 1405 free(pszTempDir); // Failed … … 1417 1422 // DosEnterCritSec(); // GKY 11-27-08 1418 1423 dcd->stopflag++; 1419 1420 1424 // DosExitCritSec(); 1425 // DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 1421 1426 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 1422 1427 strcpy(dcd->directory, dcd->previous); … … 1474 1479 WinSetDlgItemText(dcd->hwndClient, DIR_SELECTED, s); 1475 1480 if (hwndStatus && 1476 1481 dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) { 1477 1482 PostMsg(dcd->hwndObject, UM_RESCAN2, MPVOID, MPVOID); 1478 1483 if ((fSplitStatus && hwndStatus2) || fMoreButtons) { … … 1727 1732 WinEnableMenuItem((HWND) mp2, IDM_ATTRS, TRUE); 1728 1733 } 1729 1734 WinEnableMenuItem((HWND) mp2, IDM_UNLOCKFILE, fUnlock); 1730 1735 } 1731 1736 break; … … 1744 1749 WinEnableMenuItem((HWND) mp2, 1745 1750 IDM_SELECTCOMPAREMENU, 1746 1751 (CountDirCnrs(dcd->hwndParent) > 1)); 1747 1752 break; 1748 1753 … … 1850 1855 strcpy(newfile, dcd->directory); 1851 1856 AddBackslashToPath(newfile); 1852 # if 0 1857 # if 0 1853 1858 if (newfile[strlen(newfile) - 1] != '\\') 1854 1859 strcat(newfile, "\\"); 1855 # endif 1860 # endif 1856 1861 strcat(newfile, sip.ret); 1857 1862 test = IsFile(newfile); 1858 1859 1860 1861 1862 1863 if (test != 1) { 1864 CHAR *modew = "w"; 1865 1866 fp = xfopen(newfile, modew, pszSrcFile, __LINE__, TRUE); 1867 } 1863 1868 if (test != 1 && !fp) { 1864 1869 saymsg(MB_ENTER, … … 1879 1884 dummy[1] = NULL; 1880 1885 ExecOnList(hwnd, 1881 1882 1886 editor, WINDOWED | SEPARATE, NULL, NULL, 1887 dummy, NULL, pszSrcFile, __LINE__); 1883 1888 } 1884 1889 else … … 2322 2327 //DosEnterCritSec(); //GKY 11-27-08 2323 2328 dcd->stopflag++; 2324 2325 2329 // DosExitCritSec(); 2330 // DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2326 2331 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPVOID)) { 2327 2332 //DosEnterCritSec(); //GKY 11-27-08 … … 2461 2466 //DosEnterCritSec(); // GKY 11-27-08 2462 2467 dcd->stopflag++; 2463 2464 2468 //DosExitCritSec(); 2469 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2465 2470 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2466 2471 strcpy(dcd->directory, dcd->previous); … … 2494 2499 strcpy(dcd->directory, tempname2); 2495 2500 dcd->stopflag++; 2496 2501 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2497 2502 if (!PostMsg(dcd->hwndObject, 2498 2503 UM_RESCAN, MPVOID, MPFROMLONG(1L))) { … … 2523 2528 strcpy(dcd->previous, tempname); 2524 2529 dcd->stopflag++; ; 2525 2530 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2526 2531 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2527 2532 strcpy(dcd->directory, dcd->previous); … … 2557 2562 strcpy(dcd->directory, newdir); 2558 2563 dcd->stopflag++; 2559 2564 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2560 2565 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2561 2566 strcpy(dcd->directory, dcd->previous); … … 2640 2645 li->hwnd = hwnd; 2641 2646 li->list = BuildList(hwnd); 2642 2643 2647 if (li->type == IDM_DELETE) 2648 ignorereadonly = FALSE; 2644 2649 switch (SHORT1FROMMP(mp1)) { 2645 2650 case IDM_WILDMOVE: … … 2713 2718 action = UM_MASSACTION; 2714 2719 break; 2715 2716 2717 2720 } 2721 if (li->type == IDM_DELETE) 2722 ignorereadonly = FALSE; 2718 2723 if (SHORT1FROMMP(mp1) == IDM_OBJECT || 2719 2724 SHORT1FROMMP(mp1) == IDM_SHADOW || … … 2992 2997 } 2993 2998 2994 2995 2999 /** 3000 * Access DRAGITEM index to DRAGITEM 2996 3001 * Check valid rendering mechanisms and data 2997 3002 */ … … 3400 3405 strcpy(dcd->directory, pci->pszFileName); 3401 3406 dcd->stopflag++; 3402 3407 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 3403 3408 if (!PostMsg(dcd->hwndObject, 3404 3409 UM_RESCAN, MPVOID, MPFROMLONG(1))) { … … 3444 3449 else { 3445 3450 dcd->stopflag++; 3446 3451 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 3447 3452 if (!PostMsg(dcd->hwndObject, 3448 3453 UM_RESCAN, MPVOID, MPFROMLONG(1L))) { … … 3549 3554 if ((ULONG)dcd->oldproc == 0xa9a9a9a9) 3550 3555 DbgMsg(pszSrcFile, __LINE__, "calling oldproc after dcd free msg %x mp1 %x mp2 %x", 3551 3556 msg, mp1, mp2); 3552 3557 # endif 3553 3558 return dcd->oldproc(hwnd, msg, mp1, mp2); -
trunk/dll/filldir.c
r1764 r1778 236 236 HAB thab; 237 237 HMQ hmq = (HMQ) 0; 238 //BOOL ok;239 238 static INT ProcessDirCount = 0; 240 239 … … 283 282 DosReleaseMutexSem(hmtxScanning); 284 283 DosPostEventSem(hevTreeCnrScanComplete); 285 if (fInitialDriveScan && fSwitchTree && hwndTree && fSaveState && pszFocusDir) {284 if (fInitialDriveScan && fSwitchTreeOnDirChg && hwndTree && fSaveState && pszFocusDir) { 286 285 // Keep drive tree in sync with directory container 287 286 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszFocusDir), MPVOID)) … … 290 289 ProcessDirCount = 0; 291 290 FixedVolume = 0; 292 //fInitialDriveScan = FALSE;293 291 } 294 292 # ifdef FORTIFY … … 1534 1532 1535 1533 // move cursor onto the default drive rather than the first drive 1536 if (!fSwitchTree ) {1534 if (!fSwitchTreeOnDirChg) { 1537 1535 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1538 1536 CM_QUERYRECORD, … … 1707 1705 MPFROMP(pci), 1708 1706 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 1709 } 1707 } // while pci 1710 1708 1711 1709 if (hwndMain) -
trunk/dll/fm3dlg.h
r1711 r1778 631 631 #define CFGT_FRAME 25050 632 632 #define CFGT_SWITCHTREEONFOCUS 25051 633 #define CFGT_SWITCHTREE 633 #define CFGT_SWITCHTREEONDIRCHG 25052 634 634 #define CFGT_SWITCHTREEEXPAND 25053 635 635 #define CFGT_COLLAPSEFIRST 25054 -
trunk/dll/fm3res.dlg
r1711 r1778 2032 2032 AUTOCHECKBOX "~Switch on focus change", CFGT_SWITCHTREEONFOCUS, 4, 2033 2033 80, 132, 10 2034 AUTOCHECKBOX "Switch on directory ~change", CFGT_SWITCHTREE , 4,2034 AUTOCHECKBOX "Switch on directory ~change", CFGT_SWITCHTREEONDIRCHG, 4, 2035 2035 68, 132, 10 2036 2036 AUTOCHECKBOX "Co~llapse before switch", CFGT_COLLAPSEFIRST, 4, 56, -
trunk/dll/init.c
r1777 r1778 1176 1176 fAutoAddDirs = fUseNewViewer = fDataToFore = fDataShowDrives = fDataMin = 1177 1177 fSplitStatus = fDragndropDlg = fQuickArcFind = fKeepCmdLine = 1178 fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree =1178 fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTreeOnDirChg = 1179 1179 fSwitchTreeExpand = fNoSearch = fCustomFileDlg = fOtherHelp = 1180 1180 fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget = … … 1383 1383 PrfQueryProfileData(fmprof, appname, "ErrorBeepOff", &fErrorBeepOff, &size); 1384 1384 size = sizeof(BOOL); 1385 PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTree , &size);1385 PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTreeOnDirChg, &size); 1386 1386 size = sizeof(BOOL); 1387 1387 PrfQueryProfileData(fmprof, appname, "SwitchTreeExpand", &fSwitchTreeExpand, &size); -
trunk/dll/mainwnd.c
r1777 r1778 3553 3553 continue; 3554 3554 } 3555 if (x == 0 && fSwitchTree )3555 if (x == 0 && fSwitchTreeOnDirChg) 3556 3556 pszFocusDir = xstrdup(szDir, pszSrcFile, __LINE__); 3557 3557 LoadDetailsSwitches(szKeyBase, &localdcd.ds, TRUE); -
trunk/dll/mainwnd2.c
r1777 r1778 436 436 { 437 437 PERSON1DATA *pd; 438 BOOL yes; 438 439 439 440 SetShiftState(); … … 584 585 WinSendMsg(hwnd, UM_SETUP2, MPFROMLONG(1), MPVOID); 585 586 if (hwndTree) { 587 // Hide 586 588 WinShowWindow(hwndTree, FALSE); 587 589 PostMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID); 588 hwndTree = (HWND) 0;590 hwndTree = NULLHANDLE; 589 591 } 590 592 else { 591 593 // Create tree window if needed and make visible 592 594 ULONG size = sizeof(ULONG); 593 594 595 hwndTree = StartTreeCnr(hwnd, 3); 595 PrfQueryProfileData(fmprof, 596 realappname, 597 "FM/4 TreeWidth", (PVOID) & TreeWidth, &size); 596 PrfQueryProfileData(fmprof, realappname, 597 "FM/4 TreeWidth", (PVOID)&TreeWidth, &size); 598 598 TreeWidth = max(TreeWidth, 80); 599 599 } 600 { 601 BOOL dummy = (hwndTree != (HWND) 0); 602 603 PrfWriteProfileData(fmprof, 604 realappname, 605 "FM/4 TreeUp", (PVOID) & dummy, sizeof(dummy)); 606 } 600 yes = hwndTree != NULLHANDLE; 601 PrfWriteProfileData(fmprof, realappname, 602 "FM/4 TreeUp", (PVOID)&yes, sizeof(yes)); 607 603 PostMsg(hwnd, UM_SIZE, MPVOID, MPVOID); 608 604 break; … … 793 789 ULONG which; 794 790 ULONG size; 791 BOOL yes; 795 792 796 793 switch (msg) { … … 861 858 if (pd) { 862 859 CHAR s[CCHMAXPATH]; 863 BOOL dummy = TRUE; 864 860 yes = TRUE; 865 861 size = sizeof(BOOL); 866 PrfQueryProfileData(fmprof, realappname, "FM/4 TreeUp", 867 (PVOID) &dummy, &size); 868 if (dummy) { 869 size = sizeof(ULONG); 862 PrfQueryProfileData(fmprof, realappname, 863 "FM/4 TreeUp", (PVOID)&yes, &size); 864 if (yes) { 870 865 hwndTree = StartTreeCnr(hwnd, 3); 866 size = sizeof(TreeWidth); 871 867 PrfQueryProfileData(fmprof, realappname, "FM/4 TreeWidth", 872 (PVOID) 868 (PVOID)&TreeWidth, &size); 873 869 TreeWidth = max(TreeWidth, 80); 874 870 } 875 871 size = sizeof(BOOL); 876 if (PrfQueryProfileData(fmprof, appname, "Toolbar", &dummy, &size) && 877 size && !dummy) 872 if (PrfQueryProfileData(fmprof, appname, "Toolbar", &yes, &size) && 873 size && 874 !yes) 875 { 878 876 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 877 } 879 878 880 879 size = sizeof(s); -
trunk/dll/notebook.c
r1713 r1778 178 178 BOOL fStartMaximized; 179 179 BOOL fStartMinimized; 180 BOOL fSwitchTree ;180 BOOL fSwitchTreeOnDirChg; 181 181 BOOL fSwitchTreeExpand; 182 182 BOOL fSwitchTreeOnFocus; … … 1375 1375 WinCheckButton(hwnd, CFGT_COLLAPSEFIRST, fCollapseFirst); 1376 1376 WinCheckButton(hwnd, CFGT_SWITCHTREEONFOCUS, fSwitchTreeOnFocus); 1377 WinCheckButton(hwnd, CFGT_SWITCHTREE , fSwitchTree);1377 WinCheckButton(hwnd, CFGT_SWITCHTREEONDIRCHG, fSwitchTreeOnDirChg); 1378 1378 WinCheckButton(hwnd, CFGT_SWITCHTREEEXPAND, fSwitchTreeExpand); 1379 1379 WinCheckButton(hwnd, CFGT_SHOWENV, fShowEnv); … … 1457 1457 PrfWriteProfileData(fmprof, appname, "SwitchTreeExpand", 1458 1458 &fSwitchTreeExpand, sizeof(BOOL)); 1459 fSwitchTree = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREE);1460 PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTree ,1459 fSwitchTreeOnDirChg = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREEONDIRCHG); 1460 PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTreeOnDirChg, 1461 1461 sizeof(BOOL)); 1462 1462 fFollowTree = WinQueryButtonCheckstate(hwnd, CFGT_FOLLOWTREE); … … 3179 3179 3180 3180 case CFG9_HECTOR: 3181 fSwitchTree = TRUE;3181 fSwitchTreeOnDirChg = TRUE; 3182 3182 fSwitchTreeOnFocus = FALSE; 3183 3183 fSwitchTreeExpand = TRUE; … … 3295 3295 3296 3296 case CFG9_DEFAULT: 3297 fSwitchTree = TRUE;3297 fSwitchTreeOnDirChg = TRUE; 3298 3298 fSwitchTreeOnFocus = FALSE; 3299 3299 fSwitchTreeExpand = TRUE; … … 3449 3449 fFollowTree = TRUE; 3450 3450 fTopDir = FALSE; 3451 fSwitchTree = TRUE;3451 fSwitchTreeOnDirChg = TRUE; 3452 3452 fSwitchTreeOnFocus = FALSE; 3453 3453 fSwitchTreeExpand = TRUE; … … 3513 3513 fTileBackwards = TRUE; 3514 3514 ulCnrType = CCS_MULTIPLESEL; 3515 fSwitchTree = TRUE;3515 fSwitchTreeOnDirChg = TRUE; 3516 3516 fSwitchTreeOnFocus = FALSE; 3517 3517 fSwitchTreeExpand = TRUE; … … 3554 3554 fTileBackwards = FALSE; 3555 3555 ulCnrType = CCS_MULTIPLESEL | CCS_EXTENDSEL; 3556 fSwitchTree = FALSE;3556 fSwitchTreeOnDirChg = FALSE; 3557 3557 fSwitchTreeOnFocus = FALSE; 3558 3558 fSwitchTreeExpand = FALSE; … … 3611 3611 3612 3612 case CFG9_GREGG: 3613 fSwitchTree = TRUE;3613 fSwitchTreeOnDirChg = TRUE; 3614 3614 fSwitchTreeOnFocus = FALSE; 3615 3615 fSwitchTreeExpand = TRUE; -
trunk/dll/notebook.h
r1711 r1778 100 100 extern BOOL fStartMaximized; 101 101 extern BOOL fStartMinimized; 102 extern BOOL fSwitchTree ;102 extern BOOL fSwitchTreeOnDirChg; 103 103 extern BOOL fSwitchTreeExpand; 104 104 extern BOOL fSwitchTreeOnFocus; -
trunk/dll/treecnr.c
r1771 r1778 3164 3164 } 3165 3165 3166 /** 3167 * Start drive tree container 3168 * @returns tree handle or NULLHANDLE 3169 */ 3170 3166 3171 HWND StartTreeCnr(HWND hwndParent, ULONG flags) 3167 3172 { … … 3262 3267 dcd->size = sizeof(DIRCNRDATA); 3263 3268 dcd->type = TREE_FRAME; 3264 dcd->dontclose = ( (flags & 1) != 0);3265 dcd->hwndParent = (hwndParent)? hwndParent : HWND_DESKTOP;3269 dcd->dontclose = (flags & 1) != 0; 3270 dcd->hwndParent = hwndParent ? hwndParent : HWND_DESKTOP; 3266 3271 dcd->hwndClient = hwndClient; 3267 3272 dcd->hwndFrame = hwndFrame;
Note:
See TracChangeset
for help on using the changeset viewer.