Changeset 1459 for trunk/dll/dircnrs.c


Ignore:
Timestamp:
Sep 16, 2009, 7:58:59 AM (16 years ago)
Author:
Steven Levine
Message:

Show rescan progress while filling container, ticket #291

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1455 r1459  
    6868  22 Jul 09 SHL Cleanup of SETFOCUS code
    6969  14 Sep 09 SHL Drop experimental code
     70  15 Sep 09 SHL Show rescan progress while filling container
    7071
    7172***********************************************************************/
     
    101102#include "notebook.h"                   // CfgDlgProc
    102103#include "command.h"                    // RunCommand
    103 #include "worker.h"             // Action, MassAction
     104#include "worker.h"                     // Action, MassAction
    104105#include "misc.h"                       // GetTidForThread, AdjustCnrColsForFSType, AdjustCnrColsForPref
    105106                                        // AdjustDetailsSwitches, CnrDirectEdit, OpenEdit, QuickPopup
    106107                                        // SayFilter, SaySort, SayView, SetCnrCols, SetDetailsSwitches
    107                                 // SetSortChecks, SetViewMenu, SwitchCommand, CheckMenu
    108                                 // CurrentRecord, DrawTargetEmphasis, IsFm2Window
     108                                        // SetSortChecks, SetViewMenu, SwitchCommand, CheckMenu
     109                                        // CurrentRecord, DrawTargetEmphasis, IsFm2Window
    109110#include "chklist.h"                    // CenterOverWindow, DropListProc
    110111#include "common.h"                     // CommonCnrProc, CommonCreateTextChildren, CommonFrameWndProc
    111                                 // CommonTextPaint, CommonTextButton, CommonTextProc
     112                                        // CommonTextPaint, CommonTextButton, CommonTextProc
    112113#include "mainwnd.h"                    // CountDirCnrs, GetNextWindowPos, MakeBubble, TopWindow
    113114#include "select.h"                     // DeselectAll, HideAll, InvertAll, SelectAll, SelectList
    114                                 // SpecialSelect2
     115                                        // SpecialSelect2
    115116#include "dirsize.h"                    // DirSizeProc
    116117#include "flesh.h"                      // Flesh, Stubby, UnFlesh
     
    680681{
    681682  DIRCNRDATA *dcd;
     683  CHAR tf[64];
     684  CHAR tb[64];
     685  CHAR s[CCHMAXPATH * 2];
    682686
    683687  switch (msg) {
     
    754758    dcd = WinQueryWindowPtr(hwnd, QWL_USER);
    755759    if (dcd && dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) {
    756 
    757760      FSALLOCATE fsa;
    758       CHAR s[CCHMAXPATH * 2];
    759       CHAR tf[64];
    760       CHAR tb[64];
    761761      CHAR szFree[64];
    762 
    763762      DosError(FERR_DISABLEHARDERR);
    764763      if (!DosQueryFSInfo(toupper(*dcd->directory) - '@',
     
    844843      MakeValidDir(dcd->directory);
    845844      {
    846         CHAR s[CCHMAXPATH + 8];
    847 
    848845        sprintf(s,
    849846                "%s%s%s",
     
    865862      if (hwndStatus &&
    866863          dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) {
    867         WinSetWindowText(hwndStatus, GetPString(IDS_SCANNINGTEXT));
     864        WinSetWindowText(hwndStatus, GetPString(IDS_PLEASEWAITSCANNINGTEXT));
    868865        if (hwndMain)
    869866          WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
    870867      }
    871868      if (fSwitchTree && hwndTree) {
     869        // Keep drive tree in sync with directory container
    872870        PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
    873 
    874871        if (hwndMain) {
    875872          if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame && pszTempDir)
     
    884881      }
    885882      dcd->firsttree = FALSE;
     883      WinStartTimer(WinQueryAnchorBlock(hwnd), dcd->hwndCnr, ID_DIRCNR_TIMER, 500);
    886884      // fixme to check errors
    887885      FillDirCnr(dcd->hwndCnr, dcd->directory, dcd, &dcd->ullTotalBytes);
     886      WinStopTimer(WinQueryAnchorBlock(hwnd), dcd->hwndCnr, ID_DIRCNR_TIMER);
    888887      PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
    889888      if (mp2 && !fLeaveTree && (dcd->flWindowAttr & CV_TREE)) {
    890 
    891889        ULONG flWindowAttr = dcd->flWindowAttr;
    892890        CNRINFO cnri;
    893 
    894         flWindowAttr &=
    895           (~(CV_NAME | CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT));
     891        flWindowAttr &= ~(CV_NAME | CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT);
    896892        if (dcd->lastattr) {
    897893          if (dcd->lastattr & CV_TEXT)
     
    12111207{
    12121208  DIRCNRDATA *dcd = INSTDATA(hwnd);
     1209  CHAR tf[64];
     1210  CHAR tb[64];
     1211  CHAR s[CCHMAXPATH];
    12131212
    12141213  switch (msg) {
     
    12511250      case VK_HOME:
    12521251        if ((shiftstate & KC_CTRL) == KC_CTRL && dcd) {
    1253           CHAR s[CCHMAXPATH], *p;
     1252          PSZ p;
    12541253          strcpy(s, dcd->directory);
    12551254          p = strchr(s, '\\');
     
    14201419    break;
    14211420
     1421  case WM_TIMER:
     1422    // Started/stopped by DirObjWndPro
     1423    // dcd = WinQueryWindowPtr(hwnd, QWL_USER);
     1424    if (dcd) {
     1425      commafmt(tb, sizeof(tb), dcd->totalfiles);
     1426      CommaFmtULL(tf, sizeof(tf), dcd->ullTotalBytes, 'K');
     1427      sprintf(s, "%s / %s", tb, tf);
     1428      // DbgMsg(pszSrcFile, __LINE__, "WM_TIMER %s", s);        // 15 Sep 09 SHL fixme debug
     1429      WinSetDlgItemText(dcd->hwndClient, DIR_TOTALS, s);
     1430    }
     1431    break; // WM_TIMER
     1432
    14221433  case UM_RESCAN:
    14231434    if (dcd) {
    14241435
    14251436      CNRINFO cnri;
    1426       CHAR s[CCHMAXPATH * 2], tf[81], tb[81], szDate[DATE_BUF_BYTES];
     1437      CHAR szDate[DATE_BUF_BYTES];
    14271438      PCNRITEM pci;
    14281439
     
    32053216          PCNRITEM pci = (PCNRITEM) ((PCNREDITDATA) mp2)->pRecord;
    32063217          HWND hwndMLE;
    3207           static CHAR szData[CCHMAXPATH];
    32083218          CHAR testname[CCHMAXPATH];
    32093219
    32103220          if (!pci && !pfi) {
    32113221            hwndMLE = WinWindowFromID(hwnd, CID_MLE);
    3212             WinQueryWindowText(hwndMLE, sizeof(szData), szData);
    3213             chop_at_crnl(szData);
    3214             bstrip(szData);
    3215             if (*szData) {
    3216               if (!DosQueryPathInfo(szData,
     3222            WinQueryWindowText(hwndMLE, sizeof(s), s);
     3223            chop_at_crnl(s);
     3224            bstrip(s);
     3225            if (*s) {
     3226              if (!DosQueryPathInfo(s,
    32173227                                    FIL_QUERYFULLNAME,
    32183228                                    testname, sizeof(testname))) {
     
    32403250          PNOTIFYRECORDEMPHASIS pre = mp2;
    32413251          PCNRITEM pci;
    3242           CHAR s[CCHMAXPATHCOMP + 91], tb[81], tf[81];
     3252          CHAR s[CCHMAXPATHCOMP + 91];
    32433253
    32443254          pci = (PCNRITEM) (pre ? pre->pRecord : NULL);
Note: See TracChangeset for help on using the changeset viewer.