Changeset 1803


Ignore:
Timestamp:
May 2, 2015, 11:56:39 PM (10 years ago)
Author:
Gregg Young
Message:

Changes to allow a JAVA executable object to be created using "Real object" menu item on a jar file. (Ticket [37]) Eliminate redundant prompts and error messages when telling FM/2 not to delete a R/O file. (Ticket [548]) Limit attempts to unlock files to exes and dlls. (Ticket [549])

Location:
trunk/dll
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r1799 r1803  
    8787                a trap when FM2 is shutdown or the container is closed while collector
    8888                container is still populating
     89  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     90                menu item on a jar file.
    8991
    9092***********************************************************************/
     
    637639      case IDM_SHADOW:
    638640      case IDM_SHADOW2:
     641      case IDM_JAVAEXE:
    639642      case IDM_PRINT:
    640643      case IDM_ATTRS:
     
    23282331      case IDM_SHADOW:
    23292332      case IDM_SHADOW2:
     2333      case IDM_JAVAEXE:
    23302334      case IDM_DELETE:
    23312335      case IDM_PERMDELETE:
     
    23882392              case IDM_PRINT:
    23892393              case IDM_SHADOW:
    2390               case IDM_SHADOW2:
     2394              case IDM_SHADOW2:
     2395              case IDM_JAVAEXE:
    23912396              case IDM_OBJECT:
    23922397              case IDM_VIEW:
  • trunk/dll/copyf.c

    r1785 r1803  
    4141  22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories.
    4242  19 Jul 14 GKY Fix redundant error message following selection of no for unlocking a file
     43  02 May 15 GKY Changes to R/O check to eliminate redundant checks and error messages
     44  02 May 15 GKY Limit unlock attempts to exes and dlls.
    4345
    4446***********************************************************************/
     
    689691  APIRET rc;
    690692  INT ret = -1;
    691   INT retrn;
     693  INT retrn = SM2_YES;
    692694  FILESTATUS3 fsi;
    693695
     
    715717        DosError(FERR_DISABLEHARDERR);
    716718        if (!xDosSetPathInfo(filename, FIL_STANDARD, &fsi, sizeof(fsi), 0))
    717           ret = 0;
    718       }
    719     }
    720   }
    721   if (error ==  ERROR_SHARING_VIOLATION && fUnlock) {
     719          ret = SM2_YES;
     720      }
     721    }
     722  }
     723  if (error ==  ERROR_SHARING_VIOLATION && fUnlock &&
     724      (retrn == SM2_YES || retrn == SM2_DONTASK)   &&
     725      (strstr(strlwr(filename), ".dll") || strstr(strlwr(filename), ".exe"))) {
    722726    retrn = saymsg(MB_YESNO | MB_DEFBUTTON2,
    723727                 HWND_DESKTOP,
  • trunk/dll/dircnrs.c

    r1793 r1803  
    8888  30 Aug 14 GKY Add semaphore hmtxFiltering to prevent freeing dcd while filtering. Prevents
    8989                a trap when FM2 is shutdown while directory containers are still populating
     90  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     91                menu item on a jar file.
    9092
    9193***********************************************************************/
     
    982984      case IDM_SHADOW:
    983985      case IDM_SHADOW2:
     986      case IDM_JAVAEXE:
    984987      case IDM_PRINT:
    985988      case IDM_ATTRS:
     
    26072610      case IDM_SHADOW:
    26082611      case IDM_SHADOW2:
     2612      case IDM_JAVAEXE:
    26092613      case IDM_DELETE:
    26102614      case IDM_PERMDELETE:
     
    27072711              case IDM_PRINT:
    27082712              case IDM_SHADOW:
    2709               case IDM_SHADOW2:
     2713              case IDM_SHADOW2:
     2714              case IDM_JAVAEXE:
    27102715              case IDM_OBJECT:
    27112716              case IDM_VIEW:
  • trunk/dll/fm3dll2.h

    r1722 r1803  
    3939  16 Feb 14 GKY Rework readonly check on delete code so it actually works in a logical way
    4040                and so it works with move to trashcan inabled.
     41  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     42                menu item on a jar file.
    4143
    4244  Align with spaces only - no tabs please
     
    408410#define IDM_OPENDIRWINDOW   1169
    409411#define IDM_UNLOCKFILE      1170
     412#define IDM_JAVAEXE         1171
    410413
    411414#define SM2_DIALOG          1234
  • trunk/dll/fm3res.rc

    r1800 r1803  
    7676                Enhance the error message. Ticket 502
    7777  30 Aug 14 GKY Use saymsg2 for Suggest dialog
     78  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     79                menu item on a jar file.
    7880 
    7981***********************************************************************/
     
    12721274         MENUITEM "~Real objects...",IDM_OBJECT
    12731275         MENUITEM "~Shadows in folder...",IDM_SHADOW2
     1276         MENUITEM "~Change JAVA executable", IDM_JAVAEXE
    12741277  }
    12751278  SUBMENU "Save Lists to clipboard/file",         IDM_SAVESUBMENU
     
    15681571         MENUITEM "~Real objects...",IDM_OBJECT
    15691572         MENUITEM "~Shadows in folder...",IDM_SHADOW2
     1573         MENUITEM "~Change JAVA executable", IDM_JAVAEXE
    15701574  }
    15711575  SUBMENU "Save Lists to clipboard/file",         IDM_SAVESUBMENU
     
    21992203                MENUITEM "~Shadows...",         IDM_SHADOW
    22002204                MENUITEM "~Real objects...",    IDM_OBJECT
     2205                MENUITEM "~Change JAVA executable", IDM_JAVAEXE
    22012206         }
    22022207         MENUITEM "~Hide selected",        IDM_HIDEALL
     
    22802285         MENUITEM "~Shadows...",         IDM_SHADOW
    22812286         MENUITEM "~Real objects...",    IDM_OBJECT
     2287         MENUITEM "~Change JAVA executable", IDM_JAVAEXE
    22822288  }
    22832289  MENUITEM "~Hide selected",        IDM_HIDEALL
  • trunk/dll/ipf/Trouble.ipf

    r1794 r1803  
    66.*
    77.* Copyright (c) 1993-98 M. Kimes
    8 .* Copyright (c) 2002-2014 Steven H.Levine
     8.* Copyright (c) 2002-2015 Steven H.Levine
    99.*
    1010.* 06 Apr 07 GKY Added drag limit information
     
    1616.* 01 Jan 13 GKY Removed reference to install.cmd which is no longer in the FM/2 package
    1717.* 23 Mar 14 GKY Add known problems with starting with redirection and inability to copy
    18 .*               from "completed" windows. Fixed some typos
     18.*             from "completed" windows. Fixed some typos
    1919.*
    2020.***********************************************************************
  • trunk/dll/ipf/shadow.ipf

    r268 r1803  
     1.***********************************************************************
     2.*
     3.* $Id$
     4.*
     5.* fm/2 help - Objects and shadows
     6.*
     7.* Copyright (c) 1993-98 M. Kimes
     8.* Copyright (c) 2002-2015 Steven H.Levine
     9.*
     10.* 02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     11.*                menu item on a jar file.
     12.*
     13.***********************************************************************
     14.*
    115:h2 res=93600 name=PANEL_SHADOW.Shadow
    216:i1 id=aboutShadow.Shadow
     
    1327on the desktop and the shadows are placed inside that folder. You can
    1428move the shadows or folder elsewhere after that.
    15 
    1629:h2 res=91700 name=PANEL_OBJECTS.Real Objects
    1730:i1 id=aboutObjects.Real Objects
     
    2841on the desktop and the objects are placed inside that folder. You can
    2942move the objects or folder elsewhere after that.
     43:p.
     44FM/2 handles JAVA jar files in a way that creates an executable program
     45object. The first time you use it you must select the JAVA executable
     46you wish to use. I recommend PATH\OPENJDK6\bin\javaw.exe.
     47Your selection is saved in the FM/2 ini file for future
     48use. It can be changed by selecting the :hp1.Change JAVA executable:ehp1.
     49from a context menu or the Files pulldown submenu (Create Objects submenu)
     50You will be prompted to select an icon file for the object. Some JAVA
     51programs will need additional command line switches (e.g. SmartSVN requires
     52-Dsmartsvn.checkIncompatibleJava=false). You can add these by opening the
     53object properties and editing the parameters box. You should restart your
     54desktop before doing so since the object tends to lose its icon when opening
     55in properties view if you don't
    3056
  • trunk/dll/seeall.c

    r1741 r1803  
    6262                and so it works with move to trashcan inabled.
    6363  22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories.
     64  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     65                menu item on a jar file.
    6466
    6567***********************************************************************/
     
    42514253    case IDM_SHADOW:
    42524254    case IDM_OBJECT:
     4255    case IDM_JAVAEXE:
    42534256    case IDM_OPENSETTINGS:
    42544257    case IDM_OPENDEFAULT:
     
    43054308        case IDM_EXTRACT:
    43064309        case IDM_SHADOW:
    4307         case IDM_OBJECT:
     4310        case IDM_OBJECT:
     4311        case IDM_JAVAEXE:
    43084312        case IDM_OPENSETTINGS:
    43094313        case IDM_OPENDEFAULT:
     
    43444348              case IDM_UNLOCKFILE:
    43454349              case IDM_OBJECT:
    4346               case IDM_SHADOW:
     4350              case IDM_SHADOW:
     4351              case IDM_JAVAEXE:
    43474352              case IDM_OPENSETTINGS:
    43484353              case IDM_OPENDEFAULT:
  • trunk/dll/shadow.c

    r1782 r1803  
    1717  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
    1818  28 Jun 14 GKY Fix errors identified with CPPCheck;
     19  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     20                menu item on a jar file.
    1921
    2022***********************************************************************/
     
    4345#include "fortify.h"
    4446#include "init.h"                       // Data declaration(s)
     47#include "notebook.h"                   // Data declaration(s)
     48#include "getnames.h"                   // insert_filename
     49#include "srchpath.h"                   // SearchMultiplePathsForFile
    4550
    4651#pragma data_seg(DATA1)
     
    5358
    5459static HOBJECT CreateProgramObject(CHAR * objtitle, CHAR * location, CHAR * path,
     60                                   CHAR * cnr);
     61static HOBJECT CreateJAVAProgramObject(CHAR * objtitle, CHAR * location, CHAR * path,
    5562                            CHAR * cnr);
    5663static HOBJECT CreateShadowObject(CHAR * objtitle, CHAR * location, CHAR * path,
     
    6269  HOBJECT obj = (HOBJECT) 0;
    6370  CHAR *s;
    64 
    65   if (!cnr)
    66     return obj;
     71  CHAR objecttmp[CCHMAXPATH];
     72
     73  if (!cnr)
     74    return obj;
     75  strcpy(objecttmp, objtitle);
     76  s = strchr(objecttmp, '.');
     77  if (s)
     78    *s = 0;
    6779  obj = WinCreateObject((CHAR *) WPProgram,
    68                         objtitle,
     80                        objecttmp,
    6981                        "NODELETE=NO;TEMPLATE=NO;NOCOPY=NO;NOMOVE=NO",
    7082                        (location) ? location : cnr, CO_FAILIFEXISTS);
     
    8597}
    8698
     99HOBJECT CreateJAVAProgramObject(CHAR * objtitle, CHAR * location, CHAR * path,
     100                            CHAR * cnr)
     101{
     102  HOBJECT obj = (HOBJECT) 0;
     103  CHAR *s;
     104  CHAR objecttmp[CCHMAXPATH];
     105  CHAR javaexe[CCHMAXPATH] = {0};
     106  CHAR icon[CCHMAXPATH] = {0};
     107  //PSZ env = 0;
     108  //FILESTATUS3 fsa;
     109
     110  if (!cnr)
     111    return obj;
     112  if (!PrfQueryProfileString(fmprof, appname, "JavaExe", NULL, javaexe, CCHMAXPATH - 1)) {
     113    strcpy(javaexe, PCSZ_STARDOTEXE);
     114    if (insert_filename(HWND_DESKTOP, javaexe, TRUE, FALSE) &&
     115        *javaexe && !strchr(javaexe, '*') && !strchr(javaexe, '?'))
     116      PrfWriteProfileString(fmprof, appname, "JavaExe", javaexe);
     117    else
     118      return obj;
     119  }
     120  strcpy(objecttmp, objtitle);
     121  s = strchr(objecttmp, '.');
     122  if (s)
     123    *s = 0;
     124  strcpy(icon, path);
     125  strcat(icon, "\\*.ico");
     126  insert_filename(HWND_DESKTOP, icon, TRUE, FALSE);
     127  obj = WinCreateObject((CHAR *) WPProgram,
     128                        objecttmp,
     129                        "NOPRINT=YES;DEFAULTVIEW=RUNNING",
     130                        (location) ? location : cnr, CO_FAILIFEXISTS);
     131  if (obj) {
     132    s = xmalloc(5192, pszSrcFile, __LINE__);
     133    if (s) {
     134      sprintf(s,
     135              "%s%s;EXENAME=%s%s%s;PARAMETERS= %s%s%s%s %%*;%sOBJECTID=<FM2_%s>",
     136              "ICONFILE=",
     137              icon,
     138              javaexe,
     139              (path) ? ";STARTUPDIR=" : NullStr,
     140              (path) ? path : NullStr,
     141              "-jar ",
     142              (path) ? path : NullStr,
     143              (path) ? PCSZ_BACKSLASH : NullStr,
     144              objtitle,
     145              "PROGTYPE=PM;",
     146              objecttmp);
     147      WinSetObjectData(obj, s);
     148      free(s);
     149    }
     150  }
     151  return obj;
     152}
     153
    87154HOBJECT CreateDataObject(CHAR * objtitle, CHAR * location, CHAR * path,
    88155                         CHAR * cnr)
     
    189256  HOBJECT obj = (HOBJECT) 0;
    190257  FILESTATUS3 fsa;
     258  BOOL JAVA = FALSE;
    191259
    192260  *szBuff = 0;
     
    233301          if (!stricmp(p, PCSZ_DOTBAT) || !stricmp(p, PCSZ_DOTCMD) ||
    234302              !stricmp(p, PCSZ_DOTBTM))
    235             apt |= FAPPTYP_BOUND;
     303            apt |= FAPPTYP_BOUND;
     304          else if(!stricmp(p, ".jar"))
     305            JAVA = TRUE;
    236306        }
    237307        *szBuffer = 0;
     
    262332          *szBuffer = 0;
    263333        if ((fsa.attrFile & FILE_DIRECTORY) || Shadows)
    264           CreateShadowObject(p, (obj) ? szBuffer : NULL, szDir, 0, cnr);
     334          CreateShadowObject(p, (obj) ? szBuffer : NULL, szDir, 0, cnr);
     335        else if (JAVA)
     336          if (CreateJAVAProgramObject(p, (obj) ? szBuffer : NULL, szDir, cnr))
     337            apt |= FAPPTYP_BOUND;
    265338        else if (!(apt & (FAPPTYP_NOTWINDOWCOMPAT | FAPPTYP_WINDOWCOMPAT | FAPPTYP_WINDOWAPI |
    266339                          FAPPTYP_BOUND | FAPPTYP_DOS | FAPPTYP_WINDOWSREAL |
  • trunk/dll/treecnr.c

    r1799 r1803  
    9797                a trap when FM2 is shutdown or the container is closed while tree
    9898                container is still populating
     99  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     100                menu item on a jar file.
    99101
    100102***********************************************************************/
     
    909911      case IDM_SHADOW:
    910912      case IDM_SHADOW2:
     913      case IDM_JAVAEXE:
    911914      case IDM_PRINT:
    912915      case IDM_ATTRS:
  • trunk/dll/worker.c

    r1780 r1803  
    6464                delete and eliminated the check on additional temp file deletes
    6565  22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories.
     66  02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object"
     67                menu item on a jar file.
    6668
    6769***********************************************************************/
     
    129131#include "fortify.h"
    130132#include "excputil.h"                   // 06 May 08 SHL added
     133#include "getnames.h"                   // insert_filename
    131134
    132135// Data definitions
     
    15601563              AddNote(GetPString(IDS_MADEOBJSTEXT));
    15611564            }
    1562             break;
     1565            break;
     1566
     1567          case IDM_JAVAEXE:
     1568            {
     1569            CHAR javaexe[CCHMAXPATH] = {0};
     1570
     1571            strcpy(javaexe, PCSZ_STARDOTEXE);
     1572            if (insert_filename(HWND_DESKTOP, javaexe, TRUE, FALSE) &&
     1573                *javaexe && !strchr(javaexe, '*') && !strchr(javaexe, '?'))
     1574              PrfWriteProfileString(fmprof, appname, "JavaExe", javaexe);
     1575            }
     1576            break;
    15631577
    15641578          case IDM_PRINT:
     
    17941808                //DbgMsg(pszSrcFile, __LINE__, "error %i retrn %i", error, retrn);
    17951809                if (fWarnReadOnly && error ==  ERROR_FILE_EXISTS) {
    1796                   error = ERROR_ACCESS_DENIED;
    17971810                  retrn = SM2_NO;
    17981811                }
    1799                 if (error && (error != ERROR_ACCESS_DENIED ||
    1800                               (error == ERROR_ACCESS_DENIED &&
    1801                                (retrn == SM2_YES || retrn == SM2_DONTASK || retrn == 0)))) {
     1812                if (error && (retrn == SM2_YES || retrn == SM2_DONTASK))  {
    18021813                  if (LogFileHandle)
    18031814                    fprintf(LogFileHandle,
Note: See TracChangeset for help on using the changeset viewer.