Changeset 1395 for trunk/dll/init.c


Ignore:
Timestamp:
Feb 8, 2009, 2:48:16 AM (17 years ago)
Author:
Gregg Young
Message:

Allow user to turn off alert and/or error beeps in settings notebook. Ticket 341 Move repeated strings to PCSZs. Ticket 6 Add *DateFormat functions to format dates based on locale Ticket 28 Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error Ticket 6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/init.c

    r1394 r1395  
    7171  11 Jan 09 GKY Move strings that shouldn't be translated (font names etc) compile time variables
    7272  03 Feb 09 SHL Switch to STRINGTABLE
     73  07 Feb 09 GKY Move repeated strings to PCSZs.
     74  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
     75  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    7376
    7477***********************************************************************/
     
    179182PFNWP PFNWPMLE;
    180183CHAR ThousandsSeparator[2];
     184CHAR DateSeparator[2];
     185CHAR TimeSeparator[2];
     186ULONG ulTimeFmt;
     187ULONG ulDateFmt;
    181188BOOL fInitialDriveScan;
    182189BOOL fAmAV2;
     
    229236CHAR *LONGNAME;
    230237CHAR *NullStr;
     238PCSZ PCSZ_WINCREATEWINDOW;
     239PCSZ PCSZ_INIQUERYPRFTEXT;
     240PCSZ PCSZ_FILLDIRQCURERRTEXT;
     241PCSZ PCSZ_STARDOTEXE;
     242PCSZ PCSZ_STARDOTINI;
     243PCSZ PCSZ_STARDOTLST;
    231244CHAR *Settings;
    232245CHAR SwapperDat[CCHMAXPATH];
     
    433446    FNT_10SYSTEMVIO      =  "10.System VIO";
    434447    FNT_8TIMESNEWROMAN   =  "8.Times New Roman";
     448    PCSZ_WINCREATEWINDOW = "WinCreateWindow";
     449    PCSZ_INIQUERYPRFTEXT =  "PrfQueryProfile";
     450    PCSZ_FILLDIRQCURERRTEXT = "DosQCurDisk";
     451    PCSZ_STARDOTEXE    =  "*.EXE";
     452    PCSZ_STARDOTINI    =  "*.INI";
     453    PCSZ_STARDOTLST    =  "*.LST";
    435454    WC_OBJECTWINDOW    =  "WC_OBJECTWINDOW";
    436455    WC_BUBBLE          =  "WC_BUBBLE";
     
    534553    FNT_10SYSTEMVIO      =  "10.System VIO";
    535554    FNT_8TIMESNEWROMAN   =  "8.Times New Roman";
     555    PCSZ_WINCREATEWINDOW = "WinCreateWindow";
     556    PCSZ_INIQUERYPRFTEXT =  "PrfQueryProfile";
     557    PCSZ_FILLDIRQCURERRTEXT = "DosQCurDisk";
     558    PCSZ_STARDOTEXE    =  "*.EXE";
     559    PCSZ_STARDOTINI    =  "*.INI";
     560    PCSZ_STARDOTLST    =  "*.LST";
    536561    WC_OBJECTWINDOW    =  "WC_OBJECTWINDOW";
    537562    WC_BUBBLE          =  "WC_BUBBLE";
     
    935960      strcpy(inipath, profile);
    936961    DosError(FERR_DISABLEHARDERR);
    937 
     962    // fixme to check for backup if ini not found GKY 1-30-09
    938963    rc = DosQueryPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3));
    939964    if (rc) {
     
    941966      fWantFirstTimeInit = TRUE;
    942967    }
    943     else {
     968    else { //Check the ini file header and restore from backup if corupted
    944969      if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
    945         saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,
    946                "Check INI header failed will attempt to replace with backup \\
    947                if backup fails or not found will open with new ini");
     970        saymsg(MB_ENTER,HWND_DESKTOP, GetPString(IDS_DEBUG_STRING),
     971               GetPString(IDS_INIFAILURETEXT));
    948972        DosCopy("FM3.INI", "FM3INI.BAD", DCPY_EXISTING);
    949973        DosCopy("FM3INI.BAK", "FM3.INI", DCPY_EXISTING);
     
    12271251  COUNTRYINFO CtryInfo   = {0};
    12281252
    1229   DosQueryCtryInfo(sizeof(CtryInfo), &Country,
    1230                    &CtryInfo, &ulInfoLen);
    1231   *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
     1253  if (!DosQueryCtryInfo(sizeof(CtryInfo), &Country, &CtryInfo, &ulInfoLen)) {
     1254    *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
     1255    strcpy(DateSeparator, CtryInfo.szDateSeparator);
     1256    strcpy(TimeSeparator, CtryInfo.szTimeSeparator);
     1257    ulDateFmt = CtryInfo.fsDateFmt;
     1258    ulTimeFmt = CtryInfo.fsTimeFmt;
     1259    //DbgMsg(pszSrcFile, __LINE__, "Date Fmt %x", ulDateFmt);
     1260  }
     1261  else {
     1262    strcpy(ThousandsSeparator, ",");
     1263    strcpy(DateSeparator, "/");
     1264    strcpy(TimeSeparator, ":");
     1265    ulDateFmt = 0;
     1266    ulTimeFmt = 0;
     1267  }
    12321268  }
    12331269  { // Check for the existance of various partitioning tools to set up menu items
     
    13651401  PrfQueryProfileData(fmprof, FM3Str, "NoFinger", &fNoFinger, &size);
    13661402  size = sizeof(BOOL);
     1403  PrfQueryProfileData(fmprof, FM3Str, "AlertBeepOff", &fAlertBeepOff, &size);
     1404  size = sizeof(BOOL);
     1405  PrfQueryProfileData(fmprof, FM3Str, "ErrorBeepOff", &fErrorBeepOff, &size);
     1406  size = sizeof(BOOL);
    13671407  PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, &size);
    13681408  size = sizeof(BOOL);
Note: See TracChangeset for help on using the changeset viewer.