Changeset 961


Ignore:
Timestamp:
Feb 18, 2008, 8:25:13 AM (17 years ago)
Author:
Steven Levine
Message:

Restore SaveDirCnrState internal state save logic - accidentally removed
Move save shutdown state name to strings (IDS_SHUTDOWNSTATE, ShutdownState)

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r956 r961  
    3535 o Put hide/remove etc menu options on collector "view" menu (Gregg)
    3636 o Fix trap in seeall cause by pathname(s) that exceed maxpath (Gregg)
     37 o Restore SaveDirCnrState internal state save logic - accidentally removed
     38 o Move save shutdown state name to strings (IDS_SHUTDOWNSTATE, ShutdownState)
    3739
    38403.09
  • trunk/dll/fm3dll.str

    r948 r961  
    740740FM/2:  Tree filter
    741741You have disabled the ability to select more than one object at a time in Directory Containers, the Collector and Archive Containers.  If that's not what you intended, return to the Settings notebook's DirCnrs page and correct the mistake.
    742 
     742Spare 741
    743743Viewers ~2
    744 Default viewers and related controls continued
     744ShutdownState
    745745FM/2: Default DirCnr filter
    746746FM/2: Default Collector filter
  • trunk/dll/fm3str.h

    r953 r961  
    2626// Spares are named IDS_SPARE_### here
    2727// Text in fm3dll.str will contain the notation Spare ###
    28 // Last string reserved for cvs id
     28// Last string in fm3dll.str reserved for cvs id
     29// Set IDS_NUMSTRS to max value here plus 2
    2930
    3031#define IDS_NUMSTRS                                           1009
     
    739740#define IDS_TREEFILTERTITLETEXT                               739
    740741#define IDS_SELECTTYPEERRORTEXT                               740
    741 #define IDS_UNUSED1                                           741
     742#define IDS_SPARE_741                                         741
    742743#define IDS_NOTEVIEWERS3TEXT                                  742
    743 #define IDS_SPARE_743                                         743
     744#define IDS_SHUTDOWNSTATE                                     743
    744745#define IDS_DEFDIRFILTERTITLETEXT                             744
    745746#define IDS_DEFCOLFILTERTITLETEXT                             745
  • trunk/dll/mainwnd.c

    r954 r961  
    18161816        }
    18171817        /* fixme to be gone?
    1818            if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) {
    1819            WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE);
    1820            }
    1821          */
     1818          if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) {
     1819            WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE);
     1820          }
     1821        */
    18221822        PopupMenu(hwnd, hwnd, hwndMenu);
    18231823      }
     
    27732773
    27742774#define STATE_NAME_MAX_BYTES    256
    2775 #define FM2_STATE_AT_CLOSE "LastClose"
    27762775
    27772776INT SaveDirCnrState(HWND hwndClient, PSZ pszStateName)
     
    27972796  }
    27982797
    2799   fIsShutDownState = strcmp(pszStateName, FM2_STATE_AT_CLOSE) == 0;
     2798  fIsShutDownState = strcmp(pszStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0;
    28002799  sprintf(szPrefix, "%s.", pszStateName);
    28012800
     
    29652964  DIRCNRDATA localdcd, *dcd;
    29662965  BOOL fIsShutDownState;
     2966  BOOL fDeleteState;
    29672967
    29682968  if (!pszStateName || !*pszStateName) {
     
    29762976
    29772977  sprintf(szPrefix, "%s.", pszStateName);
    2978   fIsShutDownState = strcmp(pszStateName, FM2_STATE_AT_CLOSE) == 0;
    2979 
     2978
     2979  // If restoring shutdown state bypass no-prescan drives
     2980  fIsShutDownState = strcmp(pszStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0;
     2981  // Delete saved state if restored saved state or internally saved state
     2982  fDeleteState = fIsShutDownState ||
     2983                 strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT)) == 0;
    29802984
    29812985  size = sizeof(SWP);
     
    29902994    WinQueryWindowPos(WinQueryWindow(hwndClient, QW_PARENT), &swpO);
    29912995  }
    2992   // If restoring saved shutdown state, forget info
    2993   if (fIsShutDownState)
     2996  // If restoring saved shutdown state or internally saved state, forget info
     2997  if (fDeleteState)
    29942998    PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    29952999  WinQueryWindowPos(WinQueryWindow(hwndClient, QW_PARENT), &swpN);
     
    30013005  sprintf(szKey, "%sLastTreePos", szPrefix);
    30023006  if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) & swp, &size)) {
    3003     if (fIsShutDownState)
     3007    if (fDeleteState)
    30043008      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30053009    swp.hwnd = hwndTree;
     
    30333037  if (PrfQueryProfileData(fmprof,
    30343038                          FM3Str, szKey, (PVOID) & numsaves, &size) && numsaves) {
    3035     if (fIsShutDownState)
     3039    if (fDeleteState)
    30363040      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30373041    for (x = 0; x < numsaves; x++) {
     
    30393043      size = sizeof(SWP);
    30403044      if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) &swp, &size)) {
    3041         if (fIsShutDownState)
     3045        if (fDeleteState)
    30423046          PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30433047        sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, x);
    30443048        size = sizeof(szDir);
    30453049        if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) {
    3046           // If drive marked no prescan, and restoring shutdown state
     3050          // If restoring shutdown state and drive marked no prescan
    30473051          // bypass window restore
    30483052          if (fIsShutDownState &&
     
    30513055            continue;
    30523056          }
    3053           if (fIsShutDownState)
     3057          if (fDeleteState)
    30543058            PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30553059          localdcd.detailslongname = detailslongname;  // Set default
     
    30633067              size == sizeof(BOOL))
    30643068          {
    3065             if (fIsShutDownState)
     3069            if (fDeleteState)
    30663070              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30673071          }
     
    30763080              size == sizeof(BOOL))
    30773081          {
    3078             if (fIsShutDownState)
     3082            if (fDeleteState)
    30793083              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30803084          }
     
    30893093              size == sizeof(BOOL))
    30903094          {
    3091             if (fIsShutDownState)
     3095            if (fDeleteState)
    30923096              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    30933097          }
     
    31023106              size == sizeof(BOOL))
    31033107          {
    3104             if (fIsShutDownState)
     3108            if (fDeleteState)
    31053109              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31063110          }
     
    31153119              size == sizeof(BOOL))
    31163120          {
    3117             if (fIsShutDownState)
     3121            if (fDeleteState)
    31183122              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31193123          }
     
    31283132              size == sizeof(BOOL))
    31293133          {
    3130             if (fIsShutDownState)
     3134            if (fDeleteState)
    31313135              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31323136          }
     
    31403144              &size) && size == sizeof(BOOL))
    31413145          {
    3142             if (fIsShutDownState)
     3146            if (fDeleteState)
    31433147              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31443148          }
     
    31533157              size == sizeof(BOOL))
    31543158          {
    3155             if (fIsShutDownState)
     3159            if (fDeleteState)
    31563160              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31573161          }
     
    31663170              size == sizeof(BOOL))
    31673171          {
    3168             if (fIsShutDownState)
     3172            if (fDeleteState)
    31693173              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31703174          }
     
    31793183              size == sizeof(BOOL))
    31803184          {
    3181             if (fIsShutDownState)
     3185            if (fDeleteState)
    31823186              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31833187          }
     
    31923196              size == sizeof(BOOL))
    31933197          {
    3194             if (fIsShutDownState)
     3198            if (fDeleteState)
    31953199              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    31963200          }
     
    32053209              size == sizeof(BOOL))
    32063210          {
    3207             if (fIsShutDownState)
     3211            if (fDeleteState)
    32083212              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    32093213          }
     
    32423246                    dcd->sortFlags = SORT_PATHNAME;
    32433247                }
    3244                 if (fIsShutDownState)
     3248                if (fDeleteState)
    32453249                  PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    32463250                size = sizeof(MASK);
     
    32553259                }
    32563260                *(dcd->mask.prompt) = 0;
    3257                 if (fIsShutDownState)
     3261                if (fDeleteState)
    32583262                  PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    32593263                size = sizeof(ULONG);
     
    32823286                  }
    32833287                }
    3284                 if (fIsShutDownState)
     3288                if (fDeleteState)
    32853289                  PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    32863290                if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL))
     
    45534557      WinQueryWindowText(hwndStatelist, STATE_NAME_MAX_BYTES, szStateName);
    45544558      bstrip(szStateName);
    4555       // Ignore request if blank or attempting to using illegal name
    4556       if (*szStateName && stricmp(szStateName, GetPString(IDS_STATETEXT))) {
     4559      // Complain if attempting to use reserved name
     4560      if (stricmp(szStateName, GetPString(IDS_STATETEXT)) == 0 ||
     4561          stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0 ||
     4562          stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0)
     4563      {
     4564        saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,
     4565               GetPString(IDS_WARNINGTEXT),
     4566               "\"%s\" is a reserved state name", szStateName);
     4567      }
     4568      // Ignore request if blank
     4569      else if (*szStateName) {
    45574570        if (SHORT1FROMMP(mp1) == IDM_SAVEDIRCNRSTATE) {
    45584571          // Save
     
    56615674    /* start remaining child windows */
    56625675    if (!fNoSaveState && fSaveState)
    5663       PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(FM2_STATE_AT_CLOSE), MPVOID);
     5676      PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(GetPString(IDS_SHUTDOWNSTATE)), MPVOID);
    56645677    PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2);
    56655678    return 0;
     
    58055818                          "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT));
    58065819        if (!fNoSaveState && fSaveState)
    5807           SaveDirCnrState(hwnd, FM2_STATE_AT_CLOSE);
     5820          SaveDirCnrState(hwnd, GetPString(IDS_SHUTDOWNSTATE));
    58085821      }
    58095822    }
     
    62646277    {
    62656278      // Try to restore saved shutdown state
    6266       char *pszDefaultStateName = xstrdup(FM2_STATE_AT_CLOSE, pszSrcFile, __LINE__);
     6279      char *pszDefaultStateName = xstrdup(GetPString(IDS_SHUTDOWNSTATE),
     6280                                          pszSrcFile, __LINE__);
    62676281      if (pszDefaultStateName) {
    62686282        if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID))
  • trunk/dll/notebook.c

    r959 r961  
    2727  xx Jan 08 JBS Ticket 150: fix/improve save and restore of dir cnr state at FM/2 close/reopen
    2828  15 Feb 08 SHL Rework to support settings menu conditional cascade.  Make more generic
     29  16 Feb 08 SHL Restore SaveDirCnrState internal state save logic - accidentally removed
    2930
    3031***********************************************************************/
     
    13891390                        &fUnHilite, sizeof(BOOL));
    13901391    {
    1391       BOOL dummy = WinQueryButtonCheckstate(hwnd, CFGD_SYNCUPDATES);
    1392 
    1393       if (dummy != fSyncUpdates) {
    1394         fSyncUpdates = dummy;
     1392      BOOL fOldSyncUpdates = WinQueryButtonCheckstate(hwnd, CFGD_SYNCUPDATES);
     1393
     1394      if (fOldSyncUpdates != fSyncUpdates) {
     1395        fSyncUpdates = fOldSyncUpdates;
    13951396        if (hwndMain && !strcmp(realappname, FM3Str)) {
     1397          // Save state and restore to refresh windows with new settings
    13961398          if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) {
    13971399            PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2));
     
    14081410             GetPString(IDS_WARNINGTEXT),
    14091411             GetPString(IDS_SELECTTYPEERRORTEXT));
    1410     break;
     1412    break;                              // WM_CLOSE
    14111413  }
    14121414  return WinDefDlgProc(hwnd, msg, mp1, mp2);
     
    26032605                          swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE);
    26042606        }
    2605       }
    2606       if (hwndMain) {
    26072607        if (MenuInvisible)
    26082608          WinSendMsg(hwndMain, WM_COMMAND,
     
    29212921      return 0;
    29222922    }
     2923    // Save new details settings and refresh windows
    29232924    PrfWriteProfileData(fmprof, appname, "DetailsLongname",
    29242925                        &detailslongname, sizeof(BOOL));
     
    29462947                        &detailsattr, sizeof(BOOL));
    29472948    if (hwndMain) {
     2949      // Save state and restore to refresh windows with new settings
    29482950      if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) {
     2951        // Tell window procedure to close container windows
    29492952        PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2));
     2953        // Restore saved state
    29502954        PostMsg(hwndMain, UM_RESTORE, MPVOID, MPVOID);
    29512955      }
  • trunk/dll/seeall.c

    r958 r961  
    17471747}
    17481748
     1749static VOID FilterAll(HWND hwnd, ALLDATA *ad);
     1750
    17491751static VOID FilterList(HWND hwnd)
    17501752{
Note: See TracChangeset for help on using the changeset viewer.