FileBrowser.st
author Claus Gittinger <cg@exept.de>
Mon, 28 Jun 1999 10:46:13 +0200
changeset 2216 b84ee099f484
parent 2187 59aff09bfc2d
child 2220 1ec72aa513c8
permissions -rw-r--r--
dont cut of fileName part if same directory in pathField. Dont send changed:#path twice.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     1
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
     3
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     4
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    10
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    11
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    12
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    13
StandardSystemView subclass:#FileBrowser
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    14
	instanceVariableNames:'labelView filterField fileListView subView currentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    15
		fileList checkBlock checkDelta timeOfLastCheck myName killButton
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    16
		pauseToggle compressTabs lockUpdate previousDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    17
		currentFileName timeOfFileRead tabSpec commandView commandIndex
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    18
		fileEncoding tabRulerView scrollView icons listUpdateProcess
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    19
		currentFileInFileName lastFileDiffDirectory sortByWhat
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
    20
		sortCaseless showingDetails showingHiddenFiles
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
    21
		showingBigImagePreview imagePreviewView imageRenderProcess
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
    22
		dosEOLMode'
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    23
	classVariableNames:'DirectoryHistory DirectoryHistoryWhere HistorySize DefaultIcon
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
    24
		CommandHistory CommandHistorySize Icons DefaultCommandPerSuffix'
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    25
	poolDictionaries:''
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    26
	category:'Interface-Browsers'
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    27
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    28
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    29
!FileBrowser class methodsFor:'documentation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    30
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    31
copyright
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    32
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    33
 COPYRIGHT (c) 1991 by Claus Gittinger
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    34
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    35
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    36
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    37
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    38
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    39
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    40
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    41
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    42
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    43
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    44
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    45
documentation
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    46
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    47
    this used to be a very simple demo application,
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    48
    but migrated into a quite nice tool, includes all kinds of 
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    49
    warning and information boxes, background processes for directory-
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    50
    reading and internationalized strings. A good example for beginners,
100
claus
parents: 98
diff changeset
    51
    on how to do things .... (and maybe how not to do things ;-, since some
claus
parents: 98
diff changeset
    52
    stuff is historic and was implemented at times when better mechanisms
claus
parents: 98
diff changeset
    53
    were not available)
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    54
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    55
    See additional information in 'doc/misc/fbrowser.doc'.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
    56
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    57
    WARNING: files edited with FileBrowser will have leading spaces (multiple-8)
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    58
	     being replaced by tabs. If tabs are to be preserved at other
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    59
	     positions (for example, sendmail-config files) they will be
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    60
	     corrupt after being written.
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    61
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    62
    [instance variables]:
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    63
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    64
	checkDelta      <Integer>       number of seconds of check interval
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    65
					(looks ever so often if shown directory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    66
					 has changed). You may make this number
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    67
					higher, if your network-times are
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    68
					incorrect and thus, the filebrowser
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    69
					checks too often.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    70
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    71
	compressTabs    <Boolean>       if true, leading spaces will be
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    72
					replaced by tabs when saving text
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    73
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    74
    some of the defaults (long/short list etc.) can be set by the resource file;
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    75
    see FileBrowser>>initialize for more details..
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    76
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    77
    [author:]
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    78
	Claus Gittinger
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
    79
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
    80
    [start with:]
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    81
	FileBrowser open
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    82
"
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
    83
! !
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    84
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    85
!FileBrowser class methodsFor:'instance creation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    86
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    87
openOn:aDirectoryPath
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    88
    "start a new FileBrowser in a pathname"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    89
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    90
    ^ (self new currentDirectory:aDirectoryPath) open
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    91
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    92
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    93
     FileBrowser openOn:'aDirectoryPath'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    94
     FileBrowser openOn:'/etc'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    95
     FileBrowser openOn:'..'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    96
     FileBrowser openOn:'.'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    97
    "
93
claus
parents: 85
diff changeset
    98
!
claus
parents: 85
diff changeset
    99
claus
parents: 85
diff changeset
   100
openOnFileNamed:aFilename
claus
parents: 85
diff changeset
   101
    "start a new FileBrowser on a file"
claus
parents: 85
diff changeset
   102
claus
parents: 85
diff changeset
   103
    |f browser|
claus
parents: 85
diff changeset
   104
claus
parents: 85
diff changeset
   105
    f := aFilename asFilename.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   106
    f isDirectory ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   107
	^ self openOn:aFilename
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   108
    ].
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   109
93
claus
parents: 85
diff changeset
   110
    browser := self new.
claus
parents: 85
diff changeset
   111
    browser currentDirectory:f directoryName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   112
    browser updateCurrentDirectory.
93
claus
parents: 85
diff changeset
   113
    browser showFile:f baseName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   114
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   115
    ^ browser open.
93
claus
parents: 85
diff changeset
   116
claus
parents: 85
diff changeset
   117
    "
claus
parents: 85
diff changeset
   118
     FileBrowser openOnFileNamed:'Makefile'
claus
parents: 85
diff changeset
   119
     FileBrowser openOnFileNamed:'../Makefile'
claus
parents: 85
diff changeset
   120
     FileBrowser openOnFileNamed:'/tmp/foo'
claus
parents: 85
diff changeset
   121
    "
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   122
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   123
    "Modified: / 17.6.1998 / 11:25:29 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   124
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   125
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   126
!FileBrowser class methodsFor:'class initialization'!
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   127
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   128
initializeIcons
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   129
    |resources|
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   130
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   131
    resources := self classResources.
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   132
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   133
    Icons := Dictionary new.
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   134
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   135
    #(
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   136
        "/ internal-type to icon mappings.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   137
        (#directory       'ICON_DIRECTORY'        'tiny_yellow_dir.xpm'       )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   138
        (#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm')
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   139
        (#directoryLink   'ICON_DIRECTORY_LINK'   'tiny_yellow_dir_link.xpm'  )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   140
        (#file            'ICON_FILE'             'tiny_file_plain.xpm'       )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   141
        (#fileLink        'ICON_FILE_LINK'        'tiny_file_link.xpm'        )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   142
        (#fileLocked      'ICON_FILE_LOCKED'      'tiny_file_lock.xpm'        )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   143
        (#imageFile       'ICON_IMAGE_FILE'       'tiny_file_pix.xpm'         )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   144
        (#textFile        'ICON_TEXT_FILE'        'tiny_file_text.xpm'        )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   145
        (#executableFile  'ICON_EXECUTABLEFILE'   'tiny_file_exec.xpm'        )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   146
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   147
        "/ mime-type to icon mappings.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   148
        ('text/plain'                     nil     'tiny_file_text.xpm'        )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   149
        ('text/html'                      nil     'tiny_file_text.xpm'        )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   150
        ('application/postscript'         nil     'tiny_file_st.xpm'          )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   151
        ('application/x-smalltalk-source' nil     'tiny_file_st.xpm'          )
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   152
        ('image'                          nil     'tiny_file_pix.xpm'         )
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   153
     ) do:[:entry |
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   154
        |key resource defaultName nm|
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   155
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   156
        key := entry at:1.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   157
        resource := entry at:2.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   158
        defaultName := entry at:3.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   159
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   160
        resource notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   161
            nm := resources at:resource default:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   162
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   163
        nm isNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   164
            nm := 'bitmaps/xpmBitmaps/document_images/' , defaultName
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   165
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   166
        Icons at:key put:(Image fromFile:nm).
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   167
    ]
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   168
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   169
    "
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   170
     self initializeIcons
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   171
    "
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   172
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   173
    "Modified: / 1.8.1998 / 17:39:27 / cg"
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   174
! !
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   175
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   176
!FileBrowser class methodsFor:'command history'!
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   177
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   178
addToCommandHistory:aCommandString for:aFilename
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   179
    |cmd suffix|
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   180
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   181
    (aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   182
	CommandHistory notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   183
	    CommandHistory addFirst:aCommandString.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   184
	    CommandHistory size > CommandHistorySize ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   185
		CommandHistory removeLast
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   186
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   187
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   188
	aFilename notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   189
	    cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   190
	    DefaultCommandPerSuffix isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   191
		DefaultCommandPerSuffix := Dictionary new.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   192
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   193
	    suffix := aFilename asFilename suffix.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   194
	    suffix notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   195
		DefaultCommandPerSuffix at:suffix put:cmd.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   196
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   197
	]
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   198
    ]
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   199
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   200
    "Created: 14.11.1996 / 14:58:13 / cg"
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   201
! !
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   202
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   203
!FileBrowser class methodsFor:'defaults'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   204
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   205
defaultIcon
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   206
    "return the file browsers default window icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   207
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   208
    <resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)>
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   209
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   210
    |nm i res|
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   211
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   212
    (i := DefaultIcon) isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   213
	res := self classResources.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   214
	i := res at:'FILEBROWSER_ICON' default:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   215
	i isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   216
	    nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   217
	    i := Image fromFile:nm resolution:100.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   218
	    i isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   219
		i := Image fromFile:('bitmaps/' , nm) resolution:100.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   220
		i isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   221
		    i := StandardSystemView defaultIcon
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   222
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   223
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   224
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   225
	i notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   226
	    DefaultIcon := i := i on:Display
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   227
	]
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   228
    ].
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   229
    ^ i
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   230
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   231
    "Modified: 19.3.1997 / 20:48:34 / ca"
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   232
    "Modified: 15.8.1997 / 15:27:19 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   233
! !
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   234
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   235
!FileBrowser class methodsFor:'interface specs'!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   236
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   237
fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   238
    "This resource specification was automatically generated
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   239
     by the UIPainter of ST/X."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   240
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   241
    "Do not manually edit this!! If it is corrupted,
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   242
     the UIPainter may not be able to read the specification."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   243
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   244
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   245
     UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   246
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   247
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   248
    <resource: #canvas>
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   249
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   250
    ^
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   251
     
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   252
       #(#FullSpec
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   253
	  #window: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   254
	   #(#WindowSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   255
	      #name: 'File Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   256
	      #layout: #(#LayoutFrame 4 0 50 0 315 0 349 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   257
	      #level: 0
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   258
	      #label: 'File Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   259
	      #min: #(#Point 10 10)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   260
	      #max: #(#Point 1280 1024)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   261
	      #bounds: #(#Rectangle 4 50 316 350)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   262
	      #usePreferredExtent: false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   263
	      #returnIsOKInDialog: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   264
	      #escapeIsCancelInDialog: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   265
	  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   266
	  #component: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   267
	   #(#SpecCollection
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   268
	      #collection: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   269
	       #(
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   270
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   271
		    #name: 'Label1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   272
		    #layout: #(#LayoutFrame 0 0 10 0 0 1 32 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   273
		    #label: 'Search for files named:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   274
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   275
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   276
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   277
		 #(#InputFieldSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   278
		    #name: 'EntryField1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   279
		    #layout: #(#LayoutFrame 10 0 36 0 305 0 58 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   280
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   281
		    #model: #namePatternHolder
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   282
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   283
		 #(#CheckBoxSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   284
		    #name: 'CheckBox1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   285
		    #layout: #(#LayoutFrame 7 0 66 0 143 0 88 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   286
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   287
		    #model: #ignoreCaseInName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   288
		    #label: 'Ignore case'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   289
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   290
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   291
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   292
		    #name: 'Label2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   293
		    #layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   294
		    #label: 'Containing the string:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   295
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   296
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   297
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   298
		 #(#InputFieldSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   299
		    #name: 'EntryField2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   300
		    #layout: #(#LayoutFrame 10 0 133 0 305 0 155 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   301
		    #enableChannel: #notSearchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   302
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   303
		    #model: #contentsPatternHolder
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   304
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   305
		 #(#CheckBoxSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   306
		    #name: 'CheckBox2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   307
		    #layout: #(#LayoutFrame 6 0 163 0 142 0 185 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   308
		    #enableChannel: #notSearchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   309
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   310
		    #model: #ignoreCaseInContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   311
		    #label: 'Ignore case'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   312
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   313
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   314
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   315
		    #name: 'Label3'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   316
		    #layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   317
		    #label: 'Containing same contents as selected:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   318
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   319
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   320
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   321
		 #(#DividerSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   322
		    #name: 'Separator1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   323
		    #layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   324
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   325
		 #(#CheckToggleSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   326
		    #name: 'CheckToggle1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   327
		    #layout: #(#LayoutOrigin -25 1 225 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   328
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   329
		    #model: #searchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   330
		    #enableChannel: #searchForSameContentsEnabled
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   331
		    #isTriggerOnDown: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   332
		    #showLamp: false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   333
		    #lampColor: #(#Color 100.0 100.0 0.0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   334
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   335
		 #(#HorizontalPanelViewSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   336
		    #name: 'HorizontalPanel1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   337
		    #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   338
		    #component: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   339
		     #(#SpecCollection
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   340
			#collection: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   341
			 #(
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   342
			   #(#ActionButtonSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   343
			      #name: 'Button1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   344
			      #label: 'Cancel'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   345
			      #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   346
			      #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   347
			      #model: #cancel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   348
			      #extent: #(#Point 151 25)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   349
			  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   350
			   #(#ActionButtonSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   351
			      #name: 'Button2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   352
			      #label: 'Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   353
			      #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   354
			      #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   355
			      #model: #accept
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   356
			      #isDefault: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   357
			      #extent: #(#Point 152 25)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   358
			  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   359
			)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   360
		    )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   361
		    #horizontalLayout: #fitSpace
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   362
		    #verticalLayout: #centerMax
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   363
		    #horizontalSpace: 3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   364
		    #verticalSpace: 3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   365
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   366
	      )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   367
	  )
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   368
      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   369
! !
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   370
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   371
!FileBrowser class methodsFor:'menu specs'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   372
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   373
baseDirectoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   374
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   375
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   376
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   377
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   378
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   379
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   380
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   381
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   382
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   383
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   384
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   385
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   386
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   387
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   388
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   389
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   390
          
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   391
	   #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   392
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   393
		#label: 'Copy Path'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   394
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   395
		#value: #copyPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   396
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   397
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   398
		#label: '-'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   399
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   400
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   401
		#label: 'Up'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   402
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   403
		#value: #changeToParentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   404
		#enabled: #currentDirectoryIsNotTop
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   405
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   406
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   407
		#label: 'Back'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   408
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   409
		#value: #changeToPreviousDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   410
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   411
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   412
		#label: 'Home'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   413
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   414
		#value: #changeToHomeDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   415
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   416
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   417
		#label: 'Default'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   418
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   419
		#value: #changeToDefaultDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   420
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   421
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   422
		#label: 'Goto...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   423
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   424
		#value: #changeCurrentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   425
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   426
	  ) nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   427
	  nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   428
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   429
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   430
    "Created: / 4.8.1998 / 17:21:16 / cg"
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   431
    "Modified: / 14.8.1998 / 19:19:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   432
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   433
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   434
directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   435
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   436
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   437
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   438
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   439
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   440
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   441
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   442
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   443
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   444
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   445
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   446
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   447
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   448
    |m|
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   449
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   450
    m := self baseDirectoryMenuSpec.
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   451
    m := m decodeAsLiteralArray.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   452
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   453
    "/ add the history items ...
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   454
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   455
    DirectoryHistory size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   456
	m addItem:(MenuItem labeled:'-').
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   457
	DirectoryHistory do:[:dirName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   458
	    m addItem:((MenuItem label:dirName value:#changeDirectoryTo:)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   459
			    argument:dirName;
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   460
			    yourself).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   461
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   462
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   463
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   464
    m findGuiResourcesIn:self.
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   465
    ^ m
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   466
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   467
    "Modified: / 17.8.1998 / 10:13:05 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   468
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   469
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   470
menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   471
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   472
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   473
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   474
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   475
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   476
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   477
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   478
     MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   479
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   480
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   481
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   482
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   483
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   484
    ^ 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   485
     #(#Menu
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   486
        #(
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   487
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   488
            #label: 'Spawn'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   489
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   490
            #value: #fileSpawn
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   491
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   492
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   493
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   494
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   495
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   496
            #label: 'Get Contents'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   497
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   498
            #value: #fileGet
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   499
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   500
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   501
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   502
            #label: 'Insert Contents'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   503
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   504
            #value: #fileInsert
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   505
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   506
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   507
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   508
            #label: 'FileIn'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   509
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   510
            #value: #fileFileIn
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   511
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   512
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   513
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   514
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   515
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   516
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   517
            #label: 'Unix Command...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   518
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   519
            #isVisible: #systemIsUnix
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   520
            #value: #menuOSCommand
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   521
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   522
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   523
            #label: 'DOS Command...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   524
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   525
            #isVisible: #systemIsDOS
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   526
            #value: #menuOSCommand
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   527
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   528
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   529
            #label: 'VMS Command...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   530
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   531
            #isVisible: #systemIsVMS
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   532
            #value: #menuOSCommand
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   533
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   534
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   535
            #label: 'ST/X Tools'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   536
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   537
            #submenu: 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   538
           #(#Menu
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   539
              #(
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   540
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   541
                  #label: 'Changes Browser'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   542
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   543
                  #value: #openChangesBrowser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   544
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   545
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   546
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   547
                  #label: 'Editor'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   548
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   549
                  #value: #openEditor
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   550
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   551
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   552
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   553
                  #label: 'HTML Reader'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   554
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   555
                  #value: #openHTMLReader
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   556
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   557
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   558
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   559
                  #label: 'ASN1 Browser'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   560
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   561
                  #isVisible: #hasASN1Browser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   562
                  #value: #openASN1Browser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   563
                  #enabled: #hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   564
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   565
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   566
                  #label: 'Applet Viewer'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   567
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   568
                  #isVisible: #hasJava
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   569
                  #value: #openAppletViewer
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   570
                  #enabled: #hasJavaAndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   571
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   572
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   573
                  #label: 'Image Inspect'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   574
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   575
                  #value: #openImageInspector
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   576
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   577
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   578
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   579
                  #label: 'Image Preview'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   580
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   581
                  #value: #openImagePreview
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   582
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   583
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   584
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   585
                  #label: 'Image Editor'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   586
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   587
                  #value: #openImageEditor
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   588
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   589
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   590
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   591
                  #label: 'ZipFile Tool'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   592
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   593
                  #value: #openZipTool
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   594
                  #enabled: #hasZipFileSelected
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   595
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   596
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   597
                  #label: 'Hex Dump'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   598
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   599
                  #value: #fileHexDump
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   600
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   601
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   602
                  #label: 'Show File Differences'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   603
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   604
                  #value: #openDiffView
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   605
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   606
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   607
                  #label: 'Terminal'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   608
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   609
                  #isVisible: #systemIsUnix
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   610
                  #value: #openTerminal
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   611
                  #enabled: #systemIsUnix
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   612
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   613
               )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   614
              nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   615
              nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   616
            )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   617
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   618
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   619
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   620
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   621
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   622
            #label: 'Remove...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   623
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   624
            #value: #fileRemove
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   625
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   626
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   627
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   628
            #label: 'Rename...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   629
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   630
            #value: #fileRename
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   631
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   632
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   633
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   634
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   635
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   636
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   637
            #label: 'New Directory...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   638
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   639
            #value: #newDirectory
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   640
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   641
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   642
            #label: 'New File...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   643
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   644
            #value: #newFile
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   645
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   646
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   647
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   648
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   649
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   650
            #label: 'Update'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   651
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   652
            #value: #updateCurrentDirectory
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   653
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   654
         )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   655
        nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   656
        nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   657
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   658
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   659
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   660
menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   661
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   662
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   663
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   664
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   665
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   666
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   667
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   668
     MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   669
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   670
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   671
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   672
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   673
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
   674
    ^ 
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
   675
     #(#Menu
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   676
        #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   677
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   678
            #label: 'About'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   679
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   680
            #labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   681
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   682
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   683
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   684
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   685
                  #label: 'About Smalltalk/X...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   686
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   687
                  #value: #showAboutSTX
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   688
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   689
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   690
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   691
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   692
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   693
                  #label: 'About FileBrowser...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   694
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   695
                  #value: #openAboutThisApplication
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   696
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   697
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   698
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   699
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   700
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   701
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   702
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   703
            #label: 'File'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   704
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   705
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   706
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   707
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   708
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   709
                  #label: 'Open'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   710
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   711
                  #value: #menuOpen
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   712
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   713
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   714
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   715
                  #label: 'Open selected Filename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   716
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   717
                  #isVisible: #hasFilenameSelectionInCodeView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   718
                  #value: #openSelectedFilename
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   719
                  #enabled: #hasFilenameSelectionInCodeView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   720
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   721
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   722
                  #label: 'FileIn'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   723
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   724
                  #value: #fileFileIn
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   725
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   726
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   727
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   728
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   729
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   730
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   731
                  #label: 'New'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   732
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   733
                  #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   734
                 #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   735
                    #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   736
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   737
                        #label: 'Directory...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   738
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   739
                        #value: #newDirectory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   740
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   741
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   742
                        #label: 'File...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   743
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   744
                        #value: #newFile
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   745
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   746
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   747
                        #label: 'Hard Link...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   748
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   749
                        #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   750
                        #value: #newHardLink
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   751
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   752
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   753
                        #label: 'Symbolic Link...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   754
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   755
                        #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   756
                        #value: #newSoftLink
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   757
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   758
                     )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   759
                    nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   760
                    nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   761
                  )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   762
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   763
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   764
                  #label: 'Remove'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   765
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   766
                  #value: #fileRemove
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   767
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   768
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   769
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   770
                  #label: 'Rename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   771
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   772
                  #value: #fileRename
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   773
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   774
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   775
               #(#MenuItem
2143
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   776
                  #label: '-'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   777
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   778
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   779
                  #label: 'Properties...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   780
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   781
                  #value: #fileGetLongInfo
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   782
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   783
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   784
               #(#MenuItem
2143
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   785
                  #label: 'Encoding...'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   786
                  #translateLabel: true
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   787
                  #value: #fileEncoding
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   788
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   789
               #(#MenuItem
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   790
                  #label: 'DOS EndOfLine Mode'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   791
                  #translateLabel: true
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   792
                  #indication: #dosEOLMode
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   793
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   794
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   795
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   796
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   797
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   798
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   799
                  #label: 'Add to Java ClassPath'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   800
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   801
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   802
                  #value: #fileAddToJavaClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   803
                  #enabled: #canAddToClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   804
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   805
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   806
                  #label: 'Remove from Java ClassPath'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   807
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   808
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   809
                  #value: #fileRemoveFromJavaClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   810
                  #enabled: #canRemoveToClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   811
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   812
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   813
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   814
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   815
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   816
                  #label: 'Spawn'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   817
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   818
                  #value: #fileSpawn
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   819
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   820
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   821
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   822
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   823
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   824
                  #label: 'Exit'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   825
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   826
                  #value: #menuExit
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   827
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   828
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   829
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   830
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   831
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   832
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   833
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   834
            #label: 'Directory'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   835
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   836
            #submenuChannel: #directoryMenuSpec
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   837
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   838
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   839
            #label: 'Edit'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   840
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   841
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   842
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   843
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   844
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   845
                  #label: 'Get Contents'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   846
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   847
                  #value: #fileGet
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   848
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   849
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   850
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   851
                  #label: 'Insert Contents'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   852
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   853
                  #value: #fileInsert
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   854
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   855
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   856
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   857
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   858
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   859
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   860
                  #label: 'Copy File List'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   861
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   862
                  #value: #copyFileList
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   863
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   864
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   865
                  #label: 'Copy Selected Filename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   866
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   867
                  #value: #copySelectedFileName
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   868
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   869
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   870
                  #label: 'Copy Command History'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   871
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   872
                  #value: #copyCommandHistory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   873
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   874
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   875
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   876
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   877
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   878
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   879
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   880
            #label: 'View'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   881
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   882
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   883
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   884
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   885
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   886
                  #label: 'Details'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   887
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   888
                  #indication: #showingDetails
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   889
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   890
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   891
                  #label: 'Show Hidden Files'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   892
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   893
                  #indication: #showingHiddenFiles
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   894
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   895
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   896
                  #label: 'Big Image Preview'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   897
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   898
                  #indication: #showingBigImagePreview
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   899
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   900
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   901
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   902
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   903
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   904
                  #label: 'Sort by Name'
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   905
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   906
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   907
                  #choiceValue: #name
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   908
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   909
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   910
                  #label: 'Sort by Type'
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   911
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   912
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   913
                  #choiceValue: #type
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   914
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   915
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   916
                  #label: 'Sort by Time'
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   917
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   918
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   919
                  #choiceValue: #time
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   920
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   921
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   922
                  #label: 'Ignore Case'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   923
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   924
                  #enabled: #sortByName
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   925
                  #indication: #sortCaseless
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   926
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   927
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   928
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   929
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   930
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   931
                  #label: 'Update'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   932
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   933
                  #value: #updateCurrentDirectory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   934
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   935
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   936
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   937
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   938
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   939
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   940
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   941
            #label: 'Tools'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   942
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   943
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   944
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   945
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   946
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   947
                  #label: 'Unix Command'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   948
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   949
                  #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   950
                  #value: #menuOSCommand
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   951
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   952
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   953
                  #label: 'DOS Command'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   954
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   955
                  #isVisible: #systemIsDOS
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   956
                  #value: #menuOSCommand
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   957
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   958
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   959
                  #label: 'VMS Command'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   960
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   961
                  #isVisible: #systemIsVMS
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   962
                  #value: #menuOSCommand
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   963
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   964
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   965
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   966
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   967
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   968
                  #label: 'Changes Browser'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   969
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   970
                  #value: #openChangesBrowser
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   971
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   972
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   973
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   974
                  #label: 'Editor'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   975
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   976
                  #value: #openEditor
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   977
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   978
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   979
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   980
                  #label: 'HTML Reader'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   981
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   982
                  #value: #openHTMLReader
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   983
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   984
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   985
               #(#MenuItem
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   986
                  #label: 'ASN1 Browser'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   987
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   988
                  #isVisible: #hasASN1
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   989
                  #value: #openASN1Browser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   990
                  #enabled: #hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   991
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   992
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   993
                  #label: 'Applet Viewer'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   994
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   995
                  #isVisible: #hasJava
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   996
                  #value: #openAppletViewer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   997
                  #enabled: #hasJavaAndSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   998
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   999
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1000
                  #label: 'Image Inspector'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1001
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1002
                  #value: #openImageInspector
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1003
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1004
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1005
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1006
                  #label: 'Image Preview'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1007
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1008
                  #value: #openImagePreview
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1009
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1010
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1011
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1012
                  #label: 'Image Editor'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1013
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1014
                  #value: #openImageEditor
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1015
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1016
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1017
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1018
                  #label: 'ZipFile Tool'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1019
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1020
                  #value: #openZipTool
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1021
                  #enabled: #hasZipFileSelected
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1022
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1023
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1024
                  #label: 'File Differences...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1025
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1026
                  #value: #openDiffView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1027
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1028
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1029
                  #label: 'Find Duplicate Files'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1030
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1031
                  #value: #fileFindDuplicates
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1032
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1033
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1034
                  #label: 'Find All Duplicate Files (recursive)'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1035
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1036
                  #value: #fileFindAllDuplicates
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1037
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1038
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1039
                  #label: 'Find a File...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1040
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1041
                  #value: #fileFindFile
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1042
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1043
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1044
                  #label: 'Hex Dump'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1045
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1046
                  #value: #fileHexDump
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1047
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1048
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1049
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1050
                  #label: 'Shell Terminal'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1051
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1052
                  #isVisible: #canDoTerminal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1053
                  #value: #openTerminal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1054
                  #enabled: #canDoTerminal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1055
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1056
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1057
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1058
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1059
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1060
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1061
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1062
            #label: 'CVS'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1063
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1064
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1065
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1066
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1067
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1068
                  #label: 'Update selected files/directories'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1069
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1070
                  #value: #cvsUpdateSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1071
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1072
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1073
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1074
                  #label: 'Update directory local'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1075
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1076
                  #value: #cvsUpdateDirectoryLocal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1077
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1078
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1079
                  #label: 'Update directory recursive'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1080
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1081
                  #value: #cvsUpdateDirectoryRecursive
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1082
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1083
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1084
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1085
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1086
               #(#MenuItem
