Changeset 1400 for trunk/dll/notebook.c


Ignore:
Timestamp:
Mar 8, 2009, 6:50:25 PM (16 years ago)
Author:
Gregg Young
Message:

Remainder of changes to rename commafmt.h/c (Ticket 28, 82); Additional strings moved to PCSZs in init.c (Ticket 6); Added WriteDetailsSwitches used it and LoadDetailsSwitches to consolidate inline code (Ticket 343, 344)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/notebook.c

    r1398 r1400  
    4747  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    4848  07 Feb 09 GKY Move repeated strings to PCSZs.
     49  08 Mar 09 GKY Additional strings move to PCSZs in init.c
     50  08 Mar 09 GKY Add WriteDetailsSwitches and use LoadDetailsSwitches to replace in line code
    4951
    5052***********************************************************************/
     
    23382340    }
    23392341    dsDirCnrDefault.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES);
    2340     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname",
    2341                         &dsDirCnrDefault.detailslongname, sizeof(BOOL));
    23422342    dsDirCnrDefault.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT);
    2343     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject",
    2344                         &dsDirCnrDefault.detailssubject, sizeof(BOOL));
    2345     dsDirCnrDefault.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT);
    2346     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA",
    2347                         &dsDirCnrDefault.detailsea, sizeof(BOOL));
     2343    dsDirCnrDefault.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS);
    23482344    dsDirCnrDefault.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE);
    2349     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize",
    2350                         &dsDirCnrDefault.detailssize, sizeof(BOOL));
    23512345    dsDirCnrDefault.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON);
    2352     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon",
    2353                         &dsDirCnrDefault.detailsicon, sizeof(BOOL));
    23542346    dsDirCnrDefault.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE);
    2355     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate",
    2356                         &dsDirCnrDefault.detailslwdate, sizeof(BOOL));
    23572347    dsDirCnrDefault.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME);
    2358     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime",
    2359                         &dsDirCnrDefault.detailslwtime, sizeof(BOOL));
    23602348    dsDirCnrDefault.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE);
    2361     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate",
    2362                         &dsDirCnrDefault.detailsladate, sizeof(BOOL));
    23632349    dsDirCnrDefault.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME);
    2364     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime",
    2365                         &dsDirCnrDefault.detailslatime, sizeof(BOOL));
    23662350    dsDirCnrDefault.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE);
    2367     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate",
    2368                         &dsDirCnrDefault.detailscrdate, sizeof(BOOL));
    23692351    dsDirCnrDefault.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME);
    2370     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime",
    2371                         &dsDirCnrDefault.detailscrtime, sizeof(BOOL));
    23722352    dsDirCnrDefault.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR);
    2373     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr",
    2374                         &dsDirCnrDefault.detailsattr, sizeof(BOOL));
    23752353    dsDirCnrDefault.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE);
    2376     PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectInLeftPane",
    2377                         &dsDirCnrDefault.fSubjectInLeftPane, sizeof(BOOL));
    23782354    dsDirCnrDefault.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX);
    2379     PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectLengthMax",
    2380                         &dsDirCnrDefault.fSubjectLengthMax, sizeof(BOOL));
    23812355    *mask.prompt = 0;
    23822356    PrfWriteProfileData(fmprof, appname, "DirFilter", &mask, sizeof(MASK));
     
    23922366        else
    23932367          dsDirCnrDefault.SubjectDisplayWidth = 0;
    2394         PrfWriteProfileData(fmprof,
    2395                             appname, "DirCnr.SubjectDisplayWidth",
    2396                             &dsDirCnrDefault.SubjectDisplayWidth, sizeof(ULONG));
    2397     }
     2368    }
     2369    WriteDetailsSwitches(PCSZ_DIRCNR, &dsDirCnrDefault);
    23982370    break;
    23992371  }
     
    26292601
    26302602      memset(&ds, 0, sizeof(ds));
    2631       LoadDetailsSwitches("Collector", &ds);
     2603      LoadDetailsSwitches(PCSZ_COLLECTOR, &ds);
    26322604      WinCheckButton(hwnd, CFG5_SHOWLNAMES, ds.detailslongname);
    26332605      WinCheckButton(hwnd, CFG5_SHOWSUBJECT, ds.detailssubject);
     
    27212693      memset(&ds, 0, sizeof(ds));
    27222694      ds.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES);
    2723       PrfWriteProfileData(fmprof, appname, "Collector.DetailsLongname",
    2724                           &ds.detailslongname, sizeof(BOOL));
    27252695      ds.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT);
    2726       PrfWriteProfileData(fmprof, appname, "Collector.DetailsSubject",
    2727                           &ds.detailssubject, sizeof(BOOL));
    27282696      ds.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS);
    2729       PrfWriteProfileData(fmprof, appname, "Collector.DetailsEA",
    2730                           &ds.detailsea, sizeof(BOOL));
    27312697      ds.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE);
    2732       PrfWriteProfileData(fmprof, appname, "Collector.DetailsSize",
    2733                           &ds.detailssize, sizeof(BOOL));
    27342698      ds.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON);
    2735       PrfWriteProfileData(fmprof, appname, "Collector.DetailsIcon",
    2736                           &ds.detailsicon, sizeof(BOOL));
    27372699      ds.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE);
    2738       PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWDate",
    2739                           &ds.detailslwdate, sizeof(BOOL));
    27402700      ds.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME);
    2741       PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWTime",
    2742                           &ds.detailslwtime, sizeof(BOOL));
    27432701      ds.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE);
    2744       PrfWriteProfileData(fmprof, appname, "Collector.DetailsLADate",
    2745                           &ds.detailsladate, sizeof(BOOL));
    27462702      ds.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME);
    2747       PrfWriteProfileData(fmprof, appname, "Collector.DetailsLATime",
    2748                           &ds.detailslatime, sizeof(BOOL));
    27492703      ds.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE);
    2750       PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRDate",
    2751                           &ds.detailscrdate, sizeof(BOOL));
    27522704      ds.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME);
    2753       PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRTime",
    2754                           &ds.detailscrtime, sizeof(BOOL));
    27552705      ds.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR);
    2756       PrfWriteProfileData(fmprof, appname, "Collector.DetailsAttr",
    2757                           &ds.detailsattr, sizeof(BOOL));
    27582706      ds.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE);
    2759       PrfWriteProfileData(fmprof, appname, "Collector.SubjectInLeftPane",
    2760                           &ds.fSubjectInLeftPane, sizeof(BOOL));
    27612707      ds.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX);
    2762       PrfWriteProfileData(fmprof, appname, "Collector.SubjectLengthMax",
    2763                           &ds.fSubjectLengthMax, sizeof(BOOL));
    27642708      *mask.prompt = 0;
    27652709      PrfWriteProfileData(fmprof,
     
    27762720        else
    27772721          ds.SubjectDisplayWidth = 0;
    2778         PrfWriteProfileData(fmprof,
    2779                             appname, "Collector.SubjectDisplayWidth",
    2780                             &ds.SubjectDisplayWidth, sizeof(ULONG));
    2781       }
     2722      }
     2723    WriteDetailsSwitches(PCSZ_COLLECTOR, &ds);
    27822724    }
    27832725    break;
     
    30943036                            appname,
    30953037                            "Collector.Fontnamesize",
    3096                             FNT_8HELVETICA,
     3038                            (PVOID) FNT_8HELVETICA,
    30973039                            strlen(FNT_8HELVETICA) + 1);
    30983040      }
     
    31513093        //fixme to allow user to change presparams 1-10-09 GKY
    31523094        PrfWriteProfileData(fmprof, appname, "Collector.Fontnamesize",
    3153                             FNT_8HELVETICA,
     3095                            (PVOID) FNT_8HELVETICA,
    31543096                            strlen(FNT_8HELVETICA) + 1);
    31553097      }
     
    35853527    }
    35863528    // Save new details settings and refresh windows
    3587     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname",
    3588                         &dsDirCnrDefault.detailslongname, sizeof(BOOL));
    3589     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject",
    3590                         &dsDirCnrDefault.detailssubject, sizeof(BOOL));
    3591     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA",
    3592                         &dsDirCnrDefault.detailsea, sizeof(BOOL));
    3593     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize",
    3594                         &dsDirCnrDefault.detailssize, sizeof(BOOL));
    3595     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon",
    3596                         &dsDirCnrDefault.detailsicon, sizeof(BOOL));
    3597     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate",
    3598                         &dsDirCnrDefault.detailslwdate, sizeof(BOOL));
    3599     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime",
    3600                         &dsDirCnrDefault.detailslwtime, sizeof(BOOL));
    3601     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate",
    3602                         &dsDirCnrDefault.detailsladate, sizeof(BOOL));
    3603     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime",
    3604                         &dsDirCnrDefault.detailslatime, sizeof(BOOL));
    3605     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate",
    3606                         &dsDirCnrDefault.detailscrdate, sizeof(BOOL));
    3607     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime",
    3608                         &dsDirCnrDefault.detailscrtime, sizeof(BOOL));
    3609     PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr",
    3610                         &dsDirCnrDefault.detailsattr, sizeof(BOOL));
     3529    WriteDetailsSwitches(PCSZ_DIRCNR, &dsDirCnrDefault);
    36113530    if (hwndMain) {
    36123531      // Save state and restore to refresh windows with new settings
Note: See TracChangeset for help on using the changeset viewer.