Changeset 1395 for trunk/dll/saveclip.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/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;
Note: See TracChangeset for help on using the changeset viewer.