Changeset 1395 for trunk/dll/dircnrs.c


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/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);
Note: See TracChangeset for help on using the changeset viewer.