Changeset 892 for trunk/dll


Ignore:
Timestamp:
Dec 28, 2007, 8:20:34 PM (18 years ago)
Author:
Gregg Young
Message:

Dialog and menu changes for mailrun and use of WPURLDEFAULTSETTINGS for runftp and runhttp if not supplied by user (libpathstrict option added)

Location:
trunk/dll
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/fm3dlg.h

    r878 r892  
    661661#define CFGM_SHOWTARGET                 25319
    662662
    663 #define CFGV_FRAME                                                                                      25330
    664 #define CFGV_EDITOR                                                                             25331
    665 #define CFGV_BINED                                                                                      25332
    666 #define CFGV_VIEWER                                                                             25333
    667 #define CFGV_BINVIEW                                                                            25334
    668 #define CFGV_FIND                                                                                       25335
    669 #define CFGV_USENEWVIEWER                                                       25336
     663#define CFGV_FRAME                                                                      25330
     664#define CFGV_EDITOR                                                                     25331
     665#define CFGV_BINED                                                                      25332
     666#define CFGV_VIEWER                                                                     25333
     667#define CFGV_BINVIEW                                                                    25334
     668#define CFGV_FIND                                                                       25335
     669#define CFGV_USENEWVIEWER                                                               25336
    670670#define CFGV_GUESSTYPE                                                                  25337
    671 #define CFGV_HTTPRUN                                                                            25338
    672 #define CFGV_FTPRUN                                                                             25339
     671#define CFGV_PDFVIEWER                                                                  25338
     672#define CFGV_PDFVIEWERDIR                                                               25339
    673673#define CFGV_VIEWCHILD                                                                  25340
    674 #define CFGV_CHECKMM                    25350
     674#define CFGV_CHECKMM                                                                    25341
     675#define CFGV_PDFVIEWERWPSDEFAULT                                                        25342
     676
     677#define CFGH_FRAME                                                                      25344
     678#define CFGH_HTTPVIEWER                                                                 25345
     679#define CFGH_HTTPRUN                                                                    25346
     680#define CFGH_FTPRUN                                                                     25347
     681#define CFGH_RUNFTPWORKDIR                                                              25348
     682#define CFGH_RUNHTTPWORKDIR                                                             25349
     683#define CFGH_VIEWHTTPWORKDIR                                                            25350
     684#define CFGH_RUNMAILWORKDIR                                                             25351
     685#define CFGH_MAILRUN                                                                    25352
     686#define CFGH_USEWPSDEFAULTVIEWER                                                        25353
     687#define CFGH_HTTPRUNWPSDEFAULT                                                          25354
     688#define CFGH_FTPRUNWPSDEFAULT                                                           25355
     689#define CFGH_LIBPATHSTRICTHTTPVIEWER                                                    25356
     690#define CFGH_LIBPATHSTRICTHTTPRUN                                                       25357
     691#define CFGH_LIBPATHSTRICTFTPRUN                                                        25358
     692#define CFGH_FIND                                                                       25359
    675693
    676694#define CFGS_FRAME                                                                                      25360
  • trunk/dll/fm3dll.h

    r888 r892  
    14091409  fFM2Deletes, fAutoAddAllDirs, fConfirmTarget, fChangeTarget,
    14101410  fFirstTime, fShowTarget, fNoFinger, fDrivebarHelp, fCheckMM,
    1411   fSubjectLengthMax, fNoLargeFileSupport;
     1411  fSubjectLengthMax, fNoLargeFileSupport,
     1412  fHttpRunWPSDefault, fFtpRunWPSDefault,
     1413  fLibPathStrictHttpRun, fLibPathStrictFtpRun;
    14121414DATADEF BOOL detailsladate, detailslatime, detailscrdate, detailscrtime,
    14131415  detailslongname, detailsea, detailssize, detailssubject,
     
    14351437DATADEF CHAR archiverbb2[CCHMAXPATH], StopPrinting, profile[CCHMAXPATH];
    14361438DATADEF CHAR appname[12], realappname[12];
    1437 DATADEF CHAR editor[CCHMAXPATH], viewer[CCHMAXPATH],
    1438   virus[CCHMAXPATH], printer[CCHMAXPATH],
     1439DATADEF CHAR editor[CCHMAXPATH], viewer[CCHMAXPATH], virus[CCHMAXPATH],
    14391440  compare[CCHMAXPATH], extractpath[CCHMAXPATH],
    14401441  lastextractpath[CCHMAXPATH], lasttoolbox[CCHMAXPATH],
    14411442  HomePath[CCHMAXPATH], SwapperDat[CCHMAXPATH],
    1442   binview[CCHMAXPATH], bined[CCHMAXPATH],
     1443  binview[CCHMAXPATH], bined[CCHMAXPATH], printer[CCHMAXPATH],
    14431444  dircompare[CCHMAXPATH], szDefArc[CCHMAXPATH],
    1444   ftprun[CCHMAXPATH], ftprund[CCHMAXPATH], httprun[CCHMAXPATH],
    1445   httprund[CCHMAXPATH], targetdir[CCHMAXPATH];
     1445  ftprun[CCHMAXPATH], ftprundir[CCHMAXPATH], httprun[CCHMAXPATH],
     1446  httprundir[CCHMAXPATH], mailrundir[CCHMAXPATH],
     1447  mailrun[CCHMAXPATH], targetdir[CCHMAXPATH];
    14461448DATADEF HMODULE FM3DllHandle, FM3ModHandle;
    14471449DATADEF CHAR *quicktool[50];
  • trunk/dll/fm3dll.str

    r888 r892  
    305305 Internal Viewer
    306306FM/2 Viewer
    307 
    308 
    309 
     307Foreground
     308Background
     309FM/2: 'Editor' colors
    310310archive
    311311Error #%lu accessing "%s"
     
    393393http: background
    394394http: foreground
     395ftp: background
    395396ftp: foreground
    396 ftp: background
     397Mail: backgroung
     398Mail: foreground
    397399FM/2: 'Viewer' colors
    398400Normal cursored background
     
    405407System/Hidden foreground
    406408FM/2: 'See all files' colors
    407 Foreground
    408 Background
    409 FM/2: 'Editor' colors
     409
    410410byte
    411411line
     
    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.
    742742
    743 
    744 
     743Viewers ~2
     744Default viewers and related controls continued
    745745FM/2: Default DirCnr filter
    746746FM/2: Default Collector filter
  • trunk/dll/fm3dll2.h

    r552 r892  
    410410#define IDM_SETTARGET       1154
    411411#define IDM_CLOSETRAY       1155
    412 #define IDM_PARTITIONDF       1156
     412#define IDM_PARTITIONDF     1156
    413413#define IDM_PARTITIONLVMG   1157
    414 #define IDM_PARTITIONFD       1158
     414#define IDM_PARTITIONFD     1158
     415#define IDM_IGNOREMAIL      1159
    415416
    416417#define IDM_UTILITIESMENU   2000
  • trunk/dll/fm3hlp.h

    r552 r892  
    3939#define HELP_UTILITIES              92100
    4040#define HELP_CFGV                   92200
     41#define HELP_CFGH                   92250
    4142#define HELP_SORTBY                 92300
    4243#define HELP_CFGT                   92400
  • trunk/dll/fm3res.dlg

    r831 r892  
    19351935        AUTOCHECKBOX    "Check for multimedia w/ MMPM/2",CFGV_CHECKMM,
    19361936                        132, 128, 154, 10
    1937         AUTOCHECKBOX    "Run Viewer as child session", CFGV_VIEWCHILD, 4,
    1938                         104, 142, 10
    1939         LTEXT           "Run http:", -1, 8, 88, 48, 8
    1940         ENTRYFIELD      "", CFGV_HTTPRUN, 58, 88, 190, 8, ES_MARGIN
    1941         LTEXT           "Run ftp:", -1, 8, 76, 48, 8, NOT WS_GROUP
    1942         ENTRYFIELD      "", CFGV_FTPRUN, 58, 76, 190, 8, ES_MARGIN
    1943         LTEXT           "Editor:", -1, 2, 58, 48, 8
    1944         ENTRYFIELD      "", CFGV_EDITOR, 52, 58, 196, 8, ES_MARGIN
    1945         LTEXT           "Bin.Ed.", -1, 2, 46, 48, 8, NOT WS_GROUP
    1946         ENTRYFIELD      "", CFGV_BINED, 52, 46, 196, 8, ES_MARGIN
    1947         LTEXT           "Viewer:", -1, 2, 34, 48, 8, NOT WS_GROUP
    1948         ENTRYFIELD      "", CFGV_VIEWER, 52, 34, 196, 8, ES_MARGIN
    1949         LTEXT           "Bin.View:", -1, 2, 22, 48, 8, NOT WS_GROUP
    1950         ENTRYFIELD      "", CFGV_BINVIEW, 52, 22, 196, 8, ES_MARGIN
     1937        AUTOCHECKBOX    "Run viewer as child session", CFGV_VIEWCHILD, 132,
     1938                        116, 142, 10
     1939        LTEXT           "Editor:", -1, 2, 78, 68, 8, NOT WS_GROUP
     1940        ENTRYFIELD      "", CFGV_EDITOR, 72, 78, 196, 8, ES_MARGIN
     1941        LTEXT           "Bin.Ed.", -1, 2, 66, 68, 8, NOT WS_GROUP
     1942        ENTRYFIELD      "", CFGV_BINED, 72, 66, 196, 8, ES_MARGIN
     1943        LTEXT           "Viewer:", -1, 2, 54, 68, 8, NOT WS_GROUP
     1944        ENTRYFIELD      "", CFGV_VIEWER, 72, 54, 196, 8, ES_MARGIN
     1945        LTEXT           "Bin.View:", -1, 2, 42, 68, 8, NOT WS_GROUP
     1946        ENTRYFIELD      "", CFGV_BINVIEW, 72, 42, 196, 8, ES_MARGIN
    19511947        PUSHBUTTON      "Find", CFGV_FIND, 218, 4, 36, 12, BS_NOPOINTERFOCUS |
     1948                        NOT WS_TABSTOP
     1949        PUSHBUTTON      "~Help", IDM_HELP, 4, 4, 40, 14, BS_NOPOINTERFOCUS |
     1950                        WS_GROUP
     1951        PUSHBUTTON      "~Undo", IDM_UNDO, 48, 4, 40, 14, BS_NOPOINTERFOCUS
     1952    END
     1953END
     1954
     1955DLGTEMPLATE CFGH_FRAME LOADONCALL MOVEABLE DISCARDABLE
     1956BEGIN
     1957    DIALOG  "", CFGH_FRAME, 0, 0, 258, 142, NOT FS_DLGBORDER | NOT
     1958            WS_SAVEBITS
     1959    BEGIN
     1960        AUTOCHECKBOX    "Use WPS default for run http",
     1961                        CFGH_HTTPRUNWPSDEFAULT, 4, 122, 156, 10
     1962        AUTOCHECKBOX    "Use WPS default for run ftp",
     1963                        CFGH_FTPRUNWPSDEFAULT, 4, 110, 156, 10
     1964        AUTOCHECKBOX    "Use LIBPATHSTRICT for run http",
     1965                        CFGH_LIBPATHSTRICTHTTPRUN, 162, 122, 156, 10
     1966        AUTOCHECKBOX    "Use LIBPATHSTRICT for run ftp",
     1967                        CFGH_LIBPATHSTRICTFTPRUN, 162, 110, 156, 10
     1968        LTEXT           "Run http:", -1, 2, 86, 68, 8
     1969        ENTRYFIELD      "", CFGH_HTTPRUN, 72, 86, 196, 8, ES_MARGIN
     1970        LTEXT           "Run http dir:", -1, 2, 74, 68, 8, NOT WS_GROUP
     1971        ENTRYFIELD      "", CFGH_RUNHTTPWORKDIR, 72, 74, 196, 8, ES_MARGIN
     1972        LTEXT           "Run mail:", -1, 2, 62, 68, 8, NOT WS_GROUP
     1973        ENTRYFIELD      "", CFGH_MAILRUN, 72, 62, 196, 8, ES_MARGIN
     1974        LTEXT           "Run mail dir:", -1, 2, 50, 68, 8, NOT WS_GROUP
     1975        ENTRYFIELD      "", CFGH_RUNMAILWORKDIR, 72, 50, 196, 8, ES_MARGIN
     1976        LTEXT           "Run ftp:", -1, 2, 38, 68, 8, NOT WS_GROUP
     1977        ENTRYFIELD      "", CFGH_FTPRUN, 72, 38, 196, 8, ES_MARGIN
     1978        LTEXT           "Run ftp dir:", -1, 2, 26, 68, 8, NOT WS_GROUP
     1979        ENTRYFIELD      "", CFGH_RUNFTPWORKDIR, 72, 26, 196, 8, ES_MARGIN
     1980        PUSHBUTTON      "Find", CFGH_FIND, 218, 4, 36, 12, BS_NOPOINTERFOCUS |
    19521981                        NOT WS_TABSTOP
    19531982        PUSHBUTTON      "~Help", IDM_HELP, 4, 4, 40, 14, BS_NOPOINTERFOCUS |
  • trunk/dll/fm3res.rc

    r878 r892  
    21332133    MENUITEM "~Ignore http://",     IDM_IGNOREHTTP
    21342134    MENUITEM "I~gnore ftp://",      IDM_IGNOREFTP
     2135    MENUITEM "Ignore ~mail",        IDM_IGNOREMAIL
    21352136    MENUITEM "",                    -1,               MIS_SEPARATOR
    21362137    MENUITEM "~Edit this file\tCtrl + e",IDM_EDIT
  • trunk/dll/fm3str.h

    r878 r892  
    305305#define IDS_INTERNALVIEWERTITLETEXT                           304
    306306#define IDS_FM2VIEWERTITLETEXT                                305
     307#define IDS_EDCOLORS1TEXT                                     306
     308#define IDS_EDCOLORS2TEXT                                     307
     309#define IDS_EDCOLORSPROMPTTEXT                                308
    307310#define IDS_ARCHIVETEXT                                       309
    308311#define IDS_ERRORACCESSTEXT                                   310
     
    392395#define IDS_NVCOLORS11TEXT                                    394
    393396#define IDS_NVCOLORS12TEXT                                    395
    394 #define IDS_NVCOLORSPROMPTTEXT                                396
    395 #define IDS_SACOLORS1TEXT                                     397
    396 #define IDS_SACOLORS2TEXT                                     398
    397 #define IDS_SACOLORS3TEXT                                     399
    398 #define IDS_SACOLORS4TEXT                                     400
    399 #define IDS_SACOLORS5TEXT                                     401
    400 #define IDS_SACOLORS6TEXT                                     402
    401 #define IDS_SACOLORS7TEXT                                     403
    402 #define IDS_SACOLORS8TEXT                                     404
    403 #define IDS_SACOLORSPROMPTTEXT                                405
    404 #define IDS_EDCOLORS1TEXT                                     406
    405 #define IDS_EDCOLORS2TEXT                                     407
    406 #define IDS_EDCOLORSPROMPTTEXT                                408
     397#define IDS_NVCOLORS13TEXT                                    396
     398#define IDS_NVCOLORS14TEXT                                    397
     399#define IDS_NVCOLORSPROMPTTEXT                                398
     400#define IDS_SACOLORS1TEXT                                     399
     401#define IDS_SACOLORS2TEXT                                     400
     402#define IDS_SACOLORS3TEXT                                     401
     403#define IDS_SACOLORS4TEXT                                     402
     404#define IDS_SACOLORS5TEXT                                     403
     405#define IDS_SACOLORS6TEXT                                     404
     406#define IDS_SACOLORS7TEXT                                     405
     407#define IDS_SACOLORS8TEXT                                     406
     408#define IDS_SACOLORSPROMPTTEXT                                407
    407409#define IDS_BYTETEXT                                          409
    408410#define IDS_LINETEXT                                          410
     
    726728#define IDS_SELECTTYPEERRORTEXT                               740
    727729#define IDS_UNUSED1                                           741
    728 #define IDS_UNUSED2                                           742
    729 #define IDS_UNUSED3                                           743
     730#define IDS_NOTEVIEWERS3TEXT                                  742
     731#define IDS_NOTEVIEWERS4TEXT                                  743
    730732#define IDS_DEFDIRFILTERTITLETEXT                             744
    731733#define IDS_DEFCOLFILTERTITLETEXT                             745
  • trunk/dll/init.c

    r888 r892  
    11851185  size = sizeof(virus);
    11861186  PrfQueryProfileData(fmprof, appname, "Virus", virus, &size);
     1187  size = sizeof(BOOL);
     1188  PrfQueryProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, &size);
    11871189  size = sizeof(ftprun);
    11881190  PrfQueryProfileData(fmprof, appname, "FTPRun", ftprun, &size);
    11891191  if (!*ftprun){
    1190     size = sizeof(ftprun);
    1191     PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
    1192                         "DefaultBrowserExe", ftprun, &size);
    1193     PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
    1194                         "DefaultWorkingDir", ftprund, &size);
    1195   }
     1192    fFtpRunWPSDefault = TRUE;
     1193  }
     1194  size = sizeof(BOOL);
     1195  PrfQueryProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, &size);
    11961196  size = sizeof(httprun);
    11971197  PrfQueryProfileData(fmprof, appname, "HTTPRun", httprun, &size);
    11981198  if (!*httprun){
    1199     size = sizeof(httprun);
    1200     PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
    1201                         "DefaultBrowserExe", httprun, &size);
    1202     PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
    1203                         "DefaultWorkingDir", httprund, &size);
    1204   }
     1199    fHttpRunWPSDefault = TRUE;
     1200  }
     1201  size = sizeof(mailrun);
     1202  PrfQueryProfileData(fmprof, appname, "MailRun", mailrun, &size);
     1203  size = sizeof(ftprundir);
     1204  PrfQueryProfileData(fmprof, appname, "FtpRunDir", ftprundir, &size);
     1205  size = sizeof(httprundir);
     1206  PrfQueryProfileData(fmprof, appname, "HttpRunDir", httprundir, &size);
     1207  size = sizeof(mailrundir);
     1208  PrfQueryProfileData(fmprof, appname, "MailRun", mailrun, &size);
    12051209  size = sizeof(lasttoolbox);
    12061210  PrfQueryProfileData(fmprof, FM3Str, "LastToolBox", lasttoolbox,
     1211                      &size);
     1212  size = sizeof(BOOL);
     1213  PrfQueryProfileData(fmprof, appname, "LibPathStrictHttpRun", &fLibPathStrictHttpRun,
     1214                      &size);
     1215  size = sizeof(BOOL);
     1216  PrfQueryProfileData(fmprof, appname, "LibPathStrictFtpRun", &fLibPathStrictFtpRun,
    12071217                      &size);
    12081218  size = sizeof(BOOL);
     
    12891299                      &size);
    12901300  size = sizeof(ULONG);
    1291   PrfQueryProfileData(fmprof, appname, "SubjectDisplayWidth",
    1292                       &SubjectDisplayWidth, &size);
    1293   if (SubjectDisplayWidth < 50)
     1301  size = sizeof(BOOL);
     1302  PrfQueryProfileData(fmprof, appname, "SubjectLengthMax", &fSubjectLengthMax,
     1303                      &size);
     1304  if (fSubjectLengthMax)
    12941305    SubjectDisplayWidth = 0;
    1295   else if (SubjectDisplayWidth > 1000)
    1296     SubjectDisplayWidth = 1000;
    1297   size = sizeof(BOOL);
    1298   PrfQueryProfileData(fmprof, appname, "SubjectLengthMax", &fSubjectLengthMax,
    1299                       &size);
     1306  else {
     1307    PrfQueryProfileData(fmprof, appname, "SubjectDisplayWidth",
     1308                        &SubjectDisplayWidth, &size);
     1309    if (SubjectDisplayWidth < 50)
     1310      SubjectDisplayWidth = 0;
     1311    else if (SubjectDisplayWidth > 1000)
     1312      SubjectDisplayWidth = 1000;
     1313  }
    13001314
    13011315  /* load pointers and icons we use */
  • trunk/dll/mle.c

    r888 r892  
    152152  LONG len, oldlen;
    153153  APIRET rc;
     154  ULONG size;
    154155
    155156  len = MLEsizeofsel(h);
     
    177178        bstripcr(temp);
    178179        if (*temp) {
    179           if (ftp && *ftprun)
    180             runemf2(SEPARATE | WINDOWED,
    181                     h, pszSrcFile, __LINE__,
    182                     ftprund, NULL, "%s %s", ftprun, temp);
    183           else if (!ftp && *httprun)
    184             runemf2(SEPARATE | WINDOWED,
    185                     h, pszSrcFile, __LINE__,
    186                     httprund, NULL, "%s %s", httprun, temp);
     180          if (ftp) {
     181            if (fFtpRunWPSDefault) {
     182              CHAR WPSDefaultFtpRun[CCHMAXPATH], WPSDefaultFtpRunDir[CCHMAXPATH];
     183
     184              size = sizeof(WPSDefaultFtpRun);
     185              PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
     186                                  "DefaultBrowserExe", WPSDefaultFtpRun, &size);
     187              size = sizeof(WPSDefaultFtpRunDir);
     188              PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
     189                                  "DefaultWorkingDir", WPSDefaultFtpRunDir, &size);
     190              runemf2(SEPARATE | WINDOWED,
     191                      h, pszSrcFile, __LINE__,
     192                      WPSDefaultFtpRunDir,
     193                      fLibPathStrictFtpRun ? "SET LIBPATHSTRICT=TRUE" : NULL,
     194                      "%s %s", WPSDefaultFtpRun, temp);
     195            }
     196            else
     197              runemf2(SEPARATE | WINDOWED,
     198                      h, pszSrcFile, __LINE__,
     199                      ftprundir, NULL, "%s %s", ftprun, temp);
     200          }
     201          else
     202            if (fHttpRunWPSDefault) {
     203              CHAR WPSDefaultHttpRun[CCHMAXPATH], WPSDefaultHttpRunDir[CCHMAXPATH];
     204
     205              size = sizeof(WPSDefaultHttpRun);
     206              PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
     207                                  "DefaultBrowserExe", WPSDefaultHttpRun, &size);
     208              size = sizeof(WPSDefaultHttpRunDir);
     209              PrfQueryProfileData(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
     210                                  "DefaultWorkingDir", WPSDefaultHttpRunDir, &size);
     211              runemf2(SEPARATE | WINDOWED,
     212                      h, pszSrcFile, __LINE__,
     213                      WPSDefaultHttpRunDir,
     214                      fLibPathStrictHttpRun ? "SET LIBPATHSTRICT=TRUE" : NULL,
     215                      "%s %s", WPSDefaultHttpRun, temp);
     216            }
     217            else
     218              runemf2(SEPARATE | WINDOWED,
     219                      h, pszSrcFile, __LINE__,
     220                      httprundir, NULL, "%s %s", httprun, temp);
    187221        }
    188222      }
  • trunk/dll/notebook.c

    r888 r892  
    365365    WinSendDlgItemMsg(hwnd, CFGV_BINED, EM_SETTEXTLIMIT,
    366366                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
    367     WinSendDlgItemMsg(hwnd, CFGV_FTPRUN, EM_SETTEXTLIMIT,
    368                       MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
    369     WinSendDlgItemMsg(hwnd, CFGV_HTTPRUN, EM_SETTEXTLIMIT,
    370                       MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
    371367    WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE);
    372368    PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
     
    378374    WinSetDlgItemText(hwnd, CFGV_BINVIEW, binview);
    379375    WinSetDlgItemText(hwnd, CFGV_BINED, bined);
    380     WinSetDlgItemText(hwnd, CFGV_FTPRUN, ftprun);
    381     WinSetDlgItemText(hwnd, CFGV_HTTPRUN, httprun);
    382376    WinCheckButton(hwnd, CFGV_USENEWVIEWER, fUseNewViewer);
    383377    WinCheckButton(hwnd, CFGV_GUESSTYPE, fGuessType);
     
    392386    case CFGV_BINVIEW:
    393387    case CFGV_BINED:
    394     case CFGV_HTTPRUN:
    395     case CFGV_FTPRUN:
    396388      switch (SHORT2FROMMP(mp1)) {
    397389      case EN_KILLFOCUS:
     
    439431          case CFGV_BINED:
    440432          case CFGV_VIEWER:
    441           case CFGV_EDITOR:
     433          case CFGV_EDITOR:
    442434            if (insert_filename(hwnd, filename, 2, FALSE) && *filename) {
    443435              BldQuotedFileName(szfilename, filename);
     
    445437              WinSetDlgItemText(hwnd, id, szfilename);
    446438            }
    447             break;
    448           case CFGV_HTTPRUN:
    449           case CFGV_FTPRUN:
    450             if (insert_filename(hwnd, filename, 2, FALSE) && *filename){
    451               BldQuotedFileName(szfilename, filename);
    452               WinSetDlgItemText(hwnd, id, szfilename);
    453             }
    454439            break;
    455440          default:
     
    503488      if (!strchr(bined, '%') && strlen(bined) > 3)
    504489        strcat(bined, " %a");
    505       WinQueryDlgItemText(hwnd, CFGV_FTPRUN, CCHMAXPATH, szBuf);
    506       szBuf[CCHMAXPATH - 1] = 0;
    507       bstrip(szBuf);
    508       if (!strchr(szBuf, '"'))
    509         BldQuotedFileName(ftprun, szBuf);
    510490      else
    511         memcpy(ftprun, szBuf, strlen(szBuf) + 1);
    512       WinQueryDlgItemText(hwnd, CFGV_HTTPRUN, CCHMAXPATH, szBuf);
    513       szBuf[CCHMAXPATH - 1] = 0;
    514       bstrip(szBuf);
    515       if (!strchr(szBuf, '"'))
    516         BldQuotedFileName(httprun, szBuf);
    517       else
    518         memcpy(httprun, szBuf, strlen(szBuf) + 1);
     491        memcpy(bined, szBuf, strlen(szBuf) + 1);
    519492      PrfWriteProfileString(fmprof, appname, "Viewer", viewer);
    520493      PrfWriteProfileString(fmprof, appname, "Editor", editor);
    521494      PrfWriteProfileString(fmprof, appname, "BinView", binview);
    522495      PrfWriteProfileString(fmprof, appname, "BinEd", bined);
    523 
    524       PrfWriteProfileString(fmprof, appname, "FTPRun", ftprun);
    525       PrfWriteProfileString(fmprof, appname, "HTTPRun", httprun);
    526496      fUseNewViewer = WinQueryButtonCheckstate(hwnd, CFGV_USENEWVIEWER);
    527497      PrfWriteProfileData(fmprof, appname, "UseNewViewer", &fUseNewViewer,
     
    535505      fCheckMM = WinQueryButtonCheckstate(hwnd, CFGV_CHECKMM);
    536506      PrfWriteProfileData(fmprof, appname, "CheckMM", &fCheckMM, sizeof(BOOL));
     507
     508      break;
     509    }
     510  }
     511  return WinDefDlgProc(hwnd, msg, mp1, mp2);
     512}
     513
     514MRESULT EXPENTRY CfgHDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     515{
     516  switch (msg) {
     517  case WM_INITDLG:
     518    WinSendDlgItemMsg(hwnd, CFGH_RUNFTPWORKDIR, EM_SETTEXTLIMIT,
     519                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     520    WinSendDlgItemMsg(hwnd, CFGH_RUNHTTPWORKDIR, EM_SETTEXTLIMIT,
     521                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     522    WinSendDlgItemMsg(hwnd, CFGH_FTPRUN, EM_SETTEXTLIMIT,
     523                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     524    WinSendDlgItemMsg(hwnd, CFGH_HTTPRUN, EM_SETTEXTLIMIT,
     525                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     526    WinSendDlgItemMsg(hwnd, CFGH_MAILRUN, EM_SETTEXTLIMIT,
     527                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     528    WinSendDlgItemMsg(hwnd, CFGH_RUNMAILWORKDIR, EM_SETTEXTLIMIT,
     529                      MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     530    WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), FALSE);
     531    PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
     532    break;
     533
     534  case UM_UNDO:
     535    WinSetDlgItemText(hwnd, CFGH_RUNFTPWORKDIR, ftprundir);
     536    WinSetDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, httprundir);
     537    WinSetDlgItemText(hwnd, CFGH_RUNMAILWORKDIR, mailrundir);
     538    WinSetDlgItemText(hwnd, CFGH_MAILRUN, mailrun);
     539    WinSetDlgItemText(hwnd, CFGH_FTPRUN, ftprun);
     540    WinSetDlgItemText(hwnd, CFGH_HTTPRUN, httprun);
     541    WinCheckButton(hwnd, CFGH_HTTPRUNWPSDEFAULT, fHttpRunWPSDefault);
     542    WinCheckButton(hwnd, CFGH_FTPRUNWPSDEFAULT, fFtpRunWPSDefault);
     543    WinCheckButton(hwnd, CFGH_LIBPATHSTRICTHTTPRUN, fLibPathStrictHttpRun);
     544    WinCheckButton(hwnd, CFGH_LIBPATHSTRICTFTPRUN, fLibPathStrictFtpRun);
     545    return 0;
     546
     547  case WM_CONTROL:
     548    switch (SHORT1FROMMP(mp1)) {
     549    case CFGH_HTTPRUN:
     550    case CFGH_FTPRUN:
     551    case CFGH_RUNFTPWORKDIR:
     552    case CFGH_RUNHTTPWORKDIR:
     553    case CFGH_RUNMAILWORKDIR:
     554    case CFGH_MAILRUN:
     555      switch (SHORT2FROMMP(mp1)) {
     556      case EN_KILLFOCUS:
     557        WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), FALSE);
     558        break;
     559      case EN_SETFOCUS:
     560        WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), TRUE);
     561        break;
     562      }
     563      break;
     564    }
     565    return 0;
     566
     567  case WM_COMMAND:
     568    switch (SHORT1FROMMP(mp1)) {
     569    case IDM_UNDO:
     570      PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
     571      break;
     572
     573    case DID_CANCEL:
     574      WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
     575
     576    case DID_OK:
     577      PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
     578      break;
     579
     580    case IDM_HELP:
     581      if (hwndHelp)
     582        WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
     583                   MPFROM2SHORT(HELP_CFGH, 0), MPFROMSHORT(HM_RESOURCEID));
     584      break;
     585
     586    case CFGH_FIND:
     587      {
     588        CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9];
     589        USHORT id;
     590        HWND hwndFocus;
     591
     592        strcpy(filename, "*.EXE");
     593        hwndFocus = WinQueryFocus(HWND_DESKTOP);
     594        if (hwndFocus) {
     595          id = WinQueryWindowUShort(hwndFocus, QWS_ID);
     596          switch (id) {
     597          case CFGH_HTTPRUN:
     598          case CFGH_FTPRUN:
     599          case CFGH_MAILRUN:
     600            if (insert_filename(hwnd, filename, 2, FALSE) && *filename){
     601              BldQuotedFileName(szfilename, filename);
     602              WinSetDlgItemText(hwnd, id, szfilename);
     603            }
     604            break;
     605          case CFGH_RUNFTPWORKDIR:
     606            strcpy(filename, ftprundir);
     607            if (WinDlgBox(HWND_DESKTOP, hwndNotebook,
     608                          WalkExtractDlgProc, FM3ModHandle, WALK_FRAME,
     609                          MPFROMP(filename)) && *filename)
     610              WinSetDlgItemText(hwnd, id, filename);
     611            break;
     612          case CFGH_RUNHTTPWORKDIR:
     613            strcpy(filename, httprundir);
     614            if (WinDlgBox(HWND_DESKTOP, hwndNotebook,
     615                          WalkExtractDlgProc, FM3ModHandle, WALK_FRAME,
     616                          MPFROMP(filename)) && *filename)
     617              WinSetDlgItemText(hwnd, id, filename);
     618            break;
     619          case CFGH_RUNMAILWORKDIR:
     620            strcpy(filename, mailrundir);
     621            if (WinDlgBox(HWND_DESKTOP, hwndNotebook,
     622                          WalkExtractDlgProc, FM3ModHandle, WALK_FRAME,
     623                          MPFROMP(filename)) && *filename)
     624              WinSetDlgItemText(hwnd, id, filename);
     625            break;
     626          default:
     627            Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id);
     628            break;
     629          }
     630        }
     631      }
     632      break;
     633    }
     634    return 0;
     635
     636  case WM_CLOSE:
     637    {
     638      CHAR szBuf[CCHMAXPATH], buf[10] = "\"%-/";
     639
     640      WinQueryDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, CCHMAXPATH, szBuf);
     641      szBuf[CCHMAXPATH - 1] = 0;
     642      bstrip(szBuf);
     643      if (!strcspn(szBuf, buf))
     644        BldQuotedFileName(httprundir, szBuf);
     645      else
     646        memcpy(httprundir, szBuf, strlen(szBuf) + 1);
     647      WinQueryDlgItemText(hwnd, CFGH_RUNFTPWORKDIR, CCHMAXPATH, szBuf);
     648      szBuf[CCHMAXPATH - 1] = 0;
     649      bstrip(szBuf);
     650      if (!strcspn(szBuf, buf))
     651        BldQuotedFileName(ftprundir, szBuf);
     652      else
     653        memcpy(ftprundir, szBuf, strlen(szBuf) + 1);
     654      WinQueryDlgItemText(hwnd, CFGH_RUNMAILWORKDIR, CCHMAXPATH, szBuf);
     655      szBuf[CCHMAXPATH - 1] = 0;
     656      bstrip(szBuf);
     657      if (!strcspn(szBuf, buf))
     658        BldQuotedFileName(mailrundir, szBuf);
     659      else
     660        memcpy(mailrundir, szBuf, strlen(szBuf) + 1);
     661      WinQueryDlgItemText(hwnd, CFGH_FTPRUN, CCHMAXPATH, szBuf);
     662      szBuf[CCHMAXPATH - 1] = 0;
     663      bstrip(szBuf);
     664      if (!strchr(szBuf, '"'))
     665        BldQuotedFileName(ftprun, szBuf);
     666      else
     667        memcpy(ftprun, szBuf, strlen(szBuf) + 1);
     668      WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, CCHMAXPATH, szBuf);
     669      szBuf[CCHMAXPATH - 1] = 0;
     670      bstrip(szBuf);
     671      if (!strchr(szBuf, '"'))
     672        BldQuotedFileName(httprun, szBuf);
     673      else
     674        memcpy(httprun, szBuf, strlen(szBuf) + 1);
     675      WinQueryDlgItemText(hwnd, CFGH_MAILRUN, CCHMAXPATH, szBuf);
     676      szBuf[CCHMAXPATH - 1] = 0;
     677      bstrip(szBuf);
     678      if (!strcspn(szBuf, buf))
     679        BldQuotedFileName(mailrun, szBuf);
     680      else
     681        memcpy(mailrun, szBuf, strlen(szBuf) + 1);
     682      PrfWriteProfileString(fmprof, appname, "HttpRunDir", httprundir);
     683      PrfWriteProfileString(fmprof, appname, "FtpRunDir", ftprundir);
     684      PrfWriteProfileString(fmprof, appname, "MailRunDir", mailrundir);
     685      PrfWriteProfileString(fmprof, appname, "FTPRun", ftprun);
     686      PrfWriteProfileString(fmprof, appname, "HTTPRun", httprun);
     687      PrfWriteProfileString(fmprof, appname, "MailRun", mailrun);
     688      fHttpRunWPSDefault = WinQueryButtonCheckstate(hwnd, CFGH_HTTPRUNWPSDEFAULT);
     689      PrfWriteProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault,
     690                          sizeof(BOOL));
     691      fFtpRunWPSDefault = WinQueryButtonCheckstate(hwnd, CFGH_FTPRUNWPSDEFAULT);
     692      PrfWriteProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault,
     693                          sizeof(BOOL));
     694      fLibPathStrictHttpRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTHTTPRUN);
     695      PrfWriteProfileData(fmprof, appname, "LibPathStrictHttpRun",
     696                          &fLibPathStrictHttpRun, sizeof(BOOL));
     697      fLibPathStrictFtpRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTFTPRUN);
     698      PrfWriteProfileData(fmprof, appname, "LibPathStrictFtpRun",
     699                          &fLibPathStrictFtpRun, sizeof(BOOL));
    537700      break;
    538701    }
     
    16261789    {
    16271790        if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) {
    1628         WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE,
    1629                         MPFROMP(&SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE));
    1630         if (SubjectDisplayWidth < 50)
    1631           SubjectDisplayWidth  = 0;
    1632         else if (SubjectDisplayWidth > 1000)
    1633           SubjectDisplayWidth = 1000;
     1791          WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE,
     1792                            MPFROMP(&SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE));
     1793          if (SubjectDisplayWidth < 50)
     1794            SubjectDisplayWidth  = 0;
     1795          else if (SubjectDisplayWidth > 1000)
     1796            SubjectDisplayWidth = 1000;
    16341797        }
    16351798        else
     
    28262989  0,
    28272990  0,
     2991  CFGH_FRAME,
     2992  IDS_NOTEVIEWERS3TEXT,
     2993  CfgHDlgProc,
     2994  0,
     2995  0,
     2996  0,
    28282997  CFGC_FRAME,
    28292998  IDS_NOTECOMPARE1TEXT,
     
    30463215
    30473216#pragma alloc_text(NOTEBOOK,CfgTDlgProc,CfgTSDlgProc,CfgMDlgProc)
    3048 #pragma alloc_text(NOTEBOOK2,CfgADlgProc,CfgSDlgProc,CfgVDlgProc)
     3217#pragma alloc_text(NOTEBOOK2,CfgADlgProc,CfgSDlgProc,CfgVDlgProc,CfgHDlgProc)
    30493218#pragma alloc_text(NOTEBOOK3,CfgDDlgProc,Cfg5DlgProc,Cfg6DlgProc)
    30503219#pragma alloc_text(NOTEBOOK4,Cfg7DlgProc,Cfg8DlgProc,CfgCDlgProc)
  • trunk/dll/viewer.c

    r879 r892  
    303303          WinEnableMenuItem(vw->hwndPopupMenu, MLE_BLOCKMENU, TRUE);
    304304        }
    305         if (!*ftprun)
     305        if (!*ftprun && !fFtpRunWPSDefault)
    306306          WinSendMsg(vw->hwndPopupMenu, MM_DELETEITEM,
    307307                     MPFROM2SHORT(MLE_VIEWFTP, FALSE), MPVOID);
    308         if (!*httprun)
     308        if (!*httprun && !fHttpRunWPSDefault)
    309309          WinSendMsg(vw->hwndPopupMenu, MM_DELETEITEM,
    310310                     MPFROM2SHORT(MLE_VIEWHTTP, FALSE), MPVOID);
Note: See TracChangeset for help on using the changeset viewer.