Changeset 1395 for trunk/dll


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

Location:
trunk/dll
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1394 r1395  
    7070                menu option is selected.
    7171  10 Dec 08 SHL Integrate exception handler support
     72  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     73  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    7274
    7375***********************************************************************/
     
    525527    remaining = (INT)WinSendMsg(hwnd, CM_REMOVERECORD, MPFROMP(&paiFirst), MPFROM2SHORT(usCnt, usFlags));
    526528    if (remaining == -1) {
    527       // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMREMOVEERRTEXT);
    528       Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVERECORD hwnd %x pai %p cnt %u", hwnd, paiFirst, usCnt);
     529      Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVERECORD hwnd %x pai %p cnt %u",
     530                hwnd, paiFirst, usCnt);
    529531    }
    530532  }
     
    891893            goto ReTry;
    892894          }
    893         } while (tinfo);
    894         DosBeep(750, 50);               // wake up user
     895        } while (tinfo);
     896        if (!fAlertBeepOff)
     897          DosBeep(750, 50);             // wake up user
    895898        sprintf(errstr, GetPString(IDS_ARCERRORINFOTEXT),
    896899                arcname,
     
    33713374          LISTINFO *li;
    33723375
    3373           DosBeep(500, 100);            // fixme to know why beep?
     3376          //DosBeep(500, 100);          // fixme to know why beep?
    33743377          li = DoFileDrop(hwnd, dcd->arcname, FALSE, mp1, mp2);
    3375           DosBeep(50, 100);             // fixme to know why beep?
     3378          //DosBeep(50, 100);           // fixme to know why beep?
    33763379          CheckPmDrgLimit(((PCNRDRAGINFO)mp2)->pDragInfo);
    33773380          if (li) {
     
    38173820                                       HWND_TOP, (ULONG) ARC_CNR, NULL, NULL);
    38183821        if (!dcd->hwndCnr) {
    3819           Win_Error2(hwndClient, hwndClient, pszSrcFile, __LINE__,
    3820                      IDS_WINCREATEWINDOW);
     3822          Win_Error(hwndClient, hwndClient, pszSrcFile, __LINE__,
     3823                    PCSZ_WINCREATEWINDOW);
    38213824          PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    38223825          free(dcd);
  • trunk/dll/archive.c

    r1346 r1395  
    1414  22 Mar 07 GKY Use QWL_USER
    1515  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
     16  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1617
    1718***********************************************************************/
     
    223224        }
    224225      }
    225       DosBeep(50, 100);
     226      if (!fAlertBeepOff)
     227        DosBeep(50, 100);
    226228      break;
    227229
     
    272274                     pszSrcFile, __LINE__);
    273275        }
    274         else
     276        else if (!fErrorBeepOff)
    275277          DosBeep(50, 100);
    276278      }
  • trunk/dll/autoview.c

    r1391 r1395  
    2626  10 Dec 08 SHL Integrate exception handler support
    2727  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     28  07 Feb 09 GKY Add *DateFormat functions to format dates bassed on locale
     29  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    2830
    2931***********************************************************************/
     
    452454
    453455            static FILEFINDBUF4L ffb[130];
    454             CHAR fullname[CCHMAXPATH + 4], szCmmaFmtFileSize[81];
     456            CHAR fullname[CCHMAXPATH + 4], szCmmaFmtFileSize[81], szDate[11];
    455457            HDIR hdir = HDIR_CREATE;
    456458            ULONG x, nm, ml, mc, bufflen;
     
    462464
    463465            BldFullPathName(fullname, currfile, "*");
    464             //sprintf(fullname,
    465             //        "%s%s*",
    466             //        currfile,
    467             //        (currfile[strlen(currfile) - 1] == '\\') ? "" : "\\");
    468466            DosError(FERR_DISABLEHARDERR);
    469467            nm = sizeof(ffb) / sizeof(FILEFINDBUF4L);
     
    507505                                sizeof(szCmmaFmtFileSize),
    508506                                pffbFile->cbFile + CBLIST_TO_EASIZE(pffbFile->cbList),
    509                                 ' ');
     507                                ' ');
     508                    FDateFormat(szDate, pffbFile->fdateLastWrite);
    510509                    sprintf(p,
    511                             "%s%-*.*s  %-8s  [%s%s%s%s]  %04lu/%02lu/%02lu "
    512                               "%02lu:%02lu:%02lu\r",
     510                            "%s%-*.*s  %-8s  [%s%s%s%s]  %s "
     511                              "%02lu%s%02lu%s%02lu\r",
    513512                            pffbFile->attrFile & FILE_DIRECTORY ? "\\" : " ",
    514513                            ml,
     
    520519                            pffbFile->attrFile & FILE_HIDDEN ? "H" : "-",
    521520                            pffbFile->attrFile & FILE_SYSTEM ? "S" : "-",
    522                             pffbFile->fdateLastWrite.year + 1980,
    523                             pffbFile->fdateLastWrite.month,
    524                             pffbFile->fdateLastWrite.day,
    525                             pffbFile->ftimeLastWrite.hours,
    526                             pffbFile->ftimeLastWrite.minutes,
     521                            szDate,
     522                            pffbFile->ftimeLastWrite.hours, TimeSeparator,
     523                            pffbFile->ftimeLastWrite.minutes, TimeSeparator,
    527524                            pffbFile->ftimeLastWrite.twosecs * 2);
    528525                    p += strlen(p);
     
    683680                                    0L, 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
    684681      if (!hwndAutoObj) {
    685         Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
    686                    IDS_WINCREATEWINDOW);
     682        Win_Error(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
     683                  PCSZ_WINCREATEWINDOW);
    687684        if (!PostMsg(hwndParent, UM_CLOSE, MPVOID, MPVOID))
    688685          WinSendMsg(hwndParent, UM_CLOSE, MPVOID, MPVOID);
  • trunk/dll/avv.c

    r1394 r1395  
    267267    t = time(NULL);
    268268    tm = localtime(&t);
    269 
     269    //fixme to use DateFmt from locale
    270270    fprintf(fpNew,
    271271            ";\n; %s file written by FM/2 v%d.%02d on %u/%u/%u %u:%02u:%02u\n;\n",
  • trunk/dll/collect.c

    r1394 r1395  
    5959  26 Dec 08 GKY Fixed DROPHELP to check for copy as default is action is DO_DEFAULT
    6060  01 Jan 09 GKY Add Seek and Scan to drives & directory context menus pass drive/dir as search root
     61  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     62  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     63  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
     64  07 Feb 09 GKY Move repeated strings to PCSZs.
    6165
    6266***********************************************************************/
     
    877881          CHAR filename[CCHMAXPATH], *p, *pp;
    878882
    879           strcpy(filename, "*.LST");
     883          strcpy(filename, PCSZ_STARDOTLST);
    880884          size = CCHMAXPATH;
    881885          PrfQueryProfileData(fmprof, appname, "SaveToListName", filename,
     
    12641268    if (dcd) {
    12651269      CNRINFO cnri;
    1266       CHAR s[CCHMAXPATH + 69], tb[81], tf[81], *p;
     1270      CHAR s[CCHMAXPATH + 69], tb[81], tf[81], szDate[11], *p;
    12671271      PCNRITEM pci = NULL;
    12681272
     
    13321336            }
    13331337            CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
    1334             if (!fMoreButtons) {
    1335               sprintf(s, " %s  %04u/%02u/%02u %02u:%02u:%02u  [%s]  %s",
    1336                       tb, pci->date.year, pci->date.month,
    1337                       pci->date.day, pci->time.hours, pci->time.minutes,
    1338                       pci->time.seconds, pci->pszDispAttr, p);
     1338            if (!fMoreButtons) {
     1339              DateFormat(szDate, pci->date);
     1340              sprintf(s, " %s  %s %02u%s%02u%s%02u  [%s]  %s",
     1341                      tb, szDate, pci->time.hours, TimeSeparator, pci->time.minutes,
     1342                      TimeSeparator, pci->time.seconds, pci->pszDispAttr, p);
    13391343            }
    13401344            else {
     
    13501354          }
    13511355          if (fMoreButtons) {
    1352             WinSetWindowText(hwndName, pci->pszFileName);
    1353             sprintf(s, "%04u/%02u/%02u %02u:%02u:%02u",
    1354                     pci->date.year, pci->date.month,
    1355                     pci->date.day, pci->time.hours, pci->time.minutes,
    1356                     pci->time.seconds);
     1356            WinSetWindowText(hwndName, pci->pszFileName);
     1357            DateFormat(szDate, pci->date);
     1358            sprintf(s, "%s %02u%s%02u%s%02u",
     1359                    szDate, pci->time.hours, TimeSeparator, pci->time.minutes,
     1360                    TimeSeparator, pci->time.seconds);
    13571361            WinSetWindowText(hwndDate, s);
    13581362            WinSetWindowText(hwndAttr, pci->pszDispAttr);
     
    13791383
    13801384  case UM_CONTAINER_FILLED:
    1381     DosBeep(1000, 50);                  // Wake up user?
     1385    if (!fAlertBeepOff)
     1386      DosBeep(1000, 50);                        // Wake up user?
    13821387    WinSendMsg(hwnd,
    13831388               CM_INVALIDATERECORD,
     
    16861691          CHAR filename[CCHMAXPATH], *p, *pp;
    16871692
    1688           strcpy(filename, "*.LST");
     1693          strcpy(filename, PCSZ_STARDOTLST);
    16891694          size = CCHMAXPATH;
    16901695          PrfQueryProfileData(fmprof, appname, "SaveToListName",
     
    26702675          PNOTIFYRECORDEMPHASIS pre = mp2;
    26712676          PCNRITEM pci;
    2672           CHAR s[CCHMAXPATH + 91], tb[81], tf[81], *p;
     2677          CHAR s[CCHMAXPATH + 91], tb[81], tf[81], szDate[11], *p;
    26732678
    26742679          pci = (PCNRITEM) ((pre) ? pre->pRecord : NULL);
     
    27202725                  }
    27212726                  CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
    2722                   if (!fMoreButtons)
    2723                     sprintf(s, " %s  %04u/%02u/%02u %02u:%02u:%02u  [%s]  %s",
    2724                             tb, pci->date.year,
    2725                             pci->date.month, pci->date.day, pci->time.hours,
    2726                             pci->time.minutes, pci->time.seconds,
    2727                             pci->pszDispAttr, p);
     2727                  if (!fMoreButtons) {
     2728                    DateFormat(szDate, pci->date);
     2729                    sprintf(s, " %s  %s %02u%s%02u%s%02u  [%s]  %s",
     2730                            tb, szDate, pci->time.hours, TimeSeparator,
     2731                            pci->time.minutes, TimeSeparator, pci->time.seconds,
     2732                            pci->pszDispAttr, p);
     2733                  }
    27282734                  else {
    27292735                    if (pci->cbFile + pci->easize > 1024)
     
    27392745                }
    27402746                if (fMoreButtons) {
    2741                   WinSetWindowText(hwndName, pci->pszFileName);
    2742                   sprintf(s, "%04u/%02u/%02u %02u:%02u:%02u",
    2743                           pci->date.year, pci->date.month,
    2744                           pci->date.day, pci->time.hours, pci->time.minutes,
    2745                           pci->time.seconds);
     2747                  WinSetWindowText(hwndName, pci->pszFileName);
     2748                  DateFormat(szDate, pci->date);
     2749                  sprintf(s, "%s %02u%s%02u%s%02u",
     2750                          szDate, pci->time.hours, TimeSeparator, pci->time.minutes,
     2751                          TimeSeparator, pci->time.seconds);
    27462752                  WinSetWindowText(hwndDate, s);
    27472753                  WinSetWindowText(hwndAttr, pci->pszDispAttr);
     
    30233029                                     (ULONG) COLLECTOR_CNR, NULL, NULL);
    30243030      if (!dcd->hwndCnr) {
    3025         Win_Error2(hwndClient, hwndClient, pszSrcFile, __LINE__,
    3026                    IDS_WINCREATEWINDOW);
     3031        Win_Error(hwndClient, hwndClient, pszSrcFile, __LINE__,
     3032                  PCSZ_WINCREATEWINDOW);
    30273033        PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    30283034        free(dcd);
  • trunk/dll/colors.c

    r1346 r1395  
    1212  22 Mar 07 GKY Use QWL_USER
    1313  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
     14  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1415
    1516***********************************************************************/
     
    151152        co->colors[co->currentcolor] = (LONG) (SHORT1FROMMP(mp1) -
    152153                                               COLOR_FIRST);
    153         DosBeep(1000, 1);               // fixme to be gone?
     154        //DosBeep(1000, 1);             // fixme to be gone?
    154155      }
    155156      break;
  • trunk/dll/commafmt.c

    r1205 r1395  
    1515  05 Nov 07 GKY Use commafmtULL to display file sizes for large file support
    1616  10 Nov 07 GKY Get thousands separator from country info for file sizes.
     17  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    1718
    1819***********************************************************************/
     
    172173}
    173174
    174 #pragma alloc_text(MISC8,commafmt,CommaFmtU64)
     175VOID DateFormat(PSZ pszBuf, CDATE Date)
     176{
     177  switch(ulDateFmt) {
     178
     179  case 3:
     180
     181    sprintf(pszBuf, "%04u%s%02u%s%02u", Date.year, DateSeparator,
     182            Date.day, DateSeparator, Date.month);
     183    break;
     184
     185  case 2:
     186
     187    sprintf(pszBuf, "%04u%s%02u%s%02u", Date.year, DateSeparator,
     188            Date.month, DateSeparator, Date.day);
     189    break;
     190
     191  case 1:
     192
     193    sprintf(pszBuf, "%02u%s%02u%s%04u", Date.day, DateSeparator,
     194            Date.month, DateSeparator, Date.year);
     195    break;
     196
     197  case 0:
     198  default:
     199
     200    sprintf(pszBuf, "%02u%s%02u%s%04u", Date.month, DateSeparator,
     201            Date.day, DateSeparator, Date.year);
     202    break;
     203  }
     204}
     205
     206VOID FDateFormat(PSZ pszBuf, FDATE Date)
     207{
     208  switch(ulDateFmt) {
     209
     210  case 3:
     211
     212    sprintf(pszBuf, "%04u%s%02u%s%02u", Date.year + 1980, DateSeparator,
     213            Date.day, DateSeparator, Date.month);
     214    break;
     215
     216  case 2:
     217
     218    sprintf(pszBuf, "%04u%s%02u%s%02u", Date.year + 1980, DateSeparator,
     219            Date.month, DateSeparator, Date.day);
     220    break;
     221
     222  case 1:
     223
     224    sprintf(pszBuf, "%02u%s%02u%s%04u", Date.day, DateSeparator,
     225            Date.month, DateSeparator, Date.year + 1980);
     226    break;
     227
     228  case 0:
     229  default:
     230
     231    sprintf(pszBuf, "%02u%s%02u%s%04u", Date.month, DateSeparator,
     232            Date.day, DateSeparator, Date.year + 1980);
     233    break;
     234  }
     235}
     236
     237VOID DTDateFormat(PSZ pszBuf, DATETIME Date)
     238{
     239  switch(ulDateFmt) {
     240
     241  case 3:
     242
     243    sprintf(pszBuf, "%04u%s%02u%s%02u", Date.year, DateSeparator,
     244            Date.day, DateSeparator, Date.month);
     245    break;
     246
     247  case 2:
     248
     249    sprintf(pszBuf, "%04u%s%02u%s%02u", Date.year, DateSeparator,
     250            Date.month, DateSeparator, Date.day);
     251    break;
     252
     253  case 1:
     254
     255    sprintf(pszBuf, "%02u%s%02u%s%04u", Date.day, DateSeparator,
     256            Date.month, DateSeparator, Date.year);
     257    break;
     258
     259  case 0:
     260  default:
     261
     262    sprintf(pszBuf, "%02u%s%02u%s%04u", Date.month, DateSeparator,
     263            Date.day, DateSeparator, Date.year);
     264    break;
     265  }
     266}
     267
     268#pragma alloc_text(MISC8,commafmt,CommaFmtUL,CommaFmtULL)
  • trunk/dll/commafmt.h

    r1195 r1395  
    1010
    1111  Change log
     12  07 Feb 09 GKY Add *DateFormat functions to format dates bassed on locale
    1213
    1314***********************************************************************/
     
    2223size_t commafmt(PSZ pszBuf, UINT cBufSize, LONG lNumber);
    2324
     25VOID DateFormat(PSZ pszBuf, CDATE Date);
     26
     27VOID FDateFormat(PSZ pszBuf, FDATE Date);
     28
     29VOID DTDateFormat(PSZ pszBuf, DATETIME Date);
     30
    2431#endif // COMMAFMT_H
  • trunk/dll/common.c

    r1391 r1395  
    2424  01 Jan 09 GKY Add option to rescan tree container on eject of removable media
    2525  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     26  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    2627
    2728***********************************************************************/
     
    230231                              HWND_TOP, ids[x], NULL, NULL);
    231232    if (!hwndTmp)
    232       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     233      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     234                PCSZ_WINCREATEWINDOW);
    233235  } // for
    234236}
     
    407409                               hwndFrame, HWND_TOP, MAIN_STATUS, NULL, NULL);
    408410  if (!hwndStatus)
    409     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     411    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     412              PCSZ_WINCREATEWINDOW);
    410413
    411414  // Right status window
     
    428431                                HWND_TOP, MAIN_STATUS2, NULL, NULL);
    429432  if (!hwndStatus2)
    430     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     433    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     434              PCSZ_WINCREATEWINDOW);
    431435
    432436  hwndAttr = WinCreateWindow(hwndFrame,
     
    446450                             20, hwndFrame, HWND_TOP, IDM_ATTRS, NULL, NULL);
    447451  if (!hwndAttr)
    448     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     452    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     453              PCSZ_WINCREATEWINDOW);
    449454
    450455  hwndDate = WinCreateWindow(hwndFrame,
     
    464469                             20, hwndFrame, HWND_TOP, IDM_INFO, NULL, NULL);
    465470  if (!hwndDate)
    466     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     471    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     472              PCSZ_WINCREATEWINDOW);
    467473
    468474  hwndName = WinCreateWindow(hwndFrame,
     
    482488                             20, hwndFrame, HWND_TOP, IDM_RENAME, NULL, NULL);
    483489  if (!hwndName)
    484     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     490    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     491              PCSZ_WINCREATEWINDOW);
    485492
    486493  hwndTmp = WinCreateWindow(hwndFrame,
     
    499506                            30, hwndFrame, HWND_TOP, MAIN_TOOLS, NULL, NULL);
    500507  if (!hwndTmp)
    501     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     508    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     509              PCSZ_WINCREATEWINDOW);
    502510
    503511  hwndBack = WinCreateWindow(hwndFrame,
     
    518526
    519527  if (!hwndBack)
    520     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     528    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     529              PCSZ_WINCREATEWINDOW);
    521530
    522531  hwndLED = WinCreateWindow(hwndFrame,
     
    529538                            12, hwndFrame, HWND_TOP, MAIN_LED, NULL, NULL);
    530539  if (!hwndLED)
    531     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     540    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     541              PCSZ_WINCREATEWINDOW);
    532542
    533543  hwndLEDHdr = WinCreateWindow(hwndFrame,
     
    542552                               hwndFrame, HWND_TOP, MAIN_LEDHDR, NULL, NULL);
    543553  if (!hwndLEDHdr)
    544     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     554    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     555              PCSZ_WINCREATEWINDOW);
    545556
    546557  hwndAutoview = WinCreateWindow(hwndFrame,
     
    562573                                 HWND_TOP, MAIN_AUTOVIEW, NULL, NULL);
    563574  if (!hwndAutoview)
    564     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     575    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     576              PCSZ_WINCREATEWINDOW);
    565577
    566578  hwndAutoMLE = WinCreateWindow(hwndFrame,
     
    583595                                HWND_TOP, MAIN_AUTOVIEWMLE, NULL, NULL);
    584596  if (!hwndAutoMLE)
    585     Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     597    Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     598              PCSZ_WINCREATEWINDOW);
    586599
    587600  oldproc = WinSubclassWindow(hwndAutoMLE, AutoViewProc);
  • trunk/dll/comp.c

    r1394 r1395  
    6161  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis.
    6262  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     63  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    6364
    6465***********************************************************************/
     
    142143  HDIR hdir = HDIR_CREATE;
    143144  ULONG ulFindCnt;
     145  CHAR  szCmmaFmtFileSize[81], szDate[11];
    144146
    145147  // 13 Aug 07 SHL fimxe to use FileToGet
     
    161163        do {
    162164          strcpy(enddir, pffb->achName);
    163           if (!(pffb->attrFile & FILE_DIRECTORY))
    164             // 27 Sep 07 SHL fixme to use CommaFmtULL
     165          if (!(pffb->attrFile & FILE_DIRECTORY)) {
     166            CommaFmtULL(szCmmaFmtFileSize,
     167                        sizeof(szCmmaFmtFileSize), pffb->cbFile, ' ');
     168            FDateFormat(szDate, pffb->fdateLastWrite);
    165169            fprintf(fp,
    166                     "\"%s\",%u,%llu,%04u/%02u/%02u,%02u:%02u:%02u,%lu,%lu,N\n",
     170                    "\"%s\",%u,%s,%s,%02u%s%02u%s%02u,%lu,%lu,N\n",
    167171                    mask,
    168172                    enddir - mask,
    169                     pffb->cbFile,
    170                     (pffb->fdateLastWrite.year + 1980),
    171                     pffb->fdateLastWrite.month,
    172                     pffb->fdateLastWrite.day,
    173                     pffb->ftimeLastWrite.hours,
    174                     pffb->ftimeLastWrite.minutes,
     173                    szCmmaFmtFileSize,
     174                    szDate,
     175                    pffb->ftimeLastWrite.hours,
     176                    TimeSeparator,
     177                    pffb->ftimeLastWrite.minutes,
     178                    TimeSeparator,
    175179                    pffb->ftimeLastWrite.twosecs,
    176180                    pffb->attrFile,
    177                     pffb->cbList > 4 ? pffb->cbList / 2 : 0);
     181                    pffb->cbList > 4 ? pffb->cbList / 2 : 0);
     182          }
    178183          // Skip . and ..
    179184          else if (recurse &&
  • trunk/dll/datamin.c

    r1391 r1395  
    2525                Dos/Win programs from being inserted into the execute dialog with message why.
    2626  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     27  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     28  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    2729
    2830***********************************************************************/
     
    260262                             MINI_X,
    261263                             MINI_Y, hwnd, HWND_TOP, ids[c], NULL, NULL)) {
    262           Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     264          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     265                    PCSZ_WINCREATEWINDOW);
    263266        }
    264267        x += (MINI_X + 4);
     
    318321                                 WS_VISIBLE, x, y, MINI_X, MINI_Y, hwnd,
    319322                                 HWND_TOP, MINI_DRIVEA + c, NULL, NULL)) {
    320               Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__,
    321                          IDS_WINCREATEWINDOW);
     323              Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     324                        PCSZ_WINCREATEWINDOW);
    322325            }
    323326            numdrives++;
     
    747750  case UM_TIMER:
    748751    {
    749       CHAR s[134];
     752      CHAR s[134], szDate[11];
    750753      DATETIME dt;
    751754
     
    754757                        HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
    755758      if (counter && (counter % 19) && (counter % 20)) {
    756         if (!DosGetDateTime(&dt)) {
     759        if (!DosGetDateTime(&dt)) {
     760          DTDateFormat(szDate, dt);
    757761          sprintf(s,
    758                   " %02hu:%02hu:%02hu  %s %04u/%02u/%02u",
    759                   dt.hours,
    760                   dt.minutes,
     762                  " %02hu%s%02hu%s%02hu  %s %s",
     763                  dt.hours, TimeSeparator,
     764                  dt.minutes, TimeSeparator,
    761765                  dt.seconds,
    762766                  GetPString(IDS_SUNDAY + dt.weekday),
    763                   dt.year, dt.month, dt.day);
     767                  szDate);
    764768          WinSetDlgItemText(hwnd, MINI_TIME, s);
    765769        }
     
    944948                  numdays, GetPString(IDS_DAYTEXT), &"s"[numdays == 1L]);
    945949        nummins = val % (60L * 24L);
    946         sprintf(s + strlen(s), " %lu:%02lu", nummins / 60, nummins % 60);
     950        sprintf(s + strlen(s), " %lu%s%02lu", nummins / 60, TimeSeparator, nummins % 60);
    947951        WinSetDlgItemText(hwnd, MINI_TIME, s);
    948952      }
  • trunk/dll/dircnrs.c

    r1394 r1395  
    5454  26 Dec 08 GKY Fixed DROPHELP to check for copy as default is action is DO_DEFAULT
    5555  01 Jan 09 GKY Add Seek and Scan to drives & directory context menus pass drive/dir as search root
     56  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     57  07 Feb 09 GKY Move repeated strings to PCSZs.
     58  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     59  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    5660
    5761***********************************************************************/
     
    987991          ULONG size;
    988992
    989           strcpy(filename, "*.LST");
     993          strcpy(filename, PCSZ_STARDOTLST);
    990994          size = CCHMAXPATH;
    991995          PrfQueryProfileData(fmprof, appname, "SaveToListName",
     
    14701474
    14711475      CNRINFO cnri;
    1472       CHAR s[CCHMAXPATH * 2], tf[81], tb[81];
     1476      CHAR s[CCHMAXPATH * 2], tf[81], tb[81], szDate[11];
    14731477      PCNRITEM pci;
    14741478
     
    15001504            if (fSplitStatus && hwndStatus2) {
    15011505              CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
    1502               if (!fMoreButtons)
    1503                 sprintf(s,
    1504                         " %s  %04u/%02u/%02u %02u:%02u:%02u  [%s]  %s",
     1506              if (!fMoreButtons) {
     1507                DateFormat(szDate, pci->date);
     1508                sprintf(s, " %s  %s %02u%s%02u%s%02u  [%s]  %s",
    15051509                        tb,
    1506                         pci->date.year,
    1507                         pci->date.month,
    1508                         pci->date.day,
    1509                         pci->time.hours,
    1510                         pci->time.minutes,
     1510                        szDate,
     1511                        pci->time.hours,
     1512                        TimeSeparator,
     1513                        pci->time.minutes,
     1514                        TimeSeparator,
    15111515                        pci->time.seconds,
    1512                         pci->pszDispAttr, pci->pszFileName);
     1516                        pci->pszDispAttr, pci->pszFileName);
     1517              }
    15131518              else {
    15141519                *tf = 0;
     
    15251530              WinSetWindowText(hwndStatus2, NullStr);
    15261531            if (fMoreButtons) {
    1527               WinSetWindowText(hwndName, pci->pszFileName);
    1528               sprintf(s,
    1529                       "%04u/%02u/%02u %02u:%02u:%02u",
    1530                       pci->date.year,
    1531                       pci->date.month,
    1532                       pci->date.day,
    1533                       pci->time.hours, pci->time.minutes, pci->time.seconds);
     1532              WinSetWindowText(hwndName, pci->pszFileName);
     1533              DateFormat(szDate, pci->date);
     1534              sprintf(s, "%s %02u%s%02u%s%02u",
     1535                      szDate,
     1536                      pci->time.hours, TimeSeparator,
     1537                      pci->time.minutes, TimeSeparator,
     1538                      pci->time.seconds);
    15341539              WinSetWindowText(hwndDate, s);
    15351540              WinSetWindowText(hwndAttr, pci->pszDispAttr);
     
    28272832                Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    28282833                          GetPString(IDS_CANTFINDDIRTEXT),
    2829                           pci->pszFileName);
    2830                 DosBeep(250,100);
     2834                          pci->pszFileName);
     2835                if (!fErrorBeepOff)
     2836                  DosBeep(250,100);
    28312837                driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
    28322838                UnFlesh(hwnd, pci);
     
    33223328                if (fSplitStatus && hwndStatus2) {
    33233329                  CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
    3324                   if (!fMoreButtons) {
    3325                     sprintf(s, " %s  %04u/%02u/%02u %02u:%02u:%02u  [%s]  %s",
    3326                             tb, pci->date.year,
    3327                             pci->date.month, pci->date.day, pci->time.hours,
    3328                             pci->time.minutes, pci->time.seconds,
     3330                  if (!fMoreButtons) {
     3331                    CHAR date[11];
     3332
     3333                    DateFormat(date, pci->date);
     3334                    sprintf(s, " %s  %s %02u%s%02u%s%02u  [%s]  %s",
     3335                            tb, date, pci->time.hours, TimeSeparator,
     3336                            pci->time.minutes, TimeSeparator, pci->time.seconds,
    33293337                            pci->pszDispAttr, pci->pszFileName);
    33303338                  }
     
    33413349                  WinSetWindowText(hwndStatus2, s);
    33423350                }
    3343                 if (fMoreButtons) {
    3344                   WinSetWindowText(hwndName, pci->pszFileName);
    3345                   sprintf(s, "%04u/%02u/%02u %02u:%02u:%02u",
    3346                           pci->date.year, pci->date.month,
    3347                           pci->date.day, pci->time.hours, pci->time.minutes,
    3348                           pci->time.seconds);
     3351                if (fMoreButtons) {
     3352                  CHAR szDate[11];
     3353
     3354                  WinSetWindowText(hwndName, pci->pszFileName);
     3355                  DateFormat(szDate, pci->date);
     3356                  sprintf(s, "%s %02u%s%02u%s%02u",
     3357                          szDate, pci->time.hours, TimeSeparator, pci->time.minutes,
     3358                          TimeSeparator, pci->time.seconds);
    33493359                  WinSetWindowText(hwndDate, s);
    33503360                  WinSetWindowText(hwndAttr, pci->pszDispAttr);
     
    36773687                                       HWND_TOP, (ULONG) DIR_CNR, NULL, NULL);
    36783688        if (!dcd->hwndCnr) {
    3679           Win_Error2(hwndClient, hwndClient, pszSrcFile, __LINE__,
    3680                      IDS_WINCREATEWINDOW);
     3689          Win_Error(hwndClient, hwndClient, pszSrcFile, __LINE__,
     3690                    PCSZ_WINCREATEWINDOW);
    36813691          PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    36823692          free(dcd);
  • trunk/dll/dirsize.c

    r1394 r1395  
    4242  23 Aug 08 GKY Fix memory leak (failure to free cnritems)
    4343  10 Dec 08 SHL Integrate exception handler support
     44  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    4445
    4546***********************************************************************/
     
    631632    WinSendDlgItemMsg(hwnd, DSZ_CNR, CM_SORTRECORD, MPFROMP(SortSizeCnr),
    632633                      MPVOID);
    633     DosBeep(500, 25);                   // Wake up user
     634    if (!fAlertBeepOff)
     635      DosBeep(500, 25);                 // Wake up user
    634636    return 0;
    635637
     
    10161018          pState->dying = TRUE;
    10171019          pState->chStopFlag = (CHAR)0xff;
    1018           DosBeep(1000, 100);           // Complain?
     1020          if (!fAlertBeepOff)
     1021            DosBeep(1000, 100);         // Complain?
    10191022        }
    10201023        else
  • trunk/dll/eas.c

    r1347 r1395  
    2222  01 Sep 07 GKY Use xDosSetPathInfo to fix case where FS3 buffer crosses 64k boundry
    2323  29 Feb 08 GKY Use xfree where appropriate
     24  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    2425
    2526***********************************************************************/
     
    157158        else {
    158159          if (CheckEA(head, s)) {
    159             DosBeep(50, 100);
     160            if (!fAlertBeepOff)
     161              DosBeep(50, 100);
    160162            WinSetDlgItemText(hwnd, EAC_TEXT,
    161163                              GetPString(IDS_EANAMEEXISTSTEXT));
     
    164166          for (x = 0; *forbidden[x]; x++) {
    165167            if (!strcmp(forbidden[x], s)) {
    166               DosBeep(50, 100);
     168              if (!fAlertBeepOff)
     169                DosBeep(50, 100);
    167170              WinSetDlgItemText(hwnd, EAC_TEXT,
    168171                                GetPString(IDS_EANAMERESERVEDTEXT));
     
    177180            if (!strcmp(restypes[x].name, s)) {
    178181              if (type != restypes[x].type) {
    179                 DosBeep(50, 100);
     182                if (!fAlertBeepOff)
     183                  DosBeep(50, 100);
    180184                WinSetDlgItemText(hwnd, EAC_TEXT,
    181185                                  GetPString(IDS_EAWRONGTYPETEXT));
  • trunk/dll/errutil.c

    r1373 r1395  
    2929  05 Jan 08 SHL Renamed from error.c to match errutil.h
    3030  18 Dec 08 SHL Show thread id in DbgMsg
     31  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     32  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     33  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    3134
    3235***********************************************************************/
     
    4043#define INCL_DOSERRORS
    4144#define INCL_DOSPROCESS                 // PPIB PTIB
     45#define INCL_LONGLONG
    4246
    4347#include "errutil.h"
    4448#include "strutil.h"                    // GetPString
    4549#include "fm3str.h"
     50#include "notebook.h"                   // fErrorBeepOff
    4651
    4752#pragma data_seg(GLOBAL2)
     
    135140  }
    136141
    137   if (strchr(szMsg, ' ') == NULL)
    138     strcat(szMsg, " failed");           // Assume simple function name
     142  if (strchr(szMsg, ' ') == NULL) {
     143    strcat(szMsg, " ");
     144    strcat(szMsg, GetPString(IDS_FAILEDTEXT));          // Assume simple function name
     145  }
    139146
    140147  DosErrClass(ulRC, &Class, &action, &Locus);
     
    185192} // Dos_Error
    186193
    187 //== Dos_Error2: report Dos...() error using passed message id ===
     194/*== Dos_Error2: report Dos...() error using passed message id ===
    188195
    189196INT Dos_Error2(ULONG mb_type, ULONG ulRC, HWND hwndOwner,
     
    192199  return Dos_Error(mb_type, ulRC, hwndOwner, pszSrcFile, uSrcLineNo,
    193200                   GetPString(idMsg));
    194 } // Dos_Error2
     201} // Dos_Error2 */
    195202
    196203/**
     
    224231  }
    225232
    226   if (strchr(pszBuf, ' ') == NULL)
    227     strcat(pszBuf, " failed");          // Assume simple function name
     233  if (strchr(pszBuf, ' ') == NULL) {
     234    strcat(pszBuf, " ");
     235    strcat(pszBuf, GetPString(IDS_FAILEDTEXT));         // Assume simple function name
     236  }
    228237
    229238  // Append file name and line number and trailing space
     
    303312  }
    304313
    305   if (strchr(szMsg, ' ') == NULL)
    306     strcat(szMsg, " failed");           // Assume simple function name
     314  if (strchr(szMsg, ' ') == NULL) {
     315    strcat(szMsg, " ");
     316    strcat(szMsg, GetPString(IDS_FAILEDTEXT));          // Assume simple function name
     317  }
    307318
    308319  sprintf(szMsg + strlen(szMsg),
    309320          GetPString(IDS_GENERR1TEXT), pszSrcFile, uSrcLineNo);
    310321
    311   showMsg(MB_ICONEXCLAMATION, HWND_DESKTOP, DEBUG_STRING, szMsg, TRUE);
     322  showMsg(MB_ICONEXCLAMATION, HWND_DESKTOP, GetPString(IDS_DEBUG_STRING), szMsg, TRUE);
    312323
    313324} // Runtime_Error
     
    358369  if (!hwndOwner)
    359370    hwndOwner = HWND_DESKTOP;
    360 
    361   DosBeep(250, 100);
     371  if (!fErrorBeepOff)
     372    DosBeep(250, 100);
    362373
    363374  return WinMessageBox(HWND_DESKTOP,    // Parent
     
    386397} // Win_Error
    387398
    388 //== Win_Error2: report Win...() error using passed message id ===
     399/*== Win_Error2: report Win...() error using passed message id ===
    389400
    390401VOID Win_Error2(HWND hwndErr, HWND hwndOwner,
     
    393404  Win_Error(hwndErr, hwndOwner, pszSrcFile, uSrcLineNo, GetPString(idMsg));
    394405
    395 } // Win_Error2
     406} // Win_Error2 */
    396407
    397408/**
     
    417428  fputc('\n', stderr);
    418429  fflush(stderr);
    419 
    420   DosBeep(250, 100);
     430  if (!fErrorBeepOff)
     431    DosBeep(250, 100);
    421432
    422433} // Win_Error_NoMsgBox
  • trunk/dll/errutil.h

    r1196 r1395  
    1010
    1111  05 Jan 08 SHL Move from fm3dll.h to here
     12  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    1213
    1314***********************************************************************/
     
    2324INT Dos_Error(ULONG mb_type, ULONG ulRC, HWND hwndOwner,
    2425              PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    25 INT Dos_Error2(ULONG mb_type, ULONG ulRC, HWND hwndOwner, PCSZ pszSrcFile,
    26                UINT uSrcLineNo, UINT idMsg);
     26//INT Dos_Error2(ULONG mb_type, ULONG ulRC, HWND hwndOwner, PCSZ pszSrcFile,
     27//             UINT uSrcLineNo, UINT idMsg);
    2728ULONG GetMSecTimer(void);
    2829VOID Runtime_Error(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
     
    3132VOID Win_Error(HWND hwndErr, HWND hwndOwner,
    3233               PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    33 VOID Win_Error2(HWND hwndErr, HWND hwndOwner, PCSZ pszSrcFile,
    34                 UINT uSrcLineNo, UINT idMsg);
     34//VOID Win_Error2(HWND hwndErr, HWND hwndOwner, PCSZ pszSrcFile,
     35//              UINT uSrcLineNo, UINT idMsg);
    3536VOID Win_Error_NoMsgBox(HWND hwndErr, HWND hwndOwner,
    3637                        PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
  • trunk/dll/extract.c

    r1349 r1395  
    1717  29 Nov 08 GKY Add the option of creating a subdirectory from the arcname
    1818                for the extract path.
     19  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1920
    2021***********************************************************************/
     
    452453        }
    453454      }
    454       DosBeep(50, 100);                 // Complain a refuse to quit
     455      if (!fErrorBeepOff)
     456        DosBeep(50, 100);                       // Complain a refuse to quit
    455457      break;
    456458
  • trunk/dll/filldir.c

    r1358 r1395  
    6464  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
    6565  25 Dec 08 GKY Add ProcessDirectoryThread to allow optional recursive drive scan at startup.
     66  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    6667
    6768***********************************************************************/
     
    10561057                                  MPFROMLONG(ulSelCnt));
    10571058            if (!pciFirst) {
    1058               Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
    1059                          IDS_CMALLOCRECERRTEXT);
     1059              Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
     1060                        GetPString(IDS_CMALLOCRECERRTEXT));
    10601061              ok = FALSE;
    10611062              ullTotalBytes = 0;
     
    10891090                                CM_INSERTRECORD,
    10901091                                MPFROMP(pciFirst), MPFROMP(&ri))) {
    1091                   Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
    1092                              IDS_CMINSERTERRTEXT);
     1092                  Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
     1093                            GetPString(IDS_CMINSERTERRTEXT));
    10931094                  ok = FALSE;
    10941095                  ullTotalBytes = 0;
     
    11481149                              MPFROMLONG(EXTRA_RECORD_BYTES), MPFROMLONG(ulTotal));
    11491150        if (!pciFirst) {
    1150           Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
    1151                      IDS_CMALLOCRECERRTEXT);
     1151          Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
     1152                    GetPString(IDS_CMALLOCRECERRTEXT));
    11521153          ok = FALSE;
    11531154          ullTotalBytes = 0;
     
    11811182              if (!WinSendMsg(hwndCnr, CM_INSERTRECORD,
    11821183                              MPFROMP(pciFirst), MPFROMP(&ri))) {
    1183                 Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
    1184                            IDS_CMINSERTERRTEXT);
     1184                Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
     1185                          GetPString(IDS_CMINSERTERRTEXT));
    11851186                ok = FALSE;
    11861187                ullTotalBytes = 0;
     
    13261327              rc,
    13271328              HWND_DESKTOP,
    1328               pszSrcFile, __LINE__, GetPString(IDS_FILLDIRQCURERRTEXT));
     1329              pszSrcFile, __LINE__, PCSZ_FILLDIRQCURERRTEXT);
    13291330    exit(0);
    13301331  }
     
    13441345
    13451346  if (!pciFirst) {
    1346     Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, IDS_CMALLOCRECERRTEXT);
     1347    Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, GetPString(IDS_CMALLOCRECERRTEXT));
    13471348    // 04 Jan 08 SHL fixme not just up and die
    13481349    exit(0);
     
    15371538                    CM_INSERTRECORD, MPFROMP(pciFirst), MPFROMP(&ri)))
    15381539    {
    1539       Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
    1540                  IDS_CMINSERTERRTEXT);
     1540      Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
     1541                GetPString(IDS_CMINSERTERRTEXT));
    15411542    }
    15421543  }
     
    16281629                              CM_INSERTRECORD,
    16291630                              MPFROMP(pci), MPFROMP(&ri))) {
    1630                 Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
    1631                            IDS_CMINSERTERRTEXT);
     1631                Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__,
     1632                          GetPString(IDS_CMINSERTERRTEXT));
    16321633                FreeCnrItem(hwndCnr, pci);
    16331634              }
     
    19081909
    19091910  if (!WinSendMsg(hwnd, CM_FREERECORD, MPFROMP(&pci), MPFROMSHORT(1))) {
    1910     // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMFREEERRTEXT);
    19111911    Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,
    19121912              "CM_FREERECORD hwnd %x pci %p file %s",
     
    19341934  if (usCount) {
    19351935    if (!WinSendMsg(hwnd, CM_FREERECORD, MPFROMP(&pci), MPFROMSHORT(usCount))) {
    1936       // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMFREEERRTEXT);
    19371936      Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_FREERECORD hwnd %x pci %p cnt %u", hwnd, pci, usCount);
    19381937    }
     
    19931992    remaining = (INT)WinSendMsg(hwnd, CM_REMOVERECORD, MPFROMP(&pciFirst), MPFROM2SHORT(usCnt, usFlags));
    19941993    if (remaining == -1) {
    1995       // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMREMOVEERRTEXT);
    19961994      Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVERECORD hwnd %x pci %p cnt %u", hwnd, pciFirst, usCnt);
    19971995    }
  • trunk/dll/filter.c

    r1347 r1395  
    1717  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName
    1818  24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file
     19  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     20  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1921
    2022***********************************************************************/
     
    406408                             50,
    407409                             swpE.cy, hwnd, HWND_TOP, 65535, NULL, NULL)) {
    408           Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     410          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     411                    PCSZ_WINCREATEWINDOW);
    409412        }
    410413        if (!WinCreateWindow(hwnd,
     
    417420                             swpL.cx - 54,
    418421                             swpE.cy, hwnd, HWND_TOP, MSK_TEXT, NULL, NULL)) {
    419           Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     422          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     423                    PCSZ_WINCREATEWINDOW);
    420424        }
    421425        WinSendDlgItemMsg(hwnd,
     
    652656            WinDismissDlg(hwnd, 1);
    653657          }
    654           else
     658          else if (!fAlertBeepOff)
    655659            DosBeep(50, 100);           // MSK_DELETE
    656660        }
  • trunk/dll/fm3dlg.h

    r1375 r1395  
    3030  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
    3131  01 Jan 09 GKY Add option to rescan tree container on eject of removable media
     32  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    3233
    3334***********************************************************************/
     
    650651#define CFGG_CMDLNLNGTH                                                                 25216
    651652#define CFGG_TRASHCAN                                                                   25217
     653#define CFGG_ALERTBEEPOFF                                                               25218
     654#define CFGG_ERRORBEEPOFF                                                               25219
    652655
    653656#define CFGB_FRAME                                                                      25250
  • trunk/dll/fm3res.dlg

    r1377 r1395  
    4343  25 Dec 08 GKY Add ProcessDirectoryThread to allow optional recursive drive scan at startup
    4444  01 Jan 09 GKY Add option to rescan tree container on eject of removable media
     45  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    4546
    4647***********************************************************************/
     
    712713        CHECKBOX        "System", FLE_SYSTEM, 243, 96, 50, 10,
    713714                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    714         CHECKBOX        "Readable", FLE_READABLE, 4, 80, 58, 10,
    715                         BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    716         CHECKBOX        "Writeable", FLE_WRITEABLE, 67, 80, 58, 10,
    717                         BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    718         CHECKBOX        "Open", FLE_OPEN, 131, 80, 40, 10, BS_NOPOINTERFOCUS |
     715        CHECKBOX        "Readable", FLE_READABLE, 4, 80, 38, 10,
     716                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     717        CHECKBOX        "Writeable", FLE_WRITEABLE, 55, 80, 38, 10,
     718                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     719        CHECKBOX        "Open", FLE_OPEN, 101, 80, 30, 10, BS_NOPOINTERFOCUS |
    719720                        NOT WS_TABSTOP
    720         CONTROL         "Is Archive", FLE_ISARCHIVE, 176, 80, 58, 10,
     721        CONTROL         "Is Archive", FLE_ISARCHIVE, 177, 80, 35, 10,
    721722                        WC_BUTTON, BS_3STATE | BS_NOPOINTERFOCUS |
    722723                        WS_VISIBLE
    723         CONTROL         "Is Binary", FLE_BINARY, 276, 80, 54, 10, WC_BUTTON,
     724        CONTROL         "Is Binary", FLE_BINARY, 135, 80, 35, 10, WC_BUTTON,
    724725                        BS_3STATE | BS_NOPOINTERFOCUS | WS_VISIBLE
    725         LTEXT           "", FLE_ARCNAME, 234, 81, 38, 8
     726        CTEXT           "", FLE_ARCNAME, 213, 78, 93, 8
    726727                        // PRESPARAMS PP_FONTNAMESIZE, "8.Helvetica"
    727728        CHECKBOX        "OS/2 Full screen", FLE_OS2FS, 9, 57, 90, 10,
     
    27822783        AUTOCHECKBOX    "Con~firm target", CFGG_CONFIRMTARGET, 4, 56, 106,
    27832784                        10
     2785        AUTOCHECKBOX    "Alert beep off", CFGG_ALERTBEEPOFF, 4, 44, 106,
     2786                        10
    27842787        LTEXT           "Target directory:", -1, 4, 34, 102, 8
    27852788        ENTRYFIELD      "", CFGG_TARGETDIR, 6, 22, 246, 8, ES_MARGIN
     
    27972800        AUTOCHECKBOX    "Delete = move to ~trashcan", CFGG_TRASHCAN, 122, 56, 126,
    27982801                        10
    2799         LTEXT           "Command line length:", -1, 122, 44, 60, 10, NOT WS_GROUP
    2800         CONTROL         "", CFGG_CMDLNLNGTH, 184, 46, 44, 10, WC_SPINBUTTON,
     2802        AUTOCHECKBOX    "No beep on error", CFGG_ERRORBEEPOFF, 122, 44, 126,
     2803                        10
     2804        LTEXT           "Command line length:", -1, 122, 4, 60, 10, NOT WS_GROUP
     2805        CONTROL         "", CFGG_CMDLNLNGTH, 184, 6, 44, 10, WC_SPINBUTTON,
    28012806                        SPBS_NUMERICONLY | SPBS_MASTER | SPBS_SERVANT |
    28022807                        SPBS_JUSTCENTER | WS_TABSTOP | SPBS_FASTSPIN |
  • trunk/dll/fm3res.rc

    r1394 r1395  
    4545  11 Jan 08 GKY Move strings that will need translating to stringtable from sting file cut to
    4646                255 where necessary
     47  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    4748
    4849***********************************************************************/
     
    24062407    IDS_EDITTEXT                          "Edit"
    24072408    IDS_NOTPROTECTONLYEXE                 "The file %s is a Dos or Windows executible, however Dos and WinOS2 are not currently activated on this system."
     2409    IDS_INIFAILURETEXT                    "Check INI header failed will attempt to replace with backup if backup fails or not found will open with new ini"
    24082410    IDS_SHUTDOWNSTATE                     "FM2Shutdown"
    24092411    IDS_HELPCMDTEXT                       "/HELP"
     
    24502452    IDS_NOKEEPCMDTEXT                     "/NOKEEP"
    24512453    IDS_FILTERCMDTEXT                     "/FILTER"
    2452     IDS_FM2CMDHELPHDRTEXT                 "                                            FM/2 mini-command line help"
     2454    IDS_FM2CMDHELPHDRTEXT                 "FM/2 mini-command line help"
    24532455    IDS_MISSINGTEXT                       "Some text is missing"
    24542456    IDS_TOOLHELPTEXTBLANK                 "You need to provide both button text & help."
     
    26602662    IDS_NOFILESFOUNDTEXT                  "No files found."
    26612663    IDS_VIEWHELPFILESTEXT                 "FM/2: View HELP files"
     2664    IDS_DEBUG_STRING                      "Debug -- please report to author"
    26622665    IDS_GENERR1TEXT                       "\nModule: %s Line number: %u"
    2663     IDS_GENERR2TEXT                       "                                  Error Message Information"
     2666    IDS_GENERR2TEXT                       "Error Message Information"
    26642667    IDS_DOSERR1TEXT                       "\nModule: %s Line number: %u\nOS/2 error: %d\nClass: %s\nAction: %s\nLocation: %s"
    2665     IDS_DOSERR2TEXT                       "                                  OS/2 Error Message Information"
     2668    IDS_DOSERR2TEXT                       "OS/2 Error Message Information"
    26662669    IDS_ERRCLASS1TEXT                     "Out of resource"
    26672670    IDS_ERRCLASS2TEXT                     "Temporary situation"
     
    29152918    IDS_INIPRFRESETFAILEDTEXT             "PrfReset failed."
    29162919    IDS_INISWAPOS2INISTITLETEXT           "FM/2: Swap OS/2 INIs "
    2917     IDS_INIQUERYPRFFAILEDTEXT             "PrfQueryProfile failed."
    29182920    IDS_SUCCESSTEXT                       "Success!"
    29192921    IDS_INIEDITINITITLETEXT               "FM/2: Edit INI entry"
     
    31363138    IDS_CANTLOADHELPTEXT                  "Can't load help.%s"
    31373139    IDS_NOHELPACCEPTTEXT                  "  I'll continue, but you should find FM3.HLP and place it into FM/2's working directory."
    3138     IDS_MISMATCHTITLETEXT                 "                        EXE/DLL Mismatch warning!"
     3140    IDS_MISMATCHTITLETEXT                 "EXE/DLL Mismatch warning!"
    31393141    IDS_MISMATCHTEXT                      "The EXE file you're running is from a newer version than the DLL. Please reinstall _all_ the files from the warpin archive so that FM/2 can run properly (overwrite existing files, and be sure that no parts of FM/2 are running while you reinstall)."
    31403142    IDS_CHECKSYSTEMCLOCKTEXT              "Check your system clock."
     
    32293231    IDS_TREESTATUSSTARTTEXT               " [%c:  \"%s\"  SN: %08lx%s]"
    32303232    IDS_GREPFILETEXT                      "; FM/2 seek and scan mask file, one mask set per line\n"
    3231     IDS_WINCREATEWINDOW                   "WinCreateWindow"
    32323233    IDS_CMINSERTERRTEXT                   "Record insert failed"
    32333234    IDS_CMALLOCRECERRTEXT                 "Record allocation failed"
    3234     IDS_PRFQUERYPROFILESIZE               "PrfQueryProfileSize"
    3235     IDS_PRFQUERYPROFILEDATA               "PrfQueryProfileData"
    3236     IDS_FILLDIRQCURERRTEXT                "DosQCurDisk failed"
    32373235    IDS_NOWINDOWTEXT                      "No window"
    32383236    IDS_MAKEARCTITLETEXT                  "FM/2: Makearc\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32"
     
    32503248    IDS_CLEARTARGETTEXT                   "Do you want to clear the Target directory (in other words, have no preset Target directory)?"
    32513249    IDS_TARGETDIRTITLETEXT                "Target:\32"
    3252     IDS_SUGGESTTITLETEXT                  "                        FM/2 startup suggestion:\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32"
     3250    IDS_SUGGESTTITLETEXT                  "FM/2 startup suggestion:\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32"
    32533251    IDS_SUGGEST2TEXT                      " -- this includes one or more drives you had excluded, by the way"
    32543252    IDS_NOTEBUBBLE1TEXT                   "~Bubbles"
  • trunk/dll/fm3str.h

    r1394 r1395  
    2828                255 where necessary
    2929  04 Feb 09 SHL Switch to STRINGTABLE
     30  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    3031
    3132***********************************************************************/
     
    8788#define IDS_10SYSPROTEXT                                      49
    8889#define IDS_NOTPROTECTONLYEXE                                 50
     90#define IDS_INIFAILURETEXT                                    51
    8991#define IDS_8HELVTEXT                                         52
    9092#define IDS_6HELVTEXT                                         53
     
    593595#define IDS_INSTANTHELPTITLETEXT                              563
    594596#define IDS_INSTANTHELPTEXT                                   564
    595 //Moved codepages to a character array in codepage.c 11 Jan 09 GKY
     597//Moved codepages to a character array in codepage.c 11 Jan 09 GKY 565-588
     598#define IDS_DEBUG_STRING                                      565
    596599#define IDS_DOSSTARTSESSIONFAILEDTEXT                         589
    597600#define IDS_DOSEXECPGMFAILEDTEXT                              590
     
    622625#define IDS_INIPRFRESETFAILEDTEXT                             627
    623626#define IDS_INISWAPOS2INISTITLETEXT                           628
    624 #define IDS_INIQUERYPRFFAILEDTEXT                             629
    625627#define IDS_SUCCESSTEXT                                       630
    626628#define IDS_INIEDITINITITLETEXT                               631
     
    952954#define IDS_TREESTATUSSTARTTEXT                               960
    953955#define IDS_GREPFILETEXT                                      961
    954 #define IDS_WINCREATEWINDOW                                   962
    955956#define IDS_CMINSERTERRTEXT                                   963
    956957#define IDS_CMALLOCRECERRTEXT                                 964
    957 #define IDS_PRFQUERYPROFILESIZE                               965
    958 #define IDS_PRFQUERYPROFILEDATA                               966
    959 #define IDS_FILLDIRQCURERRTEXT                                967
    960958#define IDS_NOWINDOWTEXT                                      968
    961959#define IDS_2SYSTEMVIOTEXT                                    969
  • trunk/dll/grep.c

    r1303 r1395  
    3030  29 Feb 08 GKY Use xfree where appropriate
    3131  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
     32  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    3233
    3334***********************************************************************/
     
    15191520    else {
    15201521      // Insufficient memory - fall back to slow method - fixme to saymsg?
    1521       DosBeep(50, 100);
     1522      if (!fErrorBeepOff)
     1523        DosBeep(50, 100);
    15221524      if (!hwndStatus)
    15231525        WinSetWindowText(grep->hwndCurFile, GetPString(IDS_GREPDUPECOMPARINGTEXT));
  • trunk/dll/grep2.c

    r1394 r1395  
    2424  10 Dec 08 SHL Integrate exception handler support
    2525  01 Jan 09 GKY Add Seek and Scan to drives & directory context menus pass drive/dir as search root
     26  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    2627
    2728  fixme for more excess locals to be gone
     
    157158        bstrip(p);
    158159        if (!*p) {
    159           DosBeep(50, 100);
     160          if (!fAlertBeepOff)
     161            DosBeep(50, 100);
    160162          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, ENV_NAME));
    161163        }
     
    851853        bstrip(p);
    852854        if (!*p) {
    853           DosBeep(50, 100);
     855          if (!fAlertBeepOff)
     856            DosBeep(50, 100);
    854857          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, GREP_MASK));
    855858          free(p);
  • trunk/dll/info.c

    r1391 r1395  
    2929                to prevent duplicate directory names in tree following a copy before initial scan.
    3030  11 Jan 08 GKY Add Write verify off and recures scan to drive info display when appropriate.
     31  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     32  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    3133
    3234***********************************************************************/
     
    657659      CHAR s[97];
    658660      CHAR szCmmaFmtFileSize[81], szCmmaFmtEASize[81];
    659       CHAR szCmmaFmtFileEASize[81], szCmmaFmtFileEASizeK[81];
     661      CHAR szCmmaFmtFileEASize[81], szCmmaFmtFileEASizeK[81], szDate[11];
    660662      FILEFINDBUF4L fs;
    661663      HDIR hdir = HDIR_CREATE;
     
    675677        SHORT sSelect, numitems;
    676678
    677         DosBeep(250, 100);              // Wake up user
     679        if (!fAlertBeepOff)
     680          DosBeep(250, 100);            // Wake up user
    678681        sSelect = (SHORT) WinSendDlgItemMsg(hwnd,
    679682                                            FLE_NAME,
     
    696699      }
    697700      else {
    698         DosFindClose(hdir);
    699         sprintf(s,
    700                 "%04u/%02u/%02u  %02u:%02u:%02u",
    701                 1980 + fs.fdateLastWrite.year,
    702                 fs.fdateLastWrite.month,
    703                 fs.fdateLastWrite.day,
    704                 fs.ftimeLastWrite.hours,
    705                 fs.ftimeLastWrite.minutes, fs.ftimeLastWrite.twosecs * 2);
     701        DosFindClose(hdir);
     702        FDateFormat(szDate, fs.fdateLastWrite);
     703        sprintf(s, "%s  %02u%s%02u%s%02u",
     704                szDate,
     705                fs.ftimeLastWrite.hours, TimeSeparator,
     706                fs.ftimeLastWrite.minutes, TimeSeparator, fs.ftimeLastWrite.twosecs * 2);
    706707        WinSetDlgItemText(hwnd, FLE_LASTWRITE, s);
    707708        if (fs.fdateCreation.year &&
    708             fs.fdateCreation.month && fs.fdateCreation.day) {
    709           sprintf(s,
    710                   "%04u/%02u/%02u  %02u:%02u:%02u",
    711                   1980 + fs.fdateCreation.year,
    712                   fs.fdateCreation.month,
    713                   fs.fdateCreation.day,
    714                   fs.ftimeCreation.hours,
    715                   fs.ftimeCreation.minutes, fs.ftimeCreation.twosecs * 2);
     709            fs.fdateCreation.month && fs.fdateCreation.day) {
     710          FDateFormat(szDate, fs.fdateCreation);
     711          sprintf(s, "%s  %02u%s%02u%s%02u",
     712                  szDate,
     713                  fs.ftimeCreation.hours, TimeSeparator,
     714                  fs.ftimeCreation.minutes, TimeSeparator, fs.ftimeCreation.twosecs * 2);
    716715          WinSetDlgItemText(hwnd, FLE_CREATE, s);
    717716        }
    718717        if (fs.fdateLastAccess.year &&
    719             fs.fdateLastAccess.month && fs.fdateLastAccess.day) {
    720           sprintf(s,
    721                   "%04u/%02u/%02u  %02u:%02u:%02u",
    722                   1980 + fs.fdateLastAccess.year,
    723                   fs.fdateLastAccess.month,
    724                   fs.fdateLastAccess.day,
    725                   fs.ftimeLastAccess.hours,
    726                   fs.ftimeLastAccess.minutes, fs.ftimeLastAccess.twosecs * 2);
     718            fs.fdateLastAccess.month && fs.fdateLastAccess.day) {
     719          FDateFormat(szDate, fs.fdateLastAccess);
     720          sprintf(s, "%s  %02u%s%02u%s%02u",
     721                  szDate,
     722                  fs.ftimeLastAccess.hours, TimeSeparator,
     723                  fs.ftimeLastAccess.minutes, TimeSeparator, fs.ftimeLastAccess.twosecs * 2);
    727724          WinSetDlgItemText(hwnd, FLE_LASTACCESS, s);
    728725        }
  • trunk/dll/inis.c

    r1391 r1395  
    2929  10 Dec 08 SHL Integrate exception handler support
    3030  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     31  07 Feb 09 GKY Move repeated strings to PCSZs.
     32  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     33  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    3134
    3235***********************************************************************/
     
    701704        WinQueryWindowText(hwndMLE, 8192, s);
    702705        if (!*s) {
    703           DosBeep(250, 100);
     706          if (!fAlertBeepOff)
     707            DosBeep(250, 100);
    704708          break;
    705709        }
     
    722726                                      LM_QUERYITEMCOUNT, MPVOID, MPVOID);
    723727        if (!numitems) {
    724           DosBeep(250, 100);
     728          if (!fAlertBeepOff)
     729            DosBeep(250, 100);
    725730          break;
    726731        }
     
    930935        bstrip(inirec->app2);
    931936        if (!*inirec->app2) {
    932           DosBeep(50, 100);
     937          if (!fAlertBeepOff)
     938            DosBeep(50, 100);
    933939          break;
    934940        }
     
    937943          bstrip(inirec->key2);
    938944          if (!*inirec->key2) {
    939             DosBeep(50, 100);
     945            if (!fAlertBeepOff)
     946              DosBeep(50, 100);
    940947            break;
    941948          }
     
    10051012        else
    10061013          *filename = 0;
    1007         strcat(filename, "*.INI");
     1014        strcat(filename, PCSZ_STARDOTINI);
    10081015        if (insert_filename(hwnd, filename, TRUE, FALSE) && *filename)
    10091016          WinSetDlgItemText(hwnd, id, filename);
     
    11141121        else
    11151122          *filename = 0;
    1116         strcat(filename, "*.INI");
     1123        strcat(filename, PCSZ_STARDOTINI);
    11171124        if (insert_filename(hwnd, filename, TRUE, FALSE) && *filename)
    11181125          WinSetDlgItemText(hwnd, id, filename);
     
    11451152        prfp.pszSysName = (PSZ) oldsysini;
    11461153        if (!PrfQueryProfile(WinQueryAnchorBlock(hwnd), &prfp)) {
    1147           Win_Error(hwnd, hwnd, __FILE__, __LINE__,
    1148                     GetPString(IDS_INIQUERYPRFFAILEDTEXT));
     1154          Win_Error(hwnd, hwnd, __FILE__, __LINE__,
     1155                    PCSZ_INIQUERYPRFTEXT);
    11491156          break;
    11501157        }
     
    16411648      if (!inidata || !*inidata->ininame || !*inidata->applname ||
    16421649          !inidata->keyname) {
    1643         DosBeep(50, 100);
     1650        if (!fAlertBeepOff)
     1651          DosBeep(50, 100);
    16441652        break;
    16451653      }
     
    18351843         WS_VISIBLE | LS_HORZSCROLL | LS_NOADJUSTPOS, 0, 0, 0, 0, hwnd,
    18361844         HWND_TOP, INI_APPLIST, NULL, NULL)) {
    1837       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1845      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1846                PCSZ_WINCREATEWINDOW);
    18381847    }
    18391848    if (!WinCreateWindow
     
    18411850         WS_VISIBLE | LS_HORZSCROLL | LS_NOADJUSTPOS, 0, 0, 0, 0, hwnd,
    18421851         HWND_TOP, INI_KEYLIST, NULL, NULL)) {
    1843       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1852      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1853                PCSZ_WINCREATEWINDOW);
    18441854    }
    18451855    if (!WinCreateWindow
     
    18471857         WS_VISIBLE | LS_HORZSCROLL | LS_NOADJUSTPOS, 0, 0, 0, 0, hwnd,
    18481858         HWND_TOP, INI_DATALIST, NULL, NULL)) {
    1849       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1859      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1860                PCSZ_WINCREATEWINDOW);
    18501861    }
    18511862    if (!WinCreateWindow(hwnd, WC_STATIC, (PSZ) NULL, WS_VISIBLE | SS_TEXT |
    18521863                         DT_CENTER | DT_VCENTER, 0, 0, 0, 0, hwnd, HWND_TOP,
    18531864                         INI_NUMAPPS, NULL, NULL)) {
    1854       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1865      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1866                PCSZ_WINCREATEWINDOW);
    18551867    }
    18561868    if (!WinCreateWindow(hwnd, WC_STATIC, (PSZ) NULL, WS_VISIBLE | SS_TEXT |
    18571869                         DT_CENTER | DT_VCENTER, 0, 0, 0, 0, hwnd, HWND_TOP,
    18581870                         INI_NUMKEYS, NULL, NULL)) {
    1859       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1871      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1872                PCSZ_WINCREATEWINDOW);
    18601873    }
    18611874    if (!WinCreateWindow(hwnd, WC_STATIC, (PSZ) NULL, WS_VISIBLE | SS_TEXT |
    18621875                         DT_CENTER | DT_VCENTER, 0, 0, 0, 0, hwnd, HWND_TOP,
    18631876                         INI_NUMDATA, NULL, NULL)) {
    1864       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1877      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1878                PCSZ_WINCREATEWINDOW);
    18651879    }
    18661880    if (!WinCreateWindow(hwnd,
     
    18711885                         0,
    18721886                         0, 0, 0, hwnd, HWND_TOP, INI_APPHDR, NULL, NULL)) {
    1873       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1887      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1888                PCSZ_WINCREATEWINDOW);
    18741889    }
    18751890    if (!WinCreateWindow(hwnd,
     
    18801895                         0,
    18811896                         0, 0, 0, hwnd, HWND_TOP, INI_KEYHDR, NULL, NULL)) {
    1882       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1897      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1898                PCSZ_WINCREATEWINDOW);
    18831899    }
    18841900    if (!WinCreateWindow(hwnd,
     
    18891905                         0,
    18901906                         0, 0, 0, hwnd, HWND_TOP, INI_DATAHDR, NULL, NULL)) {
    1891       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     1907      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     1908                PCSZ_WINCREATEWINDOW);
    18921909    }
    18931910
     
    22722289        }
    22732290      }
    2274       else
    2275         WinSetWindowText(WinQueryWindow(hwnd, QW_PARENT),
    2276                          GetPString(IDS_INIQUERYPRFFAILEDTEXT));
     2291      else {
     2292        CHAR s[100];
     2293
     2294        sprintf(s, PCSZ_INIQUERYPRFTEXT, GetPString(IDS_FAILEDTEXT));
     2295        WinSetWindowText(WinQueryWindow(hwnd, QW_PARENT), s);
     2296      }
    22772297      return 0;
    22782298    }
     
    23272347            rstrip(tofind);
    23282348            if (!*tofind) {
    2329               DosBeep(50, 100);
     2349              if (!fAlertBeepOff)
     2350                DosBeep(50, 100);
    23302351              break;
    23312352            }
     
    23522373                     MPFROM2SHORT(x, 0), MPFROM2SHORT(TRUE, 0));
    23532374        }
    2354         else
     2375        else if (!fAlertBeepOff)
    23552376          DosBeep(250, 100);
    23562377      }
     
    23702391                    hwnd,
    23712392                    FilterIniProc, FM3ModHandle, IAF_FRAME, (PVOID) inidata);
    2372         else
     2393        else if (!fAlertBeepOff)
    23732394          DosBeep(50, 100);
    23742395      }
     
    24932514        else
    24942515          *filename = 0;
    2495         strcat(filename, "*.INI");
     2516        strcat(filename, PCSZ_STARDOTINI);
    24962517        if (export_filename(hwnd, filename, TRUE)) {
    24972518
     
    26342655        else
    26352656          *filename = 0;
    2636         strcat(filename, "*.INI");
     2657        strcat(filename, PCSZ_STARDOTINI);
    26372658        if (insert_filename(hwnd,
    26382659                            filename,
  • 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);
  • trunk/dll/init.h

    r1391 r1395  
    1414                Dos/Win programs from being inserted into the execute dialog with message why.
    1515  11 Jan 09 GKY Move strings that shouldn't be translated (font names etc) compile time variables
     16  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     17  07 Feb 09 GKY Move repeated strings to PCSZs.
     18  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    1619
    1720***********************************************************************/
     
    4245extern CHAR SwapperDat[CCHMAXPATH];
    4346extern CHAR ThousandsSeparator[2];
     47extern CHAR DateSeparator[2];
     48extern CHAR TimeSeparator[2];
     49extern ULONG ulTimeFmt;
     50extern ULONG ulDateFmt;
    4451extern CHAR *FNT_6HELVETICA;
    4552extern CHAR *FNT_8HELVETICA;
     
    5158extern CHAR *FNT_10SYSTEMVIO;
    5259extern CHAR *FNT_8TIMESNEWROMAN;
     60extern PCSZ PCSZ_WINCREATEWINDOW;
     61extern PCSZ PCSZ_INIQUERYPRFTEXT;
     62extern PCSZ PCSZ_FILLDIRQCURERRTEXT;
     63extern PCSZ PCSZ_STARDOTEXE;
     64extern PCSZ PCSZ_STARDOTINI;
     65extern PCSZ PCSZ_STARDOTLST;
    5366extern CHAR *WC_ARCCONTAINER;
    5467extern CHAR *WC_ARCSTATUS;
  • trunk/dll/mainwnd.c

    r1394 r1395  
    7979                Dos/Win programs from being inserted into the execute dialog with message why.
    8080  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     81  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    8182
    8283***********************************************************************/
     
    360361                                       0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
    361362      if (!MainObjectHwnd)
    362         Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
    363                    IDS_WINCREATEWINDOW);
     363        Win_Error(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
     364                  PCSZ_WINCREATEWINDOW);
    364365      else {
    365366        WinSetWindowPtr(MainObjectHwnd, QWL_USER, args);
     
    991992                               HWND_DESKTOP, HWND_TOP, MAIN_HELP, NULL, NULL);
    992993  if (!hwndBubble)
    993     Win_Error2(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
    994                IDS_WINCREATEWINDOW);
     994    Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
     995              PCSZ_WINCREATEWINDOW);
    995996  else {
    996997    HPS hps;
     
    15991600                                 NULL);
    16001601      if (!hwndTool)
    1601         Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    1602                    IDS_WINCREATEWINDOW);
     1602        Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     1603                  PCSZ_WINCREATEWINDOW);
    16031604      tool->flags |= T_TEXT;
    16041605    }
     
    16151616                                 HWND_TOP, tool->id + 25000, NULL, NULL);
    16161617      if (!hwndTool)
    1617         Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    1618                    IDS_WINCREATEWINDOW);
     1618        Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     1619                  PCSZ_WINCREATEWINDOW);
    16191620      else {
    16201621        SetPresParams(hwndTool,
     
    16401641                             13, hwndT, HWND_TOP, IDM_TOOLLEFT, NULL, NULL);
    16411642  if (!hwndTool)
    1642     Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    1643                IDS_WINCREATEWINDOW);
     1643    Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     1644              PCSZ_WINCREATEWINDOW);
    16441645  hwndTool =
    16451646    WinCreateWindow(hwndT, WC_BUTTON, "#6011",
     
    16471648                    13, hwndT, HWND_TOP, IDM_TOOLRIGHT, NULL, NULL);
    16481649  if (!hwndTool)
    1649     Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    1650                IDS_WINCREATEWINDOW);
     1650    Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     1651              PCSZ_WINCREATEWINDOW);
    16511652  if (resize)
    16521653    ResizeTools(hwndT);
     
    22582259                                hwndT, HWND_TOP, y + IDM_DRIVEA, NULL, NULL);
    22592260        if (!hwndB)
    2260           Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    2261                      IDS_WINCREATEWINDOW);
     2261          Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     2262                    PCSZ_WINCREATEWINDOW);
    22622263        else {
    22632264          WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);
     
    22742275                                  HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL);
    22752276          if (!hwndB)
    2276             Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    2277                        IDS_WINCREATEWINDOW);
     2277            Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     2278                      PCSZ_WINCREATEWINDOW);
    22782279          else {
    22792280            //fixme to allow user to change presparams 1-10-09 GKY
     
    25292530                                hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL);
    25302531        if (!hwndB)
    2531           Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     2532          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     2533                    PCSZ_WINCREATEWINDOW);
    25322534        hwndE = WinCreateWindow(hwnd,
    25332535                                WC_ENTRYFIELD,
     
    25402542                                hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL);
    25412543        if (!hwndE)
    2542           Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     2544          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     2545                    PCSZ_WINCREATEWINDOW);
    25432546        if (!hwndE || !hwndB) {
    25442547          PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     
    56225625                                          SV_CYMINMAXBUTTON),
    56235626                         hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) {
    5624       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5627      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5628                PCSZ_WINCREATEWINDOW);
    56255629    }
    56265630    else {
     
    56435647                              22, hwnd, HWND_TOP, IDM_OPENWALK, NULL, NULL);
    56445648    if (!hwndTmp)
    5645       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5649      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5650                PCSZ_WINCREATEWINDOW);
    56465651
    56475652    hwndTmp = WinCreateWindow(hwndFrame,
     
    56555660                              22, hwnd, HWND_TOP, IDM_USERLIST, NULL, NULL);
    56565661    if (!hwndTmp)
    5657       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5662      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5663                PCSZ_WINCREATEWINDOW);
    56585664
    56595665    hwndUserlist = WinCreateWindow(hwndFrame,
     
    56745680                                   MAIN_USERLIST, NULL, NULL);
    56755681    if (!hwndUserlist)
    5676       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5682      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5683                PCSZ_WINCREATEWINDOW);
    56775684    hwndCmdlist = WinCreateWindow(hwndFrame,
    56785685                                  WC_COMBOBOX,
     
    56925699                                  MAIN_CMDLIST, NULL, NULL);
    56935700    if (!hwndCmdlist)
    5694       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5701      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5702                PCSZ_WINCREATEWINDOW);
    56955703    WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT));
    56965704    hwndStatelist = WinCreateWindow(hwndFrame,
     
    57115719                                    MAIN_SETUPLIST, NULL, NULL);
    57125720    if (!hwndStatelist)
    5713       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5721      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5722                PCSZ_WINCREATEWINDOW);
    57145723
    57155724    hwndDrivelist = WinCreateWindow(hwndFrame,
     
    57295738                                    HWND_TOP, MAIN_DRIVELIST, NULL, NULL);
    57305739    if (!hwndDrivelist)
    5731       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5740      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5741                PCSZ_WINCREATEWINDOW);
    57325742    //fixme to allow user to change presparams 1-10-09 GKY
    57335743    SetPresParams(hwndDrivelist,
    5734                   NULL, NULL, NULL, "10.System Monospaced");
     5744                  NULL, NULL, NULL, FNT_10SYSTEMMONOTEXT);
    57355745    hwndButtonlist = WinCreateWindow(hwndFrame,
    57365746                                     WC_COMBOBOX,
     
    57485758                                     MAIN_BUTTONLIST, NULL, NULL);
    57495759    if (!hwndButtonlist)
    5750       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     5760      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     5761                PCSZ_WINCREATEWINDOW);
    57515762    WinSendMsg(WinWindowFromID(hwndUserlist, CBID_EDIT),
    57525763               EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     
    64426453                }
    64436454                else {
    6444                   Win_Error2(hwnd, hwnd, __FILE__, __LINE__,
    6445                              IDS_PRFQUERYPROFILEDATA);
     6455                  Win_Error(hwnd, hwnd, __FILE__, __LINE__,
     6456                            PCSZ_INIQUERYPRFTEXT);
    64466457                }
    64476458              }
  • trunk/dll/menu.c

    r1348 r1395  
    7676}
    7777
     78// fixme why do I exist since the only call passes no filename and FM3MENU.DAT doesn't exist. GKY 1-30-09
    7879BOOL AddToMenu(CHAR * filename, HWND hwndMenu)
    7980{
     
    134135      else {
    135136        // fixme to complain?
    136         // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tokenization failed");
     137        // saymsg(MB_ENTER, HWND_DESKTOP, GetPString(IDS_DEBUG_STRING), "Tokenization failed");
    137138      }
    138139    }
  • trunk/dll/misc.c

    r1394 r1395  
    5353  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
    5454  28 Dec 08 GKY Check for LVM.EXE and remove Refresh removable media menu item as appropriate
     55  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    5556
    5657***********************************************************************/
     
    925926            WinSetWindowText(hwndMLE, szData);
    926927            if (strcmp(szData, testname)) {
    927               if (stricmp(szData, testname) && IsFile(testname) != -1) {
    928                 DosBeep(50, 100);       /* exists; disallow */
     928              if (stricmp(szData, testname) && IsFile(testname) != -1) {
     929                if (!fAlertBeepOff)
     930                  DosBeep(50, 100);       /* exists; disallow */
    929931                return (MRESULT) FALSE;
    930932              }
  • trunk/dll/newview.c

    r1394 r1395  
    3434  10 Dec 08 SHL Integrate exception handler support
    3535  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     36  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     37  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    3638
    3739***********************************************************************/
     
    10951097            DosReleaseMutexSem(ad->ScanSem);
    10961098            if (!ad->stopflag && firstline == ULONG_MAX) {
    1097               DosBeep(50, 50);
     1099              if (!fAlertBeepOff)
     1100                DosBeep(50, 50);
    10981101              WinSetWindowText(WinWindowFromID(ad->hwndFrame,
    10991102                                               NEWVIEW_STATUS1),
     
    12051208              DosReleaseMutexSem(ad->ScanSem);
    12061209              released = TRUE;
    1207               DosBeep(50, 100);
     1210              if (!fAlertBeepOff)
     1211                DosBeep(50, 100);
    12081212              WinSetWindowText(WinWindowFromID(ad->hwndFrame,
    12091213                                               NEWVIEW_STATUS1),
     
    17491753        s[SEARCHSTRINGLEN - 1] = 0;
    17501754        if (!*s) {
    1751           DosBeep(250, 100);            // Complain
     1755          if (!fAlertBeepOff)
     1756            DosBeep(250, 100);          // Complain
    17521757          break;
    17531758        }
     
    18111816                                 HWND_TOP, IDM_PREVBLANKLINE, NULL, NULL);
    18121817      if (!temphwnd)
    1813         Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1814                    IDS_WINCREATEWINDOW);
     1818        Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1819                  PCSZ_WINCREATEWINDOW);
    18151820      else {
    18161821        //fixme to allow user to change presparams 1-10-09 GKY
     
    18321837                                 HWND_TOP, IDM_NEXTBLANKLINE, NULL, NULL);
    18331838      if (!temphwnd)
    1834         Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1835                    IDS_WINCREATEWINDOW);
     1839        Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1840                  PCSZ_WINCREATEWINDOW);
    18361841      else {
    18371842        //fixme to allow user to change presparams 1-10-09 GKY
     
    18961901                                          NEWVIEW_STATUS1, NULL, NULL);
    18971902        if (!ad->hwndStatus1)
    1898           Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1899                      IDS_WINCREATEWINDOW);
     1903          Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1904                    PCSZ_WINCREATEWINDOW);
    19001905
    19011906        ad->hwndStatus2 = WinCreateWindow(hwndFrame,
     
    19121917                                          NEWVIEW_STATUS2, NULL, NULL);
    19131918        if (!ad->hwndStatus2)
    1914           Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1915                      IDS_WINCREATEWINDOW);
     1919          Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1920                    PCSZ_WINCREATEWINDOW);
    19161921
    19171922        ad->hwndStatus3 = WinCreateWindow(hwndFrame,
     
    19281933                                          NEWVIEW_STATUS3, NULL, NULL);
    19291934        if (!ad->hwndStatus3)
    1930           Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1931                      IDS_WINCREATEWINDOW);
     1935          Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1936                    PCSZ_WINCREATEWINDOW);
    19321937
    19331938        ad->hwndListbox = WinCreateWindow(hwndFrame,
     
    19431948                                          NEWVIEW_LISTBOX, NULL, NULL);
    19441949        if (!ad->hwndListbox)
    1945           Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1946                      IDS_WINCREATEWINDOW);
     1950          Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1951                    PCSZ_WINCREATEWINDOW);
    19471952
    19481953        ad->hwndDrag = WinCreateWindow(hwndFrame,
     
    19571962                                       HWND_TOP, NEWVIEW_DRAG, NULL, NULL);
    19581963        if (!ad->hwndDrag)
    1959           Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    1960                      IDS_WINCREATEWINDOW);
     1964          Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     1965                    PCSZ_WINCREATEWINDOW);
    19611966
    19621967        oldproc = WinSubclassWindow(hwndFrame, ViewFrameWndProc);
     
    36213626            }
    36223627            WinSetPointer(HWND_DESKTOP, hptrArrow);
    3623             if (x >= ad->numlines)
     3628            if (x >= ad->numlines && !fAlertBeepOff)
    36243629              DosBeep(50, 100);
    36253630          }
     
    36923697              break;
    36933698            if (ad->numlines <= numlines) {
    3694               DosBeep(500, 100);
     3699              if (!fAlertBeepOff)
     3700                DosBeep(500, 100);
    36953701              break;
    36963702            }
  • trunk/dll/notebook.c

    r1394 r1395  
    4545  01 Jan 09 GKY Add option to rescan tree container on eject of removable media
    4646  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     47  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     48  07 Feb 09 GKY Move repeated strings to PCSZs.
    4749
    4850***********************************************************************/
     
    9496HWND Collector;
    9597DETAILS_SETTINGS dsDirCnrDefault;
     98BOOL fAlertBeepOff;
    9699BOOL fAutoAddAllDirs;
    97100BOOL fAutoAddDirs;
     
    111114BOOL fEjectFlpyScan;
    112115BOOL fEjectRemovableScan;
     116BOOL fErrorBeepOff;
    113117BOOL fExternalArcboxes;
    114118BOOL fExternalCollector;
     
    268272                         SBoxDlgProc, FM3ModHandle, ASEL_FRAME,
    269273                         (PVOID) & pat) || !pat || !pat->id || !*pat->id) {
     274            if (!fAlertBeepOff)
    270275            DosBeep(250, 100);          // Complain
    271276            WinCheckButton(hwnd, CFGA_DEFARC, FALSE);
     
    310315        HWND hwndFocus;
    311316
    312         strcpy(filename, "*.EXE");
     317        strcpy(filename, PCSZ_STARDOTEXE);
    313318        hwndFocus = WinQueryFocus(HWND_DESKTOP);
    314319        if (hwndFocus) {
     
    701706        HWND hwndFocus;
    702707
    703         strcpy(filename, "*.EXE");
     708        strcpy(filename, PCSZ_STARDOTEXE);
    704709        hwndFocus = WinQueryFocus(HWND_DESKTOP);
    705710        if (hwndFocus) {
     
    909914        HWND hwndFocus;
    910915
    911         strcpy(filename, "*.EXE");
     916        strcpy(filename, PCSZ_STARDOTEXE);
    912917        hwndFocus = WinQueryFocus(HWND_DESKTOP);
    913918        if (hwndFocus) {
     
    15111516    WinCheckButton(hwnd, CFGG_DNDDLG, fDragndropDlg);
    15121517    WinCheckButton(hwnd, CFGG_DEFAULTDELETEPERM, fDefaultDeletePerm);
     1518    WinCheckButton(hwnd, CFGG_ERRORBEEPOFF, fErrorBeepOff);
     1519    WinCheckButton(hwnd, CFGG_ALERTBEEPOFF, fAlertBeepOff);
    15131520    {
    15141521      long th = fNoFinger ? 2 : (fNoDead ? 1 : 0);
     
    16291636    fConfirmTarget = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMTARGET);
    16301637    PrfWriteProfileData(fmprof, appname, "ConfirmTarget",
    1631                         &fConfirmTarget, sizeof(BOOL));
     1638                        &fConfirmTarget, sizeof(BOOL));
     1639    fAlertBeepOff = WinQueryButtonCheckstate(hwnd, CFGG_ALERTBEEPOFF);
     1640    PrfWriteProfileData(fmprof, appname, "AlertBeepOff",
     1641                        &fAlertBeepOff, sizeof(BOOL));
     1642    fErrorBeepOff = WinQueryButtonCheckstate(hwnd, CFGG_ERRORBEEPOFF);
     1643    PrfWriteProfileData(fmprof, appname, "ErrorBeepOff",
     1644                        &fErrorBeepOff, sizeof(BOOL));
    16321645    {
    16331646      WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_QUERYVALUE,
     
    17281741        HWND hwndFocus;
    17291742
    1730         strcpy(filename, "*.EXE");
     1743        strcpy(filename, PCSZ_STARDOTEXE);
    17311744        hwndFocus = WinQueryFocus(HWND_DESKTOP);
    17321745        if (hwndFocus) {
  • trunk/dll/notebook.h

    r1375 r1395  
    1414  25 Dec 08 GKY Add ProcessDirectoryThread to allow optional recursive drive scan at startup.
    1515  01 Jan 09 GKY Add option to rescan tree container on eject of removable media
     16  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1617
    1718***********************************************************************/
     
    3233extern DETAILS_SETTINGS dsDirCnrDefault;
    3334extern CHAR extractpath[CCHMAXPATH];
     35extern BOOL fAlertBeepOff;
    3436extern BOOL fAutoAddAllDirs;
    3537extern BOOL fAutoAddDirs;
     
    4951extern BOOL fEjectFlpyScan;
    5052extern BOOL fEjectRemovableScan;
     53extern BOOL fErrorBeepOff;
    5154extern BOOL fExternalArcboxes;
    5255extern BOOL fExternalCollector;
  • trunk/dll/notify.c

    r1394 r1395  
    1616  10 Dec 08 SHL Integrate exception handler support
    1717  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     18  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     19  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    1820
    1921***********************************************************************/
     
    212214                           x, y, cx, cy, hwndP, HWND_TOP, id++, NULL, NULL);
    213215    if (!hwndP)
    214       Win_Error2(hwndP, hwndP, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     216      Win_Error(hwndP, hwndP, pszSrcFile, __LINE__,
     217                PCSZ_WINCREATEWINDOW);
    215218
    216219    if (p != str)
     
    268271      strcat(errortext, GetPString(IDS_DISKLOCKEDTEXT));
    269272  }
    270   DosBeep(250, 10);
    271   DosBeep(500, 10);
    272   DosBeep(250, 10);
    273   DosBeep(500, 10);
     273  if (!fErrorBeepOff) {
     274    DosBeep(250, 10);
     275    DosBeep(500, 10);
     276    DosBeep(250, 10);
     277    DosBeep(500, 10);
     278  }
    274279  Notify(errortext);
    275280}
  • trunk/dll/objwin.c

    r1226 r1395  
    1414  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
    1515  08 Jul 08 SHL Correct Fortify_LeaveScope usage and avoid spurious reports
     16  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    1617
    1718***********************************************************************/
     
    3334#include "objwin.h"
    3435#include "treecnr.h"                    // TreeObjWndProc
    35 
     36#include "strutil.h"                    // GetPString
    3637
    3738static PSZ pszSrcFile = __FILE__;
     
    8384                                   0L, 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
    8485      if (!ObjectHwnd)
    85         Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
    86                    IDS_WINCREATEWINDOW);
     86        Win_Error(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
     87                  PCSZ_WINCREATEWINDOW);
    8788      else {
    8889#       ifdef FORTIFY
  • trunk/dll/printer.c

    r1226 r1395  
    1414  22 Mar 07 GKY Use QWL_USER
    1515  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
     16  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1617
    1718***********************************************************************/
     
    498499          if (atol(s) < 24 || atol(s) > 4096) {
    499500            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_WIDTH));
    500             DosBeep(50, 100);
     501            if (!fAlertBeepOff)
     502              DosBeep(50, 100);
    501503            break;
    502504          }
     
    508510          if (atol(s) < 24 || atol(s) > 4096) {
    509511            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_LENGTH));
    510             DosBeep(50, 100);
     512            if (!fAlertBeepOff)
     513              DosBeep(50, 100);
    511514            break;
    512515          }
     
    518521          if (atol(s) < 0 || atol(s) > prnwidth - 1) {
    519522            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_LMARGIN));
    520             DosBeep(50, 100);
     523            if (!fAlertBeepOff)
     524              DosBeep(50, 100);
    521525            break;
    522526          }
     
    528532          if (atol(s) < 0 || atol(s) > (prnwidth - prnlmargin) - 1) {
    529533            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_RMARGIN));
    530             DosBeep(50, 100);
     534            if (!fAlertBeepOff)
     535              DosBeep(50, 100);
    531536            break;
    532537          }
     
    539544              atol(s) > prnwidth - ((prnlmargin + prnrmargin) - 1)) {
    540545            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_TABSPACES));
    541             DosBeep(50, 100);
     546            if (!fAlertBeepOff)
     547              DosBeep(50, 100);
    542548            break;
    543549          }
     
    549555          if (atol(s) < 0 || atol(s) > prnlength - 1) {
    550556            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_TMARGIN));
    551             DosBeep(50, 100);
     557            if (!fAlertBeepOff)
     558              DosBeep(50, 100);
    552559            break;
    553560          }
     
    559566          if (atol(s) < 0 || atol(s) > (prnlength - prntmargin) - 1) {
    560567            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_BMARGIN));
    561             DosBeep(50, 100);
     568            if (!fAlertBeepOff)
     569              DosBeep(50, 100);
    562570            break;
    563571          }
     
    570578              atol(s) > ((prnlength - prntmargin) - prnbmargin) - 1) {
    571579            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, PRN_SPACING));
    572             DosBeep(50, 100);
     580            if (!fAlertBeepOff)
     581              DosBeep(50, 100);
    573582            break;
    574583          }
  • trunk/dll/rename.c

    r1358 r1395  
    1414  30 Dec 07 GKY Use TestFDates for comparing dates
    1515  25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
     16  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     17  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
    1618
    1719***********************************************************************/
     
    8688
    8789        FILESTATUS3L fs1, fs2;
    88         CHAR s[CCHMAXPATH * 2], *p, chkname[CCHMAXPATH], szCmmaFmtFileSize[81];
     90        CHAR s[CCHMAXPATH * 2], *p, chkname[CCHMAXPATH], szCmmaFmtFileSize[81], szDate[11];
    8991        INT sourceexists = 0, targetexists = 0,
    9092            sourcenewer = 0, sourcesmaller = 0;
     
    103105          CommaFmtULL(szCmmaFmtFileSize,
    104106                      sizeof(szCmmaFmtFileSize), fs1.cbFile, ' ');
    105           sprintf(s,
    106                   " %s%s %ss %04u/%02u/%02u %02u:%02u:%02u",
     107          FDateFormat(szDate, fs1.fdateLastWrite);
     108          sprintf(s, " %s%s %ss %s %02u%s%02u%s%02u",
    107109                  fs1.attrFile & FILE_DIRECTORY ?
    108110                    GetPString(IDS_DIRBRKTTEXT) : NullStr,
    109111                  szCmmaFmtFileSize,
    110112                  GetPString(IDS_BYTETEXT),
    111                   fs1.fdateLastWrite.year + 1980,
    112                   fs1.fdateLastWrite.month,
    113                   fs1.fdateLastWrite.day,
    114                   fs1.ftimeLastWrite.hours,
    115                   fs1.ftimeLastWrite.minutes, fs1.ftimeLastWrite.twosecs * 2);
     113                  szDate,
     114                  fs1.ftimeLastWrite.hours, TimeSeparator,
     115                  fs1.ftimeLastWrite.minutes, TimeSeparator, fs1.ftimeLastWrite.twosecs * 2);
    116116          WinSetDlgItemText(hwnd, REN_SOURCEINFO, s);
    117117          sourceexists = 1;
     
    131131          CommaFmtULL(szCmmaFmtFileSize,
    132132                      sizeof(szCmmaFmtFileSize), fs2.cbFile, ' ');
    133           sprintf(s,
    134                   " %s%s %ss %04u/%02u/%02u %02u:%02u:%02u",
     133          FDateFormat(szDate, fs2.fdateLastWrite);
     134          sprintf(s, " %s%s %ss %s %02u%s%02u%s%02u",
    135135                  fs2.attrFile & FILE_DIRECTORY ?
    136136                    GetPString(IDS_DIRBRKTTEXT) : NullStr,
    137137                  szCmmaFmtFileSize,
    138138                  GetPString(IDS_BYTETEXT),
    139                   fs2.fdateLastWrite.year + 1980,
    140                   fs2.fdateLastWrite.month,
    141                   fs2.fdateLastWrite.day,
    142                   fs2.ftimeLastWrite.hours,
    143                   fs2.ftimeLastWrite.minutes, fs2.ftimeLastWrite.twosecs * 2);
     139                  szDate,
     140                  fs2.ftimeLastWrite.hours, TimeSeparator,
     141                  fs2.ftimeLastWrite.minutes, TimeSeparator, fs2.ftimeLastWrite.twosecs * 2);
    144142          WinSetDlgItemText(hwnd, REN_TARGETINFO, s);
    145143          targetexists = 1;
     
    327325            if (SetDir(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
    328326                                      QW_OWNER), hwnd, path, 0)) {
    329               DosBeep(250, 100);
     327              if (!fAlertBeepOff)
     328                DosBeep(250, 100);
    330329              WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, REN_TARGET));
    331330              break;
     
    335334        }
    336335        else {
    337           DosBeep(250, 100);
     336          if (!fAlertBeepOff)
     337            DosBeep(250, 100);
    338338          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, REN_TARGET));
    339339        }
  • trunk/dll/saveclip.c

    r1226 r1395  
    2525  20 Jul 08 GKY Modify ListtoClipHab to provide either fullpath name or filename for save to clipboard
    2626  24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file
     27  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
     28  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     29  07 Feb 09 GKY Move repeated strings to PCSZs.
    2730
    2831***********************************************************************/
     
    376379        WinQueryDlgItemText(hwnd, SAV_FILENAME, CCHMAXPATH, savename);
    377380        if (!*savename)
    378           strcpy(savename, "*.LST");
     381          strcpy(savename, PCSZ_STARDOTLST);
    379382        if (export_filename(hwnd, savename, 1) && *savename) {
    380383          if (!strchr(savename, '.'))
     
    401404        if (!*pattern) {
    402405          WinEnableWindow(hwnd, TRUE);
    403           DosBeep(150, 100);
     406          if (!fAlertBeepOff)
     407            DosBeep(150, 100);
    404408          break;
    405409        }
     
    437441        if (!*pattern) {
    438442          WinEnableWindow(hwnd, TRUE);
    439           DosBeep(250, 100);
     443          if (!fAlertBeepOff)
     444            DosBeep(250, 100);
    440445          break;
    441446        }
     
    446451        if (!*savename) {
    447452          WinEnableWindow(hwnd, TRUE);
    448           DosBeep(100, 100);
     453          if (!fAlertBeepOff)
     454            DosBeep(100, 100);
    449455          break;
    450456        }
     
    506512                      break;
    507513                    case 'd':
    508                     case 'D':
    509                       fprintf(fp,
    510                               "%04u/%02u/%02u",
    511                               pci->date.year, pci->date.month, pci->date.day);
    512                       break;
     514                    case 'D':
     515                      {
     516                        CHAR szDate[11];
     517
     518                        DateFormat(szDate, pci->date);
     519                        fprintf(fp,"%s", szDate);
     520                        break;
     521                      }
    513522                    case 't':
    514523                    case 'T':
    515524                      fprintf(fp,
    516                               "%02u:%02u:%02u",
    517                               pci->time.hours,
    518                               pci->time.minutes, pci->time.seconds);
     525                              "%02u%s%02u%s%02u",
     526                              pci->time.hours, TimeSeparator,
     527                              pci->time.minutes, TimeSeparator, pci->time.seconds);
    519528                      break;
    520529                    case 'l':
     
    731740        WinQueryDlgItemText(hwnd, SAV_FILENAME, CCHMAXPATH, savename);
    732741        if (!*savename)
    733           strcpy(savename, "*.LST");
     742          strcpy(savename, PCSZ_STARDOTLST);
    734743        if (export_filename(hwnd, savename, 1) && *savename) {
    735744          if (!strchr(savename, '.'))
     
    758767        if (!*pattern) {
    759768          WinEnableWindow(hwnd, TRUE);
    760           DosBeep(150, 100);
     769          if (!fAlertBeepOff)
     770            DosBeep(150, 100);
    761771          break;
    762772        }
     
    794804        if (!*pattern) {
    795805          WinEnableWindow(hwnd, TRUE);
    796           DosBeep(250, 100);
     806          if (!fAlertBeepOff)
     807            DosBeep(250, 100);
    797808          break;
    798809        }
     
    803814        if (!*savename) {
    804815          WinEnableWindow(hwnd, TRUE);
    805           DosBeep(100, 100);
     816          if (!fAlertBeepOff)
     817            DosBeep(100, 100);
    806818          break;
    807819        }
     
    945957                      break;
    946958                    case 'd':
    947                     case 'D':
    948                       fprintf(fp,
    949                               "%04u/%02u/%02u",
    950                               ffb4.fdateLastWrite.year + 1980,
    951                               ffb4.fdateLastWrite.month,
    952                               ffb4.fdateLastWrite.day);
    953                       break;
     959                    case 'D':
     960                      {
     961                        CHAR szDate[11];
     962
     963                        FDateFormat(szDate, ffb4.fdateLastWrite);
     964                        fprintf(fp,"%s", szDate);
     965                        break;
     966                      }
    954967                    case 't':
    955968                    case 'T':
    956969                      fprintf(fp,
    957                               "%02u:%02u:%02u",
    958                               ffb4.ftimeLastWrite.hours,
    959                               ffb4.ftimeLastWrite.minutes,
     970                              "%02u%s%02u%s%02u",
     971                              ffb4.ftimeLastWrite.hours,
     972                              TimeSeparator,
     973                              ffb4.ftimeLastWrite.minutes,
     974                              TimeSeparator,
    960975                              ffb4.ftimeLastWrite.twosecs * 2);
    961976                      break;
  • trunk/dll/seeall.c

    r1394 r1395  
    4242  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
    4343  11 Jan 08 GKY Change flag on GetMLEFont to 3 from 11 to give a larger selection of mono spaced fonts
     44  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     45  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
     46  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    4447
    4548***********************************************************************/
     
    10281031                      (hs > 1) ?
    10291032                      GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
    1030             if (ro || hs || sysdir)
     1033            if ((ro || hs || sysdir) && !fAlertBeepOff)
    10311034              DosBeep(300, 100);
    10321035            strcat(prompt, GetPString(IDS_DELPROMPT6TEXT));
     
    11501153                x != 1 ? GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
    11511154        WinSetWindowText(WinWindowFromID(hwndFrame, SEEALL_STATUS), message);
    1152         if (toupper(*path) < 'C')
     1155        if (toupper(*path) < 'C' && !fAlertBeepOff)
    11531156          DosBeep(1000, 25);
    11541157        DosSleep(16);                   // 05 Aug 07 GKY 33
     
    12101213                                  0, 0, HWND_TOP, SEEALL_OBJ, NULL, NULL);
    12111214        if (!hwndObj) {
    1212           Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
    1213                      IDS_WINCREATEWINDOW);
     1215          Win_Error(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
     1216                    PCSZ_WINCREATEWINDOW);
    12141217          if (!PostMsg(ad->hwndClient, WM_CLOSE, MPVOID, MPVOID))
    12151218            WinSendMsg(ad->hwndClient, WM_CLOSE, MPVOID, MPVOID);
     
    16521655                  &d2->date, &d2->time,
    16531656                  &d1->date, &d1->time);
    1654     /*(d1->date.year > d2->date.year) ? 1 :
    1655     (d1->date.year < d2->date.year) ? -1 :
    1656     (d1->date.month > d2->date.month) ? 1 :
    1657     (d1->date.month < d2->date.month) ? -1 :
    1658     (d1->date.day > d2->date.day) ? 1 :
    1659     (d1->date.day < d2->date.day) ? -1 :
    1660     (d1->time.hours > d2->time.hours) ? 1 :
    1661     (d1->time.hours < d2->time.hours) ? -1 :
    1662     (d1->time.minutes > d2->time.minutes) ? 1 :
    1663     (d1->time.minutes < d2->time.minutes) ? -1 :
    1664     (d1->time.twosecs > d2->time.twosecs) ? 1 :
    1665     (d1->time.twosecs < d2->time.twosecs) ? -1 : 0;*/
    16661657
    16671658  if (!ret)
     
    23362327  ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
    23372328  POINTL ptl;
    2338   CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81];
     2329  CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81], szDate[11];
    23392330  ULONG len, y;
    23402331
     
    23712362  }
    23722363  CommaFmtULL(szCmmaFmtFileSize,
    2373               sizeof(szCmmaFmtFileSize), ad->afindex[y]->cbFile, ' ');
     2364              sizeof(szCmmaFmtFileSize), ad->afindex[y]->cbFile, ' ');
     2365  FDateFormat(szDate, ad->afindex[y]->date);
    23742366  len = sprintf(szBuff,
    2375                 "%c%-*.*s  %-12s  %c%c%c%c%c  %04u/%02u/%02u %02u:%02u:%02u ",
     2367                "%c%-*.*s  %-12s  %c%c%c%c%c  %s %02u%s%02u%s%02u ",
    23762368                whichfile == ad->cursored - 1 ? '>' : ' ',
    23772369                ad->fullnames ? ad->longestw : ad->longest,
     
    23852377                "-S"[((ad->afindex[y]->attrFile & FILE_SYSTEM) != 0)],
    23862378                "-D"[((ad->afindex[y]->attrFile & FILE_DIRECTORY) != 0)],
    2387                 ad->afindex[y]->date.year + 1980,
    2388                 ad->afindex[y]->date.month,
    2389                 ad->afindex[y]->date.day,
    2390                 ad->afindex[y]->time.hours,
    2391                 ad->afindex[y]->time.minutes,
     2379                szDate,
     2380                ad->afindex[y]->time.hours, TimeSeparator,
     2381                ad->afindex[y]->time.minutes, TimeSeparator,
    23922382                ad->afindex[y]->time.twosecs * 2);
    23932383  GpiCharStringAt(hps, &ptl, len, szBuff);
     
    26532643                                            SEEALL_STATUS, NULL, NULL);
    26542644          if (!pAD->hwndStatus)
    2655             Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
    2656                        IDS_WINCREATEWINDOW);
     2645            Win_Error(hwndFrame, hwnd, pszSrcFile, __LINE__,
     2646                      PCSZ_WINCREATEWINDOW);
    26572647          else {
    26582648            PFNWP oldproc;
     
    34403430      pAD->multiplier = 1;
    34413431      if (!pAD->afindexcnt) {
    3442         DosBeep(250, 50);
     3432        if (!fAlertBeepOff)
     3433          DosBeep(250, 50);
    34433434        PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
    34443435      }
    34453436      else {
    3446         DosBeep(1000, 25);
     3437        if (!fAlertBeepOff)
     3438          DosBeep(1000, 25);
    34473439        WinInvalidateRect(hwnd, NULL, FALSE);
    34483440        PostMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
     
    34673459      register ULONG x;
    34683460      ULONG y, len, numlines;
    3469       CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81];
     3461      CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81], szDate[11];
    34703462      BOOL inverted, hidsys, reado, wascursored;
    34713463
     
    35553547                                             [COLORS_CURSOREDNORMALBACK]]);
    35563548            CommaFmtULL(szCmmaFmtFileSize,
    3557                         sizeof(szCmmaFmtFileSize), pAD->afindex[y]->cbFile, ' ');
     3549                        sizeof(szCmmaFmtFileSize), pAD->afindex[y]->cbFile, ' ');
     3550            FDateFormat(szDate, pAD->afindex[y]->date);
    35583551            len =
    35593552              sprintf(szBuff,
    3560                       "%c%-*.*s  %-12s  %c%c%c%c%c  %04u/%02u/%02u %02u:%02u:%02u ",
     3553                      "%c%-*.*s  %-12s  %c%c%c%c%c  %s %02u%s%02u%s%02u ",
    35613554                      wascursored ? '>' : ' ',
    35623555                      pAD->fullnames ? pAD->longestw : pAD->longest,
     
    35703563                      "-H"[((pAD->afindex[y]->attrFile & FILE_HIDDEN) != 0)],
    35713564                      "-S"[((pAD->afindex[y]->attrFile & FILE_SYSTEM) != 0)],
    3572                       "-D"[((pAD->afindex[y]->attrFile & FILE_DIRECTORY) !=
    3573                             0)], pAD->afindex[y]->date.year + 1980,
    3574                       pAD->afindex[y]->date.month, pAD->afindex[y]->date.day,
    3575                       pAD->afindex[y]->time.hours,
    3576                       pAD->afindex[y]->time.minutes,
     3565                      "-D"[((pAD->afindex[y]->attrFile & FILE_DIRECTORY) != 0)],
     3566                      szDate,
     3567                      pAD->afindex[y]->time.hours, TimeSeparator,
     3568                      pAD->afindex[y]->time.minutes, TimeSeparator,
    35773569                      pAD->afindex[y]->time.twosecs * 2);
    35783570            GpiCharStringAt(hpsp, &ptl, len, szBuff);
  • trunk/dll/tools.c

    r1348 r1395  
    2222  26 Aug 08 GKY Require unique ID plus text and help strings for all tools save toolbar on button delete
    2323  01 Sep 08 GKY Save toolbars immediately on change.
     24  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    2425
    2526***********************************************************************/
     
    784785        WinQueryDlgItemText(hwnd, ADDBTN_ID, 6, idstr);
    785786        if (!(USHORT) atoi(idstr)) {
    786           DosBeep(250, 100);
     787          if (!fAlertBeepOff)
     788            DosBeep(250, 100);
    787789          break;
    788790        }
     
    832834        WinQueryDlgItemText(hwnd, ADDBTN_ID, 6, idstr);
    833835        if (!(USHORT) atoi(idstr)) {
    834           DosBeep(250, 100);
     836          if (!fAlertBeepOff)
     837            DosBeep(250, 100);
    835838          break;
    836839        }
  • trunk/dll/treecnr.c

    r1394 r1395  
    5959  01 Jan 09 GKY Add Seek and Scan to drives & directory context menus pass drive/dir as search root
    6060  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     61  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     62  07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
     63  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    6164
    6265***********************************************************************/
     
    12201223          WinSetWindowText(WinWindowFromID(dcd->hwndFrame,
    12211224                                           MAIN_STATUS), pci->pszFileName);
    1222         if (fMoreButtons && hwndName) {
     1225        if (fMoreButtons && hwndName) {
     1226          CHAR szDate[11];
     1227
     1228          DateFormat(szDate, pci->date);
    12231229          WinSetWindowText(hwndName, pci->pszFileName);
    1224           sprintf(str,
    1225                   "%04u/%02u/%02u %02u:%02u:%02u",
    1226                   pci->date.year,
    1227                   pci->date.month,
    1228                   pci->date.day,
    1229                   pci->time.hours, pci->time.minutes, pci->time.seconds);
     1230          sprintf(str, "%s %02u%s%02u%s%02u", szDate,
     1231                  pci->time.hours, TimeSeparator,
     1232                  pci->time.minutes, TimeSeparator, pci->time.seconds);
    12301233          WinSetWindowText(hwndDate, str);
    12311234          WinSetWindowText(hwndAttr, pci->pszDispAttr);
     
    18371840                UnFlesh(hwnd, pci);
    18381841                PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
    1839                 DosBeep(250, 100);
     1842                if (!fAlertBeepOff)
     1843                  DosBeep(250, 100);
    18401844              }
    18411845            }
     
    19051909          !(pci->flags & RECFLAGS_ENV) && IsFullName(pci->pszFileName)) {
    19061910        if (driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_INVALID) {
    1907           DosBeep(50, 100);
     1911          if (!fAlertBeepOff)
     1912            DosBeep(50, 100);
    19081913          if (hwndStatus)
    19091914            WinSetWindowText(hwndStatus, GetPString(IDS_RESCANSUGTEXT));
     
    32083213                                              SV_CYMINMAXBUTTON), hwndFrame,
    32093214                                              HWND_TOP, IDM_OPENWINDOW, NULL, NULL)) {
    3210           Win_Error2(hwndFrame, hwndParent, pszSrcFile, __LINE__,
    3211                      IDS_WINCREATEWINDOW);
     3215          Win_Error(hwndFrame, hwndParent, pszSrcFile, __LINE__,
     3216                    PCSZ_WINCREATEWINDOW);
    32123217        }
    32133218      }
     
    32253230                                             * 2), 22, hwndFrame, HWND_TOP,
    32263231                             MAIN_STATUS, NULL, NULL)) {
    3227           Win_Error2(hwndFrame, hwndParent, pszSrcFile, __LINE__,
    3228                      IDS_WINCREATEWINDOW);
     3232          Win_Error(hwndFrame, hwndParent, pszSrcFile, __LINE__,
     3233                    PCSZ_WINCREATEWINDOW);
    32293234        }
    32303235      }
     
    32583263                                     HWND_TOP, (ULONG) TREE_CNR, NULL, NULL);
    32593264      if (!dcd->hwndCnr) {
    3260         Win_Error2(hwndClient, hwndClient, pszSrcFile, __LINE__,
    3261                    IDS_WINCREATEWINDOW);
     3265        Win_Error(hwndClient, hwndClient, pszSrcFile, __LINE__,
     3266                  PCSZ_WINCREATEWINDOW);
    32623267        PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    32633268        free(dcd);
  • trunk/dll/uudecode.c

    r1228 r1395  
    1616  22 Mar 07 GKY Use QWL_USER
    1717  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
     18  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1819
    1920***********************************************************************/
     
    343344        WinQueryDlgItemText(hwnd, MRG_TARGETNAME, CCHMAXPATH, szBuffer);
    344345        if (!*szBuffer) {
    345           DosBeep(50, 100);
     346          if (!fAlertBeepOff)
     347            DosBeep(50, 100);
    346348          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, MRG_TARGETNAME));
    347349          break;
     
    350352                             FIL_QUERYFULLNAME,
    351353                             wk->li->targetpath, CCHMAXPATH)) {
    352           DosBeep(50, 100);
     354          if (!fAlertBeepOff)
     355            DosBeep(50, 100);
    353356          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, MRG_TARGETNAME));
    354357          break;
  • trunk/dll/viewer.c

    r1394 r1395  
    1717  26 Nov 07 GKY Add "Save as" menu option to editor
    1818  29 Feb 08 GKY Refactor global command line variables to notebook.h
     19  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     20  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
    1921
    2022***********************************************************************/
     
    362364                         0,
    363365                         0, 0, hwnd, HWND_TOP, MLE_MLE, MPVOID, MPVOID)) {
    364       Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     366      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     367                PCSZ_WINCREATEWINDOW);
    365368    }
    366369    else {
     
    701704  case WM_COMMAND:
    702705    if (vw->busy && SHORT1FROMMP(mp1) != MLE_QUIT) {
    703       DosBeep(50, 100);
     706      if (!fAlertBeepOff)
     707        DosBeep(50, 100);
    704708      return 0;
    705709    }
     
    807811    case MLE_TOGGLEREADONLY:
    808812      if (vw->busy || vw->hex == 1) {
    809         DosBeep(50, 100);
     813        if (!fAlertBeepOff)
     814          DosBeep(50, 100);
    810815      }
    811816      else {
     
    10881093        sip.title = GetPString(IDS_NVLINEJUMPTITLETEXT);
    10891094        numlines = MLEnumlines(hwndMLE);
    1090         if (!numlines)
    1091           DosBeep(50, 100);
     1095        if (!numlines)
     1096          if (!fAlertBeepOff)
     1097            DosBeep(50, 100);
    10921098        else {
    10931099          sprintf(ss,
  • trunk/dll/viewinf.c

    r1391 r1395  
    1717  10 Dec 08 SHL Integrate exception handler support
    1818  11 Jan 09 GKY Replace font names in the string file with global set at compile in init.c
     19  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     20  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    1921
    2022***********************************************************************/
     
    250252                           swp.cy,
    251253                           hwnd, HWND_TOP, VINF_LISTBOX, NULL, NULL)) {
    252         Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
     254        Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     255                  PCSZ_WINCREATEWINDOW);
    253256      }
    254257      else {
     
    438441                                            MPVOID);
    439442        if (sSelect == LIT_NONE) {
    440           DosBeep(50, 100);
     443          if (!fAlertBeepOff)
     444            DosBeep(50, 100);
    441445          break;
    442446        }
     
    538542                                            MPVOID);
    539543        if (sSelect < 0) {
    540           DosBeep(50, 100);
     544          if (!fAlertBeepOff)
     545            DosBeep(50, 100);
    541546        }
    542547        else {
     
    550555            p = strchr(text, '>');
    551556            if (!p) {
    552               DosBeep(50, 100);
     557              if (!fAlertBeepOff)
     558                DosBeep(50, 100);
    553559              break;
    554560            }
     
    556562            bstrip(p);
    557563            if (!*p)
    558               DosBeep(50, 100);
     564              if (!fAlertBeepOff)
     565                DosBeep(50, 100);
    559566            else
    560567              ViewHelp(p);
  • trunk/dll/worker.c

    r1394 r1395  
    3838  25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session
    3939                to prevent duplicate directory names in tree following a copy before initial scan.
     40  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    4041
    4142***********************************************************************/
     
    10191020                      GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
    10201021              Notify(message);
    1021               if (toupper(*wk->li->targetpath) < 'C')
     1022              if (toupper(*wk->li->targetpath) < 'C' && !fAlertBeepOff)
    10221023                DosBeep(1000, 25);      // Wake up user
    10231024              DosSleep(16);//05 Aug 07 GKY 33
     
    16131614                          (hs > 1) ?
    16141615                          GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
    1615                 if (ro || hs || sysdir)
     1616                if ((ro || hs || sysdir) && !fAlertBeepOff)
    16161617                  DosBeep(300, 100);    // Wake up user
    16171618                strcat(prompt, GetPString(IDS_DELPROMPT6TEXT));
Note: See TracChangeset for help on using the changeset viewer.