2145
5fa2a25b576b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2143
diff changeset
  1087
                  #label: 'Remove file && CVS Container...'
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1088
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1089
                  #value: #cvsRemoveFileAndContainer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1090
                  #enabled: #canRemoveCVSContainer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1091
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1092
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1093
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1094
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1095
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1096
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1097
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1098
            #label: 'Help'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1099
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1100
            #startGroup: #right
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1101
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1102
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1103
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1104
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1105
                  #label: 'FileBrowser Documentation'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1106
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1107
                  #value: #openHTMLDocument:
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1108
                  #argument: 'tools/fbrowser/TOP.html'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1109
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1110
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1111
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1112
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1113
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1114
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1115
         )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1116
        nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1117
        nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1118
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1119
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1120
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1121
!FileBrowser class methodsFor:'queries'!
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1122
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1123
isVisualStartable
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1124
    "return true, if this application can be started via #open"
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1125
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1126
    ^ true
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1127
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1128
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1129
! !
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1130
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1131
!FileBrowser methodsFor:'aspects'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1132
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1133
canAddToClassPath
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1134
    ^ [ |f sel|
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1135
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1136
	(Java isNil or:[Java isLoaded not]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1137
	    false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1138
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1139
	    sel := fileListView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1140
	    sel size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1141
		false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1142
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1143
		sel size == 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1144
		    f := currentDirectory asFilename
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1145
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1146
		    f := fileList at:sel first ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1147
		    f notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1148
			f := currentDirectory asFilename construct:f
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1149
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1150
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1151
		f notNil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1152
		and:[(Java classPath includes:f pathName) not
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1153
		and:[f isDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1154
		     or:[(f hasSuffix:'jar')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1155
		     or:[(f hasSuffix:'zip')]]]].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1156
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1157
	]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1158
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1159
1989
728996560b15 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1160
    "Modified: / 1.2.1999 / 20:38:42 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1161
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1162
2129
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1163
canDoTerminal
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1164
    ^ OperatingSystem isUNIXlike
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1165
      or:[OperatingSystem isMSWINDOWSlike]
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1166
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1167
    "Created: / 4.8.1998 / 13:37:13 / cg"
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1168
    "Modified: / 28.4.1999 / 11:54:17 / cg"
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1169
!
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1170
2101
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1171
canRemoveCVSContainer
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1172
    ^ [ |cvsDir|
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1173
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1174
	currentDirectory notNil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1175
	and:[fileListView selection size > 0
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1176
	and:[(cvsDir := currentDirectory construct:'CVS') exists
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1177
	and:[cvsDir isDirectory]]]]
2101
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1178
!
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1179
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1180
canRemoveToClassPath
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1181
    ^ [ |f sel|
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1182
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1183
	(Java isNil or:[Java isLoaded not]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1184
	    false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1185
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1186
	    sel := fileListView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1187
	    sel size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1188
		false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1189
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1190
		sel size == 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1191
		    f := currentDirectory asFilename
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1192
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1193
		    f := fileList at:sel first ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1194
		    f notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1195
			f := currentDirectory asFilename construct:f
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1196
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1197
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1198
		f notNil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1199
		and:[(Java classPath includes:f pathName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1200
		and:[f isDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1201
		     or:[(f hasSuffix:'jar')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1202
		     or:[(f hasSuffix:'zip')]]]]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1203
	      ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1204
	  ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1205
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1206
1989
728996560b15 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1207
    "Modified: / 1.2.1999 / 20:39:25 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1208
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1209
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1210
currentDirectoryIsNotTop
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1211
    ^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1212
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1213
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1214
    "Created: / 14.8.1998 / 12:07:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1215
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1216
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1217
dosEOLMode
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1218
    ^ dosEOLMode
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1219
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1220
    "Created: / 6.5.1999 / 11:37:25 / cg"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1221
    "Modified: / 6.5.1999 / 11:39:38 / cg"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1222
!
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1223
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1224
hasASN1
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1225
    ^ [ OSI::ASN1Parser notNil 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1226
        and:[OSI::ASN1Parser isLoaded]]
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1227
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1228
!
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1229
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1230
hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1231
    ^ [ fileListView selection size > 0
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1232
        and:[OSI::ASN1Parser notNil 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1233
        and:[OSI::ASN1Parser isLoaded]]]
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1234
!
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1235
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1236
hasFilenameSelectionInCodeView
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1237
    ^ [ |val sel|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1238
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1239
	val := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1240
	sel := subView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1241
	sel notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1242
	    sel := sel asString withoutSeparators.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1243
	    sel asFilename exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1244
		val := sel asFilename isReadable
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1245
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1246
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1247
	val
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1248
    ]
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1249
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1250
    "Created: / 4.2.1999 / 17:34:57 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1251
    "Modified: / 4.2.1999 / 17:39:32 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1252
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1253
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1254
hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1255
    ^ [ JavaClassReader notNil 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1256
	and:[JavaClassReader isLoaded]]
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1257
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1258
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1259
    "Created: / 17.10.1998 / 22:58:25 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1260
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1261
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1262
hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1263
    ^ [ fileListView selection size > 0
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1264
	and:[JavaClassReader notNil 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1265
	and:[JavaClassReader isLoaded]]]
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1266
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1267
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1268
    "Created: / 17.10.1998 / 22:58:03 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1269
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1270
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1271
hasSelection
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1272
    ^ [fileListView selection size > 0]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1273
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1274
    "Created: / 4.8.1998 / 14:10:31 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1275
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1276
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1277
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1278
hasVisitHistory
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1279
    ^ [DirectoryHistory size > 0]
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1280
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1281
    "Created: / 14.8.1998 / 19:17:02 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1282
    "Modified: / 14.8.1998 / 19:17:17 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1283
!
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1284
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1285
hasZipFileSelected
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1286
    ^ [|sel f fn suff|
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1287
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1288
	sel := fileListView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1289
	sel size == 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1290
	    f := fileList at:sel first ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1291
	    f notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1292
		suff := f asFilename suffix asLowercase.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1293
		suff = 'zip' or:[suff = 'jar']
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1294
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1295
		false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1296
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1297
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1298
	    false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1299
	]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1300
      ]
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1301
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1302
    "Created: / 26.8.1998 / 16:15:26 / cg"
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1303
    "Modified: / 30.1.1999 / 19:05:59 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1304
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1305
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1306
javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1307
    ^ [ JavaClassReader notNil 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1308
	and:[JavaClassReader isLoaded]]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1309
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1310
    "Created: / 9.11.1998 / 05:33:17 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1311
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1312
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1313
showingBigImagePreview
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1314
    ^ showingBigImagePreview
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1315
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1316
    "Created: / 14.8.1998 / 14:15:44 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1317
!
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1318
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1319
showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1320
    ^ showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1321
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1322
    "Created: / 14.8.1998 / 14:15:15 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1323
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1324
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1325
showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1326
    ^ showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1327
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1328
    "Created: / 14.8.1998 / 14:15:44 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1329
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1330
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1331
sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1332
    ^ sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1333
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1334
    "Created: / 14.8.1998 / 15:55:18 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1335
    "Modified: / 14.8.1998 / 15:56:08 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1336
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1337
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1338
sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1339
    ^ sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1340
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1341
    "Created: / 14.8.1998 / 14:21:21 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1342
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1343
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1344
systemIsDOS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1345
    ^ OperatingSystem isMSDOSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1346
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1347
    "Created: / 4.8.1998 / 13:37:28 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1348
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1349
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1350
systemIsUnix
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1351
    ^ OperatingSystem isUNIXlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1352
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1353
    "Created: / 4.8.1998 / 13:37:13 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1354
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1355
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1356
systemIsVMS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1357
    ^ OperatingSystem isVMSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1358
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1359
    "Created: / 4.8.1998 / 13:37:37 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1360
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1361
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1362
!FileBrowser methodsFor:'drag & drop'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1363
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1364
canDrop:aCollectionOfDropObjects
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1365
    "I accept fileObjects only"
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1366
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1367
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1368
	aDropObject isFileObject ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1369
	    aDropObject isTextObject ifFalse:[^ false].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1370
	]
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1371
    ].
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1372
    ^ true
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1373
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1374
    "Modified: 11.4.1997 / 12:41:59 / cg"
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1375
!
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1376
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1377
drop:aCollectionOfDropObjects at:aPoint
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1378
    "handle drops"
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1379
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1380
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1381
	self dropSingleObject:aDropObject at:aPoint
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1382
    ]
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1383
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1384
    "Modified: 11.4.1997 / 12:43:36 / cg"
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1385
!
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1386
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1387
dropSingleObject:someObject at:aPoint
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1388
    "handle drops; if its a directory, change to it.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1389
     If its a file, change to its directory and select the file.
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1390
     If its text, paste it into the codeView."
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1391
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1392
    |newDir newFile|
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1393
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1394
    someObject isFileObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1395
	someObject isDirectory ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1396
	    newDir := someObject theObject pathName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1397
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1398
	    newDir := someObject theObject directoryName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1399
	    newFile := someObject theObject baseName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1400
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1401
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1402
	newDir notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1403
	    newDir ~= currentDirectory pathName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1404
		self changeDirectoryTo:newDir.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1405
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1406
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1407
	newFile notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1408
	    newFile ~= currentFileName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1409
		fileListView selection:(fileList indexOf:newFile).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1410
		self doFileGet:false.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1411
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1412
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1413
	^ self
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1414
    ].
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1415
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1416
    someObject isTextObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1417
	subView paste:someObject theObject.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1418
	^ self
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1419
    ].
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1420
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1421
    "Modified: 6.4.1997 / 14:46:44 / cg"
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1422
! !
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1423
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1424
!FileBrowser methodsFor:'events'!
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1425
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1426
handlesKeyPress:key inView:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1427
    "this method is reached via delegation: are we prepared to handle
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1428
     a keyPress in some other view ?"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1429
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1430
    <resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept #CmdF #CmdD)>
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1431
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1432
    view == fileListView ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1433
	(key == #Delete 
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1434
	or:[key == #BackSpace
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1435
	or:[key == #Accept
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1436
	or:[key == #CmdI
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1437
	or:[key == #CmdF
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1438
	or:[key == #CmdD
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1439
	or:[key == #Cmdu
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1440
	or:[key == #InspectIt
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1441
	or:[key == #GotoLine
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1442
	or:[key == #DoIt]]]]]]]]]) ifTrue:[^ true].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1443
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1444
    ^ false
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1445
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1446
    "Created: / 28.1.1997 / 14:03:20 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1447
    "Modified: / 20.6.1997 / 16:35:01 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1448
    "Modified: / 16.1.1998 / 16:50:39 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1449
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1450
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1451
keyPress:key x:x y:y view:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1452
    "this method is reached via delegation from the fileListView"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1453
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1454
    <resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept)>
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1455
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1456
    (key == #Delete or:[key == #BackSpace]) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1457
	self fileRemove.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1458
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1459
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1460
    (key == #Accept) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1461
	self fileFileIn.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1462
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1463
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1464
    (key == #GotoLine) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1465
	self fileGet.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1466
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1467
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1468
    (key == #DoIt) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1469
	self fileExecute.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1470
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1471
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1472
    (key == #InspectIt) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1473
	self fileGetInfo.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1474
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1475
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1476
    (key == #CmdI) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1477
	self fileGetLongInfo.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1478
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1479
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1480
    (key == #Cmdu) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1481
	self updateCurrentDirectory.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1482
	^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1483
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1484
    (key == #CmdF) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1485
	self newFile.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1486
	^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1487
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1488
    (key == #CmdD) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1489
	self newDirectory.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1490
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1491
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1492
    fileListView keyPress:key x:x y:y
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1493
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1494
    "Created: / 28.1.1997 / 14:03:56 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1495
    "Modified: / 20.6.1997 / 16:35:08 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1496
    "Modified: / 16.1.1998 / 16:51:38 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1497
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1498
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1499
mapped 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1500
    super mapped.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1501
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1502
     whant to know about changed history
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1503
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1504
    self updateCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1505
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1506
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1507
visibilityChange:how
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1508
    |wasVisible|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1509
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1510
    wasVisible := shown.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1511
    super visibilityChange:how.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1512
    (wasVisible not and:[shown]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1513
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1514
	 start checking again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1515
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1516
	Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1517
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1518
    ]
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1519
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1520
    "Modified: / 18.2.1998 / 17:57:44 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1521
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1522
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1523
!FileBrowser methodsFor:'fileList user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1524
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1525
bigImagePreviewSettingChanged
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1526
    "invoked, when big image preview flag changed"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1527
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1528
    |fh|
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1529
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1530
    (showingBigImagePreview value == true 
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1531
    and:[showingDetails value == true]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1532
	fh := fileListView font height.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1533
	fileListView lineSpacing:(34 - fh max:0).
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1534
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1535
	fileListView clear.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1536
	self updateCurrentDirectory.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1537
	fileListView lineSpacing:2.
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1538
    ].
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1539
    fileListView clear.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1540
    self updateCurrentDirectory
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1541
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1542
    "Modified: / 4.8.1998 / 13:43:54 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1543
    "Created: / 14.8.1998 / 14:17:49 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1544
!
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1545
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1546
changeDisplayMode
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1547
    "toggle from long to short listing (and vice-versa)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1548
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1549
    showingDetails value:(showingDetails value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1550
    "/ showLongList := showLongList not.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  1551
    self showOrHideTabView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1552
    self updateCurrentDirectory
747
a50e8643c666 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
  1553
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1554
    "Modified: / 4.8.1998 / 13:43:54 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1555
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1556
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1557
changeDotFileVisibility
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1558
    "turn on/off visibility of files whose name starts with '.'"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1559
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1560
    showingHiddenFiles value:(showingHiddenFiles value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1561
    "/ showDotFiles := showDotFiles not.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1562
    self updateCurrentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1563
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1564
    "Modified: / 4.8.1998 / 13:45:46 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1565
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1566
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1567
detailsSettingChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1568
    "invoked, when detail (i.e. long / short) listing flag changed"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1569
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1570
    self showOrHideTabView.
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1571
    self bigImagePreviewSettingChanged
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1572
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1573
    "Modified: / 4.8.1998 / 13:43:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1574
    "Created: / 14.8.1998 / 14:17:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1575
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1576
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1577
fileDoubleClick:lineNr
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1578
    "double click on a file - get its contents"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1579
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1580
    self fileSelect:lineNr.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1581
    self fileGet:true
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1582
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1583
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1584
fileEncoding
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1585
    "open a dialog to allow change of the files character encoding.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1586
     Files are converted to internal encoding when read, and converted back
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1587
     to this encoding when saved.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1588
     The default encoding is nil, which means that files are already in
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1589
     the internal encoding (which is iso8859).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1590
     Notice: currently, not too many encodings are supported by the system."
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1591
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1592
    |dialog list descr encodings encodingNames idx|
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1593
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1594
    list := SelectionInList new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1595
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1596
    descr := CharacterArray supportedExternalEncodings.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1597
    encodings := descr at:2.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1598
    encodingNames := descr at:1.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1599
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1600
    list list:encodingNames.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1601
    list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1602
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1603
    dialog := Dialog new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1604
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1605
    dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1606
    dialog addVerticalSpace.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1607
    dialog addListBoxOn:list withNumberOfLines:5.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1608
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  1609
    dialog addAbortAndOkButtons.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1610
    dialog open.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1611
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1612
    dialog accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1613
	idx := list selectionIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1614
	fileEncoding := encodings at:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1615
	subView externalEncoding:fileEncoding.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1616
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1617
	self validateFontEncodingFor:fileEncoding ask:true.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1618
    ].
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1619
1219
8495da2ea4cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  1620
    "Modified: 30.6.1997 / 14:41:12 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1621
!
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1622
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1623
fileExecute
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1624
    "if text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1625
     otherwise pop up execute box immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1626
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1627
    |action sel fileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1628
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1629
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1630
     this replaces everything by the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1631
    "
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1632
    action := [:command | 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1633
		self class addToCommandHistory:command for:fileName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1634
		self doExecuteCommand:command replace:true
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1635
	      ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1636
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1637
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when command is executed.'
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1638
	      yesButton:'execute') ifFalse:[^ self].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1639
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1640
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1641
"/     this inserts the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1642
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1643
"/    action := [:command| self doExecuteCommand:command replace:false].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1644
"/
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1645
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1646
    sel := fileListView selection.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1647
    sel size == 1 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1648
	fileName := fileList at:sel first
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1649
    ].
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1650
    self askForCommandFor:fileName thenDo:action
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1651
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1652
    "Modified: 14.11.1996 / 14:59:34 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1653
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1654
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1655
fileFileIn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1656
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1657
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1658
    self fileFileInLazy:false 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1659
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1660
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1661
fileFileInLazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1662
    "fileIn the selected file(s). Do a quick load (no compilation)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1663
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1664
    self fileFileInLazy:true 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1665
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1666
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1667
fileFileInLazy:lazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1668
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1669
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1670
    |aStream path oldPath wasLazy bos prevCurrentFileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1671
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1672
    self selectedFilesDo:[:fileName |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1673
	path := currentDirectory filenameFor:fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1674
	path type == #regular ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1675
	    prevCurrentFileName := currentFileInFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1676
	    currentFileInFileName := fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1677
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1678
	    (ObjectFileLoader notNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1679
	    and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1680
		Object abortSignal catch:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1681
		    |p|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1682
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1683
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1684
		    "/ look if already loaded ...  then unload first
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1685
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1686
		    p := path pathName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1687
		    (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1688
			(Dialog confirm:(resources 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1689
					    string:'%1 is already loaded; load anyway ?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1690
					    with:p)) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1691
			    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1692
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1693
			Transcript showCR:'unloading old ' , p , ' ...'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1694
			ObjectFileLoader unloadObjectFile:p. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1695
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1696
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1697
		    Transcript showCR:'loading ' , p , ' ...'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1698
		    ObjectFileLoader loadObjectFile:p.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1699
		    Class addInfoRecord:('fileIn ' , fileName) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1700
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1701
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1702
		(path hasSuffix:'cls') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1703
		    aStream := path readStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1704
		    aStream notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1705
			bos := BinaryObjectStorage onOld:aStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1706
			Class nameSpaceQuerySignal 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1707
			    answer:Smalltalk
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1708
			    do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1709
				bos next.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1710
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1711
			bos close
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1712
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1713
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1714
		    ((path hasSuffix:'class')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1715
		    or:[(path hasSuffix:'cla')]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1716
			JavaClassReader notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1717
			    JavaClassReader loadFile:(path pathName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1718
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1719
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1720
			aStream := path readStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1721
			aStream notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1722
			    [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1723
				Class withoutUpdatingChangesDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1724
				    oldPath := Smalltalk systemPath.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1725
				    Smalltalk systemPath:(oldPath copy addFirst:currentDirectory pathName; yourself).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1726
				    wasLazy := Compiler compileLazy:lazy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1727
				    aStream fileIn.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1728
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1729
				Class addInfoRecord:('fileIn ' , fileName) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1730
			    ] valueNowOrOnUnwindDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1731
				Compiler compileLazy:wasLazy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1732
				Smalltalk systemPath:oldPath.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1733
				aStream close
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1734
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1735
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1736
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1737
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1738
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1739
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1740
	currentFileInFileName := prevCurrentFileName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1741
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1742
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1743
    "Modified: / 19.9.1997 / 23:42:22 / stefan"
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1744
    "Modified: / 18.6.1998 / 15:30:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1745
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1746
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1747
fileFindAllDuplicates
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1748
    "scan directory and all subdirs for duplicate files"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1749
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1750
    |fileNames dir infoDir filesBySize
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1751
     result info dirPrefix|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1752
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1753
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.'
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1754
	      yesButton:'proceed') ifFalse:[^ self].
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1755
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1756
    self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1757
	result := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1758
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1759
	dir := currentDirectory asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1760
	self label:myName , '- gathering file names ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1761
	fileNames := dir recursiveDirectoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1762
	fileNames := fileNames collect:[:fn | dir construct:fn].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1763
	fileNames := fileNames select:[:fn | fn isDirectory not].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1764
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1765
	self label:myName , '- gathering sizes ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1766
	infoDir := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1767
	fileNames do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1768
	    infoDir at:fn put:(fn fileSize)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1769
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1770
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1771
	"/ for each, get the files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1772
	"/ in a first pass, look for files of the same size and
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1773
	"/ compare them ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1774
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1775
	self label:myName , '- preselect possible duplicates ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1776
	filesBySize := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1777
	infoDir keysAndValuesDo:[:fn :sz |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1778
	    |entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1779
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1780
	    entry := filesBySize at:sz ifAbsentPut:[Set new].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1781
	    entry add:fn.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1782
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1783
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1784
	"/ any of same size ?
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1785
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1786
	self label:myName , '- checking for duplicates ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1787
	filesBySize do:[:entry |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1788
	    |files|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1789
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1790
	    entry size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1791
		files := entry asArray.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1792
		1 to:files size-1 do:[:idx1 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1793
		    idx1+1 to:files size do:[:idx2 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1794
			|fn1 fn2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1795
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1796
			fn1 := files at:idx1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1797
			fn2 := files at:idx2.
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1798
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1799
"/                        self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1800
			(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1801
			    "/ compare the files
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1802
			    (fn1 sameContentsAs:fn2) ifTrue:[
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1803
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1804
				result at:fn1 put:fn2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1805
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1806
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1807
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1808
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1809
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1810
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1811
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1812
	self label:myName , '- sorting ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1813
	dirPrefix := currentDirectory asFilename pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1814
	result := result associations.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1815
	result := result collect:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1816
					|f1 f2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1817
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1818
					f1 := assoc key name.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1819
					f2 := assoc value name.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1820
					(f1 startsWith:dirPrefix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1821
					    f1 := f1 copyFrom:dirPrefix size + 2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1822
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1823
					(f2 startsWith:dirPrefix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1824
					    f2 := f2 copyFrom:dirPrefix size + 2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1825
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1826
					f1 < f2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1827
					    f2 -> f1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1828
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1829
					    f1 -> f2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1830
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1831
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1832
	result sort:[:f1 :f2 | f2 value < f1 value].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1833
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1834
	info := OrderedCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1835
	result do:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1836
	    info add:(assoc key , ' same as ' , assoc value)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1837
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1838
	info isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1839
	    info := 'No duplicate files found.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1840
	].
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1841
    ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1842
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1843
    subView contents:info.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1844
    self label:myName.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1845
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1846
    "Created: / 28.11.1998 / 17:47:53 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1847
    "Modified: / 10.12.1998 / 17:13:14 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1848
!
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1849
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1850
fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1851
    "scan directory for duplicate files"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1852
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1853
    |fileNames dir infoDir filesBySize
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1854
     result info|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1855
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1856
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.'
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1857
	      yesButton:'proceed') ifFalse:[^ self].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1858
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1859
    self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1860
	result := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1861
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1862
	dir := currentDirectory asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1863
	fileNames := dir directoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1864
	fileNames := fileNames collect:[:fn | dir construct:fn].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1865
	fileNames := fileNames select:[:fn | fn isDirectory not].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1866
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1867
	infoDir := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1868
	fileNames do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1869
	    infoDir at:fn put:(fn info)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1870
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1871
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1872
	"/ for each, get the files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1873
	"/ in a first pass, look for files of the same size and
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1874
	"/ compare them ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1875
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1876
	filesBySize := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1877
	infoDir keysAndValuesDo:[:fn :info |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1878
	    |sz entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1879
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1880
	    sz := info size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1881
	    entry := filesBySize at:sz ifAbsentPut:[Set new].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1882
	    entry add:fn.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1883
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1884
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1885
	"/ any of same size ?
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1886
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1887
	filesBySize do:[:entry |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1888
	    |files|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1889
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1890
	    entry size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1891
		files := entry asArray.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1892
		1 to:files size-1 do:[:idx1 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1893
		    idx1+1 to:files size do:[:idx2 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1894
			|fn1 fn2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1895
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1896
			fn1 := files at:idx1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1897
			fn2 := files at:idx2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1898
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1899
			(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1900
			    "/ compare the files
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1901
			    (fn1 sameContentsAs:fn2) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1902
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1903
				result at:fn1 put:fn2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1904
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1905
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1906
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1907
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1908
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1909
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1910
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1911
	result := result associations.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1912
	result := result collect:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1913
					|f1 f2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1914
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1915
					f1 := assoc key baseName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1916
					f2 := assoc value baseName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1917
					f1 < f2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1918
					    f2 -> f1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1919
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1920
					    f1 -> f2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1921
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1922
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1923
	result sort:[:f1 :f2 | f2 value < f1 value].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1924
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1925
	info := OrderedCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1926
	result do:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1927
	    info add:(assoc key , ' same as ' , assoc value)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1928
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1929
	info isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1930
	    info := 'No duplicate files found.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1931
	].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1932
    ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1933
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1934
    subView contents:info
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1935
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1936
    "Created: / 3.10.1998 / 17:59:00 / cg"
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1937
    "Modified: / 3.10.1998 / 19:29:19 / cg"
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1938
!
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1939
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1940
fileFindFile
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1941
    |sel bindings
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1942
     namePatternHolder contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1943
     ignoreCaseInName ignoreCaseInContents
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1944
     namePattern namePatterns contentsPattern 
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1945
     searchForSameContentsEnabled searchForSameContents|
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1946
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1947
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.'
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1948
              yesButton:'proceed') ifFalse:[^ self].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1949
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1950
    subView contents:nil; scrollToTop.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1951
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1952
    bindings := IdentityDictionary new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1953
    bindings at:#namePatternHolder put:(namePatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1954
    bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1955
    bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1956
    bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1957
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1958
    searchForSameContentsEnabled := false.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1959
    sel := fileListView selectionValue.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1960
    sel size == 1 ifTrue:[
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1961
        searchForSameContentsEnabled := true.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1962
        sel := sel first string withoutSeparators
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1963
    ].
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1964
    bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1965
    bindings at:#searchForSameContents put:(searchForSameContents := false asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1966
    bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1967
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1968
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1969
    (SimpleDialog new 
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1970
        openFor:self
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1971
        interfaceSpec:(self class fileSearchDialogSpec)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1972
        withBindings:bindings) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1973
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1974
        namePattern := namePatternHolder value.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1975
        namePattern size == 0 ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1976
            namePatterns := nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1977
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1978
            ignoreCaseInName value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1979
                namePattern := namePattern asLowercase
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1980
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1981
            namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$;
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1982
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1983
        contentsPattern := contentsPatternHolder value.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1984
        contentsPattern size == 0 ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1985
            contentsPattern := nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1986
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1987
            ignoreCaseInContents value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1988
                contentsPattern := contentsPattern asLowercase
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1989
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1990
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1991
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1992
        self withWaitCursorDo:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1993
            |stopSignal access myProcess lowerFrameView|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1994
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1995
            myProcess := Processor activeProcess.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1996
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1997
            access := Semaphore forMutualExclusion name:'accessLock'.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1998
            stopSignal := Signal new.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  1999
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2000
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2001
             The following is tricky: 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2002
             the pauseToggle & killButton will
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2003
             be handled by their own windowGroup process.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2004
             This means, that they respond to events even though
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2005
             I myself am reading the commands output.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2006
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2007
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2008
            commandView beInvisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2009
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2010
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2011
             must take kill & pauseButtons out of my group
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2012
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2013
            killButton windowGroup:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2014
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2015
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2016
             bring them to front, and turn hidden-mode off
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2017
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2018
            killButton label:(resources string:'stop').
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2019
            killButton raise; beVisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2020
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2021
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2022
             kill will make me raise the stopSignal when pressed
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2023
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2024
            killButton 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2025
                action:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2026
                    access critical:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2027
                        myProcess interruptWith:[stopSignal raiseRequest].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2028
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2029
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2030
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2031
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2032
             start kill button under its own windowgroup
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2033
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2034
            killButton openAutonomous.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2035
            killButton windowGroup process processGroupId:(Processor activeProcess id).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2036
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2037
            lowerFrameView := subView superView.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2038
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2039
            [
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2040
                stopSignal catch:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2041
                    searchForSameContents value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2042
                        self 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2043
                            doFindFileNamed:namePatterns
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2044
                            ignoreCase:ignoreCaseInName value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2045
                            containingString:nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2046
                            ignoreCaseInContents:ignoreCaseInContents value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2047
                            sameContentsAsFile:(currentDirectory asFilename construct:sel) 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2048
                            sameContentsAs:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2049
                            in:currentDirectory.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2050
                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2051
                        (contentsPattern size > 0 or:[namePatterns size > 0]) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2052
                            self 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2053
                                doFindFileNamed:namePatterns
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2054
                                ignoreCase:ignoreCaseInName value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2055
                                containingString:contentsPattern
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2056
                                ignoreCaseInContents:ignoreCaseInContents value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2057
                                sameContentsAsFile:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2058
                                sameContentsAs:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2059
                                in:currentDirectory.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2060
                        ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2061
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2062
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2063
            ] valueNowOrOnUnwindDo:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2064
                |wg|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2065
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2066
                self label:myName; iconLabel:myName.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2067
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2068
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2069
                 hide the button, and make sure it will stay
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2070
                 hidden when we are realized again
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2071
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2072
                killButton beInvisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2073
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2074
                commandView beVisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2075
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2076
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2077
                 remove the killButton from its group
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2078
                 (otherwise, it will be destroyed when we shut down the group)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2079
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2080
                wg := killButton windowGroup.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2081
                killButton windowGroup:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2082
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2083
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2084
                 shut down the kill buttons windowgroup
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2085
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2086
                wg notNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2087
                    wg process terminate.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2088
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2089
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2090
                 clear its action (actually not needed, but
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2091
                 releases reference to thisContext earlier)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2092
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2093
                killButton action:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2094
                killButton label:(resources string:'kill').
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2095
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2096
                "/    
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2097
                "/ allow interaction with the codeView
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2098
                "/ (bring it back into my group)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2099
                "/
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2100
                lowerFrameView windowGroup:(self windowGroup).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2101
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2102
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2103
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2104
        self label:myName.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2105
        currentFileName isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2106
            subView modified:false.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2107
        ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2108
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2109
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2110
    "Created: / 15.10.1998 / 11:32:57 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2111
    "Modified: / 15.10.1998 / 12:41:09 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2112
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2113
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2114
fileGet
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2115
    "get contents of selected file into subView.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2116
     If text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2117
     otherwise get it immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2118
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2119
    self fileGet:false
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2120
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2121
    "Modified: 19.6.1996 / 09:38:45 / cg"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2122
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2123
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2124
fileGet:viaDoubleClick
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2125
    "get contents of selected file into subView.
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2126
     If text was modified show a queryBox,
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2127
     otherwise get it immediately"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2128
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2129
    |fileName msg label|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2130
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  2131
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2132
	self doFileGet:viaDoubleClick.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2133
	^ self
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  2134
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2135
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2136
    fileName notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2137
	(currentDirectory filenameFor:fileName) isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2138
	    msg := 'contents has not been saved.\\Modifications will be lost when directory is changed.'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2139
	    label := 'change'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2140
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2141
	    msg := 'contents has not been saved.\\Modifications will be lost when new file is read.'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2142
	    label := 'get'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2143
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2144
	(self ask:(resources at:msg) yesButton:label) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2145
	    subView modified:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2146
	    self doFileGet:viaDoubleClick
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2147
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2148
    ]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2149
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2150
    "Created: 19.6.1996 / 09:38:35 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2151
    "Modified: 23.4.1997 / 13:04:11 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2152
    "Modified: 18.9.1997 / 16:27:34 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2153
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2154
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2155
fileGetInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2156
    "show short file (stat)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2157
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2158
    self fileGetInfo:false
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2159
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2160
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2161
fileGetInfo:longInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2162
    "get info on selected file - show it in a box"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2163
1672
9df905f8bfa3 update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2164
    |string box updater|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2165
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2166
    string := self getFileInfoString:longInfo.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2167
    string notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2168
	box := InfoBox title:string.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2169
	updater := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2170
	    [true] whileTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2171
		Delay waitForSeconds:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2172
		string := self getFileInfoString:longInfo.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2173
		box title:string
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2174
	    ] 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2175
	] fork.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2176
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2177
	box showAtPointer.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2178
	updater terminate.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2179
	box destroy
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2180
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2181
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2182
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2183
fileGetLongInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2184
    "show long stat (file)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2185
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2186
    self fileGetInfo:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2187
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2188
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2189
fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2190
    "show a hex dump (similar to od -x)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2191
     Only needed with non-Unix systems."
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2192
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2193
    self withReadCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2194
	|fileName f stream data offs 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2195
	 addrDigits col line asciiLine lines|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2196
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2197
	fileName := self getSelectedFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2198
	fileName notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2199
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2200
	    f isDirectory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2201
		^ self warn:(resources string:'%1 is a directory.' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2202
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2203
	    f exists ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2204
		self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2205
		^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2206
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2207
	    f isReadable ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2208
		self warn:(resources string:'''%1'' is unreadable.' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2209
		^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2210
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2211
	    stream := f readStream binary.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2212
	    data := stream contents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2213
	    stream close.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2214
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2215
	    subView list:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2216
	    col := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2217
	    offs := 0.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2218
	    lines := StringCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2219
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2220
	    addrDigits := ((f fileSize + 1) log:16) truncated + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2221
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2222
	    line := (offs hexPrintString:addrDigits) , ': '.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2223
	    asciiLine := ''.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2224
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2225
	    data do:[:byte |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2226
		line := line , (byte hexPrintString:2).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2227
		(byte between:32 and:127) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2228
		    asciiLine := asciiLine copyWith:(Character value:byte)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2229
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2230
		    asciiLine := asciiLine , '.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2231
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2232
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2233
		offs := offs + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2234
		col := col + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2235
		col > 16 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2236
		    lines add:(line , '        ' , asciiLine).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2237
		    (offs bitAnd:16rFF) == 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2238
			lines add:nil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2239
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2240
		    line := (offs hexPrintString:addrDigits) , ': '.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2241
		    asciiLine := ''.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2242
		    col := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2243
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2244
		    line := line , ' '
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2245
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2246
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2247
	    line := line paddedTo:(3*16 + addrDigits + 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2248
	    lines add:(line , '        ' , asciiLine).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2249
	    self show:lines.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2250
	]
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2251
    ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2252
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2253
    "Modified: / 7.9.1998 / 15:37:47 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2254
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2255
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2256
fileInsert
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2257
    "insert contents of file at the cursor position"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2258
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2259
    |fileName|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2260
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2261
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2262
    fileName notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2263
	self showFile:fileName insert:true encoding:fileEncoding
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2264
    ]
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  2265
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2266
    "Modified: 23.4.1997 / 13:06:06 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2267
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2268
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2269
fileListMenu
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2270
    "return the menu to show in the fileList"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2271
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  2272
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2273
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2274
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2275
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2276
    m := self class menuPopUp.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2277
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2278
    m receiver:self.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2279
    m findGuiResourcesIn:self.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2280
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2281
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2282
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2283
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2284
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2285
fileListMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2286
    "return the menu to show in the fileList"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2287
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2288
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2289
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2290
    |items m sel ns subMenu subItems|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2291
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2292
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2293
		 ('spawn'            fileSpawn        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2294
		 ('-'                nil              )  
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2295
		 ('get contents'     fileGet          GotoLine)      
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2296
		 ('insert contents'  fileInsert       )            
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2297
		 ('show info'        fileGetInfo      InspectIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2298
		 ('show full info'   fileGetLongInfo  CmdI)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2299
	       ).
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2300
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2301
    ((ns := Project current defaultNameSpace) notNil 
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2302
    and:[ns ~~ Smalltalk]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2303
	items := items copyWith:(Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2304
				    with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2305
				    with:#fileFileIn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2306
				    with:#Accept)
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2307
                                
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2308
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2309
	items := items copyWith:#( 'fileIn'  #fileFileIn  #Accept)
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2310
    ].
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2311
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2312
    items := items , #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2313
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2314
		 ('update'                    updateCurrentDirectory    Cmdu)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2315
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2316
		 ('execute unix command ...'  fileExecute               DoIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2317
		 ('st/x tools'                stxTools                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2318
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2319
		 ('remove'                    fileRemove                Delete)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2320
		 ('rename ...'                fileRename                )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2321
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2322
		 ('display long list'         changeDisplayMode         )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2323
		 ('show all files'            changeDotFileVisibility   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2324
		 ('encoding ...'              fileEncoding              )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2325
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2326
		 ('create directory ...'      newDirectory              CmdD)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2327
		 ('create file ...'           newFile                   CmdF)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2328
	       ).             
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2329
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2330
    m := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2331
	    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2332
	    resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2333
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2334
    showingHiddenFiles value "showDotFiles" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2335
	m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2336
    ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2337
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2338
	m labelAt:#changeDisplayMode put:(resources string:'display short list')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2339
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2340
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2341
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2342
			      ('Changes browser'       openChangesBrowser  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2343
			      ('Editor'                openEditor          )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2344
			      ('HTML reader'           openHTMLReader      )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2345
			      ('Image inspect'         openImageInspector  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2346
			      ('show file differences' openDiffView        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2347
		  ).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2348
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2349
    OperatingSystem isUNIXlike ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2350
	items := items , #( ('terminal'              openTerminal )).
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2351
    ].
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2352
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2353
    JavaInterpreter notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2354
	items := items , #( ('Java Applet Viewer' openAppletViewer)).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2355
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2356
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2357
    m subMenuAt:#stxTools 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2358
	    put:(PopUpMenu
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2359
		    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2360
		    resources:resources).
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2361
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2362
    ((sel := fileListView selection) isNil 
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2363
    or:[sel isEmpty]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2364
	m disableAll:#(fileGet fileInsert
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2365
		       fileGetInfo fileGetLongInfo
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2366
		       fileFileIn fileFileInLazy
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2367
		       fileRemove fileRename).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2368
	(m subMenuAt:#stxTools)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2369
	    disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector)
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2370
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2371
	fileListView selection size > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2372
	    m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2373
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2374
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2375
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2376
    ^m
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2377
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2378
    "Modified: / 16.1.1998 / 16:42:59 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2379
    "Modified: / 4.8.1998 / 13:45:56 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2380
    "Created: / 13.8.1998 / 20:51:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2381
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2382
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2383
filePrint
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2384
    "send a files contents to the printer (not in the menu)"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2385
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2386
    |fileName path inStream printStream line|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2387
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2388
    self withWaitCursorDo:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2389
	fileName := self getSelectedFileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2390
	fileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2391
	    path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2392
	    (path type == #regular) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2393
		inStream := path readStream.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2394
		inStream isNil ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2395
		    printStream := PrinterStream new.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2396
		    printStream notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2397
			[inStream atEnd] whileFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2398
			    line := inStream nextLine.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2399
			    printStream nextPutLine:line.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2400
			].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2401
			printStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2402
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2403
		    inStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2404
		]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2405
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2406
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2407
	0 "compiler hint"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2408
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2409
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2410
    "Modified: 23.4.1997 / 13:05:40 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2411
    "Modified: 18.9.1997 / 16:29:17 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2412
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2413
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2414
fileRemove
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2415
    "remove the selected file(s).
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2416
     Query if user really wants to remove the file.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2417
     - should be enhanced, to look for a ~/.trash directory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2418
     and move files there if it exists (without asking in this case)."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2419
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2420
    |sel q|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2421
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2422
    sel := fileListView selection.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2423
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2424
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2425
	sel size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2426
	    q := resources string:'remove %1 selected files ?' with:(sel size)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2427
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2428
	    q := resources string:'remove ''%1'' ?' with:(sel first asText allBold)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2429
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2430
	(self sensor shiftDown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2431
	or:[self ask:q yesButton:'remove']) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2432
	    self withCursor:(Cursor wait) do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2433
		self doRemove:sel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2434
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2435
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2436
    ]
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2437
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2438
    "Modified: / 16.12.1998 / 17:30:31 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2439
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2440
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2441
fileRename
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2442
    "rename the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2443
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2444
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2445
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2446
    queryBox := FilenameEnterBox new.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2447
    queryBox okText:(resources at:'rename').
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2448
    self selectedFilesDo:[:oldName |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2449
	queryBox title:(resources string:'rename ''%1'' to:' with:oldName).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2450
	queryBox initialText:oldName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2451
	queryBox action:[:newName | self doRename:oldName to:newName].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2452
	queryBox showAtPointer
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2453
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2454
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2455
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2456
fileSelect:lineNr
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2457
    "selected a file - do nothing here"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2458
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2459
    |fn|
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2460
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  2461
    imagePreviewView notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2462
	self stopImageRenderProcess.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2463
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2464
	fn := self getSelectedFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2465
	(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2466
	    imageRenderProcess := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2467
		self loadImageAndPerform:[:img | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2468
						imagePreviewView beVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2469
						imagePreviewView image:img
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2470
					 ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2471
	    ] forkAt:(Processor activePriority - 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2472
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2473
	    imagePreviewView beInvisible
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2474
	].
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  2475
    ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2476
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2477
    "Modified: 23.4.1997 / 13:04:55 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2478
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2479
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2480
fileSpawn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2481
    "start another FileBrowser on the selected directory or
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2482
     on the same directory if none is selected."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2483
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2484
    |any path|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2485
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2486
    any := false.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2487
    self selectedFilesDo:[:fileName |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2488
	path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2489
	path isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2490
	    self class openOn:(path pathName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2491
	    any := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2492
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2493
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2494
    any ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2495
	self class openOn:currentDirectory pathName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2496
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2497
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2498
    "Modified: 18.9.1997 / 16:32:39 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2499
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2500
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2501
loadImageAndPerform:aSelectorOrBlock
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2502
    |img path|
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2503
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2504
    self selectedFilesDo:[:fileName |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2505
	path := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2506
	path isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2507
	    img := Image fromFile:(path pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2508
	    img notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2509
		aSelectorOrBlock isSymbol ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2510
		    img perform:aSelectorOrBlock
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2511
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2512
		    aSelectorOrBlock value:img
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2513
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2514
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2515
		self warn:'unknown format: ' , fileName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2516
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2517
	]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2518
    ].
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2519
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2520
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2521
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2522
    "Created: / 26.8.1998 / 16:20:18 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2523
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2524
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2525
newDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2526
    "ask for and create a new directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2527
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2528
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2529
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2530
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2531
		    title:(resources at:'create new directory:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2532
		    okText:(resources at:'create')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2533
		    action:[:newName | self doCreateDirectory:newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2534
    queryBox showAtPointer
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2535
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2536
    "Modified: 23.4.1997 / 13:04:27 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2537
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2538
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2539
newFile
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2540
    "ask for and create a new file"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2541
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2542
    |sel queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2543
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2544
    queryBox := FilenameEnterBox 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2545
		    title:(resources at:'create new file:') withCRs
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2546
		    okText:(resources at:'create')
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2547
		    action:[:newName | newName isEmpty ifFalse:[self doCreateFile:newName]].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2548
    sel := subView selection.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2549
    sel notNil ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2550
	queryBox initialText:(sel asString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2551
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2552
    queryBox showAtPointer
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  2553
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2554
    "Modified: / 23.4.1997 / 13:04:38 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2555
    "Modified: / 16.1.1998 / 16:54:00 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2556
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2557
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2558
newHardLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2559
    "ask for and create a hard link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2560
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2561
    |sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2562
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2563
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2564
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2565
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2566
    (sel size > 0) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2567
	(currentDirectory construct:sel) isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2568
	    orgName1 := sel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2569
	]
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2570
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2571
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2572
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2573
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2574
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2575
    box := DialogBox new.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2576
    (box addTextLabel:(resources string:'Create hard link from:')) adjust:#left.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2577
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2578
    (box addTextLabel:(resources string:'to:')) adjust:#left.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2579
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2580
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2581
    box addAbortAndOkButtons.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2582
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2583
    orgName1 size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2584
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2585
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2586
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2587
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2588
    box accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2589
	name1 := name1 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2590
	(name1 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2591
	    err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2592
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2593
	    f1 := name1 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2594
	    name2 := name2 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2595
	    (name2 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2596
		err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2597
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2598
		f2 := name2 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2599
		f2 exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2600
		    err := '''%2'' already exists'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2601
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2602
		    f1 exists ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2603
			err := '''%1'' does not exist'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2604
		    ] ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2605
			f1 isDirectory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2606
			    err := '''%1'' is a directory'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2607
			] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2608
			    ErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2609
				err := ex errorString
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2610
			    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2611
				OperatingSystem createHardLinkFrom:name1 to:name2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2612
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2613
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2614
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2615
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2616
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2617
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2618
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2619
	err notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2620
	    self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2621
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2622
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2623
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2624
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2625
    "Modified: / 13.8.1998 / 21:47:01 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2626
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2627
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2628
newSoftLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2629
    "ask for and create a soft link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2630
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2631
    |sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2632
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2633
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2634
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2635
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2636
    (sel size > 0) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2637
	orgName1 := sel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2638
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2639
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2640
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2641
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2642
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2643
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2644
    (box addTextLabel:'Create symbolic link to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2645
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2646
    (box addTextLabel:'as:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2647
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2648
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2649
    box addAbortAndOkButtons.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2650
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2651
    orgName1 size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2652
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2653
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2654
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2655
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2656
    box accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2657
	name1 := name1 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2658
	(name1 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2659
	    err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2660
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2661
	    f1 := name1 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2662
	    name2 := name2 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2663
	    (name2 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2664
		err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2665
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2666
		f2 := name2 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2667
		f2 exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2668
		    err := '''%2'' already exists'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2669
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2670
		    f1 exists ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2671
			err := '''%1'' does not exist (link created anyway)'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2672
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2673
		    ErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2674
			err := ex errorString
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2675
		    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2676
			OperatingSystem createSymbolicLinkFrom:name1 to:name2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2677
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2678
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2679
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2680
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2681
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2682
	err notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2683
	    self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2684
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2685
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2686
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2687
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2688
    "Modified: / 13.8.1998 / 21:26:59 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2689
    "Created: / 13.8.1998 / 21:47:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2690
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2691
2186
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2692
openASN1Browser
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2693
    self openTool:OSI::ASN1Browser 
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2694
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2695
    "Modified: / 7.9.1998 / 21:31:58 / cg"
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2696
!
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2697
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2698
openAppletViewer
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2699
    |numItems|
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2700
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2701
    (numItems := fileListView selection size) > 2 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2702
	(self 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2703
	    confirm:(resources string:'open for each of the %1 items ?' 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2704
				 with:numItems)) ifFalse:[^ self].
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2705
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2706
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2707
    Java startupJavaSystem.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2708
"/    Java markAllClassesUninitialized.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2709
"/    Java initAllStaticFields.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2710
"/    Java initAllClasses.
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2711
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2712
    self selectedFilesDo:[:fileName |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2713
	|p path|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2714
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2715
	path := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2716
	path isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2717
	    p := Java 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2718
		    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2719
		    argumentString:path pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2720
	    p resume.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2721
	]
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2722
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2723
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2724
    "Modified: / 18.9.1997 / 17:00:59 / stefan"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2725
    "Modified: / 17.10.1998 / 17:00:43 / cg"
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2726
!
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2727
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2728
openChangesBrowser
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2729
    "open a change browser on the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2730
1939
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2731
    self openTool:(UserPreferences current changesBrowserClass)
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2732
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2733
    "Modified: / 17.10.1998 / 14:39:15 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2734
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2735
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2736
openDiffView
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2737
    "open a diff-view"
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2738
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2739
    |sel box orgName1 name1 name2 text1 text2 f d err nm here l1|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2740
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2741
    sel := self getSelectedFileName.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2742
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2743
    orgName1 := ''.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2744
    (sel size > 0
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2745
    and:[lastFileDiffDirectory notNil
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2746
    and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[
2140
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2747
        f := lastFileDiffDirectory asFilename construct:sel.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2748
        (f exists
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2749
        and:[f isReadable]) ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2750
            orgName1 := f name
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2751
        ]
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2752
    ].
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2753
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2754
    name1 := orgName1 asValue.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2755
    name2 := self getSelectedFileName asValue.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2756
    here := currentDirectory pathName.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2757
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2758
    box := DialogBox new.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2759
    (box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2760
    box addFilenameInputFieldOn:name1 in:here tabable:true.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2761
    (box addTextLabel:'and file2:') adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2762
    box addFilenameInputFieldOn:name2 in:here tabable:true.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2763
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2764
    box addAbortAndOkButtons.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2765
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2766
    box showAtPointer.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2767
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2768
    box accepted ifTrue:[
2140
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2769
        name1 := name1 value.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2770
        (name1 isNil or:[name1 isEmpty]) ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2771
"/            text1 := subView contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2772
            text1 := subView list asStringCollection withTabs.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2773
            text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2774
            name1 := nil.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2775
            l1 := 'browser contents'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2776
        ] ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2777
            name1 := currentDirectory filenameFor:name1.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2778
            name1 isReadable ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2779
                nm := name1.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2780
                name1 exists ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2781
                    err := '%1 does not exist'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2782
                ] ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2783
                    err := '%1 is not readable'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2784
                ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2785
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2786
            l1 := name1 pathName
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2787
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2788
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2789
        name2 := currentDirectory filenameFor:name2 value.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2790
        err isNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2791
            name2 isReadable ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2792
                nm := name2.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2793
                name2 exists ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2794
                    err := '%1 does not exist'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2795
                ] ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2796
                    err := '%1 is not readable'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2797
                ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2798
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2799
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2800
        err notNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2801
            self warn:(resources string:err with:nm pathName).
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2802
            ^ self
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2803
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2804
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2805
        self withWaitCursorDo:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2806
            (name1 notNil and:[name1 name ~= orgName1]) ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2807
                lastFileDiffDirectory := name1 directoryName
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2808
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2809
            name1 notNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2810
                text1 := name1 contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2811
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2812
            text2 := name2 contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2813
            text1 = text2 ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2814
                self information:'same contents'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2815
            ] ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2816
                d := DiffTextView 
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2817
                        openOn:text1 label:l1
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2818
                        and:text2 label:name2 pathName.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2819
                d label:'file differences'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2820
            ]
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2821
        ]
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2822
    ].
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2823
1735
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  2824
    "Created: / 7.12.1995 / 20:33:58 / cg"
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  2825
    "Modified: / 18.9.1997 / 17:31:46 / stefan"
2140
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2826
    "Modified: / 5.5.1999 / 16:04:10 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2827
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2828
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2829
openEditor
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2830
    self openTool:EditTextView
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2831
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2832
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2833
openHTMLReader
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2834
    self openTool:HTMLDocumentView ignoreDirectories:false
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2835
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2836
    "Modified: / 7.9.1998 / 21:31:58 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2837
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2838
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2839
openImageEditor
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2840
    [self loadImageAndPerform:#edit] fork
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2841
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2842
    "Modified: / 17.9.1995 / 17:41:24 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2843
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2844
    "Created: / 13.8.1998 / 22:07:09 / cg"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2845
    "Modified: / 7.9.1998 / 21:31:41 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2846
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2847
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2848
openImageInspector
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2849
    [self loadImageAndPerform:#inspect] fork
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2850
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2851
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2852
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2853
    "Modified: / 7.9.1998 / 21:31:30 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2854
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2855
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2856
openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2857
    [self loadImageAndPerform:[:img |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2858
				|i top viewer|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2859
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2860
				top := StandardSystemView new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2861
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2862
				viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2863
				i := img.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2864
				top extent:200@200.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2865
				top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2866
				top openAndWait.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2867
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2868
				(i width > 200 or:[i height > 200]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2869
				    i := i magnifiedPreservingRatioTo:200@200.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2870
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2871
				viewer image:i.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2872
			      ].
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2873
    ] fork
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2874
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2875
    "Modified: / 4.12.1998 / 15:49:03 / cg"
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2876
!
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2877
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2878
openSelectedFilename
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2879
    |sel|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2880
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2881
    sel := subView selection.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2882
    sel notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2883
	sel := sel asString withoutSeparators.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2884
	sel asFilename exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2885
	    self doOpenFile:sel viaDoubleClick:false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2886
	]
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2887
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2888
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2889
    "Created: / 4.2.1999 / 17:40:42 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2890
    "Modified: / 4.2.1999 / 17:47:06 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2891
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  2892
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2893
openTerminal
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  2894
    VT100TerminalView openShellIn:currentDirectory
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2895
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2896
    "Created: / 20.7.1998 / 18:18:15 / cg"
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  2897
    "Modified: / 20.7.1998 / 18:32:28 / cg"
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2898
!
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2899
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2900
openTool:aToolClass
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2901
    "open a tool on the selected file(s)"
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2902
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  2903
    ^ self openTool:aToolClass ignoreDirectories:true
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2904
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2905
    "Modified: / 7.9.1998 / 19:32:10 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2906
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2907
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2908
openTool:aToolClass ignoreDirectories:ignoreDirs
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2909
    "open a tool on the selected file(s)"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2910
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  2911
    |numItems path tool|
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2912
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2913
    aToolClass isNil ifTrue:[
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2914
        self warn:'Sorry, that tool seems to be not available'.
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2915
        ^ nil.
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2916
    ].
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2917
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2918
    (numItems := fileListView selection size) > 2 ifTrue:[
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2919
        (self 
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2920
            confirm:(resources string:'open for each of the %1 items ?' 
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2921
                                 with:numItems)) ifFalse:[^ self].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2922
    ].
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2923
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2924
    self selectedFilesDo:[:fileName |
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2925
        path := currentDirectory filenameFor:fileName.
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2926
        (ignoreDirs not
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2927
        or:[path isDirectory not]) ifTrue:[
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2928
            tool := aToolClass openOn:(path pathName).
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2929
        ]
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2930
    ].
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  2931
    ^ tool
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2932
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2933
    "Modified: / 18.9.1997 / 17:06:18 / stefan"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2934
    "Created: / 7.9.1998 / 19:31:49 / cg"
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2935
    "Modified: / 25.5.1999 / 16:30:35 / cg"
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2936
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2937
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2938
openZipTool
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  2939
    |zipTool|
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  2940
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2941
    (zipTool := self openTool:ZipTool) notNil ifTrue:[
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2942
        zipTool initialExtractDirectory:currentDirectory
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2943
    ].
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2944
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2945
    "Created: / 26.8.1998 / 16:20:55 / cg"
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  2946
    "Modified: / 25.5.1999 / 16:30:54 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2947
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2948
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2949
showOrHideTabView
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2950
    "depending on the showLongList setting, show or hde the tabSpec view"
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2951
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2952
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2953
	tabRulerView isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2954
	    self createTabRulerIn:scrollView superView.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2955
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2956
	tabRulerView beVisible.
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2957
        
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2958
	false "self is3D" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2959
	    scrollView topInset:(tabRulerView superView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2960
	    tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2961
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2962
	    scrollView topInset:(tabRulerView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2963
	    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2964
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2965
	tabRulerView hiddenTabs:#(1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2966
	tabRulerView fixedTabs:#(1).
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2967
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2968
	tabRulerView notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2969
	    tabRulerView beInvisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2970
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2971
	scrollView topInset:0
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2972
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2973
    tabSpec := nil.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2974
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2975
    "Created: / 19.4.1997 / 09:50:02 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2976
    "Modified: / 4.8.1998 / 13:44:14 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2977
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2978
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2979
!FileBrowser methodsFor:'help '!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2980
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2981
helpTextFor:aComponent
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2982
    |s|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2983
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2984
    aComponent == subView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2985
	s := 'HELP_SUBVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2986
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2987
    aComponent == fileListView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2988
	s := 'HELP_FILELIST'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2989
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2990
    aComponent == filterField ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2991
	s := 'HELP_FILTER'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2992
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2993
    aComponent == labelView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2994
	s := 'HELP_PATHFIELD'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2995
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2996
    aComponent == commandView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2997
	s := 'HELP_COMMANDVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2998
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2999
    s notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3000
	^ resources string:s
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3001
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3002
    ^ nil
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3003
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3004
2116
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3005
!FileBrowser methodsFor:'initialize / release'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3006
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3007
createTabRulerIn:topFrame
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3008
    |v|
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3009
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3010
    false "self is3D" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3011
	v := View in:topFrame.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3012
	v level:-1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3013
	tabRulerView := TabSpecRuler in:v.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3014
	tabRulerView level:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3015
	v origin:(0.0@0.0) corner:(1.0@10).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3016
	tabRulerView origin:(0.0@0.0) corner:(1.0@1.0).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3017
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3018
	tabRulerView := TabSpecRuler in:topFrame.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3019
	tabRulerView origin:(0.0@0.0) corner:(1.0@10).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3020
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3021
    tabRulerView borderWidth:0.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3022
    tabRulerView synchronousOperation:true.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3023
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3024
    "Created: / 27.7.1998 / 20:23:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3025
    "Modified: / 27.7.1998 / 20:30:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3026
!
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3027
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3028
currentDirectory:aDirectoryPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3029
    "set the directory to be browsed"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3030
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3031
    |newDirectory|
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3032
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3033
    newDirectory := aDirectoryPath asFilename.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3034
    newDirectory = currentDirectory ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3035
        ^ self
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3036
    ].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3037
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3038
    currentDirectory := aDirectoryPath asFilename.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3039
    self changed:#path.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3040
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3041
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3042
     tell my subview (whatever that is) to start its file-dialog
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3043
     (i.e. save-as etc.) in that directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3044
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3045
    (subView respondsTo:#directoryForFileDialog:) ifTrue:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3046
        subView directoryForFileDialog:currentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3047
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3048
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3049
    "Modified: 16.9.1997 / 14:56:17 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3050
    "Modified: 21.9.1997 / 11:28:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3051
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3052
2116
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3053
destroy
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3054
    "destroy view and boxes"
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3055
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3056
    ObjectMemory removeDependent:self.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3057
    self stopUpdateProcess.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3058
    self stopImageRenderProcess.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3059
    checkBlock := nil.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3060
    super destroy
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3061
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3062
    "Modified: 19.4.1997 / 13:51:48 / cg"
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3063
!
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3064
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3065
focusSequence
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3066
    "return the sequence in which ALT-CursorRight steps focus"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3067
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3068
    |fs|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3069
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3070
    fs := Array 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3071
	with:labelView
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3072
	with:filterField 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3073
	with:fileListView 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3074
	with:subView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3075
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3076
    commandView notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3077
	fs := fs copyWith:commandView
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3078
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3079
    ^fs
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3080
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3081
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3082
initEvents
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3083
    super initEvents.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3084
    self enableEvent:#visibilityChange.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3085
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3086
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3087
initialize
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3088
    |frame spacing halfSpacing v topFrame labelFrame filterModel
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3089
     buttonPanel img mH menuPanel lowerFrame|
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3090
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3091
    super initialize.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3092
819
b78a26650047 initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
  3093
    fileEncoding := #iso8859.        "/ native ST/X encoding
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  3094
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3095
    "if true, will replace leading spaces by tabs on
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3096
     file write. If false, they will be written as spaces
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3097
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3098
    compressTabs := resources at:'COMPRESS_TABS' default:true.
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3099
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3100
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3101
     showing long or short by default
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3102
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3103
    "/ showLongList := resources at:'LONG_LIST' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3104
    showingDetails := (resources at:'LONG_LIST' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3105
    showingDetails onChangeSend:#detailsSettingChanged to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3106
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3107
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3108
     show hidden files or not ?
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3109
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3110
    "/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3111
    showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3112
    showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3113
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3114
    "
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3115
     showing small icons by default
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3116
    "
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3117
    showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3118
    showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3119
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3120
    sortByWhat := #name asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3121
    sortByWhat onChangeSend:#sortChanged to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3122
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3123
    sortCaseless := (Filename isCaseSensitive not) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3124
    sortCaseless onChangeSend:#updateCurrentDirectory to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3125
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3126
    dosEOLMode := false asValue.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3127
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3128
    lockUpdate := false.
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3129
132
claus
parents: 126
diff changeset
  3130
    CommandHistory isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3131
        CommandHistory := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3132
        CommandHistorySize := 50
132
claus
parents: 126
diff changeset
  3133
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3134
    DirectoryHistory isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3135
        DirectoryHistory := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3136
        DirectoryHistoryWhere := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3137
        HistorySize := 15.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3138
    ].
132
claus
parents: 126
diff changeset
  3139
    commandIndex := 0.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3140
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  3141
    icons := Dictionary new.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3142
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3143
    Icons isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3144
        self class initializeIcons
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3145
    ].
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3146
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3147
    myName := (resources string:self class name).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3148
    self label:myName.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3149
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3150
    menuPanel := MenuPanel in:self.
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  3151
    menuPanel level:1.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3152
    menuPanel verticalLayout:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3153
    menuPanel receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3154
    menuPanel menu:(self pullDownMenu).
2050
5ef6404d6172 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2048
diff changeset
  3155
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3156
    mH := menuPanel preferredExtent y.
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3157
    menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)).
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3158
93
claus
parents: 85
diff changeset
  3159
    labelFrame := View 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3160
                        origin:(0.0 @ mH)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3161
                        corner:(1.0 @ (font height * 1.8 + mH) rounded)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3162
                        in:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3163
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3164
    (styleSheet name = #st80 or:[styleSheet name == #win95]) ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3165
        labelFrame level:1.
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3166
"/        labelFrame rightInset:-1.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3167
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3168
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3169
    spacing := ViewSpacing.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3170
    halfSpacing := spacing // 2.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3171
1100
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3172
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3173
      checkBlock is executed by the Processor every checkDelta seconds.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3174
      We use #pushEvent: to perform the directory update
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3175
      in our windowgroups process.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3176
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3177
    checkBlock := [self pushEvent:#checkIfDirectoryHasChanged].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3178
    checkDelta := resources at:'CHECK_DELTA' default:10.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3179
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3180
    currentDirectory := Filename currentDirectory.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3181
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3182
    filterModel := '*' asValue.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3183
    filterField := EditField in:labelFrame.
1071
Claus Gittinger <cg@exept.de>
parents: 1040
diff changeset
  3184
    filterField 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3185
        origin:[((width // 4 * 3) + halfSpacing) @ (halfSpacing)]
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3186
        corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ).
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3187
    filterField rightInset:(ViewSpacing - halfSpacing).
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3188
    filterField model:filterModel.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3189
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3190
    labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)).
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3191
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3192
    self initializeFilterPattern.
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3193
    filterModel onChangeSend:#filterPatternChanged to:self.
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3194
"/    filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3195
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3196
"/    labelView := Label in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3197
"/    labelView origin:(halfSpacing @ halfSpacing)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3198
"/              extent:[((width // 4 * 3) - spacing - borderWidth)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3199
"/                       @
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3200
"/                       (filterField heightIncludingBorder)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3201
"/                       "(font height + font descent)"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3202
"/                     ].
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3203
"/    labelView adjust:#right.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3204
"/    labelView borderWidth:0.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3205
"/    labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3206
"/    labelFrame model:self; menu:#labelMenu.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3207
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3208
    labelView := FilenameEditField in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3209
    labelView 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3210
        origin:(halfSpacing @ (halfSpacing))
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3211
        extent:[((width // 4 * 3) - spacing - borderWidth)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3212
                @
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3213
                (filterField heightIncludingBorder)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3214
                "(font height + font descent)"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3215
               ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3216
    labelView menu:#labelMenu; 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3217
            aspect:#path; changeMessage:#pathChanged:.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3218
    labelView model:self.
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3219
    labelView acceptOnExpand:true.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3220
    labelView backgroundColor:(labelFrame viewBackground).
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  3221
    labelFrame model:self; menu:#labelMenu.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3222
    labelView cursorType:#solidCaret; cursorTypeNoFocus:#none.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3223
    labelView level:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3224
    labelView borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3225
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3226
    killButton := Button label:(resources string:'kill') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3227
"/    killButton origin:(halfSpacing @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3228
"/               extent:(killButton width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3229
    killButton origin:(halfSpacing @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3230
    killButton topInset:(killButton height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3231
    killButton beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3232
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3233
    pauseToggle := Toggle label:(resources string:'pause') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3234
"/    pauseToggle origin:((killButton corner x + 50) @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3235
"/                extent:(pauseToggle width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3236
    pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3237
    pauseToggle topInset:(pauseToggle height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3238
    pauseToggle beInvisible.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3239
132
claus
parents: 126
diff changeset
  3240
    self initializeCommandViewIn:self.
claus
parents: 126
diff changeset
  3241
claus
parents: 126
diff changeset
  3242
"/    frame := VariableVerticalPanel
claus
parents: 126
diff changeset
  3243
"/                 origin:[frame borderWidth negated 
claus
parents: 126
diff changeset
  3244
"/                         @ 
claus
parents: 126
diff changeset
  3245
"/                         labelFrame height
claus
parents: 126
diff changeset
  3246
"/                         "/ (labelView height + labelView origin y + spacing)
claus
parents: 126
diff changeset
  3247
"/                        ]
claus
parents: 126
diff changeset
  3248
"/                 corner:(1.0 @ 1.0)
claus
parents: 126
diff changeset
  3249
"/                     in:self.
claus
parents: 126
diff changeset
  3250
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3251
    frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self.
132
claus
parents: 126
diff changeset
  3252
    frame topInset:labelFrame height.
claus
parents: 126
diff changeset
  3253
    commandView notNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3254
        frame bottomInset:(commandView height + spacing + spacing)
132
claus
parents: 126
diff changeset
  3255
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3256
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3257
    topFrame := View in:frame.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3258
    topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3259
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3260
false ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3261
    self createTabRulerIn:topFrame.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3262
].
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3263
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3264
    scrollView := ScrollableView in:topFrame.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3265
    scrollView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3266
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3267
    fileListView := SelectionInListView new.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3268
    scrollView scrolledView:fileListView.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3269
    fileListView action:[:lineNr | self fileSelect:lineNr].
1326
aab1605ad945 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  3270
    fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3271
    fileListView multipleSelectOk:true.
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  3272
    fileListView delegate:self.
98
claus
parents: 93
diff changeset
  3273
    fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu.
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  3274
    fileListView allowDrag:true.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3275
    fileListView dragObjectConverter:[:obj | 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3276
                                        |dir nm path idx|
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3277
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3278
                                        nm := obj theObject asString.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3279
                                        idx := fileListView list indexOf:nm.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3280
                                        idx == 0 ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3281
                                            "/ cannot happen ...
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3282
                                            nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3283
                                        ] ifFalse:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3284
                                            nm := fileList at:idx.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3285
                                            dir := currentDirectory pathName asFilename.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3286
                                            path := dir constructString:nm.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3287
                                            DropObject newFile:path.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3288
                                        ]
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3289
                                     ].
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3290
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3291
    "/ sigh - must be delayed - origin is not yet fixe
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3292
"/    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3293
"/    self showOrHideTabView.
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3294
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3295
    lowerFrame := View in:frame.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3296
    lowerFrame origin:(0.0 @ 0.3) corner:(1.0 @ 1.0).
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3297
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3298
    v := self initializeSubViewIn:lowerFrame.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3299
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3300
    subView := v scrolledView.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3301
    (subView respondsTo:#directoryForFileDialog:) ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3302
        subView directoryForFileDialog:currentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3303
    ].
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3304
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3305
"/    buttonPanel := HorizontalPanelView in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3306
"/    buttonPanel horizontalLayout:#leftSpace.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3307
"/    buttonPanel verticalSpace:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3308
"/    "/ buttonPanel verticalLayout:#top.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3309
"/    buttonPanel borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3310
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3311
"/    buttonPanel 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3312
"/        origin:(0.5 @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3313
"/        extent:[((width // 4) - spacing - borderWidth)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3314
"/                @
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3315
"/                (buttonPanel preferredExtent y max:(labelView height))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3316
"/               ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3317
"/    "/ buttonPanel level:-1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3318
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3319
"/    upButton := Button in:buttonPanel.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3320
"/    img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3321
"/    upButton label:(img ? 'up').
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3322
"/    upButton action:[self changeToParentDirectory].
1328
9588cd743755 Fix kill and pause buttons.
Stefan Vogel <sv@exept.de>
parents: 1327
diff changeset
  3323
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3324
    ObjectMemory addDependent:self.
132
claus
parents: 126
diff changeset
  3325
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3326
    "Modified: / 6.9.1995 / 20:26:06 / claus"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3327
    "Modified: / 16.9.1997 / 14:52:46 / stefan"
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3328
    "Modified: / 6.5.1999 / 11:38:08 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3329
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3330
132
claus
parents: 126
diff changeset
  3331
initializeCommandViewIn:frame
claus
parents: 126
diff changeset
  3332
    "set up the command view - can be redefined in subclasses as empty,
claus
parents: 126
diff changeset
  3333
     if no commandView is wanted"
claus
parents: 126
diff changeset
  3334
claus
parents: 126
diff changeset
  3335
claus
parents: 126
diff changeset
  3336
    commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame.
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  3337
    commandView allInset:ViewSpacing//2.
132
claus
parents: 126
diff changeset
  3338
    commandView topInset:(commandView preferredExtent y negated - ViewSpacing).
claus
parents: 126
diff changeset
  3339
133
claus
parents: 132
diff changeset
  3340
"/    commandView contents:'** no commands which require input here **'.
132
claus
parents: 126
diff changeset
  3341
142
claus
parents: 139
diff changeset
  3342
    commandView entryCompletionBlock:[:contents |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3343
	|newString|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3344
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3345
	newString := Filename 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3346
			filenameCompletionFor:contents 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3347
			directory:currentDirectory 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3348
			directoriesOnly:false 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3349
			filesOnly:false 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3350
			ifMultiple:[:dir | commandView flash.].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3351
	commandView contents:newString.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3352
	commandView cursorToEndOfLine.
132
claus
parents: 126
diff changeset
  3353
    ].
claus
parents: 126
diff changeset
  3354
    commandView leaveAction:[:key | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3355
	|cmd nCmd empty|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3356
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3357
	(key == #CursorDown 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3358
	or:[key == #CursorUp]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3359
	    nCmd := CommandHistory size.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3360
	    nCmd == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3361
		empty := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3362
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3363
		key == #CursorUp ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3364
		    commandIndex == nCmd ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3365
			commandView flash.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3366
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3367
		    commandIndex := (commandIndex + 1) min:nCmd
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3368
		] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3369
		    commandIndex == 1 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3370
			commandView flash.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3371
			empty := true.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3372
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3373
		    commandIndex := (commandIndex - 1) max:1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3374
		].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3375
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3376
	    empty == true ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3377
		commandView contents:nil
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3378
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3379
		commandView contents:(CommandHistory at:commandIndex).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3380
	    ]        
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3381
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3382
	key == #Return ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3383
	    cmd := commandView contents.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3384
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3385
	    subView insertLine:(
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3386
				Text string:('>> ' , cmd)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3387
				     emphasis:(Array with:#bold with:#underline with:(#color->Color blue))
539
33b603dd30ba replaced ColoredListEntry by Text
Claus Gittinger <cg@exept.de>
parents: 525
diff changeset
  3388
"/                                ColoredListEntry string:('>> ' , cmd) color:Color blue
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3389
				)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3390
		    before:(subView cursorLine).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3391
	    subView cursorDown:1.
133
claus
parents: 132
diff changeset
  3392
claus
parents: 132
diff changeset
  3393
"/            subView insertStringAtCursor:cmd.
claus
parents: 132
diff changeset
  3394
"/            subView insertCharAtCursor:(Character cr).
132
claus
parents: 126
diff changeset
  3395
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3396
	    (cmd notNil and:[cmd notEmpty]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3397
		self class addToCommandHistory:cmd for:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3398
		self doExecuteCommand:cmd replace:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3399
		commandView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3400
		commandIndex := 0
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3401
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3402
	]
132
claus
parents: 126
diff changeset
  3403
    ].
claus
parents: 126
diff changeset
  3404
133
claus
parents: 132
diff changeset
  3405
    "Modified: 7.9.1995 / 15:48:45 / claus"
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  3406
    "Modified: 30.8.1997 / 19:22:52 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3407
    "Modified: 18.9.1997 / 16:55:01 / stefan"
132
claus
parents: 126
diff changeset
  3408
!
claus
parents: 126
diff changeset
  3409
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3410
initializeFilterPattern
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3411
    "set an initial matchpattern - can be redefined in subclasses"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3412
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3413
    filterField model value:'*'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3414
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3415
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3416
initializeSubViewIn:frame
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3417
    "set up the contents view - can be redefined in subclasses for
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3418
     different view types (SoundFileBrowser/ImageBrowsers etc.)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3419
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3420
    |textView|
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3421
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3422
    textView := HVScrollableView 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3423
	for:CodeView 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3424
	miniScrollerH:true 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3425
	miniScrollerV:false 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3426
	in:frame.
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3427
    textView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3428
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3429
"/    imagePreviewView := HVScrollableView 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3430
"/        for:ImageView 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3431
"/        miniScrollerH:true 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3432
"/        miniScrollerV:false 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3433
"/        in:frame.
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3434
"/    imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3435
"/
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3436
"/    imagePreviewView beInvisible.
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3437
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3438
    ^ textView.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3439
!
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3440
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3441
postRealize
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3442
    super postRealize.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3443
    self showOrHideTabView.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3444
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3445
    "Created: 24.7.1997 / 18:13:46 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3446
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3447
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3448
!FileBrowser methodsFor:'menu actions'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3449
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3450
copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3451
    "copy the command history to the clipBoard"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3452
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3453
    self setTextSelection:(CommandHistory asStringCollection asString).
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3454
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3455
    "Modified: / 29.10.1998 / 12:17:14 / cg"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3456
!
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3457
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3458
copyFileList
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3459
    "copy fileList to the clipBoard"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3460
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3461
    self setTextSelection:(fileListView list 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3462
			      collect:[:l | |ll|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3463
					ll := l string withoutSeparators.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3464
					(ll endsWith:' ...') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3465
					    ll copyWithoutLast:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3466
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3467
					    ll
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3468
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3469
				      ]) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3470
				asStringCollection asString.
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3471
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3472
    "Modified: / 17.8.1998 / 10:13:10 / cg"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3473
!
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3474
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3475
copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3476
    "copy the selected filename to the clipBoard (for easy paste)"
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3477
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3478
    |sel fileName|
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3479
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3480
    sel := fileListView selection.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3481
    sel size == 1 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3482
	fileName := fileList at:sel first.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3483
	self setTextSelection:fileName
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3484
    ].
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3485
!
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3486
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3487
menuExit
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3488
    self closeRequest
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3489
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3490
    "Created: / 4.8.1998 / 13:41:38 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3491
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3492
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3493
menuOSCommand
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3494
    self fileExecute
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3495
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3496
    "Created: / 4.8.1998 / 14:06:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3497
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3498
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3499
menuOpen
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3500
    "same as a double-click"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3501
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3502
    "Modified: / 4.8.1998 / 13:42:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3503
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3504
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3505
menuShowFileBrowserDocumentation
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3506
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3507
    "Created: / 4.8.1998 / 14:03:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3508
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3509
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3510
openAboutThisApplication
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3511
    "opens an about box for this application."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3512
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3513
    |rev box myClass clsRev image msg|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3514
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3515
    rev := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3516
    myClass := self class.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3517
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3518
    (clsRev := myClass revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3519
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3520
    msg := '\' withCRs , myClass name asBoldText, rev.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3521
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3522
    AboutBox isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3523
	"/ this handles bad installations of ST/X,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3524
	"/ where the AboutBox is missing.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3525
	"/ (May vanish in the future)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3526
	^ self information:msg
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3527
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3528
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3529
    box := AboutBox title:msg.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3530
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3531
    image := self class defaultIcon.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3532
    image notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3533
	box image:image
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3534
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3535
    box   label:'About This Application'.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3536
    box   autoHideAfter:10 with:[].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3537
    box   showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3538
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3539
    "Modified: / 14.8.1998 / 13:20:24 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3540
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3541
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3542
openHTMLDocument:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3543
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3544
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3545
    "Created: / 4.8.1998 / 14:06:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3546
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3547
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3548
pullDownMenu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3549
    "return the top (pullDown) menu"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3550
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3551
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3552
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3553
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3554
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3555
    m := self class menuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3556
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3557
    m receiver:self.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  3558
    m findGuiResourcesIn:self.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3559
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3560
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3561
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3562
    "Created: / 14.8.1998 / 14:14:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3563
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3564
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3565
showAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3566
    ToolApplicationModel openAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3567
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3568
    "Created: / 14.8.1998 / 13:18:41 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3569
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3570
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3571
sortChanged
2020
7c9afb53b8a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
  3572
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3573
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3574
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3575
    "Created: / 14.8.1998 / 16:17:20 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3576
    "Modified: / 14.8.1998 / 16:44:00 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3577
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3578
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3579
!FileBrowser methodsFor:'menu actions - cvs'!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3580
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3581
cvsRemoveFileAndContainer
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3582
    "remove the selected file(s) and their CVS containers.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3583
     Query if user really wants to really remove them."
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3584
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3585
    |sel q|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3586
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3587
    sel := fileListView selection.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3588
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3589
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3590
	sel size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3591
	    q := resources string:'remove %1 selected files and CVS containers ?' with:(sel size)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3592
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3593
	    q := resources string:'remove ''%1'' and CVS container ?' with:(sel first asText allBold)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3594
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3595
	(self sensor shiftDown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3596
	or:[self ask:q yesButton:'remove']) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3597
	    self withCursor:(Cursor wait) do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3598
		self doRemoveAndRemoveFromCVS:sel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3599
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3600
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3601
    ]
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3602
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3603
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3604
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3605
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3606
cvsUpdateDirectoryLocal
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3607
    "update this directory"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3608
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3609
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3610
	doExecuteCommand:'cvs upd -l' replace:false
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3611
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3612
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3613
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3614
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3615
cvsUpdateDirectoryRecursive
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3616
    "update this directory"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3617
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3618
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3619
	doExecuteCommand:'cvs upd -d' replace:false
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3620
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3621
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3622
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3623
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3624
cvsUpdateSelection
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3625
    "update selected files"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3626
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3627
    |sel|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3628
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3629
    sel := fileListView selection.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3630
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3631
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3632
	sel do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3633
	    self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3634
		doExecuteCommand:('cvs upd ' , fn) replace:false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3635
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3636
    ].
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3637
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3638
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3639
doRemoveAndRemoveFromCVS:filesToRemove
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3640
    "remove the selected file(s) and their CVS containers - no questions asked"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3641
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3642
    |msg idx needUpdate toRemove updateRunning yesToAll|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3643
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3644
    updateRunning := listUpdateProcess notNil.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3645
    self stopUpdateProcess.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3646
    toRemove := OrderedCollection new.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3647
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3648
    "/
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3649
    "/ did the directory change in the meanwhile ?
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3650
    "/
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3651
    needUpdate := (currentDirectory modificationTime > timeOfLastCheck).
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3652
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3653
    yesToAll := false.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3654
    lockUpdate := true.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3655
    [
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3656
	filesToRemove do:[:fileName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3657
	    |f|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3658
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3659
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3660
	    OperatingSystem accessDeniedErrorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3661
		"was not able to remove it"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3662
		msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3663
		self showAlert:msg with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3664
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3665
		|answer contents|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3666
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3667
		(f isSymbolicLink not) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3668
		    self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3669
			doExecuteCommand:('cvs remove -f ' , f baseName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3670
			replace:false.
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3671
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3672
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3673
		self show:nil
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3674
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3675
		    idx := fileList indexOf:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3676
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3677
			toRemove add:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3678
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3679
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3680
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3681
	].
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3682
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3683
	lockUpdate := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3684
	fileListView setSelection:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3685
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3686
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3687
	"/ remove reverse - otherwise indices are wrong
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3688
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3689
	toRemove sort.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3690
	toRemove reverseDo:[:idx |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3691
	    fileList removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3692
	    fileListView removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3693
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3694
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3695
	updateRunning ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3696
	    self updateCurrentDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3697
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3698
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3699
	     install a new check after some time
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3700
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3701
	    needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3702
	    Processor removeTimedBlock:checkBlock.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3703
	    Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3704
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3705
    ].
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3706
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3707
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3708
	doExecuteCommand:('cvs commit -m ''removed via FileBrowser''')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3709
	replace:false.
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3710
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3711
    "Modified: / 21.10.1998 / 17:02:11 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3712
! !
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3713
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3714
!FileBrowser methodsFor:'misc user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3715
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3716
closeRequest
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3717
    "exit FileBrowser"
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3718
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3719
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when FileBrowser is closed.'
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3720
	      yesButton:'close') 
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3721
    ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3722
	"/ self windowGroup closeDownViews.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3723
	super closeRequest
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3724
    ]
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3725
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3726
    "Created: / 3.8.1998 / 19:55:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3727
    "Modified: / 4.8.1998 / 18:21:03 / cg"
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3728
!
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3729
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3730
discardChangesDialog
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3731
    "ask the user if changes should be discarded,
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3732
     return true if changes should be discarded, false otherwise"
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3733
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3734
    ^ self askIfModified:'contents has not been saved.\\Modifications will be lost when directory is changed.'
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3735
	       yesButton:'change'
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3736
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3737
    "Created: 2.10.1997 / 14:08:37 / stefan"
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3738
!
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3739
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3740
filterPatternChanged
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3741
    fileListView scrollToTop.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3742
    fileListView deselect.
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3743
    self updateCurrentDirectory
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3744
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3745
    "Modified: / 3.10.1998 / 18:23:34 / cg"
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3746
!
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3747
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3748
update:what with:someArgument from:changedObject
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3749
    realized ifFalse:[^ self].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3750
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3751
    (what == #aboutToExit) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3752
	"system wants to shut down this
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3753
	 - if text was modified, pop up, and ask user and save if requested."
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3754
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3755
	(subView modified and:[subView contentsWasSaved not]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3756
	    self raiseDeiconified.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3757
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3758
	    (self 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3759
		ask:(resources at:'FileBrowser:\\contents has not been saved.\\Save before exiting ?')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3760
		yesButton:'save'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3761
		noButton:'don''t save')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3762
	    ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3763
		subView acceptAction notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3764
		    subView accept
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3765
		] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3766
		    subView save
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3767
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3768
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3769
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3770
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3771
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3772
    changedObject == tabSpec ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3773
	fileListView invalidate
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3774
    ].
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3775
585
be0241bf7268 use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 564
diff changeset
  3776
    "Modified: 29.5.1996 / 16:13:43 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3777
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3778
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3779
!FileBrowser methodsFor:'pathField user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3780
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3781
addDirToJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3782
    "add the current path to javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3783
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3784
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3785
    Java addToClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3786
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3787
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3788
    "Created: 1.8.1997 / 21:25:22 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3789
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3790
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3791
addDirToJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3792
    "add the current path to javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3793
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3794
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3795
    Java addToSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3796
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3797
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3798
    "Created: 2.8.1997 / 14:11:19 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3799
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3800
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3801
changeCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3802
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3803
     otherwise ask for & change to that directory"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3804
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3805
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3806
	self queryForDirectoryToChange
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3807
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3808
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3809
    "Modified: 21.9.1997 / 23:45:35 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3810
    "Modified: 2.10.1997 / 14:09:02 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3811
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3812
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3813
changeDirectoryTo:aDirectoryName
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3814
    "sent from label menu to change back to a previous directory"
132
claus
parents: 126
diff changeset
  3815
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3816
    self discardChangesDialog ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3817
	self doChangeCurrentDirectoryTo:aDirectoryName updateHistory:true "/false.
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3818
    ].
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3819
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3820
    "Modified: / 2.10.1997 / 14:09:24 / stefan"
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3821
    "Modified: / 21.7.1998 / 16:38:03 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3822
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3823
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3824
changeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3825
    "if text was modified show a queryBox, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3826
     otherwise change immediately to the default directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3827
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3828
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3829
	 self doChangeToDefaultDirectory
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3830
    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3831
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3832
    "Modified: 21.9.1997 / 23:45:04 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3833
    "Modified: 2.10.1997 / 14:09:33 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3834
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3835
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3836
changeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3837
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3838
     otherwise change immediately to the home directory"
132
claus
parents: 126
diff changeset
  3839
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3840
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3841
	 self doChangeToHomeDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3842
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3843
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3844
    "Modified: 21.9.1997 / 23:45:10 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3845
    "Modified: 2.10.1997 / 14:09:42 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3846
!
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3847
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3848
changeToParentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3849
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3850
     otherwise change immediately to the parent directory"
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3851
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3852
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3853
	 self doChangeToParentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3854
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3855
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3856
    "Modified: 21.9.1997 / 23:45:15 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3857
    "Modified: 2.10.1997 / 14:09:55 / stefan"
98
claus
parents: 93
diff changeset
  3858
!
claus
parents: 93
diff changeset
  3859
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3860
copyPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3861
    "copy current path into cut & paste buffer"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3862
873
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3863
    self setTextSelection:currentDirectory pathName
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3864
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3865
    "Modified: 14.12.1996 / 15:37:47 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3866
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3867
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3868
fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3869
    "add the current path to javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3870
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3871
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3872
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3873
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3874
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3875
    f isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3876
	^ self addDirToJavaClassPath
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3877
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3878
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3879
    Java addToClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3880
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3881
    "Created: / 9.11.1998 / 05:41:34 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3882
    "Modified: / 9.11.1998 / 05:56:00 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3883
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3884
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3885
fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3886
    "remove the current path from javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3887
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3888
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3889
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3890
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3891
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3892
    f isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3893
	^ self removeDirToJavaClassPath
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3894
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3895
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3896
    Java removeFromClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3897
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3898
    "Created: / 9.11.1998 / 05:42:05 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3899
    "Modified: / 9.11.1998 / 05:56:14 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3900
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3901
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3902
labelMenu
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3903
    "return the popUpMenu for the path label"
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3904
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  3905
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3906
2051
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3907
    |m|
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3908
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3909
    m := self class directoryMenuSpec.
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3910
    m menuPerformer:self.
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3911
    ^ m
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3912
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3913
    "Modified: / 14.8.1998 / 12:11:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3914
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3915
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3916
labelMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3917
    "return the popUpMenu for the path label"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3918
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3919
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3920
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3921
    |items menu currentIndex|
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3922
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3923
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3924
		   ('copy path'                   copyPath                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3925
		   ('-'                                                     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3926
		   ('up'                          changeToParentDirectory   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3927
		   ('back'                        changeToPreviousDirectory )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3928
		   ('change to home-directory'    changeToHomeDirectory     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3929
		   ('change to default-directory' changeToDefaultDirectory  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3930
		   ('change directory ...'        changeCurrentDirectory    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3931
	       ).             
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3932
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3933
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3934
	items := items , #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3935
			    ( '-')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3936
			    ( 'add to JavaClassPath'       addDirToJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3937
			    ( 'add to JavaSourcePath'      addDirToJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3938
			    ( 'remove from JavaClassPath'  removeDirFromJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3939
			    ( 'remove from JavaSourcePath' removeDirFromJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3940
			  ).
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3941
    ].
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3942
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3943
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3944
	items := items copyWith:#('-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3945
	items := items ,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3946
		 (DirectoryHistory 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3947
			collect:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3948
				    Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3949
					with:dirName 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3950
					with:#changeDirectoryTo:
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3951
					with:nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3952
					with:dirName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3953
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3954
		 ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3955
	currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3956
	currentIndex == 0 ifTrue:[currentIndex := nil].
123
claus
parents: 120
diff changeset
  3957
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3958
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3959
    menu := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3960
		itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3961
		resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3962
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3963
    previousDirectory isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3964
	menu disable:#changeToPreviousDirectory.
132
claus
parents: 126
diff changeset
  3965
    ].
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3966
    currentIndex notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3967
	menu disable:currentIndex
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3968
    ].
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3969
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3970
	(Java classPath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3971
	    menu disable:#addDirToJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3972
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3973
	    menu disable:#removeDirFromJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3974
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3975
	(Java sourcePath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3976
	    menu disable:#addDirToJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3977
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3978
	    menu disable:#removeDirFromJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3979
	].
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3980
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3981
    ^menu.
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3982
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3983
    "Modified: / 21.7.1998 / 16:43:25 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3984
    "Created: / 14.8.1998 / 12:10:02 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3985
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3986
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3987
pathChanged:newPath
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3988
    "change directory to newPath. If newPath is a filename, change
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3989
     to its directory and get get the file."
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3990
2135
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  3991
    |f name lcName idx|
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3992
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3993
    self discardChangesDialog ifTrue:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3994
        f := newPath asFilename.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3995
        (f isDirectory) ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3996
            self changeDirectoryTo:newPath
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3997
        ] ifFalse:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3998
            self changeDirectoryTo:(f directoryName).
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3999
"/            self changed:#path.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4000
            name := f baseName.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4001
            idx := fileList indexOf:name.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4002
            idx = 0 ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4003
                lcName := name asLowercase.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4004
                f class isCaseSensitive ifFalse:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4005
                    idx := fileList findFirst:[:nm | nm asLowercase = lcName].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4006
                ]
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4007
            ].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4008
            fileListView selection:idx.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4009
            self fileSelect:name.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4010
            self fileGet:true.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4011
        ].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4012
    ] ifFalse:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4013
        self changed:#path.
2135
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4014
    ].
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4015
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4016
    "Created: / 21.9.1997 / 10:43:12 / cg"
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4017
    "Modified: / 7.10.1997 / 14:10:39 / stefan"
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4018
    "Modified: / 30.4.1999 / 11:19:29 / cg"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4019
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4020
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4021
queryForDirectoryToChange
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4022
    "query for new directory"
123
claus
parents: 120
diff changeset
  4023
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4024
    |queryBox dirName|
98
claus
parents: 93
diff changeset
  4025
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4026
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4027
		    title:(resources at:'change directory to:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4028
		    okText:(resources at:'change')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4029
		    action:[:newName | dirName := newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4030
"/    queryBox initialText:''.
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4031
    queryBox showAtPointer.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4032
    queryBox destroy.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4033
    self doChangeCurrentDirectoryTo:dirName updateHistory:true.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4034
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4035
    "Modified: 28.4.1997 / 19:50:52 / cg"
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4036
    "Modified: 28.4.1997 / 22:30:40 / dq"
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4037
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4038
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4039
removeDirFromJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4040
    "remove the current path from javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4041
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4042
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4043
    Java removeFromClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4044
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4045
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4046
    "Created: 1.8.1997 / 21:25:36 / cg"
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4047
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4048
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4049
removeDirFromJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4050
    "remove the current path from javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4051
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4052
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4053
    Java removeFromSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4054
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4055
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4056
    "Created: 2.8.1997 / 14:11:41 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4057
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4058
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4059
!FileBrowser methodsFor:'private'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4060
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4061
ask:question yesButton:yesButtonText
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4062
    "common method to ask a yes/no question; return true or false"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4063
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4064
    ^ self ask:question yesButton:yesButtonText noButton:'cancel' 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4065
!
93
claus
parents: 85
diff changeset
  4066
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4067
ask:question yesButton:yesButtonText noButton:noButtonText
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4068
    "common method to ask a yes/no question"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4069
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4070
    ^ Dialog 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4071
	confirm:question withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4072
	yesLabel:(resources at:yesButtonText)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4073
	noLabel:(resources at:noButtonText)
37
50f59bad66b1 *** empty log message ***
claus
parents: 36
diff changeset
  4074
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4075
    "Modified: 21.2.1996 / 01:19:21 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4076
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4077
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4078
askForCommandFor:fileName thenDo:aBlock
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4079
    "setup and launch a querybox to ask for unix command.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4080
     Then evaluate aBlock passing the command-string as argument."
93
claus
parents: 85
diff changeset
  4081
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4082
    |box osName|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4083
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4084
    osName := OperatingSystem platformName.
93
claus
parents: 85
diff changeset
  4085
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4086
    box := FilenameEnterBox 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4087
		title:(resources string:'execute %1 command:' with:osName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4088
	       okText:(resources string:'execute')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4089
	       action:aBlock.
79
d78f92a07d5d *** empty log message ***
claus
parents: 75
diff changeset
  4090
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4091
    fileName notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4092
	self initialCommandFor:fileName into:box.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4093
    ].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4094
    box directory:currentDirectory.
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4095
    box showAtPointer.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4096
    box destroy.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4097
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4098
    "Modified: / 7.9.1995 / 10:31:54 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4099
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4100
    "Modified: / 14.8.1998 / 14:12:52 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4101
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4102
98
claus
parents: 93
diff changeset
  4103
askIfModified:question yesButton:yesButtonText
claus
parents: 93
diff changeset
  4104
    "tell user, that code has been modified - let her confirm"
claus
parents: 93
diff changeset
  4105
claus
parents: 93
diff changeset
  4106
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4107
	^ true
98
claus
parents: 93
diff changeset
  4108
    ].
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4109
    (self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4110
	"/ reset modified flag so question is asked only once
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4111
	subView modified:false.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4112
	^ true
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4113
    ].
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4114
    ^ false
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4115
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4116
    "Modified: 2.10.1997 / 14:23:47 / stefan"
98
claus
parents: 93
diff changeset
  4117
!
claus
parents: 93
diff changeset
  4118
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4119
getSelectedFileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4120
    "returns the currently selected file; shows an error if
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4121
     multiple files are selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4122
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4123
    |sel|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4124
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4125
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4126
    (sel size > 1) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4127
	self onlyOneSelection
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4128
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4129
	sel notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4130
	    ^ fileList at:sel first ifAbsent:nil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4131
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4132
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4133
    ^ nil
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4134
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4135
    "Modified: / 3.10.1998 / 18:21:23 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4136
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4137
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4138
onlyOneSelection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4139
    "show a warning, that only one file must be selected for
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4140
     this operation"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4141
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4142
    self warn:'exactly one file must be selected !!'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4143
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4144
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4145
selectedFilesDo:aBlock
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4146
    "evaluate aBlock on all selected files;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4147
     show a wait cursor while doing this"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4148
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  4149
    |sel action|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4150
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4151
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4152
    sel notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4153
	sel := sel collect:[:aSelectionIndex | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4154
	    |nm|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4155
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4156
	    nm := fileList at:aSelectionIndex ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4157
	    nm notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4158
		nm := nm string.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4159
		(nm endsWith:' ...') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4160
		    nm := (nm copyWithoutLast:4) withoutSpaces
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4161
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4162
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4163
	    nm
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4164
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4165
	action := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4166
	    sel do:[:nm |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4167
		nm notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4168
		    aBlock value:nm
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4169
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4170
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4171
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4172
	Processor activeProcess == self windowGroup process ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4173
	    self withWaitCursorDo:action
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4174
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4175
	    action value
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4176
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4177
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4178
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  4179
    "Modified: / 16.12.1998 / 17:30:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4180
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4181
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4182
show:something
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4183
    "show something in subview and undef acceptAction"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4184
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4185
    subView contents:something.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4186
    subView acceptAction:nil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4187
    subView modified:false.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4188
    currentFileName := nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4189
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4190
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4191
showAlert:aString with:anErrorString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4192
    "show an alertbox, displaying the last Unix-error"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4193
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4194
    |msg|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4195
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4196
    anErrorString isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4197
	msg := aString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4198
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4199
	msg := aString , '\\(' , anErrorString , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4200
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4201
    self warn:msg withCRs
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4202
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4203
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4204
withoutHiddenFiles:aCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4205
    "remove hidden files (i.e. those that start with '.') from
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4206
     the list in aCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4207
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4208
    |newCollection|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4209
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4210
    newCollection := aCollection species new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4211
    aCollection do:[:fname |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4212
	|ignore|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4213
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4214
	ignore := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4215
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4216
	((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4217
	    showingHiddenFiles value "showDotFiles" ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4218
		ignore := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4219
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4220
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4221
	ignore ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4222
	    newCollection add:fname
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4223
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4224
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4225
    ^ newCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4226
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4227
    "Modified: / 4.8.1998 / 13:46:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4228
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4229
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4230
!FileBrowser methodsFor:'private - actions & command execution'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4231
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4232
binaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4233
    "for some binary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4234
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4235
1330
2d8c64367afc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  4236
    (currentDirectory construct:aFilename) isExecutableProgram ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4237
	(OperatingSystem executeCommand:'cd ', currentDirectory pathName, '; ',aFilename)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4238
	ifTrue:[^true].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4239
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4240
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4241
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4242
    "Modified: 19.6.1996 / 09:44:07 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4243
    "Modified: 18.9.1997 / 17:18:04 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4244
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4245
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4246
doExecuteCommand:commandArg replace:replace
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4247
    "execute a unix command inserting the output of the command.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4248
     If replace is true, all text is replaced by the commands output;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4249
     otherwise, its inserted as selected text at the cursor position."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4250
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  4251
    |command stream line lnr myProcess myPriority startLine startCol stopSignal
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4252
     pauseSignal access stillReplacing pauseHolder lowerFrameView
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4253
     buttonWindowGroup|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4254
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4255
    command := commandArg asString.
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4256
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4257
    access := Semaphore forMutualExclusion name:'accessLock'.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4258
    stopSignal := Signal new.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4259
    pauseSignal := Signal new.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4260
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4261
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4262
     The following is tricky: 
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4263
     the pauseToggle & killButton will
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4264
     be handled by their own windowGroup process.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4265
     This means, that they respond to events even though
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4266
     I myself am reading the commands output.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4267
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4268
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4269
    commandView beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4270
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4271
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4272
     must take kill & pauseButtons out of my group
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4273
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4274
    killButton windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4275
    pauseToggle windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4276
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4277
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4278
     bring them to front, and turn hidden-mode off
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4279
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4280
    killButton raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4281
    pauseToggle raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4282
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4283
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4284
     kill will make me raise the stopSignal when pressed
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4285
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4286
    killButton 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4287
	action:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4288
	    stream notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4289
		access critical:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4290
		    myProcess interruptWith:[stopSignal raiseRequest].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4291
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4292
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4293
	].
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4294
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4295
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4296
     pause makes me stop reading the commands output
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4297
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4298
    pauseHolder := false asValue.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4299
    pauseToggle model:pauseHolder.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4300
    pauseToggle pressAction:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4301
	stream notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4302
	    access critical:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4303
		myProcess interruptWith:[pauseSignal raiseRequest].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4304
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4305
	]
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4306
    ].
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4307
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4308
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4309
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4310
     start kill button under its own windowgroup
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4311
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4312
    killButton openAutonomous.
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4313
    buttonWindowGroup := killButton windowGroup.
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4314
    buttonWindowGroup process name:'FileBrowser sub'.
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4315
    buttonWindowGroup process processGroupId:(Processor activeProcess id).
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4316
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4317
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4318
     and add the pauseToggle to its windowGroup
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4319
    "
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4320
    pauseToggle windowGroup:buttonWindowGroup.
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4321
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4322
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4323
    lowerFrameView := subView superView.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4324
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4325
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4326
     go fork a pipe and read it
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4327
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4328
    self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4329
    [
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4330
      self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4331
	stopSignal catch:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4332
	    pauseSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4333
		|noPauseSema|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4334
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4335
		"/    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4336
		"/ allow interaction with
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4337
		"/ the codeView via the other windowGroup
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4338
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4339
		lowerFrameView windowGroup:buttonWindowGroup.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4340
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4341
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4342
		"/ wait for pause to be turned off
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4343
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4344
		noPauseSema := Semaphore new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4345
		pauseHolder onChangeSend:#signal to:noPauseSema.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4346
		noPauseSema wait.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4347
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4348
		"/    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4349
		"/ no interaction with the codeView ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4350
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4351
		lowerFrameView windowGroup:(self windowGroup).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4352
		ex proceed.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4353
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4354
		startLine := subView cursorLine.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4355
		startCol := subView cursorCol.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4356
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4357
		"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4358
		 this can be a time consuming operation; therefore lower my priority
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4359
		"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4360
		myProcess := Processor activeProcess.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4361
"/                myPriority := myProcess priority.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4362
"/                myProcess priority:(Processor userBackgroundPriority).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4363
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4364
		stream := PipeStream 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4365
			    readingFrom:command
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4366
			    errorDisposition:#inline
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4367
			    inDirectory:currentDirectory.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4368
		stream notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4369
		    [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4370
			|codeView lines noPauseSema enc|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4371
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4372
			enc := fileEncoding.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4373
			enc == #iso8859 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4374
			    enc := nil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4375
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4376
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4377
			stream buffered:true.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4378
			codeView := subView.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4379
			codeView unselect.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4380
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4381
			replace ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4382
			    codeView list:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4383
			    lnr := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4384
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4385
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4386
			stillReplacing := replace.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4387
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4388
			[stream readWait. stream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4389
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4390
			     data available; read up to 100 lines
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4391
			     and insert as a single junk. This speeds up
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4392
			     display of long output (less line-scrolling).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4393
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4394
			    lines := OrderedCollection new:100.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4395
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4396
			    [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4397
				line := stream nextLine.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4398
				line notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4399
				    enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4400
					line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4401
				    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4402
				    lines add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4403
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4404
			    ] doWhile:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4405
				stream canReadWithoutBlocking
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4406
				and:[stream atEnd not
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4407
				and:[lines size < 100]]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4408
			    ]. 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4409
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4410
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4411
			     need this critical section; otherwise,
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4412
			     we could get the signal while waiting for
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4413
			     an expose event ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4414
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4415
			    access critical:[                        
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4416
				lines size > 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4417
				    stillReplacing ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4418
					lines do:[:line |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4419
					    codeView at:lnr put:line withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4420
					    codeView cursorToBottom; cursorDown:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4421
					    lnr := lnr + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4422
					    lnr > codeView list size ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4423
						stillReplacing := false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4424
					    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4425
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4426
				    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4427
					codeView insertLines:lines before:codeView cursorLine.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4428
					codeView cursorDown:lines size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4429
				    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4430
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4431
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4432
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4433
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4434
			     give others running at same prio a chance too
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4435
			     (especially other FileBrowsers doing the same)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4436
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4437
			    Processor yield
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4438
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4439
		    ] valueNowOrOnUnwindDo:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4440
			stream shutDown "close". stream := nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4441
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4442
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4443
		    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4444
		    "/ the command could have changed the directory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4445
		    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4446
		    self updateCurrentDirectoryIfChanged
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4447
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4448
		replace ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4449
		    subView modified:false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4450
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4451
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4452
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4453
      ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4454
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4455
	|wg|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4456
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4457
	self label:myName; iconLabel:myName.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4458
"/        myProcess notNil ifTrue:[myProcess priority:myPriority].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4459
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4460
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4461
	 hide the button, and make sure it will stay
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4462
	 hidden when we are realized again
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4463
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4464
	killButton beInvisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4465
	pauseToggle beInvisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4466
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4467
	commandView beVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4468
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4469
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4470
	 remove the killButton from its group
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4471
	 (otherwise, it will be destroyed when we shut down the group)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4472
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4473
	wg := killButton windowGroup.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4474
	killButton windowGroup:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4475
	pauseToggle windowGroup:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4476
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4477
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4478
	 shut down the kill buttons windowgroup
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4479
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4480
	wg notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4481
	    wg process terminate.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4482
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4483
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4484
	 clear its action (actually not needed, but
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4485
	 releases reference to thisContext earlier)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4486
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4487
	killButton action:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4488
	pauseToggle pressAction:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4489
	"/    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4490
	"/ allow interaction with the codeView
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4491
	"/ (bring it back into my group)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4492
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4493
	lowerFrameView windowGroup:(self windowGroup).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4494
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4495
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4496
    currentFileName isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4497
	subView modified:false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4498
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4499
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4500
    subView size > 10000 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4501
	self warn:'text quite large now - please cut off some lines'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4502
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4503
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4504
    "Modified: / 21.9.1995 / 11:18:46 / claus"
1508
66bca43c9654 Use #raiseRequest when exception handler does #proceed
Stefan Vogel <sv@exept.de>
parents: 1507
diff changeset
  4505
    "Modified: / 6.3.1998 / 17:32:03 / stefan"
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4506
    "Modified: / 15.10.1998 / 12:37:52 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4507
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4508
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4509
imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4510
    "for some image files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4511
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4512
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4513
    |img errmsg|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4514
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4515
    (Image isImageFileSuffix:(aFilename asFilename suffix))
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4516
    ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4517
        Image imageLoadErrorSignal handle:[:ex |
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4518
            errmsg := ex errorString
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4519
        ] do:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4520
            img := Image fromFile:(currentDirectory construct:aFilename).
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4521
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4522
        img notNil ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4523
            ImageEditor openOnImage:img.
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  4524
"/            img inspect.
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4525
            ^ true
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4526
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4527
        errmsg notNil ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4528
            self warn:errmsg.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4529
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4530
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4531
    ^ false
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4532
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4533
    "Created: / 19.6.1996 / 09:43:50 / cg"
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4534
    "Modified: / 18.9.1997 / 16:35:48 / stefan"
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4535
    "Modified: / 18.5.1999 / 15:45:06 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4536
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4537
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4538
initialCommandFor:fileName into:aBox
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4539
    "set a useful initial command for execute box."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4540
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4541
    |cmd select path suffix|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4542
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4543
    "/ XXX should be changed to take stuff from a config file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4544
    "/ XXX or from resources.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4545
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4546
    path := currentDirectory filenameFor:fileName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4547
    (path type == #regular) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4548
	path isExecutableProgram ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4549
	    aBox initialText:(fileName , ' <arguments>').
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4550
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4551
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4552
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4553
	select := true.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4554
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4555
	"some heuristics - my personal preferences ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4556
	 (actually this should come from a configfile)"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4557
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4558
	(fileName endsWith:'akefile') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4559
	    aBox initialText:'make target' selectFrom:6 to:11.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4560
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4561
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4562
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4563
	suffix := path suffix.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4564
	(suffix = 'C') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4565
	    cmd := 'g++ -c %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4566
	    select := 6.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4567
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4568
	    suffix := suffix asLowercase.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4569
	    (suffix = 'taz') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4570
		aBox initialText:'zcat %1 | tar tvf -'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4571
		select := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4572
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4573
	    (suffix = 'tar') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4574
		cmd := 'tar tvf %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4575
		select := 7.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4576
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4577
	    (suffix = 'zoo') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4578
		cmd := 'zoo -list %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4579
		select := 9.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4580
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4581
	    (suffix = 'zip') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4582
		cmd := 'unzip -l %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4583
		select := 8.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4584
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4585
	    (suffix = 'jar') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4586
		cmd := 'unzip -l %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4587
		select := 8.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4588
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4589
	    (suffix = 'z') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4590
		(fileName asLowercase endsWith:'tar.z') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4591
		    cmd := 'zcat %1 | tar tvf -'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4592
		    select := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4593
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4594
		    cmd := 'uncompress %1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4595
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4596
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4597
	    (suffix = 'gz') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4598
		(fileName asLowercase endsWith:'tar.gz') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4599
		    cmd := ('gunzip < %1 | tar tvf -' ).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4600
		    select := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4601
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4602
		    cmd := 'gunzip %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4603
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4604
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4605
	    (suffix = 'tgz') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4606
		cmd := ('gunzip < %1 | tar tvf -' ).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4607
		select := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4608
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4609
	    (suffix = 'html') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4610
		cmd := 'netscape %1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4611
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4612
	    (suffix = 'htm') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4613
		cmd := 'netscape %1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4614
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4615
	    (suffix = 'uue') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4616
		cmd := 'uudecode %1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4617
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4618
	    (suffix = 'c') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4619
		cmd := 'cc -c %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4620
		select := 5.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4621
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4622
	    (suffix = 'cc') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4623
		cmd := 'g++ -c %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4624
		select := 6.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4625
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4626
	    (suffix = 'xbm') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4627
		cmd := 'bitmap %1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4628
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4629
	    (suffix = 'ps') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4630
		cmd := 'ghostview %1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4631
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4632
	    ((suffix = '1') or:[suffix = 'man']) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4633
		cmd := 'nroff -man %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4634
		select := 10.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4635
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4636
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4637
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4638
	cmd isNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4639
	    DefaultCommandPerSuffix isNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4640
		cmd := '<cmd>'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4641
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4642
		cmd := DefaultCommandPerSuffix 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4643
			at:suffix
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4644
			ifAbsent:'<cmd>'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4645
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4646
	    cmd := cmd , ' %1'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4647
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4648
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4649
	cmd := cmd bindWith:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4650
	select == false ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4651
	    aBox initialText:cmd
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4652
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4653
	    select isInteger ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4654
		select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4655
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4656
	    aBox initialText:cmd selectFrom:1 to:select
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4657
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4658
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4659
1542
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  4660
    "Modified: / 24.9.1997 / 16:34:52 / stefan"
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  4661
    "Modified: / 9.4.1998 / 17:15:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4662
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4663
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4664
nonBinaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4665
    "for some nonBinary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4666
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4667
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  4668
    |fullPath|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4669
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4670
    fullPath := currentDirectory filenameFor:aFilename.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4671
    ((fullPath hasSuffix:'htm') or:[fullPath hasSuffix:'html']) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4672
	HTMLDocumentView openOn:fullPath pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4673
	^ true
2091
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  4674
    ].
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  4675
    ((fullPath hasSuffix:'prj')  
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  4676
    and:[ProjectBrowser notNil]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4677
	ProjectBrowser openOnFile:fullPath pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4678
	^ true
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4679
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4680
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4681
    OperatingSystem isUNIXlike ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4682
	(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4683
	ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4684
	     HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4685
	    ^ true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4686
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4687
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4688
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4689
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4690
    "Created: 19.6.1996 / 09:36:38 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4691
    "Modified: 4.4.1997 / 10:49:00 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4692
    "Modified: 18.9.1997 / 16:58:40 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4693
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4694
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4695
!FileBrowser methodsFor:'private - directory stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4696
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4697
addToHistory:path
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4698
    |pos idx|
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4699
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4700
    (DirectoryHistory includes:path) ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4701
	DirectoryHistory size >= HistorySize ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4702
	    DirectoryHistory removeLast.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4703
	    DirectoryHistoryWhere removeLast
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4704
	]
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4705
    ] ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4706
	"already been there before; move the entry to
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4707
	 the beginning, so it will fall out later."
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4708
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4709
	idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4710
	DirectoryHistory removeIndex:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4711
	pos := DirectoryHistoryWhere at:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4712
	DirectoryHistoryWhere removeIndex:idx.
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4713
    ].
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4714
    DirectoryHistory addFirst:path.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4715
    DirectoryHistoryWhere addFirst:pos.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4716
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4717
    "Created: / 8.11.1997 / 17:16:29 / cg"
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4718
!
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4719
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4720
changeToPreviousDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4721
    "if text was modified show a queryBox, 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4722
     otherwise change immediately to previous directory."
93
claus
parents: 85
diff changeset
  4723
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4724
    previousDirectory isNil ifTrue:[^ self].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4725
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4726
	self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false 
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4727
    ]
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4728
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4729
    "Modified: 2.10.1997 / 14:13:40 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4730
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4731
98
claus
parents: 93
diff changeset
  4732
checkIfDirectoryHasChanged
claus
parents: 93
diff changeset
  4733
    "every checkDelta secs, check if directoy has changed and update the list if so.
claus
parents: 93
diff changeset
  4734
     Also, we check if the file shown has been touched in the meanwhile (for example,
claus
parents: 93
diff changeset
  4735
     from another browser) and say 'outdated' in the label if so. 
claus
parents: 93
diff changeset
  4736
     This avoids confusion if the same file is being edited by two browsers. (or other editors).
claus
parents: 93
diff changeset
  4737
     If the text shown in the codeView has been edited, 'modified' is shown.
claus
parents: 93
diff changeset
  4738
    "
claus
parents: 93
diff changeset
  4739
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4740
    |oldSelection nOld newState msg newLabel t|
98
claus
parents: 93
diff changeset
  4741
claus
parents: 93
diff changeset
  4742
    shown ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4743
	currentDirectory notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4744
	    lockUpdate ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4745
		Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4746
		Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4747
		^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4748
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4749
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4750
	    subView modified ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4751
		newState := ' (modified)'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4752
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4753
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4754
	    (currentDirectory isReadable) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4755
		Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4756
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4757
		t := currentDirectory modificationTime.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4758
		(t notNil and:[t > timeOfLastCheck]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4759
		    nOld := fileListView numberOfSelections.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4760
		    oldSelection := fileListView selectionValue.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4761
		    self updateCurrentDirectory.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4762
		    nOld ~~ 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4763
			nOld > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4764
			    oldSelection do:[:element  |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4765
				fileListView addElementToSelection:element
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4766
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4767
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4768
			    fileListView selectElementWithoutScroll:oldSelection
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4769
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4770
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4771
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4772
		    Processor addTimedBlock:checkBlock afterSeconds:checkDelta
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4773
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4774
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4775
		currentFileName notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4776
		    |f|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4777
		    f := currentDirectory construct:currentFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4778
		    f exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4779
			newState := ' (removed)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4780
		    ] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4781
			f modificationTime > timeOfFileRead ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4782
			    newState := ' (outdated)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4783
			    subView modified ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4784
				newState := ' (modified & outdated)'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4785
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4786
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4787
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4788
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4789
	    ] ifFalse:[         
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4790
		"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4791
		 if the directory has been deleted, or is not readable ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4792
		"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4793
		(currentDirectory exists) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4794
		    msg := 'FileBrowser:\\directory %1 is gone ?!!?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4795
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4796
		    msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4797
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4798
		self warn:(resources string:msg with:currentDirectory pathName) withCRs.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4799
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4800
		fileListView contents:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4801
		newLabel := myName , ': directory is gone !!'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4802
		"/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4803
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4804
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4805
	    newState notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4806
		newLabel := myName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4807
		currentFileName notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4808
		    newLabel := newLabel , ': ' , currentFileName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4809
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4810
		newLabel := newLabel , newState.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4811
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4812
	    newLabel notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4813
		self label:newLabel.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4814
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4815
	]
98
claus
parents: 93
diff changeset
  4816
    ]
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4817
1380
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4818
    "Modified: / 28.4.1997 / 22:31:02 / dq"
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4819
    "Modified: / 16.9.1997 / 15:17:15 / stefan"
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4820
    "Modified: / 18.2.1998 / 17:57:49 / cg"
98
claus
parents: 93
diff changeset
  4821
!
claus
parents: 93
diff changeset
  4822
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4823
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4824
    "verify argument is name of a readable & executable directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4825
     and if so, go there"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4826
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4827
    |msg path idx f|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4828
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4829
    self label:myName; iconLabel:myName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4830
    fileName notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4831
	(f := fileName asFilename) isAbsolute ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4832
	    f := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4833
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4834
	f := f asAbsoluteFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4835
	(f isDirectory) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4836
	    (f isReadable) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4837
		(f isExecutable) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4838
		    path := currentDirectory pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4839
		    previousDirectory := path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4840
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4841
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4842
		     remember where we are positioned in the fileList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4843
		     (in case we want to return)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4844
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4845
		    idx := DirectoryHistory indexOf:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4846
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4847
			DirectoryHistoryWhere at:idx put:fileListView firstLineShown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4848
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4849
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4850
		    updateHistory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4851
			self addToHistory:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4852
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4853
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4854
		    self setCurrentDirectory:(f pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4855
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4856
		    "/ fetch the new path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4857
		    path := currentDirectory pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4858
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4859
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4860
		     if we have already been there, look for the
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4861
		     position offset, and scroll the fileList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4862
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4863
		    idx := DirectoryHistory indexOf:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4864
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4865
			|pos|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4866
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4867
			pos := DirectoryHistoryWhere at:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4868
			pos notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4869
			    fileListView scrollToLine:pos.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4870
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4871
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4872
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4873
		    updateHistory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4874
			self addToHistory:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4875
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4876
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4877
		    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4878
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4879
		msg := 'cannot change directory to ''%1'' !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4880
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4881
		msg := 'cannot read directory ''%1'' !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4882
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4883
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4884
	    OperatingSystem isVMSlike ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4885
		"/ cannot tell if it exists or is simply invisible ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4886
		msg := '''%1'' is not a directory or unreadable !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4887
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4888
		msg := '''%1'' is not a directory !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4889
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4890
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4891
	Dialog warn:(resources string:msg withCRs with:fileName).
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4892
    ]
1166
0029f77ccea7 when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
  4893
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4894
    "Modified: / 18.9.1997 / 18:22:30 / stefan"
2128
dfff36f688d2 care for windows filenames (dont expand \'s in filename)
Claus Gittinger <cg@exept.de>
parents: 2124
diff changeset
  4895
    "Modified: / 27.4.1999 / 17:10:14 / cg"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4896
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4897
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4898
doChangeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4899
    "go to parent directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4900
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4901
    self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4902
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4903
    "Created: 21.9.1997 / 23:45:59 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4904
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4905
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4906
doChangeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4907
    "go to home directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4908
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4909
    self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4910
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4911
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4912
doChangeToParentDirectory
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4913
    "go to parent directory"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4914
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4915
    self doChangeCurrentDirectoryTo:'..' updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4916
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4917
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4918
doCreateDirectory:newName
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4919
    |f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4920
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4921
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4922
    f exists ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4923
	self warn:'%1 already exists.' with:newName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4924
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4925
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4926
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4927
    f makeDirectory ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4928
	self updateCurrentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4929
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4930
	self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4931
		  with:(OperatingSystem lastErrorString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4932
    ]
1157
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  4933
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  4934
    "Modified: / 18.9.1997 / 17:21:25 / stefan"
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  4935
    "Modified: / 30.1.1999 / 16:24:12 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4936
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4937
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4938
setCurrentDirectory:aPathName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4939
    "setup for another directory"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4940
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4941
    |newDirectory|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4942
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4943
    aPathName isEmpty ifTrue:[^ self].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4944
    newDirectory := currentDirectory filenameFor:aPathName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4945
    newDirectory isDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4946
	self currentDirectory:newDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4947
	currentFileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4948
	    fileListView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4949
	    currentFileName := nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4950
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4951
	    fileListView setSelection:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4952
	    fileListView scrollToTop.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4953
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4954
	self updateCurrentDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4955
	self showInfo.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4956
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  4957
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4958
    "Modified: 21.9.1995 / 11:22:45 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4959
    "Modified: 25.5.1996 / 12:27:01 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4960
    "Modified: 18.9.1997 / 17:08:07 / stefan"
912
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  4961
!
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  4962
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4963
updateCurrentDirectoryIfChanged
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4964
    |t|
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4965
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4966
    OperatingSystem isMSDOSlike ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4967
	"/ workaround: DOS has no diretory modifiation time ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4968
	self updateCurrentDirectory.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4969
	^ self
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4970
    ].
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4971
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4972
    ((t := currentDirectory modificationTime) isNil
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4973
    or:[t > timeOfLastCheck]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4974
	self updateCurrentDirectory
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4975
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4976
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4977
    "Modified: / 16.9.1997 / 15:35:52 / stefan"
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4978
    "Modified: / 16.12.1998 / 22:55:44 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4979
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4980
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4981
!FileBrowser methodsFor:'private - encoding'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4982
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4983
guessEncodingFrom:aBuffer
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4984
    "look for a string
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4985
	encoding #name
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4986
     or:
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4987
	encoding: name
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4988
     within the given buffer 
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4989
     (which is usually the first few bytes of a textFile).
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4990
     If thats not found, use heuristics (in CharacterArray) to guess."
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4991
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4992
    |n "{Class: SmallInteger }"
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4993
     binary idx s w enc|
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4994
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4995
    binary := false.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4996
    n := aBuffer size.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4997
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4998
    (idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4999
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5000
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5001
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5002
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5003
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5004
	    (idx := w indexOf:$") ~~ 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5005
		w := w copyTo:idx-1
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5006
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5007
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5008
	].
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5009
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5010
    (idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5011
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5012
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5013
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5014
	s peek == $: ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5015
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5016
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5017
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5018
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5019
	s peek == $# ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5020
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5021
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5022
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5023
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5024
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5025
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5026
	].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5027
    ].
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5028
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5029
    1 to:n do:[:i |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5030
	(aBuffer at:i) isPrintable ifFalse:[binary := true].
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5031
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5032
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5033
    binary ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5034
	"/ look for JIS7 / EUC encoding
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5035
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5036
	enc := CharacterArray guessEncodingFrom:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5037
	enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5038
	    ^ enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5039
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5040
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5041
	"/ if the encoding has been set to any non iso setting,
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5042
	"/ assume its what we defined ...
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5043
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5044
	(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5045
	    ^ #binary
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5046
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5047
	^ fileEncoding ? #binary
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5048
    ].
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5049
    ^ #ascii
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5050
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5051
    "Created: 26.2.1996 / 17:43:08 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5052
    "Modified: 1.7.1997 / 00:00:27 / cg"
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5053
!
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5054
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5055
preferredFontEncodingFor:fileEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5056
    "given a file encoding, return corresponding preferred fontEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5057
     match pattern"
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5058
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5059
    |fe|
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5060
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5061
    fe := MIMETypes fontForCharset:fileEncoding.
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5062
    fe notNil ifTrue:[^ fe].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5063
    ^ 'iso8859*'
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5064
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5065
    "Created: 28.6.1997 / 20:47:35 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5066
    "Modified: 1.7.1997 / 00:04:56 / cg"
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5067
!
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5068
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5069
validateFontEncodingFor:newEncoding ask:ask
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5070
    "if required, query user if he/she wants to change to another font,
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5071
     which is able to display text encoded as specified by newEncoding"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5072
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5073
    |fontsEncoding msg filter f defaultFont pref|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5074
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5075
    fontsEncoding := subView font encoding.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5076
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5077
    pref := self preferredFontEncodingFor:newEncoding.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5078
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5079
    (pref match:fontsEncoding) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5080
	^ self
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5081
    ].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5082
    "/ stupid ...
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5083
    pref = 'ascii*' ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5084
	(fontsEncoding match:'iso8859*') ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5085
	    ^ self
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5086
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5087
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5088
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5089
    filter := [:f | |coding|
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5090
		    (coding := f encoding) notNil 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5091
		    and:[pref match:coding]].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5092
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5093
    defaultFont := TextView defaultFont onDevice:device.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5094
    (pref match:(defaultFont encoding)) ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5095
	defaultFont := nil.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5096
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5097
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5098
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5099
	(pref = 'ascii*'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5100
	or:[pref = 'iso8859*']) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5101
	    defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5102
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5103
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5104
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5105
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5106
	defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5107
			    listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5108
				detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5109
				ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5110
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5111
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5112
	    "/ flush list, and refetch font list
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5113
	    "/ (in case someone just changed the font path ...)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5114
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5115
	    device flushListOfAvailableFonts.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5116
	    defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5117
				listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5118
				    detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5119
				    ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5120
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5121
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5122
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5123
	    self warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5124
	    ^ self.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5125
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5126
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5127
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5128
    msg := 'switch to a %1 encoded font ?'.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5129
    (ask not or:[self confirm:(resources string:msg with:pref) withCRs])
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5130
    ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5131
	self withWaitCursorDo:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5132
	    f := FontPanel 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5133
		fontFromUserInitial:defaultFont
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5134
			      title:(resources string:'font selection')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5135
			     filter:filter.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5136
	    f notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5137
		subView font:f
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5138
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5139
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5140
    ]
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5141
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5142
    "Created: 26.10.1996 / 12:06:54 / cg"
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5143
    "Modified: 30.6.1997 / 17:46:46 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5144
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5145
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5146
!FileBrowser methodsFor:'private - file stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5147
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5148
doCreateFile:newName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5149
    "create an empty file"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5150
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5151
    |aStream f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5152
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5153
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5154
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5155
	(self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5156
	    ask:(resources string:'%1 already exists\\truncate ?' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5157
	    yesButton:'truncate'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5158
	) ifFalse:[^ self].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5159
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5160
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5161
    FileStream openErrorSignal handle:[:ex|
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5162
	^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5163
		    with:(FileStream lastErrorString)
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5164
    ] do:[    
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5165
	aStream := f newReadWriteStream.
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5166
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5167
    aStream notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5168
	aStream close.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5169
	self updateCurrentDirectoryIfChanged
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5170
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5171
	self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5172
		  with:(FileStream lastErrorString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5173
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5174
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5175
    "Modified: 23.4.1997 / 13:19:12 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5176
    "Modified: 18.9.1997 / 17:21:45 / stefan"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5177
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5178
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5179
doFileGet:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5180
    "get selected file - show contents in subView.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5181
     This is invoked either by the 'get file' menu item, or via double click.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5182
     When invoked via the menu (viaDoubleClick argument is false),
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5183
     the automatic file action is not performed - instead, the file is always
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5184
     shown in the codeView (if possible).
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5185
     This distinction was done to allow xpm or xbm files (which have an automatic
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5186
     action) to be edited."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5187
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5188
    |fileName|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5189
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5190
    fileName := self getSelectedFileName.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5191
    fileName notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5192
	self doOpenFile:fileName viaDoubleClick:viaDoubleClick
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5193
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5194
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  5195
    "Created: / 19.6.1996 / 09:39:07 / cg"
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  5196
    "Modified: / 18.9.1997 / 17:35:31 / stefan"
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5197
    "Modified: / 4.2.1999 / 17:43:51 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5198
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5199
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5200
doFindFileNamed:namePatterns ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5201
    |dir subDirs nameMatches contentsMatches lines contentsToCompare|
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5202
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5203
    bytesToCompareContentsOrNil notNil ifTrue:[
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5204
        contentsToCompare := bytesToCompareContentsOrNil
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5205
    ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5206
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5207
    subDirs := OrderedCollection new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5208
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5209
    dir := aDirectory asFilename.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5210
    self label:myName , '- searching ' , dir name.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5211
    (dir directoryContents ? #()) sort do:[:fn |
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5212
        |f|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5213
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5214
        f := dir construct:fn.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5215
        f isDirectory ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5216
            f isSymbolicLink ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5217
                subDirs add:f
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5218
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5219
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5220
            (nameMatches := namePatterns isNil) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5221
                ignCaseInName ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5222
                    nameMatches := namePatterns contains:[:aPattern | aPattern match:(fn asLowercase)]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5223
                ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5224
                    nameMatches := namePatterns contains:[:aPattern | aPattern  match:fn]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5225
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5226
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5227
            nameMatches ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5228
                filenameToCompareContentsOrNil notNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5229
                    "/ contents compare ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5230
                    contentsMatches := false.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5231
                    f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5232
                        f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5233
                            contentsToCompare isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5234
                                filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5235
                                    contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5236
                                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5237
                            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5238
                            contentsToCompare isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5239
                                "/ too large - compare block-wise ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5240
                                contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5241
                            ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5242
                                contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5243
                            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5244
                        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5245
                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5246
                        f isSymbolicLink ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5247
                            subView insertLine:(f name , ' is a symbolic link to ' , f pathName)  before:subView cursorLine.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5248
                            subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5249
                        ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5250
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5251
                ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5252
                    "/ string search ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5253
                    (contentsMatches := contentsString isNil) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5254
                        (f exists and:[f isReadable]) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5255
                            subView insertLine:('*** ' , f pathName , ' skipped - unreadable or bad symbolic link ***') before:subView cursorLine.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5256
                            subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5257
                        ] ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5258
                            f fileSize > (4024*1024) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5259
                                subView insertLine:('*** ' , f pathName , ' skipped - too large ***') before:subView cursorLine.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5260
                                subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5261
                            ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5262
                                Stream lineTooLongErrorSignal handle:[:ex |
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5263
                                    |cont|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5264
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5265
                                    "/ this typically happens, when a binary file is read linewise ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5266
                                    cont := f readStream binary contentsOfEntireFile asString.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5267
                                    ignCaseInString ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5268
                                        contentsMatches := cont asLowercase includesString:contentsString
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5269
                                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5270
                                        contentsMatches := cont includesString:contentsString
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5271
                                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5272
                                ] do:[    
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5273
                                    lines := f contents ? #().
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5274
                                    ignCaseInString ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5275
                                        contentsMatches := (lines findFirst:[:l | l asLowercase includesString:contentsString]) ~~ 0
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5276
                                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5277
                                        contentsMatches := (lines findFirst:[:l | l includesString:contentsString]) ~~ 0
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5278
                                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5279
                                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5280
                            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5281
                        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5282
                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5283
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5284
                contentsMatches ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5285
                    subView insertLine:f pathName before:subView cursorLine.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5286
                    subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5287
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5288
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5289
        ]
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5290
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5291
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5292
    subDirs do:[:dir |
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5293
        self
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5294
            doFindFileNamed:namePatterns 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5295
            ignoreCase:ignCaseInName 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5296
            containingString:contentsString 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5297
            ignoreCaseInContents:ignCaseInString 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5298
            sameContentsAsFile:filenameToCompareContentsOrNil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5299
            sameContentsAs:contentsToCompare
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5300
            in:dir
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5301
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5302
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5303
    "Created: / 15.10.1998 / 11:37:15 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5304
    "Modified: / 15.10.1998 / 12:50:48 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5305
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5306
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5307
doOpenFile:fileName viaDoubleClick:viaDoubleClick
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5308
    "get selected file - show contents in subView.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5309
     This is invoked either by the 'get file' menu item, or via double click.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5310
     When invoked via the menu (viaDoubleClick argument is false),
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5311
     the automatic file action is not performed - instead, the file is always
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5312
     shown in the codeView (if possible).
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5313
     This distinction was done to allow xpm or xbm files (which have an automatic
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5314
     action) to be edited."
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5315
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5316
    |iconLbl winLbl f|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5317
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5318
    self withReadCursorDo:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5319
        (f := fileName asFilename) isAbsolute ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5320
            f := currentDirectory construct:fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5321
        ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5322
        f isDirectory ifTrue:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5323
            self doChangeCurrentDirectoryTo:fileName updateHistory:true.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5324
            winLbl := myName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5325
            iconLbl := myName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5326
        ] ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5327
            f exists ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5328
                Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName asText allBold).
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5329
                ^ self
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5330
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5331
            timeOfFileRead := f modificationTime.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5332
            self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5333
            currentFileName := fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5334
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5335
            self fileTypeSpecificActions.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5336
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5337
            subView acceptAction:[:theCode |
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5338
                (f modificationTime <= timeOfFileRead
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5339
                or:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5340
                    (self 
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5341
                        ask:(resources at:'FileBrowser:\\file has changed somehow in the meanwhile.\(Hint: use the file-difference menu function to see what has changed)\\Do you really want to save ?')
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5342
                        yesButton:'save'
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5343
                        noButton:'don''t save')]) ifTrue:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5344
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5345
                    self withCursor:(Cursor write) do:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5346
                        self writeFile:fileName text:theCode encoding:fileEncoding.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5347
                        timeOfFileRead := f modificationTime.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5348
                        self label:myName , ': ' , currentFileName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5349
                    ]
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5350
                ]
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5351
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5352
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5353
            winLbl := myName , ': ' , fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5354
            f isWritable ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5355
                winLbl := winLbl , ' (readonly)'
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5356
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5357
            iconLbl := fileName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5358
        ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5359
        self label:winLbl.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5360
        self iconLabel:iconLbl.
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5361
    ]
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5362
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5363
    "Created: / 4.2.1999 / 17:43:26 / cg"
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5364
    "Modified: / 3.5.1999 / 20:32:27 / ps"
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5365
    "Modified: / 4.5.1999 / 20:39:10 / cg"
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5366
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5367
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  5368
doRemove:filesToRemove
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5369
    "remove the selected file(s) - no questions asked"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5370
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5371
    |msg needUpdate toRemove updateRunning yesToAll mTime|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5372
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5373
    updateRunning := listUpdateProcess notNil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5374
    self stopUpdateProcess.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5375
    toRemove := OrderedCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5376
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5377
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5378
    "/ did the directory change in the meanwhile ?
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5379
    "/
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5380
    mTime := currentDirectory modificationTime.
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5381
    needUpdate := mTime notNil and:[mTime > timeOfLastCheck].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5382
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  5383
    yesToAll := false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5384
    lockUpdate := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5385
    [
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5386
	filesToRemove keysAndValuesDo:[:idx :fileName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5387
	    |f|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5388
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5389
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5390
	    OperatingSystem accessDeniedErrorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5391
		"was not able to remove it"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5392
		msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5393
		self showAlert:msg with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5394
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5395
		|answer contents i|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5396
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5397
		(f isSymbolicLink not and:[f isDirectory]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5398
		    contents := f directoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5399
		    contents isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5400
			f remove
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5401
		    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5402
			yesToAll ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5403
			    idx == filesToRemove size ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5404
				answer := Dialog
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5405
					    confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5406
					    labels:(resources array:#('cancel' 'remove'))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5407
					    values:#(false true) 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5408
					    default:2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5409
			    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5410
				answer := Dialog
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5411
					    confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5412
					    labels:(resources array:#('cancel' 'remove all' 'remove'))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5413
					    values:#(false #removeAll true) 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5414
					    default:3.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5415
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5416
			    answer == false ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5417
				^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5418
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5419
			    answer == #removeAll ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5420
				yesToAll := true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5421
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5422
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5423
			f recursiveRemove
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5424
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5425
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5426
		    f remove.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5427
		].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5428
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5429
		self show:nil
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  5430
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5431
		i := fileList indexOf:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5432
		i ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5433
		    toRemove add:i.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5434
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5435
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5436
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5437
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5438
	lockUpdate := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5439
	fileListView setSelection:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5440
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5441
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5442
	"/ remove reverse - otherwise indices are wrong
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5443
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5444
	toRemove sort.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5445
	toRemove reverseDo:[:idx |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5446
	    fileList removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5447
	    fileListView removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5448
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5449
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5450
	updateRunning ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5451
	    self updateCurrentDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5452
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5453
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5454
	     install a new check after some time
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5455
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5456
	    needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5457
	    Processor removeTimedBlock:checkBlock.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5458
	    Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5459
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5460
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5461
1374
b3a1e95a6220 Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents: 1371
diff changeset
  5462
    "Modified: / 20.11.1997 / 17:39:14 / stefan"
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5463
    "Modified: / 26.4.1999 / 23:03:12 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5464
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5465
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5466
doRename:oldName to:newName
1331
73e712c85588 Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents: 1330
diff changeset
  5467
    "rename a file (or directory)"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5468
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5469
    |old new|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5470
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5471
    (oldName notNil and:[newName notNil]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5472
	(oldName isBlank or:[newName isBlank]) ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5473
	    old := currentDirectory filenameFor:oldName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5474
	    new := currentDirectory filenameFor:newName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5475
	    OperatingSystem errorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5476
		self showAlert:(resources string:'cannot rename file ''%1'' to %2 !!' 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5477
					  with:oldName with:newName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5478
			  with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5479
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5480
		new exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5481
		    (self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName asText allBold))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5482
		    ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5483
			^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5484
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5485
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5486
		old renameTo:new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5487
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5488
	    self updateCurrentDirectoryIfChanged.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5489
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5490
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5491
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5492
    "Modified: / 24.9.1997 / 09:20:00 / stefan"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5493
    "Modified: / 3.10.1998 / 18:19:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5494
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5495
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5496
!FileBrowser methodsFor:'private - file type & info'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5497
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5498
fileCommentStrings
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5499
    "return a useful comment definition; based upon the fileName for now"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5500
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5501
    |suff mime|
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5502
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5503
    "/ for now,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5504
    "/ define comment strings, by heuristics;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5505
    "/ (should look for some mode= or similar string
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5506
    "/  found in the file itself - like emacs does it)
2182
0f2f1fde3901 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2181
diff changeset
  5507
    "/ Also, I would prefer some other (central) place for this
0f2f1fde3901 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2181
diff changeset
  5508
    "/ kind of information (how about the MIMEType class ?)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5509
2087
343c831f625a fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  5510
    (#('Make.proto'
343c831f625a fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  5511
      'Makefile'
343c831f625a fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  5512
      'makefile'
343c831f625a fixed commentString setting (commentIt/uncommentIt for C sources)
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  5513
    ) includes:currentFileName) ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5514
        ^ #('#' (nil nil)).
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5515
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5516
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5517
    suff := currentFileName asFilename suffix.
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5518
    suff := suff asLowercase.
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5519
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5520
    mime := MIMETypes mimeTypeForSuffix:suff.
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5521
    mime notNil ifTrue:[
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5522
        mime = 'application/x-smalltalk-source' ifTrue:[
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5523
            "/ smalltalk comments
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5524
            ^ #('"/' ('"' '"')).
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5525
        ].
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  5526
        mime = 'text/html' ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  5527
            ^ #(nil ('<!!--' '-->')).
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  5528
        ].
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5529
    ].
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5530
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5531
    (suff = 'mak') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5532
        ^ #('#' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5533
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5534
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5535
    (suff = 'sh') ifTrue:[
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5536
        ^ #('#' (nil nil)).
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5537
    ].
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  5538
    (suff = 'bat') ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  5539
        ^ #('rem ' (nil nil)).
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  5540
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5541
    (suff = 'c') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5542
        ^ #(nil ('/*' '*/')).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5543
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5544
    ((suff = 'cc') or:[suff = 'cpp']) ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5545
        ^ #('//' ('/*' '*/')).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5546
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5547
    (suff = 'java') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5548
        ^ #('//' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5549
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5550
    (suff = 'style') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5551
        ^ #(';' (nil nil)).
2104
4cdfa467fb7c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
  5552
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5553
    (suff = 'rs') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5554
        ^ #(';' (nil nil)).
2104
4cdfa467fb7c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
  5555
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5556
    ((suff = 'asn1')
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5557
    or:[(suff = 'x409')
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5558
    or:[(suff = 'gdmo')
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5559
    or:[(suff = 'gdm')]]]) ifTrue:[
2181
3a6dc8c26849 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  5560
        ^ #('--' ('--' '--')).
3a6dc8c26849 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  5561
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5562
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5563
    "/ default: smalltalk comments
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5564
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5565
    ^ #('"/' ('"' '"')).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5566
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5567
    "Created: / 7.1.1997 / 20:30:00 / cg"
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5568
    "Modified: / 4.5.1999 / 19:42:30 / ps"
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5569
    "Modified: / 4.5.1999 / 20:39:14 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5570
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5571
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5572
fileTypeSpecificActions
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5573
    "any special fileTypeSpecific actions are done here,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5574
     when a new file is selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5575
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5576
    |commentStrings|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5577
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5578
    commentStrings := self fileCommentStrings.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5579
    commentStrings notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5580
	subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5581
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5582
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5583
    "Modified: 7.1.1997 / 20:30:54 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5584
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5585
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5586
getFileInfoString:longInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5587
    "get stat info on selected file - return a string which can be
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5588
     shown in a box"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5589
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5590
    |fileName f fullPath text info fileOutput type modeBits modeString s ts|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5591
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5592
    fileName := self getSelectedFileName.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5593
    fileName isNil ifTrue:[^ nil].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5594
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5595
    f := currentDirectory construct:fileName.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5596
    info := f info.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5597
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5598
    info isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5599
	self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5600
		  with:(OperatingSystem lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5601
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5602
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5603
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5604
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5605
    f isSymbolicLink ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5606
	text add:(resources string:'symbolic link to: %1' with:(f linkInfo path))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5607
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5608
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5609
    type := info type.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5610
    (longInfo and:[type == #regular]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5611
	fullPath := currentDirectory pathName asFilename constructString:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5612
	fileOutput := fullPath asFilename fileType.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5613
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5614
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5615
    s := (resources at:'type:   ').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5616
    fileOutput isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5617
	s := s ,  type asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5618
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5619
	s := s , 'regular (' , fileOutput , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5620
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5621
    text add:s.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5622
    text add:(resources string:'size:   %1' with:(info size) printString).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5623
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5624
    modeBits := info mode.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5625
    modeString := self getModeString:modeBits.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5626
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5627
	text add:(resources string:'access: %1 (%2)'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5628
			      with:modeString 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5629
			      with:(modeBits printStringRadix:8))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5630
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5631
	text add:(resources string:'access: %1' with:modeString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5632
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5633
    text add:(resources string:'owner:  %1'
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5634
			  with:(OperatingSystem getUserNameFromID:(info uid))).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5635
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5636
	text add:(resources string:'group:  %1'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5637
			      with:(OperatingSystem getGroupNameFromID:(info gid))).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5638
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5639
	ts := info accessed.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5640
	text add:(resources string:'last access:       %1 %2' 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5641
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5642
			      with:(ts asDate printString)).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5643
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5644
	ts := info modified.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5645
	text add:(resources string:'last modification: %1 %2'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5646
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5647
			      with:(ts asDate printString)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5648
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5649
    ^ text asString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5650
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5651
    "Modified: 8.9.1995 / 11:59:28 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5652
    "Modified: 1.11.1996 / 20:47:52 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5653
    "Modified: 18.9.1997 / 16:34:31 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5654
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5655
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5656
getInfoFile
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5657
    "get filename of a description-file (.dir.info, README etc.);
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5658
     This file is automatically shown when a directory is enterred.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5659
     You can add more names below if you like."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5660
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5661
    #( 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5662
       '.dir.info'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5663
       'README'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5664
       'ReadMe'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5665
       'Readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5666
       'readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5667
       'read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5668
       'Read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5669
       'READ.ME'
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5670
       'README.TXT'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5671
       'readme.txt'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5672
       'Readme.txt'
1307
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  5673
       'Info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  5674
       'info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  5675
       'INFO.TXT'
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5676
    ) do:[:f | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5677
	|n|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5678
	n := currentDirectory construct:f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5679
	(n isReadable and:[n isDirectory not]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5680
	    ^ f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5681
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5682
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5683
    ^ nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5684
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5685
    "Modified: 3.8.1997 / 16:50:33 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5686
    "Modified: 16.9.1997 / 15:26:53 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5687
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5688
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5689
getModeString:modeBits
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5690
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5691
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5692
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5693
    ^ self getModeString:modeBits 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5694
		    with:#( 'owner:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5695
			    ' group:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5696
			    ' others:' $r $w $x )
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5697
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5698
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5699
getModeString:modeBits with:texts
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5700
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5701
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5702
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5703
    |bits modeString|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5704
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5705
    bits := modeBits bitAnd:8r777.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5706
    modeString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5707
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5708
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5709
    with: texts do:[:bitMask :access |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5710
	|ch|
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5711
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5712
	bitMask isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5713
	    modeString := modeString , (resources string:access)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5714
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5715
	    (bits bitAnd:bitMask) == 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5716
		ch := $-
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5717
	    ] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5718
		ch := access
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5719
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5720
	    modeString := modeString copyWith:ch 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5721
	]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5722
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5723
    ^ modeString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5724
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5725
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5726
showInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5727
    "show directory info when dir has changed"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5728
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5729
    |info txt|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5730
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5731
    info := self getInfoFile.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5732
    info notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5733
	txt := self readFile:info
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5734
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5735
    self show:txt.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5736
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5737
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5738
sizePrintString:size
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5739
    "helper for update-directory to return a string with a files size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5740
     This one gives the size in byte, Kb or Mb depending on size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5741
     If you dont like this, just uncomment the first statement below."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5742
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5743
    |unitString n|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5744
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5745
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5746
    ^ size printString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5747
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5748
    unitString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5749
    size < (500 * 1024) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5750
	size < 1024 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5751
	    n := size
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5752
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5753
	    n := (size * 10 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5754
	    unitString := ' Kb'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5755
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5756
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5757
	n := (size * 10 // 1024 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5758
	unitString := ' Mb'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5759
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5760
    ^ (n printStringLeftPaddedTo:5) , unitString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5761
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5762
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5763
!FileBrowser methodsFor:'private - file-I/O'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5764
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5765
readFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5766
    "read in the file, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5767
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5768
    ^ self readFile:fileName lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5769
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5770
    "Modified: 22.2.1996 / 14:57:08 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5771
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5772
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5773
readFile:fileName lineDelimiter:aCharacter encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5774
    "read in the file, return its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5775
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5776
     If encoding is nonNil, the file is assumed to be coded according to
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5777
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5778
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5779
    |f stream text msg sz|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5780
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5781
    (f := fileName asFilename) isAbsolute ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5782
	f := (currentDirectory construct:fileName)
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5783
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5784
    stream := f readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5785
    stream isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5786
	msg := (resources string:'cannot read file ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5787
	self showAlert:msg with:(FileStream lastErrorString).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5788
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5789
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5790
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5791
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5792
     for very big files, give ObjectMemory a hint, to preallocate more
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5793
    "
1311
e09e4a65d8a9 filename stuff
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  5794
    (sz := stream fileSize) > 1000000 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5795
	Processor activeProcess withPriority:Processor userBackgroundPriority do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5796
	    ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5797
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5798
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5799
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5800
    text := self readStream:stream lineDelimiter:aCharacter encoding:encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5801
    stream close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5802
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5803
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5804
    "Created: / 22.2.1996 / 14:56:48 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5805
    "Modified: / 18.9.1997 / 17:06:54 / stefan"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5806
    "Modified: / 4.2.1999 / 17:52:18 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5807
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5808
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5809
readStream:aStream
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5810
    "read in from aStream, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5811
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5812
    ^ self readStream:aStream lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5813
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5814
    "Modified: 22.2.1996 / 14:58:40 / cg"
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5815
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5816
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5817
readStream:aStream lineDelimiter:aCharacter encoding:encoding 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5818
    "read from aStream, answer its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5819
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5820
     If encoding is nonNil, the file is assumed to be coded according to
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5821
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5822
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5823
    |text line enc|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5824
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5825
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5826
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5827
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5828
    enc == #iso8859 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5829
	enc := nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5830
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5831
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5832
    aCharacter == Character cr ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5833
	FileStream lineTooLongErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5834
	    |s partialLine|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5835
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5836
	    s := ex parameter at:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5837
	    partialLine := ex parameter at:2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5838
	    ex proceedWith:(partialLine , s upTo:aCharacter)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5839
	] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5840
	    [aStream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5841
		line := aStream nextLine withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5842
		enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5843
		    line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5844
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5845
		text add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5846
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5847
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5848
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5849
	[aStream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5850
	    line := (aStream upTo:aCharacter) withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5851
	    enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5852
		line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5853
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5854
	    text add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5855
	].
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5856
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5857
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5858
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5859
    "Created: / 22.2.1996 / 14:58:25 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5860
    "Modified: / 5.2.1999 / 00:53:22 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5861
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5862
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5863
showFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5864
    "show contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5865
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5866
    fileListView selection:(fileList indexOf:fileName).
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5867
    self fileGet
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5868
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5869
    "Modified: / 17.6.1998 / 11:26:13 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5870
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5871
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5872
showFile:fileName insert:insert encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5873
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5874
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5875
    ^ self 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5876
	showFile:fileName insert:insert encoding:encoding doubleClick:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5877
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5878
    "Modified: 19.6.1996 / 09:40:19 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5879
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5880
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5881
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5882
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5883
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5884
    |path buffer s n i ok convert text msg eol guess action enc 
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5885
     fontsEncoding pref failWarning|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5886
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5887
    fileName asFilename isAbsolute ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5888
        path := currentDirectory filenameFor:fileName.
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5889
    ] ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5890
        path := fileName asFilename asAbsoluteFilename
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5891
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5892
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5893
    (path type == #regular) ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5894
        "asked for a non-file  - ignore it ..."
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5895
        path exists ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5896
            msg := '''%1'' does not exist !!'.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5897
        ] ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5898
            msg := '''%1'' is not a regular file !!'.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5899
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5900
        self warn:(resources string:msg with:fileName).
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5901
        ^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5902
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5903
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5904
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5905
    "/ check if file is a text file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5906
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5907
    s := path readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5908
    s isNil ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5909
        self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileName)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5910
                  with:(FileStream lastErrorString).
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5911
        ^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5912
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5913
1222
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5914
    buffer := String new:4096.
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5915
    n := s nextBytes:4096 into:buffer.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5916
    s close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5917
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5918
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5919
    ok := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5920
    guess := self guessEncodingFrom:buffer.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5921
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5922
    guess == #binary ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5923
        ok := false.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5924
        viaDoubleClick ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5925
            (self binaryFileAction:fileName) ifTrue:[^ self].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5926
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5927
        (self confirm:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileName))
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5928
        ifFalse:[^ self]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5929
    ] ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5930
        viaDoubleClick ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5931
            (self nonBinaryFileAction:fileName) ifTrue:[^ self].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5932
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5933
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5934
        fontsEncoding := subView font encoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5935
        pref := self preferredFontEncodingFor:guess.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5936
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5937
        ok := pref match:fontsEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5938
        ok ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5939
            pref = 'iso8859*' ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5940
                ok := 'ascii*' match:fontsEncoding
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5941
            ]
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5942
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5943
        ok ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5944
            fileEncoding := guess.    
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5945
            enc := guess.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5946
        ] ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5947
            action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileName with:pref)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5948
                           labels:(resources array:#('cancel' 'show' 'change font'))
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5949
                           values:#(nil #show #encoding)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5950
                           default:#encoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5951
            action isNil ifTrue:[^ self].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5952
            action == #encoding ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5953
                fileEncoding := guess asSymbol.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5954
                subView externalEncoding:fileEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5955
                self validateFontEncodingFor:fileEncoding ask:false.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5956
            ] ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5957
                self information:(resources string:'Individual characters may be invisible/wrong in this font.')
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5958
            ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5959
            enc := fileEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5960
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5961
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5962
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5963
    convert := false.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5964
"/    ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5965
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5966
"/        "/ check if line delimiter is a cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5967
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5968
"/        i := buffer indexOf:Character cr.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5969
"/        i == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5970
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5971
"/            "/ no newline found - try cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5972
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5973
"/            i := buffer indexOf:(Character value:13).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5974
"/            i ~~ 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5975
"/                convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5976
"/            ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5977
"/        ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5978
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5979
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5980
    insert ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5981
        "/ release old text first 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5982
        "/ - we might need the memory in case of huge files
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5983
        "/  (helps if you have a 4Mb file in the view, 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5984
        "/   and click on another biggy)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5985
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5986
        subView contents:nil.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5987
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5988
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5989
    convert ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5990
        eol := Character value:13
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5991
    ] ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5992
        eol := Character cr
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5993
    ].
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5994
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5995
    failWarning := false.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5996
    CharacterArray decodingFailedSignal handle:[:ex |
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5997
        |errStr|
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5998
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5999
        failWarning ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6000
            errStr := resources string:ex errorString.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6001
            (self confirm:(resources 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6002
                                string:'An error occurred while decoding:\%1\\The file has either a different encoding or is corrupted.\\Continue ?'
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6003
                                with:errStr) withCRs)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6004
            ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6005
                ^ self
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6006
            ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6007
            failWarning := true.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6008
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6009
        ex proceed.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6010
    ] do:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6011
        text := self readFile:fileName lineDelimiter:eol encoding:enc.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6012
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6013
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6014
    insert ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6015
        self show:text
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6016
    ] ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6017
        subView insertSelectedStringAtCursor:text asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6018
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6019
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6020
    "Created: / 19.6.1996 / 09:39:52 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6021
    "Modified: / 18.9.1997 / 17:10:20 / stefan"
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6022
    "Modified: / 18.5.1999 / 15:51:18 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6023
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6024
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6025
writeFile:fileName text:someText encoding:encoding
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6026
    |stream errReason msg startNr nLines string|
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6027
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6028
    errReason := ''.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6029
    FileStream streamErrorSignal handle:[:ex |
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6030
        errReason := ex errorString.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6031
        ex return.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6032
    ] do:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6033
        stream := (currentDirectory filenameFor:fileName) writeStream.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6034
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6035
    stream isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6036
        msg := (resources string:'cannot write file ''%1'' !!' with:fileName).
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6037
        self showAlert:msg with:errReason.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6038
        ^ self.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6039
    ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6040
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6041
    dosEOLMode value == true ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6042
        stream eolMode:#crlf.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6043
        "/ must do it lineWise ...
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6044
        someText asStringCollection do:[:line |
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6045
            line notNil ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6046
                stream nextPutAll:line
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6047
            ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6048
            stream cr
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6049
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6050
    ] ifFalse:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6051
        (someText isString) ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6052
            stream nextPutAll:someText.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6053
        ] ifFalse:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6054
            "/
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6055
            "/ on some systems, writing linewise is very slow (via NFS)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6056
            "/ therefore we convert to a string and write it in chunks.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6057
            "/ To avoid creating huge strings, we do it in blocks of 1000 lines.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6058
            "/
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6059
            startNr := 1.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6060
            nLines := someText size.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6061
            [startNr <= nLines] whileTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6062
                string := someText asStringWithCRsFrom:startNr
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6063
                                                    to:((startNr + 1000) min:nLines)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6064
                                          compressTabs:compressTabs.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6065
                encoding notNil ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6066
                    string := string encodeInto:encoding
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6067
                ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6068
                stream nextPutAll:string.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6069
                startNr := startNr + 1000 + 1.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6070
            ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6071
        ].
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6072
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6073
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6074
    stream close.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6075
    subView modified:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6076
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6077
    "Created: / 22.2.1996 / 15:03:10 / cg"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6078
    "Modified: / 18.9.1997 / 17:12:44 / stefan"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6079
    "Modified: / 6.5.1999 / 11:45:50 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6080
! !
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6081
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6082
!FileBrowser methodsFor:'private - presentation'!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6083
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6084
defineTabulatorsForLongList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6085
    "define the tabs for the long list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6086
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6087
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6088
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6089
"/  tabSpec positions:#(0     0.25    2.3   4.3    5.3    6.0      6.5).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6090
    tabSpec widths:   #(0.25   2      2.0     1      0.5  0.5      1"any").
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6091
    "                   icon  name   mode  owner  group  size     type"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6092
    tabSpec align:    #(#left #left  #left #right #right #decimal #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6093
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6094
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6095
    tabRulerView tabulatorSpecification:tabSpec.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6096
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6097
    "Modified: 17.4.1997 / 02:56:07 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6098
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6099
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6100
defineTabulatorsForShortList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6101
    "define the tabs for the short list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6102
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6103
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6104
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6105
"/  tabSpec positions:#(0     0.25 ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6106
    tabSpec widths:   #(0.25   2   ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6107
    "                   icon  name"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6108
    tabSpec align:    #(#left #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6109
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6110
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6111
    tabRulerView notNil ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6112
	tabRulerView tabulatorSpecification:tabSpec.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6113
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6114
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6115
    "Created: / 17.4.1997 / 02:51:41 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6116
    "Modified: / 27.7.1998 / 20:23:34 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6117
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6118
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6119
iconForFile:aFilenameString
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6120
    "given a fileName, return an appropriate icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6121
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6122
    |f icn key key2 suff mimeType|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6123
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6124
    f := currentDirectory construct:aFilenameString.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6125
    f isDirectory ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6126
        f isSymbolicLink ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6127
            key := #directoryLink
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6128
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6129
            key := #directory.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6130
            (f isReadable not or:[f isExecutable not]) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6131
                key := #directoryLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6132
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6133
        ]
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6134
    ] ifFalse:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6135
        f isSymbolicLink ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6136
            f isReadable not ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6137
                key := #fileLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6138
            ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6139
                key := #fileLink
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6140
            ]
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6141
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6142
            key := key2 := #file.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6143
            f isExecutableProgram ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6144
                key := key2 := #executableFile
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6145
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6146
            (f isReadable not) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6147
                key := #fileLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6148
            ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6149
                suff := f suffix.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6150
                mimeType := MIMETypes mimeTypeForSuffix:suff.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6151
                mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6152
                    (mimeType startsWith:'image/') ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6153
                        key := #imageFile
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6154
                    ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6155
                        (mimeType startsWith:'text/') ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6156
                            key := #textFile
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6157
                        ]
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6158
                    ]
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6159
                ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6160
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6161
        ].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6162
    ].
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6163
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6164
    "/ local (device) icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6165
    icons notNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6166
        mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6167
            icn := icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6168
            icn notNil ifTrue:[^ icn].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6169
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6170
        icn := icons at:key ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6171
        icn notNil ifTrue:[^ icn].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6172
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6173
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6174
    "/ global icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6175
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6176
    Icons notNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6177
        mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6178
            icn := Icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6179
            "/ sight - check for parent-MIME types ...
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6180
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6181
            [icn isNil and:[mimeType includes:$/]] whileTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6182
                mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6183
                icn := Icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6184
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6185
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6186
        icn notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6187
            key := mimeType
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6188
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6189
            icn := Icons at:key ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6190
        ].
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6191
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6192
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  6193
    icn isNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6194
        (    (key := key2) isNil
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6195
         or:[(icn := icons at:key ifAbsent:nil) notNil
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6196
         or:[(icn := Icons at:key ifAbsent:nil) isNil]]
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6197
        ) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6198
            ^ icn
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6199
        ]
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  6200
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6201
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6202
    "/ remember device icon
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6203
    icn := icn copy onDevice:device.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6204
    icn clearMaskedPixels.
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6205
    icons at:key put:icn.
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  6206
    ^ icn
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6207
1746
68a187e3f30f another icon for executable files.
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
  6208
    "Modified: / 18.9.1997 / 16:35:28 / stefan"
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6209
    "Modified: / 1.8.1998 / 17:42:37 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6210
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6211
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6212
stopImageRenderProcess
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6213
    imageRenderProcess notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6214
	imageRenderProcess terminate.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6215
	imageRenderProcess := nil
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6216
    ].
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6217
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6218
    "Created: 19.4.1997 / 13:51:34 / cg"
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6219
!
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6220
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6221
stopUpdateProcess
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6222
    Processor removeTimedBlock:checkBlock.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6223
    listUpdateProcess notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6224
	listUpdateProcess terminate.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6225
	listUpdateProcess := nil.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6226
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6227
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6228
    "Created: 19.4.1997 / 13:51:34 / cg"
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6229
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6230
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6231
updateCurrentDirectory
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6232
    "update listView with directory contents"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6233
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6234
    "the code below may look somewhat complex -
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6235
     it reads the directory first for the names,
1151
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  6236
     then (in followup sweeps over the files) gets the
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  6237
     files type, info and icon in a forked subprocess. 
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  6238
     This makes the Filebrowsers list update faster, since the fileInfo 
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  6239
     (i.e. stat-calls) may take long - especially on NFS-mounted directories.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6240
     The file reading is done at lower priority, to let user continue
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6241
     his work in other views. However, to be fair to other fileBrowser,
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6242
     which may also read directories at low prio, give up the processor
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  6243
     after every entry. This shares the cpu among all fileBrowsers;
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  6244
     Therefore, browsers which read short directories will finish first.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6245
     ST/X users love this behavior ;-)
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6246
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6247
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  6248
    self withReadCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6249
	|files matchPattern list passDone f|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6250
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6251
	self stopUpdateProcess.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6252
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6253
	timeOfLastCheck := AbsoluteTime now.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6254
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6255
	files := currentDirectory asFilename fullDirectoryContents.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6256
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6257
"/        (files includes:(Filename parentDirectoryName)) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6258
"/            upButton enable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6259
"/        ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6260
"/            upButton disable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6261
"/        ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6262
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6263
	"/ show files which are either directories
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6264
	"/ or match the current pattern
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6265
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6266
	matchPattern := filterField contents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6267
	(matchPattern notNil and:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6268
	 matchPattern isEmpty not and:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6269
	 matchPattern ~= '*']]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6270
	     files := files select:[:aName | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6271
			 ((currentDirectory construct:aName) isDirectory)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6272
			 or:[matchPattern compoundMatch:aName]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6273
		      ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6274
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6275
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6276
	files size == 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6277
	    self information:('directory ', currentDirectory pathName, ' vanished').
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6278
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6279
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6280
	(sortByWhat value == #name) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6281
	    sortCaseless value == true ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6282
		files sort:[:a :b | a asLowercase < b asLowercase]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6283
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6284
		files sort.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6285
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6286
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6287
	    (sortByWhat value == #time) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6288
		files sort:[:a :b | |f1 f2 t1 t2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6289
				f1 := (currentDirectory construct:a).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6290
				f2 := (currentDirectory construct:b).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6291
				t1 := f1 isSymbolicLink 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6292
					ifFalse:[f1 modificationTime]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6293
					ifTrue:[f1 linkInfo modified].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6294
				t2 := f2 isSymbolicLink 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6295
					ifFalse:[f2 modificationTime]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6296
					ifTrue:[f2 linkInfo modified].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6297
				t1 := t1 ? (AbsoluteTime now).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6298
				t2 := t2 ? (AbsoluteTime now).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6299
				t1 > t2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6300
			   ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6301
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6302
		(sortByWhat value == #type) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6303
		    files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6304
				    f1 := (currentDirectory construct:a).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6305
				    f2 := (currentDirectory construct:b).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6306
				    t1 := f1 type ? #xbadLink. 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6307
				    t2 := f2 type ? #xbadLink. 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6308
				    t1 = t2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6309
					suff1 := f1 suffix.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6310
					suff2 := f2 suffix.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6311
					suff1 = suff2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6312
					    sortCaseless value == true ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6313
						a asLowercase < b asLowercase
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6314
					    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6315
						a < b
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6316
					    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6317
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6318
					    suff1 asLowercase < suff2 asLowercase
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6319
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6320
				    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6321
					t1 < t2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6322
				    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6323
			       ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6324
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6325
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6326
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6327
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6328
	files := self withoutHiddenFiles:files.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6329
	fileList := files copy.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6330
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6331
	tabSpec isNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6332
	    showingDetails value "showLongList" ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6333
		self defineTabulatorsForLongList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6334
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6335
		self defineTabulatorsForShortList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6336
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6337
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6338
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6339
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6340
	"/ first show all the names - this can be done fast ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6341
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6342
	list := files collect:[:fileName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6343
		    |entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6344
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6345
		    entry := MultiColListEntry new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6346
		    entry tabulatorSpecification:tabSpec.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6347
		    entry colAt:1 put:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6348
		    entry colAt:2 put:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6349
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6350
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6351
	fileListView setList:list expandTabs:false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6352
	passDone := Array new:list size withAll:0.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6353
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6354
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6355
	 this is a time consuming operation (especially, if reading an
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6356
	 NFS-mounted directory); therefore, start a low prio process,
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6357
	 which fills in the remaining fields in the fileList ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6358
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6359
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6360
	listUpdateProcess := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6361
	    |prevUid prevGid fileNameString nameString groupString 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6362
	     modeString info line len
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6363
	     anyImages lineIndex aFileName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6364
	     entry typ f p typeString done endIndex 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6365
	     state stopAtEnd nextState img prevFirstLine prevLastLine
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6366
	     numVisible dirSuffix|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6367
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6368
	    dirSuffix := Filename directorySuffix.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6369
	    dirSuffix size > 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6370
		dirSuffix := '.' , dirSuffix asLowercase.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6371
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6372
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6373
	    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6374
	    "/ then walk over the files, adding more info
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6375
	    "/ (since we have to stat each file, this may take a while longer)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6376
	    "/ Visible items are always filled first.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6377
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6378
	    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6379
	    "/ the state machine
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6380
	    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6381
	    nextState := IdentityDictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6382
	    showingDetails value "showLongList" ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6383
		nextState add:(#visibleIcons -> #visibleAttributes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6384
		nextState add:(#visibleAttributes -> #visibleTypes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6385
		nextState add:(#visibleTypes -> #visibleImages).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6386
		nextState add:(#visibleImages -> #nextPageIcons).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6387
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6388
		nextState add:(#nextPageIcons -> #nextPageAttributes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6389
		nextState add:(#nextPageAttributes -> #nextPageTypes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6390
		nextState add:(#nextPageTypes -> #nextPageImages).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6391
		nextState add:(#nextPageImages -> #previousPageIcons).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6392
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6393
		nextState add:(#previousPageIcons -> #previousPageAttributes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6394
		nextState add:(#previousPageAttributes -> #previousPageTypes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6395
		nextState add:(#previousPageTypes -> #previousPageImages).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6396
		nextState add:(#previousPageImages -> #remainingIcons).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6397
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6398
		nextState add:(#remainingIcons -> #remainingAttributes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6399
		nextState add:(#remainingAttributes -> #remainingTypes).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6400
		nextState add:(#remainingTypes -> #remainingImages).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6401
		nextState add:(#remainingImages -> nil).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6402
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6403
		nextState add:(#visibleIcons -> #nextPageIcons).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6404
		nextState add:(#nextPageIcons -> #previousPageIcons).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6405
		nextState add:(#previousPageIcons -> #remainingIcons).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6406
		nextState add:(#remainingIcons -> nil).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6407
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6408
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6409
	    anyImages := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6410
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6411
	    lineIndex := prevFirstLine := fileListView firstLineShown.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6412
	    endIndex := prevLastLine := fileListView lastLineShown.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6413
	    endIndex := endIndex min:(files size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6414
	    state := #visibleIcons.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6415
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6416
	    done := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6417
	    [done] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6418
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6419
		"/ if multiple FileBrowsers are reading, let others
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6420
		"/ make some progress too
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6421
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6422
		Processor yield.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6423
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6424
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6425
		"/ could be destroyed in the meanwhile ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6426
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6427
		realized ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6428
		    listUpdateProcess := nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6429
		    Processor activeProcess terminate
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6430
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6431
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6432
		((prevFirstLine ~~ fileListView firstLineShown)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6433
		or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6434
		    "/ start all over again
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6435
		    lineIndex := prevFirstLine := fileListView firstLineShown.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6436
		    endIndex := prevLastLine := fileListView lastLineShown.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6437
		    endIndex := endIndex min:(files size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6438
		    state := #visibleIcons.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6439
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6440
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6441
		(lineIndex between:1 and:(files size)) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6442
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6443
		    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6444
		    "/ expand the next entry ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6445
		    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6446
		    aFileName := files at:lineIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6447
		    entry := fileListView at:lineIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6448
		    f := currentDirectory construct:aFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6449
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6450
		    (state endsWith:'Icons') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6451
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6452
			"/ pass 1 - icons
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6453
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6454
			(passDone at:lineIndex) < 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6455
			    (f isDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6456
			      and:[(aFileName ~= '..') and:[aFileName ~= '.']]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6457
			    ) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6458
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6459
				"/ the following suffix cutOff is not really required, 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6460
				"/ but makes the list look better on VMS ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6461
				fileNameString := aFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6462
				dirSuffix notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6463
				    (aFileName asLowercase endsWith:dirSuffix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6464
					fileNameString := aFileName copyWithoutLast:(dirSuffix size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6465
				    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6466
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6467
				fileNameString := fileNameString , ' ...'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6468
			    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6469
				fileNameString := aFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6470
				OperatingSystem isVMSlike ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6471
				    (aFileName endsWith:'.') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6472
					aFileName ~= '..' ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6473
					    fileNameString := aFileName copyWithoutLast:1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6474
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6475
				    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6476
				]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6477
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6478
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6479
			    showingDetails value "showLongList" ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6480
				len := fileNameString size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6481
				(len > 20) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6482
				    fileNameString := (fileNameString contractTo:20)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6483
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6484
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6485
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6486
			    entry colAt:1 put:(self iconForFile:aFileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6487
			    entry colAt:2 put:fileNameString.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6488
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6489
			    "/fileListView at:lineIndex put:entry.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6490
			    fileListView withoutRedrawAt:lineIndex put:entry.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6491
			    fileListView invalidateLine:lineIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6492
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6493
			    anyImages ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6494
				(Image isImageFileSuffix:(aFileName asFilename suffix))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6495
				ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6496
				    anyImages := true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6497
				]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6498
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6499
			    passDone at:lineIndex put:1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6500
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6501
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6502
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6503
		    (state endsWith:'Attributes') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6504
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6505
			"/ pass 2 - everything except fileType (which takes very long)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6506
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6507
			(passDone at:lineIndex) < 2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6508
			    info := f info.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6509
			    info isNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6510
				"not accessable - usually a symlink,
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6511
				 to a nonexisting/nonreadable file
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6512
				"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6513
				f isSymbolicLink ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6514
				    p := f linkInfo path.    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6515
				    typeString := 'broken symbolic link to ' , p
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6516
				] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6517
				    typeString := 'unknown'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6518
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6519
			    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6520
				typ := (info type).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6521
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6522
				modeString := self getModeString:(info at:#mode)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6523
							    with:#( '' $r $w $x 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6524
								    '  ' $r $w $x 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6525
								    '  ' $r $w $x ).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6526
				entry colAt:3 put:modeString.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6527
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6528
				((info uid) ~~ prevUid) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6529
				    prevUid := (info uid).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6530
				    nameString := OperatingSystem getUserNameFromID:prevUid.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6531
				    nameString := nameString contractTo:10.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6532
				    nameString := nameString , (String new:(10 - nameString size))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6533
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6534
				nameString isNil ifTrue:[nameString := '???'].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6535
				entry colAt:4 put:nameString withoutSpaces.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6536
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6537
				((info gid) ~~ prevGid) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6538
				    prevGid := (info gid).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6539
				    groupString := OperatingSystem getGroupNameFromID:prevGid.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6540
				    groupString := groupString contractTo:10.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6541
				    groupString := groupString , (String new:(10 - groupString size))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6542
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6543
				groupString isNil ifTrue:[groupString := '???'].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6544
				entry colAt:5 put:groupString withoutSpaces.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6545
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6546
				(typ == #regular) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6547
				    entry colAt:6 put:(self sizePrintString:(info size)).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6548
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6549
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6550
				f isSymbolicLink ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6551
				    p := f linkInfo path.    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6552
				    typeString := 'symbolic link to ' , p
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6553
				] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6554
				    typeString := typ asString
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6555
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6556
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6557
			    entry colAt:7 put:typeString.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6558
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6559
			    "/ fileListView at:lineIndex put:entry.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6560
			    fileListView withoutRedrawAt:lineIndex put:entry.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6561
			    fileListView invalidateLine:lineIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6562
			    passDone at:lineIndex put:2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6563
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6564
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6565
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6566
		    (state endsWith:'Types') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6567
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6568
			"/ pass 3: add fileType
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6569
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6570
			(passDone at:lineIndex) < 3 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6571
			    info := f info.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6572
			    info notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6573
				f isSymbolicLink ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6574
				    (Image isImageFileSuffix:(f suffix)) ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6575
					typeString := f fileType.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6576
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6577
					entry colAt:7 put:typeString.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6578
					"/ fileListView at:lineIndex put:entry
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6579
					fileListView withoutRedrawAt:lineIndex put:entry.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6580
					fileListView invalidateLine:lineIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6581
				    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6582
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6583
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6584
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6585
			    passDone at:lineIndex put:3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6586
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6587
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6588
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6589
		    (state endsWith:'Images') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6590
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6591
			"/ pass 4: read images
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6592
			"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6593
			(passDone at:lineIndex) < 4 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6594
			    (Image isImageFileSuffix:(f suffix)) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6595
				f isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6596
				    img := Image fromFile:(f pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6597
				    img notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6598
					showingBigImagePreview value == true ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6599
					    img := img magnifiedTo:32@32.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6600
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6601
					    img := img magnifiedTo:16@16.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6602
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6603
					img := img on:self device.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6604
					entry colAt:7 put:img.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6605
					"/ fileListView at:lineIndex put:entry
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6606
					fileListView withoutRedrawAt:lineIndex put:entry.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6607
					fileListView invalidateLine:lineIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6608
				    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6609
				]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6610
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6611
			    passDone at:lineIndex put:4
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6612
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6613
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6614
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6615
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6616
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6617
		"/ advance to the next line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6618
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6619
		lineIndex := lineIndex + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6620
		lineIndex > endIndex ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6621
		    "/ finished this round ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6622
		    "/ see what we are going for ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6623
		    numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6624
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6625
		    state := nextState at:state ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6626
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6627
		    state isNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6628
			done := true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6629
		    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6630
			(state startsWith:'visible') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6631
			    lineIndex := fileListView firstLineShown.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6632
			    endIndex := fileListView lastLineShown.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6633
			    endIndex := endIndex min:(files size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6634
			] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6635
			    (state startsWith:'nextPage') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6636
				lineIndex := fileListView lastLineShown + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6637
				endIndex := lineIndex + numVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6638
				endIndex := endIndex min:(files size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6639
				lineIndex := lineIndex min:(files size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6640
			    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6641
				(state startsWith:'previousPage') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6642
				    endIndex := fileListView firstLineShown - 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6643
				    lineIndex := endIndex - numVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6644
				    lineIndex := lineIndex max:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6645
				    endIndex := endIndex min:(files size).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6646
				    endIndex := endIndex max:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6647
				] ifFalse:[ 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6648
				    "/ remaining
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6649
				    lineIndex := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6650
				    endIndex := files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6651
				]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6652
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6653
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6654
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6655
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6656
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6657
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6658
	    listUpdateProcess := nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6659
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6660
	] forkAt:(Processor activePriority - 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6661
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6662
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6663
	 install a new check after some time
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6664
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6665
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6666
    ]
142
claus
parents: 139
diff changeset
  6667
1487
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  6668
    "Modified: / 21.9.1995 / 11:40:23 / claus"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  6669
    "Modified: / 28.4.1997 / 22:30:30 / dq"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  6670
    "Modified: / 18.9.1997 / 18:28:30 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  6671
    "Modified: / 14.8.1998 / 17:59:06 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  6672
! !
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  6673
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6674
!FileBrowser methodsFor:'queries'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  6675
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6676
fileName
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6677
    "return my current fileName - during fileIn, the file
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6678
     which is being loaded is returned.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6679
     This is provided for VW fileIn scripts, which walk the
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6680
     context hierarchy and ask the fileBrowser for the name."
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6681
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6682
    |f|
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6683
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6684
    f := currentFileInFileName ? currentFileName.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6685
    f isNil ifTrue:[^ nil].
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6686
    ^ self path asFilename construct:f
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6687
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6688
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6689
     (FileBrowser openOnFileNamed:'Makefile') fileName
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6690
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6691
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6692
    "Modified: / 18.6.1998 / 15:27:35 / cg"
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6693
!
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6694
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6695
path
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6696
    "return my currentDirectories pathName;
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6697
     sent from the pathField to aquire the pathname when I changed directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6698
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6699
    "/ somewhat tricky: first ask it for the full pathName,
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6700
    "/ then convert it to a directory name
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6701
    "/ (which only makes a difference on VMS)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6702
1828
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  6703
    ^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  6704
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  6705
    "Modified: / 12.8.1998 / 14:45:48 / cg"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6706
! !
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6707
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  6708
!FileBrowser class methodsFor:'documentation'!
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  6709
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  6710
version
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  6711
    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.332 1999-06-28 08:46:13 cg Exp $'
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  6712
! !