Changeset 948 for trunk/dll/collect.c


Ignore:
Timestamp:
Feb 12, 2008, 6:20:47 AM (18 years ago)
Author:
Steven Levine
Message:

Rework collector progress reporting and improve performance (ticket #79)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r946 r948  
    242242            break;
    243243          case DIR_FILTER:
    244             s = GetPString(IDS_DIRCNRFILTERHELP);
    245             break;
     244            s = GetPString(IDS_DIRCNRFILTERHELP);
     245            break;
    246246          default:
    247247            break;
     
    11451145            PostMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
    11461146        }
    1147         if (!fMoreButtons) {
    1148           sprintf(s, " %s%s%s%s",
    1149                   dcd->amextracted ?
    1150                     GetPString(IDS_COLLECTINGTEXT) :
     1147        if (!dcd->amextracted) {
     1148          if (!fMoreButtons) {
     1149            sprintf(s, " %s%s%s%s",
    11511150                    GetPString(IDS_COLLECTORTEXT),
    1152                   *dcd->mask.szMask || dcd->mask.antiattr ||
    1153                     dcd->mask.attrFile != ALLATTRS ? "  (" : NullStr,
    1154                   *dcd->mask.szMask ?
    1155                     dcd->mask.szMask :
    1156                     dcd->mask.antiattr ||
    1157                      dcd->mask.attrFile != ALLATTRS ?
    1158                       GetPString(IDS_ATTRTEXT) : NullStr,
    1159                   *dcd->mask.szMask || dcd->mask.antiattr ||
    1160                     dcd->mask.attrFile != ALLATTRS ?
    1161                     ")" : NullStr);
    1162         }
    1163         else {
    1164           strcpy(s,
    1165                 dcd->amextracted ?
    1166                   GetPString(IDS_COLLECTINGTEXT) :
    1167                   GetPString(IDS_COLLECTORTEXT));
    1168         }
    1169         WinSetWindowText(hwndStatus, s);
     1151                    *dcd->mask.szMask || dcd->mask.antiattr ||
     1152                      dcd->mask.attrFile != ALLATTRS ? "  (" : NullStr,
     1153                    *dcd->mask.szMask ?
     1154                      dcd->mask.szMask :
     1155                      dcd->mask.antiattr ||
     1156                       dcd->mask.attrFile != ALLATTRS ?
     1157                        GetPString(IDS_ATTRTEXT) : NullStr,
     1158                    *dcd->mask.szMask || dcd->mask.antiattr ||
     1159                      dcd->mask.attrFile != ALLATTRS ?
     1160                      ")" : NullStr);
     1161          }
     1162          else
     1163            strcpy(s, GetPString(IDS_COLLECTORTEXT));
     1164          WinSetWindowText(hwndStatus, s);
     1165        }
    11701166        if (!pci)
    11711167          pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS,
     
    12191215        }
    12201216        else {
    1221           if (hwndStatus2)
    1222             WinSetWindowText(hwndStatus2, NullStr);
     1217          if (hwndStatus2) {
     1218            if (dcd->amextracted)
     1219              WinSetWindowText(hwndStatus2, GetPString(IDS_INSEEKSCANTEXT));    // Say working
     1220            else
     1221              WinSetWindowText(hwndStatus2, NullStr);
     1222          }
    12231223          if (fMoreButtons) {
    12241224            WinSetWindowText(hwndName, NullStr);
     
    26752675    case WM_MOUSEMOVE: {
    26762676      if (fOtherHelp) {
    2677         RECTL rectl;
    2678         SHORT i, sCurrentMenuitem;
    2679         SHORT MenuItems = 5;
    2680         SHORT asMenuIDs[5] = {IDM_GREP,
    2681               IDM_SEEALL,
    2682               IDM_CLEARCNR,
    2683               IDM_REMOVE,
    2684               0};
    2685         char *szHelpString = NULL;
    2686 
    2687 
    2688         for (i=0; i<MenuItems; i++) {
    2689           sCurrentMenuitem = asMenuIDs[i];
    2690           oldMenuProc(hwnd,MM_QUERYITEMRECT,
    2691                       MPFROM2SHORT(asMenuIDs[i], FALSE),
    2692                       &rectl);
    2693 
    2694         if (MOUSEMSG(&msg)->x > rectl.xLeft &&
    2695             MOUSEMSG(&msg)->x < rectl.xRight &&
    2696             MOUSEMSG(&msg)->y > rectl.yBottom &&
    2697             MOUSEMSG(&msg)->y < rectl.yTop)
    2698            break;
    2699         }                      // for
    2700 
    2701 
    2702         switch (sCurrentMenuitem) {
    2703         case 0:
    2704            break;
    2705         case IDM_GREP:
    2706            szHelpString = GetPString(IDS_COLMENUSEEKSCANHELP);
    2707            break;
    2708         case IDM_SEEALL:
    2709            szHelpString = GetPString(IDS_COLMENUSEEALLHELP);
    2710            break;
    2711         case IDM_CLEARCNR:
    2712            szHelpString = GetPString(IDS_COLMENUCLEARCNRHELP);
    2713            break;
    2714         case IDM_REMOVE:
    2715            szHelpString = GetPString(IDS_COLMENUREMOVECNRHELP);
    2716            break;
    2717         default:
    2718            break;
    2719         }
    2720 
    2721         if (sLastMenuitem != sCurrentMenuitem && szHelpString) {
    2722           sLastMenuitem = sCurrentMenuitem;
    2723           MakeBubble(hwnd, TRUE, szHelpString);
    2724         }
    2725         else if (hwndBubble && !sCurrentMenuitem){
    2726           sLastMenuitem = sCurrentMenuitem;
    2727           WinDestroyWindow(hwndBubble);
    2728         }
     2677        RECTL rectl;
     2678        SHORT i, sCurrentMenuitem;
     2679        SHORT MenuItems = 5;
     2680        SHORT asMenuIDs[5] = {IDM_GREP,
     2681              IDM_SEEALL,
     2682              IDM_CLEARCNR,
     2683              IDM_REMOVE,
     2684              0};
     2685        char *szHelpString = NULL;
     2686
     2687
     2688        for (i=0; i<MenuItems; i++) {
     2689          sCurrentMenuitem = asMenuIDs[i];
     2690          oldMenuProc(hwnd,MM_QUERYITEMRECT,
     2691                      MPFROM2SHORT(asMenuIDs[i], FALSE),
     2692                      &rectl);
     2693
     2694        if (MOUSEMSG(&msg)->x > rectl.xLeft &&
     2695            MOUSEMSG(&msg)->x < rectl.xRight &&
     2696            MOUSEMSG(&msg)->y > rectl.yBottom &&
     2697            MOUSEMSG(&msg)->y < rectl.yTop)
     2698           break;
     2699        }                      // for
     2700
     2701
     2702        switch (sCurrentMenuitem) {
     2703        case 0:
     2704           break;
     2705        case IDM_GREP:
     2706           szHelpString = GetPString(IDS_COLMENUSEEKSCANHELP);
     2707           break;
     2708        case IDM_SEEALL:
     2709           szHelpString = GetPString(IDS_COLMENUSEEALLHELP);
     2710           break;
     2711        case IDM_CLEARCNR:
     2712           szHelpString = GetPString(IDS_COLMENUCLEARCNRHELP);
     2713           break;
     2714        case IDM_REMOVE:
     2715           szHelpString = GetPString(IDS_COLMENUREMOVECNRHELP);
     2716           break;
     2717        default:
     2718           break;
     2719        }
     2720
     2721        if (sLastMenuitem != sCurrentMenuitem && szHelpString) {
     2722          sLastMenuitem = sCurrentMenuitem;
     2723          MakeBubble(hwnd, TRUE, szHelpString);
     2724        }
     2725        else if (hwndBubble && !sCurrentMenuitem){
     2726          sLastMenuitem = sCurrentMenuitem;
     2727          WinDestroyWindow(hwndBubble);
     2728        }
    27292729      }
    27302730    }
     
    28082808        WinSetWindowPtr(dcd->hwndCnr, QWL_USER, (PVOID) dcd);
    28092809        WinSetWindowText(hwndFrame, GetPString(IDS_COLLECTORTITLETEXT));
    2810         if (FrameFlags & FCF_MENU) {
    2811           PFNWP oldmenuproc;
    2812           HWND hwndMenu = WinWindowFromID(hwndFrame, FID_MENU);
     2810        if (FrameFlags & FCF_MENU) {
     2811          PFNWP oldmenuproc;
     2812          HWND hwndMenu = WinWindowFromID(hwndFrame, FID_MENU);
    28132813
    28142814          oldmenuproc = WinSubclassWindow(hwndMenu, (PFNWP) CollectorMenuProc);
    28152815          WinSetWindowPtr(hwndMenu, QWL_USER, (PVOID) oldmenuproc);
    28162816          if (!fToolbar) {
    2817             if (hwndMenu) {
     2817            if (hwndMenu) {
    28182818
    28192819              WinSendMsg(hwndMenu,
Note: See TracChangeset for help on using the changeset viewer.