Changeset 1128


Ignore:
Timestamp:
Aug 29, 2008, 4:03:23 PM (17 years ago)
Author:
John Small
Message:

Ticket 259: 1) Support save/restore of target dir with states (except FM2Shutdown)

2) Added separate toolbar setting for FM/2 Lite
3) Improved earlier changes for this ticket

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cfgmgr.cmd

    r1125 r1128  
    1414           /UNATTENDED
    1515                   Runs without user interaction/confirmation
     16
     17           /TOOLBARSONLY
     18                   Process toolbar-related files only
    1619
    1720   If CFGMGR.CMD is run without parameters, it will install a default
     
    5659   if cfg.operation = 'INSTALL' then
    5760      if file_exists \= '' then
    58          do
    59             if cfg.defaults = 1 then
    60                if FilesAreDifferent(cfg.file.f.default, cfg.file.f.name) = 1 then
    61                   do
    62                      if cfg.unattended = 0 then
    63                         do
    64                            user_choice = PromptForReplaceOption(f)
    65                            if user_choice == 'Q' then
    66                               signal NormalExit
    67                            if user_choice == 'N' then
    68                               iterate
    69                         end
    70                      /* unattended = 1 or user_choice = 'Y' */
    71                      cfg.errorcode = CfgAction( 'RESETTODEFAULT', f )
    72                   end
     61         if (cfg.toolbarsonly = 0 | cfg.file.f.toolbar = 1) then
     62            do
     63               if cfg.defaults = 1 then
     64                  if FilesAreDifferent(cfg.file.f.default, cfg.file.f.name) = 1 then
     65                     do
     66                        if cfg.unattended = 0 then
     67                           do
     68                              user_choice = PromptForReplaceOption(f)
     69                              if user_choice == 'Q' then
     70                                 signal NormalExit
     71                              if user_choice == 'N' then
     72                                 iterate
     73                           end
     74                        /* unattended = 1 or user_choice = 'Y' */
     75                        cfg.errorcode = CfgAction( 'RESETTODEFAULT', f )
     76                     end
     77                  else
     78                     nop
    7379               else
    74                   nop
    75             else
    76                if (cfg.file.f.toolbar = 1) & (cfg.unattended = 1) then
    77                   call Ticket267Fix cfg.file.f.name
    78          end
     80                  if (cfg.file.f.toolbar = 1) & (cfg.unattended = 1) then
     81                     call Ticket267Fix cfg.file.f.name
     82            end
     83         else
     84            nop
    7985      else
    8086        cfg.errorcode = CfgAction( 'INSTALLDEFAULT', f )
     
    166172   cfg.defaults      = 0
    167173   cfg.unattended    = 0
     174   cfg.toolbarsonly  = 0
    168175   cfg.actionmethod  = 'COPY'       /* The default method of backing up and restoring */
    169176   cfg.backupdir     = '.\User_Config_Backup'
     
    323330         when param = '/DEFAULTS' then
    324331            cfg.defaults = 1
     332         when param = '/TOOLBARSONLY' then
     333            cfg.toolbarsonly = 1
    325334         otherwise
    326335            cfg.errorcode = 2
     
    570579        call SysIni inifile, 'FM/3', 'LastToolbar', LastToolbar
    571580      end
    572    if SysIni(inifile, 'FM/3', 'FM2Shudown.Toolbar') = 'ERROR:' then
     581   if SysIni(inifile, 'FM/3', 'FM2Shutdown.Toolbar') = 'ERROR:' then
    573582                call SysIni inifile, 'FM/3', 'FM2Shutdown.Toolbar', LastToolbar
     583   if SysIni(inifile, 'FM/4', 'Toolbar') = 'ERROR:' then
     584                call SysIni inifile, 'FM/4', 'Toolbar', LastToolbar
    574585return
    575586
  • trunk/dll/mainwnd.c

    r1125 r1128  
    6767  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory
    6868  26 Aug 08 GKY Require unique ID plus text and help strings for all tools save toolbar on button delete
     69  27 Aug 08 JBS Ticket 259: Support saving/restoring toolbars with states
     70  29 Aug 08 JBS Ticket 259: Support saving/restoring target directories with states (except the shutdown state)
    6971
    7072***********************************************************************/
     
    28392841  sprintf(szPrefix, "%s.", pszStateName);
    28402842
    2841   sprintf(szKey, "%sToolbar", szPrefix);
    2842   PrfWriteProfileString(fmprof, FM3Str, szKey, lasttoolbar);
     2843  if (*lasttoolbar) {
     2844    sprintf(szKey, "%sToolbar", szPrefix);
     2845    PrfWriteProfileString(fmprof, FM3Str, szKey, lasttoolbar);
     2846  }
     2847
     2848  if (*targetdir && !fIsShutDownState) {
     2849    sprintf(szKey, "%sTargetDir", szPrefix);
     2850    PrfWriteProfileString(fmprof, FM3Str, szKey, targetdir);
     2851  }
    28432852
    28442853  henum = WinBeginEnumWindows(hwndClient);
     
    30783087    load_tools(NULL);
    30793088    PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);
     3089  }
     3090  size = (ULONG)0;
     3091  sprintf(szKey, "%sTargetDir", szPrefix);
     3092  if (PrfQueryProfileSize(fmprof, FM3Str, szKey, &size) && size)
     3093  {
     3094    PrfQueryProfileData(fmprof, FM3Str, szKey, targetdir, &size);
     3095    PrfWriteProfileString(fmprof, FM3Str, "TargetDir", targetdir);
     3096    SetTargetDir(NULL, TRUE);
    30803097  }
    30813098  size = sizeof(SWP);
  • trunk/dll/mainwnd2.c

    r1125 r1128  
    2424  14 Feb 08 SHL Rework to support settings menu conditional cascade
    2525  29 Feb 08 GKY Use xfree where appropriate
     26  27 Aug 08 JBS Ticket 259: Support saving/restoring toolbars with states
    2627
    2728***********************************************************************/
     
    702703          strcpy(lasttoolbar,
    703704                 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]);
    704           PrfWriteProfileString(fmprof, FM3Str, "LastToolbar", lasttoolbar);
     705//        PrfWriteProfileString(fmprof, FM3Str, "LastToolbar", lasttoolbar);
     706          PrfWriteProfileString(fmprof, appname, "LastToolbar", lasttoolbar);
    705707        }
    706708        PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);
Note: See TracChangeset for help on using the changeset viewer.