Changeset 1670 for trunk/dll/comp.c


Ignore:
Timestamp:
Aug 13, 2012, 3:33:25 AM (13 years ago)
Author:
Gregg Young
Message:

Add ability to change and save PresParam to compare dialog (Ticket 443) Fix loading of a list file in the right compare container (Ticket 489) Allow for selection of include subdirectories or a list file on initial startup of compare dirs (Ticket 145)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/comp.c

    r1655 r1670  
    7878  12 Jun 11 GKY Added SleepIfNeeded in the container fill loop
    7979  02 Jan 12 GKY Added pszFmtFileSize to container info to fix loss of file sizes on move and copy.
     80  12 Aug 12 GKY Add ability to change and save PresParam
     81  12 Aug 12 GKY Fix loading of a list file in the right compare container
     82  12 Aug 12 GKY Allow for selection of include subdirectories or a list file on initial startup of compare dirs
    8083
    8184***********************************************************************/
     
    16891692          } // if have rightdir
    16901693          fclose(fp);
    1691         }
     1694        }
     1695        FillDirList(cmp->rightdir, lenr, cmp->includesubdirs,
     1696                    &filesr, &cmp->cmp->totalright, &numallocr);
    16921697      } // if snapshot file
    16931698
     
    22202225      SetCnrCols(GetHwndLeft(hwnd), TRUE);
    22212226      SetCnrCols(GetHwndRight(hwnd), TRUE);
     2227      if (cmp->listfile) {
     2228        CHAR fullname[CCHMAXPATH];
     2229
     2230        strcpy(fullname, PCSZ_STARDOTPMD);
     2231        if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) &&
     2232            *fullname && !strchr(fullname, '*') && !strchr(fullname, '?'))
     2233          strcpy(cmp->rightlist, fullname);
     2234      }
    22222235      WinSendMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
    22232236      WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
    22242237      PostMsg(hwnd, UM_STRETCH, MPVOID, MPVOID);
    22252238      {
    2226         USHORT ids[] = { COMP_LEFTDIR, COMP_RIGHTDIR, COMP_TOTALLEFT,
    2227                          COMP_TOTALRIGHT, COMP_SELLEFT, COMP_SELRIGHT,
    2228                          0
    2229                        };
     2239        USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT,
     2240                        COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
     2241                        COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
     2242                        COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
     2243                        COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
     2244                        COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
     2245                        COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
    22302246        UINT x;
     2247        CHAR s[24];
     2248
    22312249        for (x = 0; ids[x]; x++) {
    2232           //fixme to allow user to change presparams 1-10-09 GKY
    2233           SetPresParams(WinWindowFromID(hwnd, ids[x]),
     2250          //fixme to allow user to change presparams 1-10-09 GKY
     2251          sprintf(s, "CompDir%i", ids[x]);
     2252          RestorePresParams(WinWindowFromID(hwnd, ids[x]), s);
     2253          /*SetPresParams(WinWindowFromID(hwnd, ids[x]),
    22342254                        &RGBGREY,
    2235                         &RGBBLACK, &RGBBLACK, FNT_8HELVETICA);
     2255                        &RGBBLACK, &RGBBLACK, FNT_8HELVETICA);*/
    22362256        }
    22372257      }
     
    26802700      COMPARE *forthread;
    26812701      CNRINFO cnri;
     2702      if (cmp->includesubdirs)
     2703        WinCheckButton(hwnd, COMP_INCLUDESUBDIRS, TRUE);
    26822704      cmp->includesubdirs = WinQueryButtonCheckstate(hwnd,
    2683                                                      COMP_INCLUDESUBDIRS);
     2705                                                     COMP_INCLUDESUBDIRS);
    26842706      memset(&cnri, 0, sizeof(CNRINFO));
    26852707      cnri.cb = sizeof(CNRINFO);
     
    27192741          WinSetDlgItemText(hwnd, COMP_NOTE,
    27202742                            (CHAR *) GetPString(IDS_COMPHOLDREADDISKTEXT));
    2721           SetButtonEnables(cmp, FALSE);
     2743          SetButtonEnables(cmp, FALSE);
     2744          cmp->includesubdirs = FALSE;
    27222745          cmp->selleft = 0;
    27232746          cmp->selright = 0;
     
    30533076        wa.size = sizeof(wa);
    30543077        strcpy(wa.szCurrentPath1, cmp->leftdir);
    3055         strcpy(wa.szCurrentPath2, cmp->rightdir);
     3078        strcpy(wa.szCurrentPath2, cmp->rightdir);
     3079        wa.includesubdirs = WinQueryButtonCheckstate(hwnd,
     3080                                                     COMP_INCLUDESUBDIRS);
    30563081        if (WinDlgBox(HWND_DESKTOP,
    30573082                      hwnd,
     
    30633088            !IsFile(wa.szCurrentPath2)) {
    30643089          strcpy(cmp->leftdir, wa.szCurrentPath1);
    3065           strcpy(cmp->rightdir, wa.szCurrentPath2);
    3066           *cmp->rightlist = 0;
     3090          strcpy(cmp->rightdir, wa.szCurrentPath2);
     3091          cmp->includesubdirs = wa.includesubdirs;
     3092          if (!cmp->includesubdirs)
     3093            WinCheckButton(hwnd, COMP_INCLUDESUBDIRS, FALSE);
     3094          cmp->listfile = wa.listfile;
     3095          if (cmp->listfile) {
     3096            CHAR fullname[CCHMAXPATH];
     3097   
     3098            strcpy(fullname, PCSZ_STARDOTPMD);
     3099            if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) &&
     3100                *fullname && !strchr(fullname, '*') && !strchr(fullname, '?'))
     3101              strcpy(cmp->rightlist, fullname);
     3102          }
     3103          else
     3104            *cmp->rightlist = 0;
    30673105          PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
    30683106          PostMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
     
    31273165        SWP swp;
    31283166        ULONG size = sizeof(SWP);
    3129 
     3167        USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT,
     3168                        COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
     3169                        COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
     3170                        COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
     3171                        COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
     3172                        COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
     3173                        COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
     3174        UINT x;
     3175        CHAR s[24];
    31303176        WinQueryWindowPos(hwnd, &swp);
    31313177        PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp,
    3132                             size);
     3178                            size);
     3179        for (x = 0; ids[x]; x++) {
     3180          //fixme to allow user to change presparams 1-10-09 GKY
     3181          sprintf(s, "CompDir%i", ids[x]);
     3182          SavePresParams(WinWindowFromID(hwnd, ids[x]), s);
     3183        }
    31333184      }
    31343185      WinDismissDlg(hwnd, 0);
Note: See TracChangeset for help on using the changeset viewer.