FileBrowser.st
author Claus Gittinger <cg@exept.de>
Tue, 23 May 2000 09:50:54 +0200
changeset 2665 3601bc8c5ae2
parent 2640 49fe3af4260d
child 2666 9441a29e67d1
permissions -rw-r--r--
cursorLeft - change to parent dir
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
2665
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
    13
"{ Package: 'stx:libtool' }"
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
    14
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    15
StandardSystemView subclass:#FileBrowser
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    16
	instanceVariableNames:'labelView filterField fileListView subView currentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    17
		fileList checkBlock checkDelta timeOfLastCheck myName killButton
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    18
		pauseToggle compressTabs lockUpdate previousDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    19
		currentFileName timeOfFileRead tabSpec commandView commandIndex
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    20
		fileEncoding tabRulerView scrollView icons listUpdateProcess
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    21
		currentFileInFileName lastFileDiffDirectory sortByWhat
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
    22
		sortCaseless showingDetails showingHiddenFiles
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
    23
		showingBigImagePreview imagePreviewView imageRenderProcess
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
    24
		dosEOLMode doAutoUpdate'
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    25
	classVariableNames:'DirectoryHistory DirectoryHistoryWhere HistorySize DefaultIcon
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
    26
		CommandHistory CommandHistorySize Icons DefaultCommandPerSuffix
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
    27
		DefaultCommandPerMIME'
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    28
	poolDictionaries:''
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    29
	category:'Interface-Browsers'
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    30
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    31
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    32
!FileBrowser class methodsFor:'documentation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    33
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    34
copyright
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    35
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    36
 COPYRIGHT (c) 1991 by Claus Gittinger
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    37
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    38
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    39
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    40
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    42
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    43
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    44
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    45
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    46
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    47
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    48
documentation
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    49
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    50
    this used to be a very simple demo application,
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    51
    but migrated into a quite nice tool, includes all kinds of 
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    52
    warning and information boxes, background processes for directory-
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    53
    reading and internationalized strings. A good example for beginners,
100
claus
parents: 98
diff changeset
    54
    on how to do things .... (and maybe how not to do things ;-, since some
claus
parents: 98
diff changeset
    55
    stuff is historic and was implemented at times when better mechanisms
claus
parents: 98
diff changeset
    56
    were not available)
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    57
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    58
    See additional information in 'doc/misc/fbrowser.doc'.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
    59
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    60
    WARNING: files edited with FileBrowser will have leading spaces (multiple-8)
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    61
	     being replaced by tabs. If tabs are to be preserved at other
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    62
	     positions (for example, sendmail-config files) they will be
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    63
	     corrupt after being written.
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    64
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    65
    [instance variables]:
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    66
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    67
	checkDelta      <Integer>       number of seconds of check interval
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    68
					(looks ever so often if shown directory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    69
					 has changed). You may make this number
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    70
					higher, if your network-times are
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    71
					incorrect and thus, the filebrowser
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    72
					checks too often.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    73
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    74
	compressTabs    <Boolean>       if true, leading spaces will be
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    75
					replaced by tabs when saving text
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    76
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    77
    some of the defaults (long/short list etc.) can be set by the resource file;
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    78
    see FileBrowser>>initialize for more details..
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    79
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    80
    [author:]
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    81
	Claus Gittinger
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
    82
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
    83
    [start with:]
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
    84
	FileBrowser open
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    85
"
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
    86
! !
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    87
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    88
!FileBrowser class methodsFor:'instance creation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    89
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    90
openOn:aDirectoryPath
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    91
    "start a new FileBrowser in a pathname"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    92
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    93
    ^ (self new currentDirectory:aDirectoryPath) open
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    94
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    95
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    96
     FileBrowser openOn:'aDirectoryPath'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    97
     FileBrowser openOn:'/etc'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    98
     FileBrowser openOn:'..'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    99
     FileBrowser openOn:'.'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   100
    "
93
claus
parents: 85
diff changeset
   101
!
claus
parents: 85
diff changeset
   102
claus
parents: 85
diff changeset
   103
openOnFileNamed:aFilename
claus
parents: 85
diff changeset
   104
    "start a new FileBrowser on a file"
claus
parents: 85
diff changeset
   105
claus
parents: 85
diff changeset
   106
    |f browser|
claus
parents: 85
diff changeset
   107
claus
parents: 85
diff changeset
   108
    f := aFilename asFilename.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   109
    f isDirectory ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   110
	^ self openOn:aFilename
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   111
    ].
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   112
93
claus
parents: 85
diff changeset
   113
    browser := self new.
claus
parents: 85
diff changeset
   114
    browser currentDirectory:f directoryName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   115
    browser updateCurrentDirectory.
93
claus
parents: 85
diff changeset
   116
    browser showFile:f baseName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   117
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   118
    ^ browser open.
93
claus
parents: 85
diff changeset
   119
claus
parents: 85
diff changeset
   120
    "
claus
parents: 85
diff changeset
   121
     FileBrowser openOnFileNamed:'Makefile'
claus
parents: 85
diff changeset
   122
     FileBrowser openOnFileNamed:'../Makefile'
claus
parents: 85
diff changeset
   123
     FileBrowser openOnFileNamed:'/tmp/foo'
claus
parents: 85
diff changeset
   124
    "
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   125
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   126
    "Modified: / 17.6.1998 / 11:25:29 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   127
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   128
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   129
!FileBrowser class methodsFor:'class initialization'!
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   130
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   131
initializeDefaultCommands
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   132
    DefaultCommandPerMIME := Dictionary new.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   133
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   134
    DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   135
    DefaultCommandPerMIME at:'application/pdf'              put:'acroread %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   136
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   137
    "
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   138
     self initializeDefaultCommands
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   139
    "
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   140
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   141
    "Modified: / 1.8.1998 / 17:39:27 / cg"
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   142
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   143
!
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   144
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   145
initializeIcons
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   146
    |resources|
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   147
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   148
    resources := self classResources.
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   149
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   150
    Icons := Dictionary new.
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   151
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   152
    #(
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   153
        "/ internal-type to icon mappings.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   154
        (#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
   155
        (#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
   156
        (#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
   157
        (#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
   158
        (#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
   159
        (#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
   160
        (#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
   161
        (#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
   162
        (#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
   163
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   164
        "/ mime-type to icon mappings.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   165
        ('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
   166
        ('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
   167
        ('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
   168
        ('application/x-smalltalk-source' nil     'tiny_file_st.xpm'          )
2320
1c6abdeb68ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2257
diff changeset
   169
        ('application/x-java-source'      nil     'tiny_file_java.xpm'        )
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   170
        ('image'                          nil     'tiny_file_pix.xpm'         )
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   171
     ) do:[:entry |
2491
0222b19ee371 new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
   172
        |key resource defaultName nm img|
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   173
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   174
        key := entry at:1.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   175
        resource := entry at:2.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   176
        defaultName := entry at:3.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   177
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   178
        resource notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   179
            nm := resources at:resource default:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   180
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   181
        nm isNil ifTrue:[
2491
0222b19ee371 new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
   182
            nm := 'xpmBitmaps/document_images/' , defaultName
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   183
        ].
2492
055eef2763e3 moved icon search to smalltalk utility method
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   184
        Icons at:key put:(Smalltalk imageFromFileNamed:nm forClass:self).
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   185
    ]
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   186
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   187
    "
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   188
     self initializeIcons
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   189
    "
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   190
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   191
    "Modified: / 1.8.1998 / 17:39:27 / cg"
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   192
! !
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   193
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   194
!FileBrowser class methodsFor:'command history'!
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   195
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   196
addToCommandHistory:aCommandString for:aFilename
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   197
    |cmd suffix|
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   198
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   199
    (aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   200
	CommandHistory notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   201
	    CommandHistory addFirst:aCommandString.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   202
	    CommandHistory size > CommandHistorySize ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   203
		CommandHistory removeLast
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   204
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   205
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   206
	aFilename notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   207
	    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
   208
	    DefaultCommandPerSuffix isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   209
		DefaultCommandPerSuffix := Dictionary new.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   210
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   211
	    suffix := aFilename asFilename suffix.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   212
	    suffix notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   213
		DefaultCommandPerSuffix at:suffix put:cmd.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   214
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   215
	]
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   216
    ]
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   217
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   218
    "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
   219
! !
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   220
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   221
!FileBrowser class methodsFor:'defaults'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   222
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   223
defaultIcon
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   224
    "return the file browsers default window icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   225
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   226
    <resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)>
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   227
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   228
    |nm i res|
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   229
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   230
    (i := DefaultIcon) isNil ifTrue:[
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   231
        res := self classResources.
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   232
        i := res at:'FILEBROWSER_ICON' default:nil.
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   233
        i isNil ifTrue:[
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   234
            nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'.
2476
866fdfe9b2d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
   235
            i := Smalltalk imageFromFileNamed:nm forClass:self.
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   236
            i isNil ifTrue:[
2453
63c50508c4cd try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
   237
                i := StandardSystemView defaultIcon
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   238
            ]
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   239
        ].
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   240
        i notNil ifTrue:[
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   241
            DefaultIcon := i := i onDevice:Display
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   242
        ]
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   243
    ].
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   244
    ^ i
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   245
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   246
    "Modified: 19.3.1997 / 20:48:34 / ca"
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   247
    "Modified: 15.8.1997 / 15:27:19 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   248
! !
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   249
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   250
!FileBrowser class methodsFor:'interface specs'!
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
fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   253
    "This resource specification was automatically generated
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   254
     by the UIPainter of ST/X."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   255
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   256
    "Do not manually edit this!! If it is corrupted,
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   257
     the UIPainter may not be able to read the specification."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   258
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   259
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   260
     UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   261
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   262
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   263
    <resource: #canvas>
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   264
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   265
    ^
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   266
     
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   267
       #(#FullSpec
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   268
	  #window: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   269
	   #(#WindowSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   270
	      #name: 'File Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   271
	      #layout: #(#LayoutFrame 4 0 50 0 315 0 349 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   272
	      #level: 0
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   273
	      #label: 'File Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   274
	      #min: #(#Point 10 10)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   275
	      #max: #(#Point 1280 1024)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   276
	      #bounds: #(#Rectangle 4 50 316 350)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   277
	      #usePreferredExtent: false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   278
	      #returnIsOKInDialog: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   279
	      #escapeIsCancelInDialog: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   280
	  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   281
	  #component: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   282
	   #(#SpecCollection
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   283
	      #collection: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   284
	       #(
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   285
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   286
		    #name: 'Label1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   287
		    #layout: #(#LayoutFrame 0 0 10 0 0 1 32 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   288
		    #label: 'Search for files named:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   289
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   290
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   291
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   292
		 #(#InputFieldSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   293
		    #name: 'EntryField1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   294
		    #layout: #(#LayoutFrame 10 0 36 0 305 0 58 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   295
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   296
		    #model: #namePatternHolder
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   297
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   298
		 #(#CheckBoxSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   299
		    #name: 'CheckBox1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   300
		    #layout: #(#LayoutFrame 7 0 66 0 143 0 88 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   301
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   302
		    #model: #ignoreCaseInName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   303
		    #label: 'Ignore case'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   304
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   305
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   306
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   307
		    #name: 'Label2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   308
		    #layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   309
		    #label: 'Containing the string:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   310
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   311
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   312
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   313
		 #(#InputFieldSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   314
		    #name: 'EntryField2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   315
		    #layout: #(#LayoutFrame 10 0 133 0 305 0 155 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   316
		    #enableChannel: #notSearchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   317
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   318
		    #model: #contentsPatternHolder
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   319
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   320
		 #(#CheckBoxSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   321
		    #name: 'CheckBox2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   322
		    #layout: #(#LayoutFrame 6 0 163 0 142 0 185 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   323
		    #enableChannel: #notSearchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   324
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   325
		    #model: #ignoreCaseInContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   326
		    #label: 'Ignore case'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   327
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   328
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   329
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   330
		    #name: 'Label3'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   331
		    #layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   332
		    #label: 'Containing same contents as selected:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   333
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   334
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   335
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   336
		 #(#DividerSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   337
		    #name: 'Separator1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   338
		    #layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   339
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   340
		 #(#CheckToggleSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   341
		    #name: 'CheckToggle1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   342
		    #layout: #(#LayoutOrigin -25 1 225 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   343
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   344
		    #model: #searchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   345
		    #enableChannel: #searchForSameContentsEnabled
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   346
		    #isTriggerOnDown: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   347
		    #showLamp: false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   348
		    #lampColor: #(#Color 100.0 100.0 0.0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   349
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   350
		 #(#HorizontalPanelViewSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   351
		    #name: 'HorizontalPanel1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   352
		    #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   353
		    #component: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   354
		     #(#SpecCollection
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   355
			#collection: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   356
			 #(
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   357
			   #(#ActionButtonSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   358
			      #name: 'Button1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   359
			      #label: 'Cancel'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   360
			      #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   361
			      #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   362
			      #model: #cancel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   363
			      #extent: #(#Point 151 25)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   364
			  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   365
			   #(#ActionButtonSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   366
			      #name: 'Button2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   367
			      #label: 'Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   368
			      #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   369
			      #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   370
			      #model: #accept
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   371
			      #isDefault: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   372
			      #extent: #(#Point 152 25)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   373
			  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   374
			)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   375
		    )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   376
		    #horizontalLayout: #fitSpace
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   377
		    #verticalLayout: #centerMax
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   378
		    #horizontalSpace: 3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   379
		    #verticalSpace: 3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   380
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   381
	      )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   382
	  )
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   383
      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   384
! !
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   385
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   386
!FileBrowser class methodsFor:'menu specs'!
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
baseDirectoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   389
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   390
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   391
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   392
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   393
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   394
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   395
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   396
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   397
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   398
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   399
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   400
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   401
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   402
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   403
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   404
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   405
          
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   406
	   #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   407
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   408
		#label: 'Copy Path'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   409
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   410
		#value: #copyPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   411
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   412
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   413
		#label: '-'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   414
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   415
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   416
		#label: 'Up'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   417
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   418
		#value: #changeToParentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   419
		#enabled: #currentDirectoryIsNotTop
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: 'Back'
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: #changeToPreviousDirectory
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
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   427
		#label: 'Home'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   428
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   429
		#value: #changeToHomeDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   430
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   431
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   432
		#label: 'Default'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   433
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   434
		#value: #changeToDefaultDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   435
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   436
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   437
		#label: 'Goto...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   438
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   439
		#value: #changeCurrentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   440
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   441
	  ) nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   442
	  nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   443
      )
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
    "Created: / 4.8.1998 / 17:21:16 / cg"
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   446
    "Modified: / 14.8.1998 / 19:19:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   447
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   448
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   449
directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   450
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   451
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   454
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   455
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   456
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   457
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   458
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   459
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   460
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   461
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   462
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   463
    |m|
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   464
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   465
    m := self baseDirectoryMenuSpec.
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   466
    m := m decodeAsLiteralArray.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   467
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   468
    "/ add the history items ...
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   469
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   470
    DirectoryHistory size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   471
	m addItem:(MenuItem labeled:'-').
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   472
	DirectoryHistory do:[:dirName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   473
	    m addItem:((MenuItem label:dirName value:#changeDirectoryTo:)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   474
			    argument:dirName;
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   475
			    yourself).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   476
	].
1834
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
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   479
    m findGuiResourcesIn:self.
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   480
    ^ m
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   481
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   482
    "Modified: / 17.8.1998 / 10:13:05 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   483
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   484
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   485
menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   486
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   487
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   488
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   489
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   490
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   491
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   492
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   493
     MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   494
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   495
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   496
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   497
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   498
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   499
    ^ 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   500
     #(#Menu
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   501
        #(
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   502
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   503
            #label: 'Spawn'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   504
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   505
            #value: #fileSpawn
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: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   509
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   510
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   511
            #label: 'Get Contents'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   512
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   513
            #value: #fileGet
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   514
            #enabled: #hasSelection
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: 'Insert Contents'
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
            #value: #fileInsert
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   520
            #enabled: #hasSelection
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: 'FileIn'
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
            #value: #fileFileIn
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   526
            #enabled: #hasSelection
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
   527
            #shortcutKeyCharacter: #'Accept'
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   528
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   529
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   530
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   531
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   532
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   533
            #label: 'Unix Command...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   534
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   535
            #isVisible: #systemIsUnix
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   536
            #value: #menuOSCommand
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   537
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   538
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   539
            #label: 'DOS Command...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   540
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   541
            #isVisible: #systemIsDOS
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   542
            #value: #menuOSCommand
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   543
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   544
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   545
            #label: 'VMS Command...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   546
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   547
            #isVisible: #systemIsVMS
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   548
            #value: #menuOSCommand
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   549
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   550
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   551
            #label: 'ST/X Tools'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   552
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   553
            #submenu: 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   554
           #(#Menu
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   555
              #(
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   556
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   557
                  #label: 'Changes Browser'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   558
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   559
                  #value: #openChangesBrowser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   560
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   561
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   562
               #(#MenuItem
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   563
                  #label: 'Create Smalltalk Project'
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   564
                  #translateLabel: true
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   565
                  #value: #createProjectAndOpenProjectBrowser
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   566
                  #enabled: #canCreateNewProject
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   567
                )
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   568
               #(#MenuItem
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   569
                  #label: 'Install autoloaded'
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   570
                  #translateLabel: true
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   571
                  #value: #readAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   572
                  #enabled: #canReadAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   573
                )
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   574
               #(#MenuItem
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   575
                  #label: 'Editor'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   576
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   577
                  #value: #openEditor
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   578
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   579
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   580
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   581
                  #label: 'HTML Reader'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   582
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   583
                  #value: #openHTMLReader
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   584
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   585
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   586
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   587
                  #label: 'ASN1 Browser'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   588
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   589
                  #isVisible: #hasASN1Browser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   590
                  #value: #openASN1Browser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   591
                  #enabled: #hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   592
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   593
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   594
                  #label: 'Applet Viewer'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   595
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   596
                  #isVisible: #hasJava
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   597
                  #value: #openAppletViewer
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   598
                  #enabled: #hasJavaAndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   599
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   600
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   601
                  #label: 'Image Inspect'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   602
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   603
                  #value: #openImageInspector
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   604
                  #enabled: #hasSelection
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: 'Image Preview'
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
                  #value: #openImagePreview
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   610
                  #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   611
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   612
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   613
                  #label: 'Image Editor'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   614
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   615
                  #value: #openImageEditor
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   616
                  #enabled: #hasSelection
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: 'ZipFile Tool'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   620
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   621
                  #value: #openZipTool
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   622
                  #enabled: #hasZipFileSelected
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   623
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   624
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   625
                  #label: 'Hex Dump'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   626
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   627
                  #value: #fileHexDump
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   628
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   629
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   630
                  #label: 'Show File Differences'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   631
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   632
                  #value: #openDiffView
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   633
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   634
               #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   635
                  #label: 'Terminal'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   636
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   637
                  #isVisible: #systemIsUnix
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   638
                  #value: #openTerminal
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   639
                  #enabled: #systemIsUnix
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
               )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   642
              nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   643
              nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   644
            )
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: 'Remove...'
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: #fileRemove
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   653
            #enabled: #hasSelection
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
   654
            #shortcutKeyCharacter: #Cut
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   655
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   656
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   657
            #label: 'Rename...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   658
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   659
            #value: #fileRename
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   660
            #enabled: #hasSelection
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
   661
            #shortcutKeyCharacter: #'Replace'
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   662
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   663
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   664
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   665
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   666
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   667
            #label: 'New Directory...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   668
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   669
            #value: #newDirectory
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   670
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   671
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   672
            #label: 'New File...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   673
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   674
            #value: #newFile
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   675
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   676
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   677
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   678
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   679
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   680
            #label: 'Update'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   681
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   682
            #value: #updateCurrentDirectory
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   683
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   684
         )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   685
        nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   686
        nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   687
      )
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   688
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
   689
    "Modified: / 29.1.2000 / 13:04:43 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   690
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   691
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   692
menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   693
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   694
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   695
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   696
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   697
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   698
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   699
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   700
     MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   701
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   702
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   703
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   704
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   705
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
   706
    ^ 
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
   707
     #(#Menu
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   708
        #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   709
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   710
            #label: 'About'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   711
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   712
            #labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   713
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   714
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   715
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   716
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   717
                  #label: 'About Smalltalk/X...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   718
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   719
                  #value: #showAboutSTX
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: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   723
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   724
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   725
                  #label: 'About FileBrowser...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   726
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   727
                  #value: #openAboutThisApplication
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   728
                )
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
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   731
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   732
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   733
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   734
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   735
            #label: 'File'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   736
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   737
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   738
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   739
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   740
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   741
                  #label: 'Open'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   742
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   743
                  #value: #menuOpen
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   744
                  #enabled: #hasSelection
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: 'Open selected Filename'
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: #hasFilenameSelectionInCodeView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   750
                  #value: #openSelectedFilename
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   751
                  #enabled: #hasFilenameSelectionInCodeView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   752
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   753
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   754
                  #label: 'FileIn'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   755
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   756
                  #value: #fileFileIn
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   757
                  #enabled: #hasSelection
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
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   760
                  #label: '-'
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
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   763
                  #label: 'New'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   764
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   765
                  #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   766
                 #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   767
                    #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   768
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   769
                        #label: 'Directory...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   770
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   771
                        #value: #newDirectory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   772
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   773
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   774
                        #label: 'File...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   775
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   776
                        #value: #newFile
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   777
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   778
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   779
                        #label: 'Hard Link...'
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
                        #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   782
                        #value: #newHardLink
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
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   785
                        #label: 'Symbolic Link...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   786
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   787
                        #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   788
                        #value: #newSoftLink
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   789
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   790
                     )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   791
                    nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   792
                    nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   793
                  )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   794
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   795
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   796
                  #label: 'Remove'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   797
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   798
                  #value: #fileRemove
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   799
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   800
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   801
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   802
                  #label: 'Rename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   803
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   804
                  #value: #fileRename
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   805
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   806
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   807
               #(#MenuItem
2143
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   808
                  #label: '-'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   809
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   810
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   811
                  #label: 'Properties...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   812
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   813
                  #value: #fileGetLongInfo
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   814
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   815
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   816
               #(#MenuItem
2143
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   817
                  #label: 'Encoding...'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   818
                  #translateLabel: true
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   819
                  #value: #fileEncoding
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   820
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   821
               #(#MenuItem
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   822
                  #label: 'DOS EndOfLine Mode'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   823
                  #translateLabel: true
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   824
                  #indication: #dosEOLMode
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   825
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   826
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   827
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   828
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   829
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   830
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   831
                  #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
   832
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   833
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   834
                  #value: #fileAddToJavaClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   835
                  #enabled: #canAddToClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   836
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   837
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   838
                  #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
   839
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   840
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   841
                  #value: #fileRemoveFromJavaClassPath
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   842
                  #enabled: #canRemoveFromClassPath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   843
                )
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   844
               #(#MenuItem
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   845
                  #label: 'Add to Java SourcePath'
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   846
                  #translateLabel: true
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   847
                  #isVisible: #javaSupportLoaded
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   848
                  #value: #fileAddToJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   849
                  #enabled: #canAddToSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   850
                )
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   851
               #(#MenuItem
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   852
                  #label: 'Remove from Java SourcePath'
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   853
                  #translateLabel: true
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   854
                  #isVisible: #javaSupportLoaded
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   855
                  #value: #fileRemoveFromJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   856
                  #enabled: #canRemoveFromSourcePath
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   857
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   858
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   859
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   860
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   861
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   862
                  #label: 'Spawn'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   863
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   864
                  #value: #fileSpawn
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   865
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   866
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   867
                  #label: '-'
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: 'Exit'
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: #menuExit
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: 'Directory'
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
            #submenuChannel: #directoryMenuSpec
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   883
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   884
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   885
            #label: 'Edit'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   886
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   887
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   888
           #(#Menu
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: 'Get Contents'
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
                  #value: #fileGet
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   894
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   895
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   896
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   897
                  #label: 'Insert Contents'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   898
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   899
                  #value: #fileInsert
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   900
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   901
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   902
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   903
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   904
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   905
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   906
                  #label: 'Copy File List'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   907
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   908
                  #value: #copyFileList
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   909
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   910
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   911
                  #label: 'Copy Selected Filename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   912
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   913
                  #value: #copySelectedFileName
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
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   916
                  #label: 'Copy Command History'
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
                  #value: #copyCommandHistory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   919
                )
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
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   922
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   923
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   924
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   925
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   926
            #label: 'View'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   927
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   928
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   929
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   930
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   931
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   932
                  #label: 'Details'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   933
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   934
                  #indication: #showingDetails
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
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   937
                  #label: 'Show Hidden Files'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   938
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   939
                  #indication: #showingHiddenFiles
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   940
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   941
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   942
                  #label: 'Big Image Preview'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   943
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   944
                  #indication: #showingBigImagePreview
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: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   948
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   949
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   950
                  #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
   951
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   952
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   953
                  #choiceValue: #name
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   954
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   955
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   956
                  #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
   957
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   958
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   959
                  #choiceValue: #type
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   960
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   961
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   962
                  #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
   963
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   964
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   965
                  #choiceValue: #time
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: 'Ignore Case'
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
                  #enabled: #sortByName
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   971
                  #indication: #sortCaseless
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: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   975
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   976
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   977
                  #label: 'Update'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   978
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   979
                  #value: #updateCurrentDirectory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   980
                )
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   981
               #(#MenuItem
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   982
                  #label: 'AutoUpdate'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   983
                  #translateLabel: true
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   984
                  #indication: #autoUpdate
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   985
                )
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   986
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   987
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   988
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   989
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   990
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   991
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   992
            #label: 'Tools'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   993
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   994
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   995
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   996
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   997
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   998
                  #label: 'Unix Command'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   999
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1000
                  #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1001
                  #value: #menuOSCommand
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1002
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1003
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1004
                  #label: 'DOS Command'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1005
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1006
                  #isVisible: #systemIsDOS
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1007
                  #value: #menuOSCommand
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1008
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1009
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1010
                  #label: 'VMS Command'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1011
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1012
                  #isVisible: #systemIsVMS
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1013
                  #value: #menuOSCommand
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1014
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1015
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1016
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1017
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1018
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1019
                  #label: 'Changes Browser'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1020
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1021
                  #value: #openChangesBrowser
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1022
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1023
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1024
               #(#MenuItem
2562
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1025
                  #label: 'Create Smalltalk Project'
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1026
                  #translateLabel: true
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1027
                  #value: #createProjectAndOpenProjectBrowser
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1028
                  #enabled: #canCreateNewProject
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1029
                )
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1030
               #(#MenuItem
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1031
                  #label: 'Install autoloaded'
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1032
                  #translateLabel: true
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1033
                  #value: #readAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1034
                  #enabled: #canReadAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1035
                )
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1036
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1037
                  #label: 'Editor'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1038
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1039
                  #value: #openEditor
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1040
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1041
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1042
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1043
                  #label: 'HTML Reader'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1044
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1045
                  #value: #openHTMLReader
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1046
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1047
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1048
               #(#MenuItem
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1049
                  #label: 'ASN1 Browser'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1050
                  #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1051
                  #isVisible: #hasASN1
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1052
                  #value: #openASN1Browser
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1053
                  #enabled: #hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1054
                )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1055
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1056
                  #label: 'Applet Viewer'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1057
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1058
                  #isVisible: #hasJava
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1059
                  #value: #openAppletViewer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1060
                  #enabled: #hasJavaAndSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1061
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1062
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1063
                  #label: 'Image Inspector'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1064
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1065
                  #value: #openImageInspector
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1066
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1067
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1068
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1069
                  #label: 'Image Preview'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1070
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1071
                  #value: #openImagePreview
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1072
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1073
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1074
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1075
                  #label: 'Image Editor'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1076
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1077
                  #value: #openImageEditor
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1078
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1079
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1080
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1081
                  #label: 'ZipFile Tool'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1082
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1083
                  #value: #openZipTool
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1084
                  #enabled: #hasZipFileSelected
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
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1087
                  #label: 'File Differences...'
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: #openDiffView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1090
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1091
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1092
                  #label: 'Find Duplicate Files'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1093
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1094
                  #value: #fileFindDuplicates
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
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1097
                  #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
  1098
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1099
                  #value: #fileFindAllDuplicates
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1100
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1101
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1102
                  #label: 'Find a File...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1103
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1104
                  #value: #fileFindFile
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1105
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1106
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1107
                  #label: 'Hex Dump'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1108
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1109
                  #value: #fileHexDump
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1110
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1111
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1112
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1113
                  #label: 'Shell Terminal'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1114
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1115
                  #isVisible: #canDoTerminal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1116
                  #value: #openTerminal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1117
                  #enabled: #canDoTerminal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1118
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1119
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1120
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1121
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1122
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1123
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1124
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1125
            #label: 'CVS'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1126
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1127
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1128
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1129
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1130
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1131
                  #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
  1132
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1133
                  #value: #cvsUpdateSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1134
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1135
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1136
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1137
                  #label: 'Update directory local'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1138
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1139
                  #value: #cvsUpdateDirectoryLocal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1140
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1141
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1142
                  #label: 'Update directory recursive'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1143
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1144
                  #value: #cvsUpdateDirectoryRecursive
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1145
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1146
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1147
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1148
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1149
               #(#MenuItem
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1150
                  #label: 'Commit...'
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1151
                  #translateLabel: true
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1152
                  #value: #cvsCommitSelection
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1153
                )
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1154
               #(#MenuItem
2424
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1155
                  #label: 'Add...'
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1156
                  #translateLabel: true
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1157
                  #value: #cvsAddSelection
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1158
                )
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1159
               #(#MenuItem
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1160
                  #label: '-'
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1161
                )
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1162
               #(#MenuItem
2145
5fa2a25b576b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2143
diff changeset
  1163
                  #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
  1164
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1165
                  #value: #cvsRemoveFileAndContainer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1166
                  #enabled: #canRemoveCVSContainer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1167
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1168
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1169
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1170
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1171
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1172
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1173
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1174
            #label: 'Help'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1175
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1176
            #startGroup: #right
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1177
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1178
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1179
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1180
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1181
                  #label: 'FileBrowser Documentation'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1182
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1183
                  #value: #openHTMLDocument:
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1184
                  #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
  1185
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1186
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1187
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1188
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1189
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1190
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1191
         )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1192
        nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1193
        nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1194
      )
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1195
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1196
    "Modified: / 29.1.2000 / 12:59:41 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1197
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1198
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1199
!FileBrowser class methodsFor:'queries'!
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1200
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1201
isVisualStartable
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1202
    "return true, if this application can be started via #open"
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1203
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1204
    ^ true
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1205
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1206
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1207
! !
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1208
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1209
!FileBrowser methodsFor:'aspects'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1210
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1211
autoUpdate
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1212
    ^ doAutoUpdate
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1213
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1214
    "Created: / 6.5.1999 / 11:37:25 / cg"
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1215
    "Modified: / 6.5.1999 / 11:39:38 / cg"
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1216
!
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1217
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1218
canAddToClassPath
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1219
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1220
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1221
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1222
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1223
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1224
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1225
            f notNil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1226
            and:[(Java classPath includes:f pathName) not
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1227
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1228
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1229
                 or:[(f hasSuffix:'zip')]]]].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1230
        ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1231
      ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1232
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1233
    "Modified: / 1.2.1999 / 20:38:42 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1234
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1235
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1236
canAddToSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1237
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1238
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1239
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1240
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1241
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1242
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1243
            f notNil
2438
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1244
            and:[(Java sourcePath isNil
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1245
                 or:[(Java sourcePath includes:f pathName) not])
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1246
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1247
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1248
                 or:[(f hasSuffix:'zip')]]]].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1249
        ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1250
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1251
1989
728996560b15 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1252
    "Modified: / 1.2.1999 / 20:38:42 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1253
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1254
2562
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1255
canCreateNewProject
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1256
    ^ [ 
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1257
        currentDirectory notNil
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1258
        and:[((currentDirectory directoryContents 
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1259
                select:[:f| f endsWith:'.prj']) size == 0)
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1260
        and:[((currentDirectory directoryContents 
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1261
                select:[:f| f endsWith:'.st']) size > 0)
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1262
      ]]]
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1263
!
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1264
2129
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1265
canDoTerminal
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1266
    ^ OperatingSystem isUNIXlike
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1267
      or:[OperatingSystem isMSWINDOWSlike]
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1268
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1269
    "Created: / 4.8.1998 / 13:37:13 / cg"
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1270
    "Modified: / 28.4.1999 / 11:54:17 / cg"
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1271
!
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1272
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1273
canReadAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1274
    ^ [|sel f fn suff|
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1275
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1276
        sel := fileListView selection.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1277
        sel size == 1 ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1278
            f := fileList at:sel first ifAbsent:nil.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1279
            f notNil ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1280
                f = 'abbrev.stc'.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1281
            ] ifFalse:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1282
                false
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1283
            ]
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1284
        ] ifFalse:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1285
            false
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1286
        ]
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1287
      ]
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1288
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1289
    "Modified: / 30.1.1999 / 19:05:59 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1290
    "Created: / 29.1.2000 / 13:00:57 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1291
!
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1292
2101
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1293
canRemoveCVSContainer
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1294
    ^ [ |cvsDir|
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1295
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1296
	currentDirectory notNil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1297
	and:[fileListView selection size > 0
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1298
	and:[(cvsDir := currentDirectory construct:'CVS') exists
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1299
	and:[cvsDir isDirectory]]]]
2101
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1300
!
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1301
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1302
canRemoveFromClassPath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1303
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1304
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1305
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1306
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1307
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1308
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1309
            f notNil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1310
            and:[(Java classPath includes:f pathName)
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1311
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1312
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1313
                 or:[(f hasSuffix:'zip')]]]]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1314
          ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1315
      ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1316
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1317
    "Modified: / 1.2.1999 / 20:39:25 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1318
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1319
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1320
canRemoveFromSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1321
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1322
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1323
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1324
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1325
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1326
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1327
            f notNil
2438
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1328
            and:[(Java sourcePath isNil
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1329
                 or:[(Java sourcePath includes:f pathName)])
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1330
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1331
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1332
                 or:[(f hasSuffix:'zip')]]]]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1333
          ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1334
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1335
1989
728996560b15 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1336
    "Modified: / 1.2.1999 / 20:39:25 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1337
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1338
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1339
currentDirectoryIsNotTop
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1340
    ^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1341
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1342
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1343
    "Created: / 14.8.1998 / 12:07:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1344
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1345
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1346
dosEOLMode
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1347
    ^ dosEOLMode
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1348
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1349
    "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
  1350
    "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
  1351
!
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1352
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1353
hasASN1
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1354
    ^ [ OSI::ASN1Parser notNil 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1355
        and:[OSI::ASN1Parser isLoaded]]
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1356
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1357
!
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1358
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1359
hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1360
    ^ [ fileListView selection size > 0
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1361
        and:[OSI::ASN1Parser notNil 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1362
        and:[OSI::ASN1Parser isLoaded]]]
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1363
!
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1364
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1365
hasFilenameSelectionInCodeView
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1366
    ^ [ |val sel|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1367
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1368
	val := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1369
	sel := subView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1370
	sel notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1371
	    sel := sel asString withoutSeparators.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1372
	    sel asFilename exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1373
		val := sel asFilename isReadable
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1374
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1375
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1376
	val
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1377
    ]
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1378
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1379
    "Created: / 4.2.1999 / 17:34:57 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1380
    "Modified: / 4.2.1999 / 17:39:32 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1381
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1382
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1383
hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1384
    ^ [ JavaClassReader notNil 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1385
	and:[JavaClassReader isLoaded]]
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1386
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1387
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1388
    "Created: / 17.10.1998 / 22:58:25 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1389
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1390
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1391
hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1392
    ^ [ fileListView selection size > 0
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1393
	and:[JavaClassReader notNil 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1394
	and:[JavaClassReader isLoaded]]]
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1395
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1396
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1397
    "Created: / 17.10.1998 / 22:58:03 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1398
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1399
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1400
hasSelection
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1401
    ^ [fileListView selection size > 0]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1402
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1403
    "Created: / 4.8.1998 / 14:10:31 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1404
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1405
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1406
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1407
hasVisitHistory
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1408
    ^ [DirectoryHistory size > 0]
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1409
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1410
    "Created: / 14.8.1998 / 19:17:02 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1411
    "Modified: / 14.8.1998 / 19:17:17 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1412
!
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1413
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1414
hasZipFileSelected
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1415
    ^ [|sel f fn suff|
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1416
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1417
	sel := fileListView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1418
	sel size == 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1419
	    f := fileList at:sel first ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1420
	    f notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1421
		suff := f asFilename suffix asLowercase.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1422
		suff = 'zip' or:[suff = 'jar']
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1423
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1424
		false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1425
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1426
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1427
	    false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1428
	]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1429
      ]
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1430
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1431
    "Created: / 26.8.1998 / 16:15:26 / cg"
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1432
    "Modified: / 30.1.1999 / 19:05:59 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1433
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1434
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1435
javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1436
    ^ [ JavaClassReader notNil 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1437
	and:[JavaClassReader isLoaded]]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1438
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1439
    "Created: / 9.11.1998 / 05:33:17 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1440
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1441
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1442
showingBigImagePreview
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1443
    ^ showingBigImagePreview
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1444
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1445
    "Created: / 14.8.1998 / 14:15:44 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1446
!
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1447
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1448
showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1449
    ^ showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1450
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1451
    "Created: / 14.8.1998 / 14:15:15 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1452
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1453
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1454
showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1455
    ^ showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1456
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1457
    "Created: / 14.8.1998 / 14:15:44 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1458
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1459
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1460
singleSelectedFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1461
    |f sel|
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1462
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1463
    sel := fileListView selection.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1464
    sel size ~~ 1 ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1465
        ^ nil
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1466
    ].
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1467
    f := fileList at:sel first ifAbsent:nil.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1468
    f notNil ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1469
        ^ currentDirectory asFilename construct:f
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1470
    ].
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1471
    ^ nil
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1472
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1473
    "Created: / 29.1.2000 / 13:09:09 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1474
!
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1475
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1476
singleSelectedFileOrCurrentDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1477
    |f sel|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1478
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1479
    sel := fileListView selection.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1480
    sel size > 1 ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1481
        ^ nil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1482
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1483
    sel size == 0 ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1484
        ^ currentDirectory asFilename
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1485
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1486
    f := fileList at:sel first ifAbsent:nil.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1487
    f notNil ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1488
        ^ currentDirectory asFilename construct:f
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1489
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1490
    ^ nil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1491
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1492
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1493
sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1494
    ^ sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1495
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1496
    "Created: / 14.8.1998 / 15:55:18 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1497
    "Modified: / 14.8.1998 / 15:56:08 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1498
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1499
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1500
sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1501
    ^ sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1502
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1503
    "Created: / 14.8.1998 / 14:21:21 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1504
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1505
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1506
systemIsDOS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1507
    ^ OperatingSystem isMSDOSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1508
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1509
    "Created: / 4.8.1998 / 13:37:28 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1510
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1511
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1512
systemIsUnix
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1513
    ^ OperatingSystem isUNIXlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1514
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1515
    "Created: / 4.8.1998 / 13:37:13 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1516
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1517
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1518
systemIsVMS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1519
    ^ OperatingSystem isVMSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1520
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1521
    "Created: / 4.8.1998 / 13:37:37 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1522
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1523
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1524
!FileBrowser methodsFor:'drag & drop'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1525
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1526
canDrop:aCollectionOfDropObjects
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1527
    "I accept fileObjects only"
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1528
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1529
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1530
	aDropObject isFileObject ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1531
	    aDropObject isTextObject ifFalse:[^ false].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1532
	]
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1533
    ].
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1534
    ^ true
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1535
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1536
    "Modified: 11.4.1997 / 12:41:59 / cg"
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1537
!
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1538
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1539
drop:aCollectionOfDropObjects at:aPoint
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1540
    "handle drops"
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1541
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1542
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1543
	self dropSingleObject:aDropObject at:aPoint
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1544
    ]
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1545
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1546
    "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
  1547
!
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1548
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1549
dropSingleObject:someObject at:aPoint
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1550
    "handle drops; if its a directory, change to it.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1551
     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
  1552
     If its text, paste it into the codeView."
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1553
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1554
    |newDir newFile|
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1555
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1556
    someObject isFileObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1557
	someObject isDirectory ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1558
	    newDir := someObject theObject pathName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1559
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1560
	    newDir := someObject theObject directoryName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1561
	    newFile := someObject theObject baseName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1562
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1563
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1564
	newDir notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1565
	    newDir ~= currentDirectory pathName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1566
		self changeDirectoryTo:newDir.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1567
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1568
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1569
	newFile notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1570
	    newFile ~= currentFileName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1571
		fileListView selection:(fileList indexOf:newFile).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1572
		self doFileGet:false.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1573
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1574
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1575
	^ self
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1576
    ].
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1577
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1578
    someObject isTextObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1579
	subView paste:someObject theObject.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1580
	^ self
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1581
    ].
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1582
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1583
    "Modified: 6.4.1997 / 14:46:44 / cg"
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1584
! !
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1585
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1586
!FileBrowser methodsFor:'events'!
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1587
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1588
handlesKeyPress:key inView:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1589
    "this method is reached via delegation: are we prepared to handle
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1590
     a keyPress in some other view ?"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1591
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1592
    <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
  1593
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1594
    view == fileListView ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1595
        (key == #Delete 
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1596
        or:[key == #BackSpace
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1597
        or:[key == #Accept
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1598
        or:[key == #CmdI
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1599
        or:[key == #CmdF
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1600
        or:[key == #CmdD
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1601
        or:[key == #Cmdu
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1602
        or:[key == #Cut
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1603
        or:[key == #Cmdr
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1604
        or:[key == #Replace
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1605
        or:[key == #InspectIt
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1606
        or:[key == #GotoLine
2665
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1607
        or:[key == #CursorLeft
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1608
        or:[key == #DoIt]]]]]]]]]]]]]) ifTrue:[^ true].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1609
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1610
    ^ false
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1611
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1612
    "Created: / 28.1.1997 / 14:03:20 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1613
    "Modified: / 20.6.1997 / 16:35:01 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1614
    "Modified: / 16.1.1998 / 16:50:39 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1615
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1616
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1617
keyPress:key x:x y:y view:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1618
    "this method is reached via delegation from the fileListView"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1619
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1620
    <resource: #keyboard (#GotoLine #InspectIt  
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1621
                          #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1622
                          #Cmdr #Cut)>
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1623
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1624
    (key == #Delete 
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1625
    or:[key == #Cut
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1626
    or:[key == #BackSpace]]) ifTrue:[
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1627
        self fileRemove.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1628
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1629
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1630
    (key == #Accept) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1631
        self fileFileIn.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1632
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1633
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1634
    (key == #GotoLine) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1635
        self fileGet.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1636
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1637
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1638
    (key == #DoIt) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1639
        self fileExecute.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1640
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1641
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1642
    (key == #InspectIt) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1643
        self fileGetInfo.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1644
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1645
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1646
    (key == #CmdI) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1647
        self fileGetLongInfo.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1648
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1649
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1650
    (key == #Cmdu) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1651
        self updateCurrentDirectory.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1652
        ^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1653
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1654
    (key == #CmdF) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1655
        self newFile.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1656
        ^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1657
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1658
    (key == #CmdD) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1659
        self newDirectory.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1660
        ^ self
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1661
    ].
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1662
    ((key == #Cmdr) or:[key == #Replace]) ifTrue:[
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1663
        self fileRename.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1664
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1665
    ].
2665
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1666
    (key == #CursorLeft) ifTrue:[
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1667
        self changeToParentDirectory.
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1668
        ^ self
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1669
    ].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1670
    fileListView keyPress:key x:x y:y
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1671
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1672
    "Created: / 28.1.1997 / 14:03:56 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1673
    "Modified: / 20.6.1997 / 16:35:08 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1674
    "Modified: / 16.1.1998 / 16:51:38 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1675
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1676
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1677
mapped 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1678
    super mapped.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1679
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1680
     whant to know about changed history
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1681
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1682
    self updateCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1683
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1684
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1685
visibilityChange:how
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1686
    |wasVisible|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1687
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1688
    wasVisible := shown.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1689
    super visibilityChange:how.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1690
    (wasVisible not and:[shown]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1691
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1692
	 start checking again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1693
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1694
	Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1695
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1696
    ]
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1697
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1698
    "Modified: / 18.2.1998 / 17:57:44 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1699
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1700
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1701
!FileBrowser methodsFor:'fileList user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1702
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1703
bigImagePreviewSettingChanged
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1704
    "invoked, when big image preview flag changed"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1705
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1706
    |fh|
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1707
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1708
    (showingBigImagePreview value == true 
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1709
    and:[showingDetails value == true]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1710
	fh := fileListView font height.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1711
	fileListView lineSpacing:(34 - fh max:0).
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1712
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1713
	fileListView clear.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1714
	self updateCurrentDirectory.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1715
	fileListView lineSpacing:2.
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1716
    ].
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1717
    fileListView clear.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1718
    self updateCurrentDirectory
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1719
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1720
    "Modified: / 4.8.1998 / 13:43:54 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1721
    "Created: / 14.8.1998 / 14:17:49 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1722
!
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1723
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1724
changeDisplayMode
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1725
    "toggle from long to short listing (and vice-versa)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1726
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1727
    showingDetails value:(showingDetails value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1728
    "/ showLongList := showLongList not.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  1729
    self showOrHideTabView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1730
    self updateCurrentDirectory
747
a50e8643c666 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
  1731
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1732
    "Modified: / 4.8.1998 / 13:43:54 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1733
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1734
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1735
changeDotFileVisibility
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1736
    "turn on/off visibility of files whose name starts with '.'"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1737
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1738
    showingHiddenFiles value:(showingHiddenFiles value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1739
    "/ showDotFiles := showDotFiles not.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1740
    self updateCurrentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1741
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1742
    "Modified: / 4.8.1998 / 13:45:46 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1743
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1744
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1745
detailsSettingChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1746
    "invoked, when detail (i.e. long / short) listing flag changed"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1747
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1748
    self showOrHideTabView.
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1749
    self bigImagePreviewSettingChanged
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1750
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1751
    "Modified: / 4.8.1998 / 13:43:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1752
    "Created: / 14.8.1998 / 14:17:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1753
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1754
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1755
fileDoubleClick:lineNr
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1756
    "double click on a file - get its contents"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1757
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1758
    self fileSelect:lineNr.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1759
    self fileGet:true
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1760
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1761
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1762
fileEncoding
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1763
    "open a dialog to allow change of the files character encoding.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1764
     Files are converted to internal encoding when read, and converted back
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1765
     to this encoding when saved.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1766
     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
  1767
     the internal encoding (which is iso8859).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1768
     Notice: currently, not too many encodings are supported by the system."
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1769
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1770
    |dialog list descr encodings encodingNames idx|
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1771
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1772
    list := SelectionInList new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1773
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1774
    descr := CharacterArray supportedExternalEncodings.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1775
    encodings := descr at:2.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1776
    encodingNames := descr at:1.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1777
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1778
    list list:encodingNames.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1779
    list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1780
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1781
    dialog := Dialog new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1782
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1783
    dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1784
    dialog addVerticalSpace.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1785
    dialog addListBoxOn:list withNumberOfLines:5.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1786
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  1787
    dialog addAbortAndOkButtons.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1788
    dialog open.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1789
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1790
    dialog accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1791
	idx := list selectionIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1792
	fileEncoding := encodings at:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1793
	subView externalEncoding:fileEncoding.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1794
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1795
	self validateFontEncodingFor:fileEncoding ask:true.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1796
    ].
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1797
1219
8495da2ea4cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  1798
    "Modified: 30.6.1997 / 14:41:12 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1799
!
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1800
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1801
fileExecute
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1802
    "if text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1803
     otherwise pop up execute box immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1804
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1805
    |action sel fileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1806
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1807
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1808
     this replaces everything by the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1809
    "
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1810
    action := [:command | 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1811
		self class addToCommandHistory:command for:fileName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1812
		self doExecuteCommand:command replace:true
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1813
	      ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1814
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1815
    (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
  1816
	      yesButton:'execute') ifFalse:[^ self].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1817
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1818
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1819
"/     this inserts the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1820
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1821
"/    action := [:command| self doExecuteCommand:command replace:false].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1822
"/
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1823
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1824
    sel := fileListView selection.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1825
    sel size == 1 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1826
	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
  1827
    ].
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1828
    self askForCommandFor:fileName thenDo:action
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1829
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1830
    "Modified: 14.11.1996 / 14:59:34 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1831
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1832
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1833
fileFileIn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1834
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1835
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1836
    self fileFileInLazy:false 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1837
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1838
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1839
fileFileInLazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1840
    "fileIn the selected file(s). Do a quick load (no compilation)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1841
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1842
    self fileFileInLazy:true 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1843
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1844
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1845
fileFileInLazy:lazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1846
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1847
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1848
    |aStream path wasLazy bos prevCurrentFileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1849
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1850
    self selectedFilesDo:[:fileName |
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1851
        path := currentDirectory filenameFor:fileName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1852
        path type == #regular ifTrue:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1853
            prevCurrentFileName := currentFileInFileName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1854
            currentFileInFileName := fileName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1855
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1856
            (ObjectFileLoader notNil
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1857
            and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1858
                Object abortSignal catch:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1859
                    |p|
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1860
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1861
                    "/
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1862
                    "/ look if already loaded ...  then unload first
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1863
                    "/
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1864
                    p := path pathName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1865
                    (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1866
                        (Dialog confirm:(resources 
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1867
                                            string:'%1 is already loaded; load anyway ?'
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1868
                                            with:p)) ifFalse:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1869
                            ^ self
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1870
                        ].
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1871
                        Transcript showCR:'unloading old ' , p , ' ...'.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1872
                        ObjectFileLoader unloadObjectFile:p. 
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1873
                    ].
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1874
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1875
                    Transcript showCR:'loading ' , p , ' ...'.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1876
                    ObjectFileLoader loadObjectFile:p.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1877
                    Class addInfoRecord:('fileIn ' , fileName) 
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1878
                ]
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1879
            ] ifFalse:[ (path hasSuffix:'cls') ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1880
                "/ loading a binary class file
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1881
                aStream := path readStream.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1882
                aStream notNil ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1883
                    bos := BinaryObjectStorage onOld:aStream.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1884
                    Class nameSpaceQuerySignal 
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1885
                        answer:Smalltalk
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1886
                        do:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1887
                            bos next.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1888
                        ].
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1889
                    bos close
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1890
                ]
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1891
            ] ifFalse:[
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1892
                ((path hasSuffix:'class')
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1893
                or:[(path hasSuffix:'cla')]) ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1894
                    "/ loading a java class file
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1895
                    JavaClassReader notNil ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1896
                        JavaClassReader loadFile:(path pathName)
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1897
                    ]
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1898
                ] ifFalse:[ (path hasSuffix:'sif') ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1899
                    "/ loading a sif (smalltalk interchange format) file
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1900
                    SmalltalkInterchangeFileManager newForFileIn
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1901
                        fileName: path pathName;
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1902
                        fileIn.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1903
                ] ifFalse:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1904
                    "/ loading a regular (chunk) or xml source file
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1905
                    aStream := path readStream.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1906
                    aStream notNil ifTrue:[
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1907
                        [
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1908
                            Class withoutUpdatingChangesDo:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1909
                                wasLazy := Compiler compileLazy:lazy.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1910
                                aStream fileIn.
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1911
                            ].
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1912
                            Class addInfoRecord:('fileIn ' , fileName) 
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1913
                        ] valueNowOrOnUnwindDo:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1914
                            Compiler compileLazy:wasLazy.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1915
                            aStream close
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1916
                        ]
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1917
                    ]
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1918
                ]]
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1919
            ]]
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1920
        ].
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1921
        currentFileInFileName := prevCurrentFileName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1922
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1923
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1924
    "Modified: / 19.9.1997 / 23:42:22 / stefan"
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1925
    "Modified: / 16.10.1999 / 12:16:31 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1926
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1927
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1928
fileFindAllDuplicates
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1929
    "scan directory and all subdirs for duplicate files"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1930
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1931
    |fileNames dir infoDir filesBySize
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1932
     result info dirPrefix|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1933
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1934
    (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
  1935
	      yesButton:'proceed') ifFalse:[^ self].
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1936
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1937
    self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1938
	result := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1939
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1940
	dir := currentDirectory asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1941
	self label:myName , '- gathering file names ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1942
	fileNames := dir recursiveDirectoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1943
	fileNames := fileNames collect:[:fn | dir construct:fn].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1944
	fileNames := fileNames select:[:fn | fn isDirectory not].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1945
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1946
	self label:myName , '- gathering sizes ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1947
	infoDir := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1948
	fileNames do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1949
	    infoDir at:fn put:(fn fileSize)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1950
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1951
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1952
	"/ for each, get the files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1953
	"/ in a first pass, look for files of the same size and
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1954
	"/ compare them ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1955
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1956
	self label:myName , '- preselect possible duplicates ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1957
	filesBySize := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1958
	infoDir keysAndValuesDo:[:fn :sz |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1959
	    |entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1960
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1961
	    entry := filesBySize at:sz ifAbsentPut:[Set new].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1962
	    entry add:fn.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1963
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1964
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1965
	"/ any of same size ?
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1966
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1967
	self label:myName , '- checking for duplicates ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1968
	filesBySize do:[:entry |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1969
	    |files|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1970
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1971
	    entry size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1972
		files := entry asArray.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1973
		1 to:files size-1 do:[:idx1 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1974
		    idx1+1 to:files size do:[:idx2 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1975
			|fn1 fn2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1976
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1977
			fn1 := files at:idx1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1978
			fn2 := files at:idx2.
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1979
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1980
"/                        self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1981
			(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1982
			    "/ compare the files
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1983
			    (fn1 sameContentsAs:fn2) ifTrue:[
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1984
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1985
				result at:fn1 put:fn2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1986
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1987
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1988
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1989
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1990
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1991
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1992
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1993
	self label:myName , '- sorting ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1994
	dirPrefix := currentDirectory asFilename pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1995
	result := result associations.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1996
	result := result collect:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1997
					|f1 f2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1998
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1999
					f1 := assoc key name.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2000
					f2 := assoc value name.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2001
					(f1 startsWith:dirPrefix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2002
					    f1 := f1 copyFrom:dirPrefix size + 2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2003
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2004
					(f2 startsWith:dirPrefix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2005
					    f2 := f2 copyFrom:dirPrefix size + 2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2006
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2007
					f1 < f2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2008
					    f2 -> f1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2009
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2010
					    f1 -> f2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2011
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2012
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2013
	result sort:[:f1 :f2 | f2 value < f1 value].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2014
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2015
	info := OrderedCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2016
	result do:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2017
	    info add:(assoc key , ' same as ' , assoc value)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2018
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2019
	info isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2020
	    info := 'No duplicate files found.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2021
	].
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2022
    ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2023
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2024
    subView contents:info.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2025
    self label:myName.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2026
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2027
    "Created: / 28.11.1998 / 17:47:53 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2028
    "Modified: / 10.12.1998 / 17:13:14 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2029
!
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2030
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2031
fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2032
    "scan directory for duplicate files"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2033
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2034
    |fileNames dir infoDir filesBySize
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2035
     result info|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2036
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2037
    (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
  2038
	      yesButton:'proceed') ifFalse:[^ self].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2039
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2040
    self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2041
	result := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2042
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2043
	dir := currentDirectory asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2044
	fileNames := dir directoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2045
	fileNames := fileNames collect:[:fn | dir construct:fn].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2046
	fileNames := fileNames select:[:fn | fn isDirectory not].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2047
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2048
	infoDir := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2049
	fileNames do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2050
	    infoDir at:fn put:(fn info)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2051
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2052
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2053
	"/ for each, get the files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2054
	"/ in a first pass, look for files of the same size and
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2055
	"/ compare them ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2056
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2057
	filesBySize := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2058
	infoDir keysAndValuesDo:[:fn :info |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2059
	    |sz entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2060
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2061
	    sz := info size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2062
	    entry := filesBySize at:sz ifAbsentPut:[Set new].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2063
	    entry add:fn.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2064
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2065
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2066
	"/ any of same size ?
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2067
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2068
	filesBySize do:[:entry |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2069
	    |files|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2070
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2071
	    entry size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2072
		files := entry asArray.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2073
		1 to:files size-1 do:[:idx1 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2074
		    idx1+1 to:files size do:[:idx2 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2075
			|fn1 fn2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2076
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2077
			fn1 := files at:idx1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2078
			fn2 := files at:idx2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2079
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2080
			(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2081
			    "/ compare the files
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2082
			    (fn1 sameContentsAs:fn2) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2083
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2084
				result at:fn1 put:fn2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2085
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2086
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2087
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2088
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2089
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2090
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2091
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2092
	result := result associations.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2093
	result := result collect:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2094
					|f1 f2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2095
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2096
					f1 := assoc key baseName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2097
					f2 := assoc value baseName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2098
					f1 < f2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2099
					    f2 -> f1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2100
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2101
					    f1 -> f2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2102
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2103
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2104
	result sort:[:f1 :f2 | f2 value < f1 value].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2105
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2106
	info := OrderedCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2107
	result do:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2108
	    info add:(assoc key , ' same as ' , assoc value)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2109
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2110
	info isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2111
	    info := 'No duplicate files found.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2112
	].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2113
    ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2114
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2115
    subView contents:info
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2116
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2117
    "Created: / 3.10.1998 / 17:59:00 / cg"
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  2118
    "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
  2119
!
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2120
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2121
fileFindFile
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2122
    |sel bindings
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2123
     namePatternHolder contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2124
     ignoreCaseInName ignoreCaseInContents
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2125
     namePattern namePatterns contentsPattern 
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2126
     searchForSameContentsEnabled searchForSameContents|
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2127
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2128
    (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
  2129
              yesButton:'proceed') ifFalse:[^ self].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2130
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2131
    subView contents:nil; scrollToTop.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2132
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2133
    bindings := IdentityDictionary new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2134
    bindings at:#namePatternHolder put:(namePatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2135
    bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2136
    bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2137
    bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2138
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2139
    searchForSameContentsEnabled := false.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2140
    sel := fileListView selectionValue.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2141
    sel size == 1 ifTrue:[
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2142
        searchForSameContentsEnabled := true.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2143
        sel := sel first string withoutSeparators
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2144
    ].
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2145
    bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2146
    bindings at:#searchForSameContents put:(searchForSameContents := false asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2147
    bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2148
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2149
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2150
    (SimpleDialog new 
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2151
        openFor:self
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2152
        interfaceSpec:(self class fileSearchDialogSpec)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2153
        withBindings:bindings) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2154
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2155
        namePattern := namePatternHolder value.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2156
        namePattern size == 0 ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2157
            namePatterns := nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2158
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2159
            ignoreCaseInName value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2160
                namePattern := namePattern asLowercase
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2161
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2162
            namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$;
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2163
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2164
        contentsPattern := contentsPatternHolder value.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2165
        contentsPattern size == 0 ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2166
            contentsPattern := nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2167
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2168
            ignoreCaseInContents value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2169
                contentsPattern := contentsPattern asLowercase
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2170
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2171
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2172
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2173
        self withWaitCursorDo:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2174
            |stopSignal access myProcess lowerFrameView|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2175
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2176
            myProcess := Processor activeProcess.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2177
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2178
            access := Semaphore forMutualExclusion name:'accessLock'.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2179
            stopSignal := Signal new.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2180
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2181
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2182
             The following is tricky: 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2183
             the pauseToggle & killButton will
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2184
             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
  2185
             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
  2186
             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
  2187
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2188
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2189
            commandView beInvisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2190
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2191
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2192
             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
  2193
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2194
            killButton windowGroup:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2195
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2196
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2197
             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
  2198
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2199
            killButton label:(resources string:'stop').
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2200
            killButton raise; beVisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2201
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2202
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2203
             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
  2204
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2205
            killButton 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2206
                action:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2207
                    access critical:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2208
                        myProcess interruptWith:[stopSignal raiseRequest].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2209
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2210
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2211
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2212
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2213
             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
  2214
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2215
            killButton openAutonomous.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2216
            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
  2217
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2218
            lowerFrameView := subView superView.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2219
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2220
            [
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2221
                stopSignal catch:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2222
                    searchForSameContents value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2223
                        self 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2224
                            doFindFileNamed:namePatterns
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2225
                            ignoreCase:ignoreCaseInName value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2226
                            containingString:nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2227
                            ignoreCaseInContents:ignoreCaseInContents value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2228
                            sameContentsAsFile:(currentDirectory asFilename construct:sel) 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2229
                            sameContentsAs:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2230
                            in:currentDirectory.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2231
                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2232
                        (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
  2233
                            self 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2234
                                doFindFileNamed:namePatterns
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2235
                                ignoreCase:ignoreCaseInName value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2236
                                containingString:contentsPattern
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2237
                                ignoreCaseInContents:ignoreCaseInContents value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2238
                                sameContentsAsFile:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2239
                                sameContentsAs:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2240
                                in:currentDirectory.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2241
                        ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2242
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2243
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2244
            ] valueNowOrOnUnwindDo:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2245
                |wg|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2246
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2247
                self label:myName; iconLabel:myName.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2248
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2249
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2250
                 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
  2251
                 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
  2252
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2253
                killButton beInvisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2254
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2255
                commandView beVisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2256
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2257
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2258
                 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
  2259
                 (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
  2260
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2261
                wg := killButton windowGroup.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2262
                killButton windowGroup:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2263
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2264
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2265
                 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
  2266
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2267
                wg notNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2268
                    wg process terminate.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2269
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2270
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2271
                 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
  2272
                 releases reference to thisContext earlier)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2273
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2274
                killButton action:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2275
                killButton label:(resources string:'kill').
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2276
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2277
                "/    
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2278
                "/ allow interaction with the codeView
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2279
                "/ (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
  2280
                "/
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2281
                lowerFrameView windowGroup:(self windowGroup).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2282
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2283
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2284
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2285
        self label:myName.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2286
        currentFileName isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2287
            subView modified:false.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2288
        ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2289
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2290
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2291
    "Created: / 15.10.1998 / 11:32:57 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2292
    "Modified: / 15.10.1998 / 12:41:09 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2293
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2294
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2295
fileGet
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2296
    "get contents of selected file into subView.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2297
     If text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2298
     otherwise get it immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2299
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2300
    self fileGet:false
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2301
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2302
    "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
  2303
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2304
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2305
fileGet:viaDoubleClick
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2306
    "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
  2307
     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
  2308
     otherwise get it immediately"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2309
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2310
    |fileName msg label|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2311
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  2312
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2313
	self doFileGet:viaDoubleClick.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2314
	^ self
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  2315
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2316
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2317
    fileName notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2318
	(currentDirectory filenameFor:fileName) isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2319
	    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
  2320
	    label := 'change'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2321
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2322
	    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
  2323
	    label := 'get'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2324
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2325
	(self ask:(resources at:msg) yesButton:label) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2326
	    subView modified:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2327
	    self doFileGet:viaDoubleClick
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2328
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2329
    ]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2330
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2331
    "Created: 19.6.1996 / 09:38:35 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2332
    "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
  2333
    "Modified: 18.9.1997 / 16:27:34 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2334
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2335
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2336
fileGetInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2337
    "show short file (stat)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2338
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2339
    self fileGetInfo:false
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2340
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2341
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2342
fileGetInfo:longInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2343
    "get info on selected file - show it in a box"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2344
1672
9df905f8bfa3 update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2345
    |string box updater|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2346
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2347
    string := self getFileInfoString:longInfo.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2348
    string notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2349
	box := InfoBox title:string.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2350
	updater := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2351
	    [true] whileTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2352
		Delay waitForSeconds:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2353
		string := self getFileInfoString:longInfo.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2354
		box title:string
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2355
	    ] 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2356
	] fork.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2357
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2358
	box showAtPointer.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2359
	updater terminate.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2360
	box destroy
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2361
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2362
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2363
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2364
fileGetLongInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2365
    "show long stat (file)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2366
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2367
    self fileGetInfo:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2368
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2369
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2370
fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2371
    "show a hex dump (similar to od -x)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2372
     Only needed with non-Unix systems."
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2373
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2374
    self withReadCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2375
	|fileName f stream data offs 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2376
	 addrDigits col line asciiLine lines|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2377
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2378
	fileName := self getSelectedFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2379
	fileName notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2380
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2381
	    f isDirectory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2382
		^ self warn:(resources string:'%1 is a directory.' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2383
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2384
	    f exists ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2385
		self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2386
		^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2387
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2388
	    f isReadable ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2389
		self warn:(resources string:'''%1'' is unreadable.' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2390
		^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2391
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2392
	    stream := f readStream binary.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2393
	    data := stream contents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2394
	    stream close.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2395
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2396
	    subView list:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2397
	    col := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2398
	    offs := 0.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2399
	    lines := StringCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2400
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2401
	    addrDigits := ((f fileSize + 1) log:16) truncated + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2402
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2403
	    line := (offs hexPrintString:addrDigits) , ': '.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2404
	    asciiLine := ''.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2405
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2406
	    data do:[:byte |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2407
		line := line , (byte hexPrintString:2).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2408
		(byte between:32 and:127) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2409
		    asciiLine := asciiLine copyWith:(Character value:byte)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2410
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2411
		    asciiLine := asciiLine , '.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2412
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2413
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2414
		offs := offs + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2415
		col := col + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2416
		col > 16 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2417
		    lines add:(line , '        ' , asciiLine).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2418
		    (offs bitAnd:16rFF) == 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2419
			lines add:nil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2420
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2421
		    line := (offs hexPrintString:addrDigits) , ': '.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2422
		    asciiLine := ''.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2423
		    col := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2424
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2425
		    line := line , ' '
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2426
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2427
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2428
	    line := line paddedTo:(3*16 + addrDigits + 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2429
	    lines add:(line , '        ' , asciiLine).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2430
	    self show:lines.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2431
	]
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2432
    ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2433
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2434
    "Modified: / 7.9.1998 / 15:37:47 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2435
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2436
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2437
fileInsert
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2438
    "insert contents of file at the cursor position"
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
    |fileName|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2441
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2442
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2443
    fileName notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2444
	self showFile:fileName insert:true encoding:fileEncoding
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2445
    ]
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  2446
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2447
    "Modified: 23.4.1997 / 13:06:06 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2448
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2449
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2450
fileListMenu
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2451
    "return the menu to show in the fileList"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2452
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  2453
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2454
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2455
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2456
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2457
    m := self class menuPopUp.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2458
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2459
    m receiver:self.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2460
    m findGuiResourcesIn:self.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2461
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2462
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2463
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2464
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2465
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2466
fileListMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2467
    "return the menu to show in the fileList"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2468
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2469
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2470
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2471
    |items m sel ns subMenu subItems|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2472
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2473
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2474
		 ('spawn'            fileSpawn        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2475
		 ('-'                nil              )  
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2476
		 ('get contents'     fileGet          GotoLine)      
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2477
		 ('insert contents'  fileInsert       )            
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2478
		 ('show info'        fileGetInfo      InspectIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2479
		 ('show full info'   fileGetLongInfo  CmdI)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2480
	       ).
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2481
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2482
    ((ns := Project current defaultNameSpace) notNil 
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2483
    and:[ns ~~ Smalltalk]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2484
	items := items copyWith:(Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2485
				    with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2486
				    with:#fileFileIn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2487
				    with:#Accept)
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2488
                                
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2489
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2490
	items := items copyWith:#( 'fileIn'  #fileFileIn  #Accept)
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2491
    ].
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2492
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2493
    items := items , #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2494
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2495
		 ('update'                    updateCurrentDirectory    Cmdu)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2496
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2497
		 ('execute unix command ...'  fileExecute               DoIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2498
		 ('st/x tools'                stxTools                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2499
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2500
		 ('remove'                    fileRemove                Delete)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2501
		 ('rename ...'                fileRename                )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2502
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2503
		 ('display long list'         changeDisplayMode         )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2504
		 ('show all files'            changeDotFileVisibility   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2505
		 ('encoding ...'              fileEncoding              )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2506
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2507
		 ('create directory ...'      newDirectory              CmdD)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2508
		 ('create file ...'           newFile                   CmdF)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2509
	       ).             
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2510
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2511
    m := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2512
	    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2513
	    resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2514
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2515
    showingHiddenFiles value "showDotFiles" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2516
	m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2517
    ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2518
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2519
	m labelAt:#changeDisplayMode put:(resources string:'display short list')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2520
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2521
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2522
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2523
			      ('Changes browser'       openChangesBrowser  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2524
			      ('Editor'                openEditor          )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2525
			      ('HTML reader'           openHTMLReader      )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2526
			      ('Image inspect'         openImageInspector  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2527
			      ('show file differences' openDiffView        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2528
		  ).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2529
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2530
    OperatingSystem isUNIXlike ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2531
	items := items , #( ('terminal'              openTerminal )).
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2532
    ].
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2533
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2534
    JavaInterpreter notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2535
	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
  2536
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2537
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2538
    m subMenuAt:#stxTools 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2539
	    put:(PopUpMenu
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2540
		    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2541
		    resources:resources).
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2542
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2543
    ((sel := fileListView selection) isNil 
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2544
    or:[sel isEmpty]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2545
	m disableAll:#(fileGet fileInsert
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2546
		       fileGetInfo fileGetLongInfo
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2547
		       fileFileIn fileFileInLazy
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2548
		       fileRemove fileRename).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2549
	(m subMenuAt:#stxTools)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2550
	    disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector)
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2551
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2552
	fileListView selection size > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2553
	    m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2554
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2555
    ].
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
    ^m
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2558
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2559
    "Modified: / 16.1.1998 / 16:42:59 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2560
    "Modified: / 4.8.1998 / 13:45:56 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2561
    "Created: / 13.8.1998 / 20:51:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2562
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2563
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2564
filePrint
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2565
    "send a files contents to the printer (not in the menu)"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2566
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2567
    |fileName path inStream printStream line|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2568
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2569
    self withWaitCursorDo:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2570
	fileName := self getSelectedFileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2571
	fileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2572
	    path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2573
	    (path type == #regular) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2574
		inStream := path readStream.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2575
		inStream isNil ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2576
		    printStream := PrinterStream new.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2577
		    printStream notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2578
			[inStream atEnd] whileFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2579
			    line := inStream nextLine.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2580
			    printStream nextPutLine:line.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2581
			].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2582
			printStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2583
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2584
		    inStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2585
		]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2586
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2587
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2588
	0 "compiler hint"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2589
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2590
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2591
    "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
  2592
    "Modified: 18.9.1997 / 16:29:17 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2593
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2594
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2595
fileRemove
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2596
    "remove the selected file(s).
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2597
     Query if user really wants to remove the file.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2598
     - should be enhanced, to look for a ~/.trash directory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2599
     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
  2600
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2601
    |sel q|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2602
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2603
    sel := fileListView selection.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2604
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2605
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2606
	sel size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2607
	    q := resources string:'remove %1 selected files ?' with:(sel size)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2608
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2609
	    q := resources string:'remove ''%1'' ?' with:(sel first asText allBold)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2610
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2611
	(self sensor shiftDown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2612
	or:[self ask:q yesButton:'remove']) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2613
	    self withCursor:(Cursor wait) do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2614
		self doRemove:sel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2615
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2616
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2617
    ]
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2618
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2619
    "Modified: / 16.12.1998 / 17:30:31 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2620
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2621
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2622
fileRename
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2623
    "rename the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2624
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2625
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2626
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2627
    queryBox := FilenameEnterBox new.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2628
    queryBox okText:(resources at:'rename').
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2629
    self selectedFilesDo:[:oldName |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2630
	queryBox title:(resources string:'rename ''%1'' to:' with:oldName).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2631
	queryBox initialText:oldName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2632
	queryBox action:[:newName | self doRename:oldName to:newName].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2633
	queryBox showAtPointer
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2634
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2635
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2636
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2637
fileSelect:lineNr
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2638
    "selected a file - do nothing here"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2639
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2640
    |fn|
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2641
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  2642
    imagePreviewView notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2643
	self stopImageRenderProcess.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2644
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2645
	fn := self getSelectedFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2646
	(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2647
	    imageRenderProcess := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2648
		self loadImageAndPerform:[:img | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2649
						imagePreviewView beVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2650
						imagePreviewView image:img
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2651
					 ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2652
	    ] forkAt:(Processor activePriority - 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2653
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2654
	    imagePreviewView beInvisible
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2655
	].
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  2656
    ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2657
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2658
    "Modified: 23.4.1997 / 13:04:55 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2659
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2660
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2661
fileSpawn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2662
    "start another FileBrowser on the selected directory or
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2663
     on the same directory if none is selected."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2664
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2665
    |any path|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2666
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2667
    any := false.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2668
    self selectedFilesDo:[:fileName |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2669
	path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2670
	path isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2671
	    self class openOn:(path pathName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2672
	    any := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2673
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2674
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2675
    any ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2676
	self class openOn:currentDirectory pathName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2677
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2678
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2679
    "Modified: 18.9.1997 / 16:32:39 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2680
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2681
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2682
loadImageAndPerform:aSelectorOrBlock
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2683
    |img path|
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2684
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2685
    self selectedFilesDo:[:fileName |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2686
	path := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2687
	path isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2688
	    img := Image fromFile:(path pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2689
	    img notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2690
		aSelectorOrBlock isSymbol ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2691
		    img perform:aSelectorOrBlock
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2692
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2693
		    aSelectorOrBlock value:img
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2694
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2695
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2696
		self warn:'unknown format: ' , fileName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2697
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2698
	]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2699
    ].
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2700
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2701
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2702
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2703
    "Created: / 26.8.1998 / 16:20:18 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2704
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2705
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2706
newDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2707
    "ask for and create a new directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2708
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2709
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2710
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2711
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2712
		    title:(resources at:'create new directory:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2713
		    okText:(resources at:'create')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2714
		    action:[:newName | self doCreateDirectory:newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2715
    queryBox showAtPointer
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2716
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2717
    "Modified: 23.4.1997 / 13:04:27 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2718
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2719
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2720
newFile
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2721
    "ask for and create a new file"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2722
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2723
    |sel queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2724
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2725
    queryBox := FilenameEnterBox 
2512
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2726
                    title:(resources at:'create new file:') withCRs
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2727
                    okText:(resources at:'create')
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2728
                    action:[:newName | newName isEmpty ifFalse:[
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2729
                                           self doCreateFile:newName.
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2730
                                           self selectFile:newName.
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2731
                                       ]
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2732
                           ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2733
    sel := subView selection.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2734
    sel notNil ifTrue:[
2512
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2735
        queryBox initialText:(sel asString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2736
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2737
    queryBox showAtPointer
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  2738
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2739
    "Modified: / 23.4.1997 / 13:04:38 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2740
    "Modified: / 16.1.1998 / 16:54:00 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2741
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2742
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2743
newHardLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2744
    "ask for and create a hard link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2745
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2746
    |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
  2747
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2748
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2749
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2750
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2751
    (sel size > 0) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2752
	(currentDirectory construct:sel) isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2753
	    orgName1 := sel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2754
	]
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2755
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2756
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2757
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2758
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2759
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2760
    box := DialogBox new.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2761
    (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
  2762
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2763
    (box addTextLabel:(resources string:'to:')) adjust:#left.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2764
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2765
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2766
    box addAbortAndOkButtons.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2767
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2768
    orgName1 size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2769
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2770
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2771
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2772
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2773
    box accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2774
	name1 := name1 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2775
	(name1 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2776
	    err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2777
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2778
	    f1 := name1 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2779
	    name2 := name2 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2780
	    (name2 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2781
		err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2782
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2783
		f2 := name2 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2784
		f2 exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2785
		    err := '''%2'' already exists'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2786
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2787
		    f1 exists ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2788
			err := '''%1'' does not exist'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2789
		    ] ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2790
			f1 isDirectory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2791
			    err := '''%1'' is a directory'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2792
			] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2793
			    ErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2794
				err := ex errorString
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2795
			    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2796
				OperatingSystem createHardLinkFrom:name1 to:name2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2797
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2798
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2799
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2800
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2801
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2802
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2803
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2804
	err notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2805
	    self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2806
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2807
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2808
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2809
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2810
    "Modified: / 13.8.1998 / 21:47:01 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2811
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2812
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2813
newSoftLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2814
    "ask for and create a soft link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2815
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2816
    |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
  2817
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2818
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2819
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2820
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2821
    (sel size > 0) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2822
	orgName1 := sel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2823
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2824
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2825
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2826
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2827
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2828
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2829
    (box addTextLabel:'Create symbolic link to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2830
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2831
    (box addTextLabel:'as:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2832
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2833
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2834
    box addAbortAndOkButtons.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2835
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2836
    orgName1 size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2837
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2838
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2839
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2840
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2841
    box accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2842
	name1 := name1 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2843
	(name1 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2844
	    err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2845
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2846
	    f1 := name1 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2847
	    name2 := name2 value.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2848
	    (name2 size == 0) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2849
		err := 'no name entered'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2850
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2851
		f2 := name2 asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2852
		f2 exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2853
		    err := '''%2'' already exists'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2854
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2855
		    f1 exists ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2856
			err := '''%1'' does not exist (link created anyway)'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2857
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2858
		    ErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2859
			err := ex errorString
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2860
		    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2861
			OperatingSystem createSymbolicLinkFrom:name1 to:name2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2862
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2863
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2864
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2865
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2866
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2867
	err notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2868
	    self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2869
	    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2870
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2871
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2872
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2873
    "Modified: / 13.8.1998 / 21:26:59 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2874
    "Created: / 13.8.1998 / 21:47:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2875
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2876
2186
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2877
openASN1Browser
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2878
    self openTool:OSI::ASN1Browser 
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2879
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2880
    "Modified: / 7.9.1998 / 21:31:58 / cg"
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2881
!
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2882
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2883
openAppletViewer
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2884
    |numItems|
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2885
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2886
    (numItems := fileListView selection size) > 2 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2887
	(self 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2888
	    confirm:(resources string:'open for each of the %1 items ?' 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2889
				 with:numItems)) ifFalse:[^ self].
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2890
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2891
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2892
    Java startupJavaSystem.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2893
"/    Java markAllClassesUninitialized.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2894
"/    Java initAllStaticFields.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2895
"/    Java initAllClasses.
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2896
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2897
    self selectedFilesDo:[:fileName |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2898
	|p path|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2899
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2900
	path := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2901
	path isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2902
	    p := Java 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2903
		    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2904
		    argumentString:path pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2905
	    p resume.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2906
	]
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2907
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2908
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2909
    "Modified: / 18.9.1997 / 17:00:59 / stefan"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2910
    "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
  2911
!
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2912
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2913
openChangesBrowser
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2914
    "open a change browser on the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2915
1939
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2916
    self openTool:(UserPreferences current changesBrowserClass)
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2917
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2918
    "Modified: / 17.10.1998 / 14:39:15 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2919
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2920
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2921
openDiffView
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2922
    "open a diff-view"
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2923
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2924
    |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
  2925
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2926
    sel := self getSelectedFileName.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2927
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2928
    orgName1 := ''.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2929
    (sel size > 0
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2930
    and:[lastFileDiffDirectory notNil
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2931
    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
  2932
        f := lastFileDiffDirectory asFilename construct:sel.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2933
        (f exists
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2934
        and:[f isReadable]) ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2935
            orgName1 := f name
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2936
        ]
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2937
    ].
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2938
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2939
    name1 := orgName1 asValue.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2940
    name2 := self getSelectedFileName asValue.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2941
    here := currentDirectory pathName.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2942
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2943
    box := DialogBox new.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2944
    (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
  2945
    box addFilenameInputFieldOn:name1 in:here tabable:true.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2946
    (box addTextLabel:'and file2:') adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2947
    box addFilenameInputFieldOn:name2 in:here tabable:true.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2948
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2949
    box addAbortAndOkButtons.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2950
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2951
    box showAtPointer.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2952
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2953
    box accepted ifTrue:[
2140
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2954
        name1 := name1 value.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2955
        (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
  2956
"/            text1 := subView contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2957
            text1 := subView list asStringCollection withTabs.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2958
            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
  2959
            name1 := nil.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2960
            l1 := 'browser contents'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2961
        ] ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2962
            name1 := currentDirectory filenameFor:name1.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2963
            name1 isReadable ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2964
                nm := name1.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2965
                name1 exists ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2966
                    err := '%1 does not exist'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2967
                ] ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2968
                    err := '%1 is not readable'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2969
                ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2970
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2971
            l1 := name1 pathName
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2972
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2973
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2974
        name2 := currentDirectory filenameFor:name2 value.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2975
        err isNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2976
            name2 isReadable ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2977
                nm := name2.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2978
                name2 exists ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2979
                    err := '%1 does not exist'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2980
                ] ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2981
                    err := '%1 is not readable'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2982
                ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2983
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2984
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2985
        err notNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2986
            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
  2987
            ^ self
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2988
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2989
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2990
        self withWaitCursorDo:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2991
            (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
  2992
                lastFileDiffDirectory := name1 directoryName
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2993
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2994
            name1 notNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2995
                text1 := name1 contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2996
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2997
            text2 := name2 contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2998
            text1 = text2 ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  2999
                self information:'same contents'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3000
            ] ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3001
                d := DiffTextView 
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3002
                        openOn:text1 label:l1
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3003
                        and:text2 label:name2 pathName.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3004
                d label:'file differences'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3005
            ]
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3006
        ]
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3007
    ].
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3008
1735
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  3009
    "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
  3010
    "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
  3011
    "Modified: / 5.5.1999 / 16:04:10 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3012
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3013
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3014
openEditor
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3015
    self openTool:EditTextView
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3016
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3017
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3018
openHTMLReader
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3019
    self openTool:HTMLDocumentView ignoreDirectories:false
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3020
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3021
    "Modified: / 7.9.1998 / 21:31:58 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3022
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3023
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3024
openImageEditor
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3025
    [self loadImageAndPerform:#edit] fork
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3026
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3027
    "Modified: / 17.9.1995 / 17:41:24 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3028
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3029
    "Created: / 13.8.1998 / 22:07:09 / cg"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3030
    "Modified: / 7.9.1998 / 21:31:41 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3031
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3032
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3033
openImageInspector
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3034
    [self loadImageAndPerform:#inspect] fork
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3035
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3036
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3037
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3038
    "Modified: / 7.9.1998 / 21:31:30 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3039
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3040
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3041
openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3042
    [self loadImageAndPerform:[:img |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3043
				|i top viewer|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3044
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3045
				top := StandardSystemView new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3046
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3047
				viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3048
				i := img.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3049
				top extent:200@200.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3050
				top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3051
				top openAndWait.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3052
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3053
				(i width > 200 or:[i height > 200]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3054
				    i := i magnifiedPreservingRatioTo:200@200.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3055
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3056
				viewer image:i.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3057
			      ].
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3058
    ] fork
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3059
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3060
    "Modified: / 4.12.1998 / 15:49:03 / cg"
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3061
!
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3062
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3063
openSelectedFilename
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3064
    |sel|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3065
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3066
    sel := subView selection.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3067
    sel notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3068
	sel := sel asString withoutSeparators.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3069
	sel asFilename exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3070
	    self doOpenFile:sel viaDoubleClick:false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3071
	]
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3072
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3073
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3074
    "Created: / 4.2.1999 / 17:40:42 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3075
    "Modified: / 4.2.1999 / 17:47:06 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3076
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3077
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3078
openTerminal
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  3079
    VT100TerminalView openShellIn:currentDirectory
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3080
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3081
    "Created: / 20.7.1998 / 18:18:15 / cg"
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  3082
    "Modified: / 20.7.1998 / 18:32:28 / cg"
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3083
!
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3084
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3085
openTool:aToolClass
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3086
    "open a tool on the selected file(s)"
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3087
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3088
    ^ self openTool:aToolClass ignoreDirectories:true
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3089
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3090
    "Modified: / 7.9.1998 / 19:32:10 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3091
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3092
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3093
openTool:aToolClass ignoreDirectories:ignoreDirs
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3094
    "open a tool on the selected file(s)"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3095
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3096
    |numItems path tool|
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3097
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3098
    aToolClass isNil ifTrue:[
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3099
        self warn:'Sorry, that tool seems to be not available'.
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3100
        ^ nil.
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3101
    ].
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3102
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3103
    (numItems := fileListView selection size) > 2 ifTrue:[
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3104
        (self 
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3105
            confirm:(resources string:'open for each of the %1 items ?' 
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3106
                                 with:numItems)) ifFalse:[^ self].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3107
    ].
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3108
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3109
    self selectedFilesDo:[:fileName |
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3110
        path := currentDirectory filenameFor:fileName.
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3111
        (ignoreDirs not
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3112
        or:[path isDirectory not]) ifTrue:[
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3113
            tool := aToolClass openOn:(path pathName).
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3114
        ]
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3115
    ].
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3116
    ^ tool
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3117
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3118
    "Modified: / 18.9.1997 / 17:06:18 / stefan"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3119
    "Created: / 7.9.1998 / 19:31:49 / cg"
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3120
    "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
  3121
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3122
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3123
openZipTool
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3124
    |zipTool|
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3125
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3126
    (zipTool := self openTool:ZipTool) notNil ifTrue:[
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3127
        zipTool initialExtractDirectory:currentDirectory
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3128
    ].
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3129
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3130
    "Created: / 26.8.1998 / 16:20:55 / cg"
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3131
    "Modified: / 25.5.1999 / 16:30:54 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3132
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3133
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3134
readAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3135
    |sel|
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3136
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3137
    sel := self singleSelectedFile.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3138
    sel notNil ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3139
        Smalltalk installAutoloadedClassesFrom:sel
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3140
    ].
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3141
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3142
    "Created: / 4.2.1999 / 17:40:42 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3143
    "Modified: / 29.1.2000 / 13:10:01 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3144
!
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3145
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3146
showOrHideTabView
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3147
    "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
  3148
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3149
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3150
	tabRulerView isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3151
	    self createTabRulerIn:scrollView superView.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3152
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3153
	tabRulerView beVisible.
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3154
        
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3155
	false "self is3D" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3156
	    scrollView topInset:(tabRulerView superView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3157
	    tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3158
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3159
	    scrollView topInset:(tabRulerView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3160
	    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3161
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3162
	tabRulerView hiddenTabs:#(1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3163
	tabRulerView fixedTabs:#(1).
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3164
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3165
	tabRulerView notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3166
	    tabRulerView beInvisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3167
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3168
	scrollView topInset:0
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3169
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3170
    tabSpec := nil.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3171
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3172
    "Created: / 19.4.1997 / 09:50:02 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3173
    "Modified: / 4.8.1998 / 13:44:14 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3174
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3175
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3176
!FileBrowser methodsFor:'help '!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3177
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3178
helpTextFor:aComponent
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3179
    |s|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3180
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3181
    aComponent == subView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3182
	s := 'HELP_SUBVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3183
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3184
    aComponent == fileListView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3185
	s := 'HELP_FILELIST'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3186
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3187
    aComponent == filterField ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3188
	s := 'HELP_FILTER'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3189
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3190
    aComponent == labelView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3191
	s := 'HELP_PATHFIELD'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3192
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3193
    aComponent == commandView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3194
	s := 'HELP_COMMANDVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3195
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3196
    s notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3197
	^ resources string:s
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3198
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3199
    ^ nil
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3200
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3201
2116
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3202
!FileBrowser methodsFor:'initialize / release'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3203
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3204
createTabRulerIn:topFrame
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3205
    |v|
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3206
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3207
    false "self is3D" ifTrue:[
2256
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3208
        v := View in:topFrame.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3209
        v level:-1.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3210
        tabRulerView := TabSpecRuler in:v.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3211
        tabRulerView level:1.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3212
        v origin:(0.0@0.0) corner:(1.0@10).
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3213
        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
  3214
    ] ifFalse:[
2256
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3215
        tabRulerView := TabSpecRuler in:topFrame.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3216
        tabRulerView origin:(0.0@0.0) corner:(1.0@10).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3217
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3218
    tabRulerView borderWidth:0.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3219
    tabRulerView synchronousOperation:true.
2256
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3220
    tabRulerView masterView:scrollView scrolledView
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3221
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3222
    "Created: / 27.7.1998 / 20:23:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3223
    "Modified: / 27.7.1998 / 20:30:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3224
!
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3225
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3226
currentDirectory:aDirectoryPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3227
    "set the directory to be browsed"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3228
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3229
    |newDirectory|
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3230
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3231
    newDirectory := aDirectoryPath asFilename.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3232
    newDirectory = currentDirectory ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3233
        ^ self
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3234
    ].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3235
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3236
    currentDirectory := aDirectoryPath asFilename.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3237
    self changed:#path.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3238
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3239
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3240
     tell my subview (whatever that is) to start its file-dialog
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3241
     (i.e. save-as etc.) in that directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3242
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3243
    (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
  3244
        subView directoryForFileDialog:currentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3245
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3246
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3247
    "Modified: 16.9.1997 / 14:56:17 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3248
    "Modified: 21.9.1997 / 11:28:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3249
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3250
2116
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3251
destroy
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3252
    "destroy view and boxes"
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3253
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3254
    ObjectMemory removeDependent:self.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3255
    self stopUpdateProcess.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3256
    self stopImageRenderProcess.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3257
    checkBlock := nil.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
    super destroy
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
    "Modified: 19.4.1997 / 13:51:48 / cg"
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
!
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3262
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3263
focusSequence
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3264
    "return the sequence in which ALT-CursorRight steps focus"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3265
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3266
    |fs|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3267
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3268
    fs := Array 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3269
	with:labelView
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3270
	with:filterField 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3271
	with:fileListView 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3272
	with:subView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3273
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3274
    commandView notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3275
	fs := fs copyWith:commandView
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3276
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3277
    ^fs
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3278
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3279
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3280
initEvents
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3281
    super initEvents.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3282
    self enableEvent:#visibilityChange.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3283
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3284
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3285
initialize
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3286
    |frame spacing halfSpacing v topFrame labelFrame filterModel
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3287
     buttonPanel img mH menuPanel lowerFrame|
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3288
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3289
    super initialize.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3290
819
b78a26650047 initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
  3291
    fileEncoding := #iso8859.        "/ native ST/X encoding
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  3292
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3293
    "if true, will replace leading spaces by tabs on
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3294
     file write. If false, they will be written as spaces
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3295
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3296
    compressTabs := resources at:'COMPRESS_TABS' default:true.
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3297
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3298
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3299
     showing long or short by default
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3300
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3301
    "/ showLongList := resources at:'LONG_LIST' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3302
    showingDetails := (resources at:'LONG_LIST' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3303
    showingDetails onChangeSend:#detailsSettingChanged to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3304
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3305
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3306
     show hidden files or not ?
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3307
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3308
    "/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3309
    showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3310
    showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3311
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3312
    "
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3313
     showing small icons by default
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3314
    "
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3315
    showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3316
    showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3317
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3318
    sortByWhat := #name asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3319
    sortByWhat onChangeSend:#sortChanged to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3320
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3321
    sortCaseless := (Filename isCaseSensitive not) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3322
    sortCaseless onChangeSend:#updateCurrentDirectory to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3323
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3324
    dosEOLMode := false asValue.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3325
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3326
    lockUpdate := false.
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3327
132
claus
parents: 126
diff changeset
  3328
    CommandHistory isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3329
        CommandHistory := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3330
        CommandHistorySize := 50
132
claus
parents: 126
diff changeset
  3331
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3332
    DirectoryHistory isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3333
        DirectoryHistory := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3334
        DirectoryHistoryWhere := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3335
        HistorySize := 15.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3336
    ].
132
claus
parents: 126
diff changeset
  3337
    commandIndex := 0.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3338
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  3339
    icons := Dictionary new.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3340
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3341
    Icons isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3342
        self class initializeIcons
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3343
    ].
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3344
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3345
    myName := (resources string:self class name).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3346
    self label:myName.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3347
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3348
    menuPanel := MenuPanel in:self.
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  3349
    menuPanel level:1.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3350
    menuPanel verticalLayout:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3351
    menuPanel receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3352
    menuPanel menu:(self pullDownMenu).
2050
5ef6404d6172 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2048
diff changeset
  3353
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3354
    mH := menuPanel preferredExtent y.
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3355
    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
  3356
93
claus
parents: 85
diff changeset
  3357
    labelFrame := View 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3358
                        origin:(0.0 @ mH)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3359
                        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
  3360
                        in:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3361
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3362
    (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
  3363
        labelFrame level:1.
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3364
"/        labelFrame rightInset:-1.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3365
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3366
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3367
    spacing := ViewSpacing.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3368
    halfSpacing := spacing // 2.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3369
1100
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3370
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3371
      checkBlock is executed by the Processor every checkDelta seconds.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3372
      We use #pushEvent: to perform the directory update
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3373
      in our windowgroups process.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3374
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3375
    checkBlock := [self pushEvent:#checkIfDirectoryHasChanged].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3376
    checkDelta := resources at:'CHECK_DELTA' default:10.
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  3377
    doAutoUpdate := true asValue.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3378
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3379
    currentDirectory := Filename currentDirectory.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3380
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3381
    filterModel := '*' asValue.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3382
    filterField := EditField in:labelFrame.
1071
Claus Gittinger <cg@exept.de>
parents: 1040
diff changeset
  3383
    filterField 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3384
        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
  3385
        corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ).
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3386
    filterField rightInset:(ViewSpacing - halfSpacing).
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3387
    filterField model:filterModel.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3388
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3389
    labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)).
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3390
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3391
    self initializeFilterPattern.
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3392
    filterModel onChangeSend:#filterPatternChanged to:self.
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3393
"/    filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3394
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3395
"/    labelView := Label in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3396
"/    labelView origin:(halfSpacing @ halfSpacing)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3397
"/              extent:[((width // 4 * 3) - spacing - borderWidth)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3398
"/                       @
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3399
"/                       (filterField heightIncludingBorder)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3400
"/                       "(font height + font descent)"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3401
"/                     ].
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3402
"/    labelView adjust:#right.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3403
"/    labelView borderWidth:0.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3404
"/    labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3405
"/    labelFrame model:self; menu:#labelMenu.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3406
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3407
    labelView := FilenameEditField in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3408
    labelView 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3409
        origin:(halfSpacing @ (halfSpacing))
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3410
        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
  3411
                @
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3412
                (filterField heightIncludingBorder)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3413
                "(font height + font descent)"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3414
               ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3415
    labelView menu:#labelMenu; 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3416
            aspect:#path; changeMessage:#pathChanged:.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3417
    labelView model:self.
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3418
    labelView acceptOnExpand:true.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3419
    labelView backgroundColor:(labelFrame viewBackground).
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  3420
    labelFrame model:self; menu:#labelMenu.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3421
    labelView cursorType:#solidCaret; cursorTypeNoFocus:#none.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3422
    labelView level:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3423
    labelView borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3424
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3425
    killButton := Button label:(resources string:'kill') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3426
"/    killButton origin:(halfSpacing @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3427
"/               extent:(killButton width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3428
    killButton origin:(halfSpacing @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3429
    killButton topInset:(killButton height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3430
    killButton beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3431
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3432
    pauseToggle := Toggle label:(resources string:'pause') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3433
"/    pauseToggle origin:((killButton corner x + 50) @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3434
"/                extent:(pauseToggle width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3435
    pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3436
    pauseToggle topInset:(pauseToggle height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3437
    pauseToggle beInvisible.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3438
132
claus
parents: 126
diff changeset
  3439
    self initializeCommandViewIn:self.
claus
parents: 126
diff changeset
  3440
claus
parents: 126
diff changeset
  3441
"/    frame := VariableVerticalPanel
claus
parents: 126
diff changeset
  3442
"/                 origin:[frame borderWidth negated 
claus
parents: 126
diff changeset
  3443
"/                         @ 
claus
parents: 126
diff changeset
  3444
"/                         labelFrame height
claus
parents: 126
diff changeset
  3445
"/                         "/ (labelView height + labelView origin y + spacing)
claus
parents: 126
diff changeset
  3446
"/                        ]
claus
parents: 126
diff changeset
  3447
"/                 corner:(1.0 @ 1.0)
claus
parents: 126
diff changeset
  3448
"/                     in:self.
claus
parents: 126
diff changeset
  3449
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3450
    frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self.
132
claus
parents: 126
diff changeset
  3451
    frame topInset:labelFrame height.
claus
parents: 126
diff changeset
  3452
    commandView notNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3453
        frame bottomInset:(commandView height + spacing + spacing)
132
claus
parents: 126
diff changeset
  3454
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3455
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3456
    topFrame := View in:frame.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3457
    topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3458
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3459
false ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3460
    self createTabRulerIn:topFrame.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3461
].
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3462
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3463
    scrollView := ScrollableView in:topFrame.
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3464
    scrollView 
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3465
        verticalScrollable:true;
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3466
        verticalMini:false;
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3467
        horizontalScrollable:true;
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3468
        horizontalMini:true;
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3469
        autoHideHorizontalScrollBar:true;
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3470
        autoHideVerticalScrollBar:false;
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3471
        origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3472
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3473
    fileListView := SelectionInListView new.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3474
    scrollView scrolledView:fileListView.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3475
    fileListView action:[:lineNr | self fileSelect:lineNr].
1326
aab1605ad945 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  3476
    fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3477
    fileListView multipleSelectOk:true.
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  3478
    fileListView delegate:self.
98
claus
parents: 93
diff changeset
  3479
    fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu.
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  3480
    fileListView allowDrag:true.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3481
    fileListView dragObjectConverter:[:obj | 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3482
                                        |dir nm path idx|
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3483
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3484
                                        nm := obj theObject asString.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3485
                                        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
  3486
                                        idx == 0 ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3487
                                            "/ cannot happen ...
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3488
                                            nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3489
                                        ] ifFalse:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3490
                                            nm := fileList at:idx.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3491
                                            dir := currentDirectory pathName asFilename.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3492
                                            path := dir constructString:nm.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3493
                                            DropObject newFile:path.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3494
                                        ]
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3495
                                     ].
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3496
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3497
    "/ sigh - must be delayed - origin is not yet fixe
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3498
"/    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3499
"/    self showOrHideTabView.
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3500
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3501
    lowerFrame := View in:frame.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3502
    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
  3503
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3504
    v := self initializeSubViewIn:lowerFrame.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3505
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3506
    subView := v scrolledView.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3507
    (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
  3508
        subView directoryForFileDialog:currentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3509
    ].
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3510
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3511
"/    buttonPanel := HorizontalPanelView in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3512
"/    buttonPanel horizontalLayout:#leftSpace.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3513
"/    buttonPanel verticalSpace:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3514
"/    "/ buttonPanel verticalLayout:#top.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3515
"/    buttonPanel borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3516
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3517
"/    buttonPanel 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3518
"/        origin:(0.5 @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3519
"/        extent:[((width // 4) - spacing - borderWidth)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3520
"/                @
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3521
"/                (buttonPanel preferredExtent y max:(labelView height))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3522
"/               ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3523
"/    "/ buttonPanel level:-1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3524
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3525
"/    upButton := Button in:buttonPanel.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3526
"/    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
  3527
"/    upButton label:(img ? 'up').
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3528
"/    upButton action:[self changeToParentDirectory].
1328
9588cd743755 Fix kill and pause buttons.
Stefan Vogel <sv@exept.de>
parents: 1327
diff changeset
  3529
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3530
    ObjectMemory addDependent:self.
132
claus
parents: 126
diff changeset
  3531
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3532
    "Modified: / 6.9.1995 / 20:26:06 / claus"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3533
    "Modified: / 16.9.1997 / 14:52:46 / stefan"
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3534
    "Modified: / 12.7.1999 / 12:59:47 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3535
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3536
132
claus
parents: 126
diff changeset
  3537
initializeCommandViewIn:frame
claus
parents: 126
diff changeset
  3538
    "set up the command view - can be redefined in subclasses as empty,
claus
parents: 126
diff changeset
  3539
     if no commandView is wanted"
claus
parents: 126
diff changeset
  3540
claus
parents: 126
diff changeset
  3541
claus
parents: 126
diff changeset
  3542
    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
  3543
    commandView allInset:ViewSpacing//2.
132
claus
parents: 126
diff changeset
  3544
    commandView topInset:(commandView preferredExtent y negated - ViewSpacing).
claus
parents: 126
diff changeset
  3545
133
claus
parents: 132
diff changeset
  3546
"/    commandView contents:'** no commands which require input here **'.
132
claus
parents: 126
diff changeset
  3547
142
claus
parents: 139
diff changeset
  3548
    commandView entryCompletionBlock:[:contents |
2522
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3549
        |newString|
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3550
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3551
        newString := Filename 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3552
                        filenameCompletionFor:contents 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3553
                        directory:currentDirectory 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3554
                        directoriesOnly:false 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3555
                        filesOnly:false 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3556
                        ifMultiple:[:dir | commandView flash.].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3557
        commandView contents:newString.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3558
        commandView cursorToEndOfLine.
132
claus
parents: 126
diff changeset
  3559
    ].
claus
parents: 126
diff changeset
  3560
    commandView leaveAction:[:key | 
2522
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3561
        |cmd nCmd empty|
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3562
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3563
        (key == #CursorDown 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3564
        or:[key == #CursorUp]) ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3565
            nCmd := CommandHistory size.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3566
            nCmd == 0 ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3567
                empty := true
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3568
            ] ifFalse:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3569
                key == #CursorUp ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3570
                    commandIndex == nCmd ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3571
                        commandView flash.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3572
                    ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3573
                    commandIndex := (commandIndex + 1) min:nCmd
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3574
                ] ifFalse:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3575
                    commandIndex == 1 ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3576
                        commandView flash.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3577
                        empty := true.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3578
                    ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3579
                    commandIndex := (commandIndex - 1) max:1.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3580
                ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3581
            ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3582
            empty == true ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3583
                commandView contents:nil
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3584
            ] ifFalse:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3585
                commandView contents:(CommandHistory at:commandIndex).
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3586
            ]        
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3587
        ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3588
        key == #Return ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3589
            cmd := commandView contents string.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3590
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3591
            subView insertLine:(
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3592
                                Text string:('>> ' , cmd)
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3593
                                     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
  3594
"/                                ColoredListEntry string:('>> ' , cmd) color:Color blue
2522
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3595
                                )
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3596
                    before:(subView cursorLine).
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3597
            subView cursorDown:1.
133
claus
parents: 132
diff changeset
  3598
claus
parents: 132
diff changeset
  3599
"/            subView insertStringAtCursor:cmd.
claus
parents: 132
diff changeset
  3600
"/            subView insertCharAtCursor:(Character cr).
132
claus
parents: 126
diff changeset
  3601
2522
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3602
            (cmd notNil and:[cmd notEmpty]) ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3603
                self class addToCommandHistory:cmd for:nil.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3604
                self doExecuteCommand:cmd replace:false.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3605
                commandView contents:nil.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3606
                commandIndex := 0
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3607
            ]
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3608
        ]
132
claus
parents: 126
diff changeset
  3609
    ].
claus
parents: 126
diff changeset
  3610
133
claus
parents: 132
diff changeset
  3611
    "Modified: 7.9.1995 / 15:48:45 / claus"
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  3612
    "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
  3613
    "Modified: 18.9.1997 / 16:55:01 / stefan"
132
claus
parents: 126
diff changeset
  3614
!
claus
parents: 126
diff changeset
  3615
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3616
initializeFilterPattern
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3617
    "set an initial matchpattern - can be redefined in subclasses"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3618
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3619
    filterField model value:'*'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3620
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3621
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3622
initializeSubViewIn:frame
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3623
    "set up the contents view - can be redefined in subclasses for
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3624
     different view types (SoundFileBrowser/ImageBrowsers etc.)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3625
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3626
    |textView|
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3627
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3628
    textView := HVScrollableView 
2572
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3629
        for:CodeView 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3630
        miniScrollerH:true 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3631
        miniScrollerV:false 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3632
        in:frame.
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3633
    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
  3634
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3635
"/    imagePreviewView := HVScrollableView 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3636
"/        for:ImageView 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3637
"/        miniScrollerH:true 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3638
"/        miniScrollerV:false 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3639
"/        in:frame.
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3640
"/    imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3641
"/
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3642
"/    imagePreviewView beInvisible.
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3643
2572
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3644
    textView doItAction:[:theCode |
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3645
        PositionableStream currentFileInDirectoryQuerySignal 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3646
        answer:(currentDirectory asFilename)
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3647
        do:[
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3648
            Compiler 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3649
                evaluate:theCode 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3650
                in:nil 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3651
                receiver:nil 
2607
fa77c15f43bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  3652
                notifying:textView 
2572
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3653
                logged:true 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3654
                ifFail:nil
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3655
        ]
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3656
    ].
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3657
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3658
    ^ textView.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3659
!
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3660
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3661
postRealize
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3662
    super postRealize.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3663
    self showOrHideTabView.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3664
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3665
    "Created: 24.7.1997 / 18:13:46 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3666
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3667
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3668
!FileBrowser methodsFor:'menu actions'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3669
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3670
copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3671
    "copy the command history to the clipBoard"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3672
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3673
    self setTextSelection:(CommandHistory asStringCollection asString).
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3674
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3675
    "Modified: / 29.10.1998 / 12:17:14 / cg"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3676
!
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3677
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3678
copyFileList
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3679
    "copy fileList to the clipBoard"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3680
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3681
    self setTextSelection:(fileListView list 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3682
			      collect:[:l | |ll|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3683
					ll := l string withoutSeparators.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3684
					(ll endsWith:' ...') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3685
					    ll copyWithoutLast:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3686
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3687
					    ll
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3688
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3689
				      ]) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3690
				asStringCollection asString.
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3691
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3692
    "Modified: / 17.8.1998 / 10:13:10 / cg"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3693
!
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3694
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3695
copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3696
    "copy the selected filename to the clipBoard (for easy paste)"
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3697
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3698
    |sel fileName|
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3699
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3700
    sel := fileListView selection.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3701
    sel size == 1 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3702
	fileName := fileList at:sel first.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3703
	self setTextSelection:fileName
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3704
    ].
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3705
!
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3706
2562
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3707
createProjectAndOpenProjectBrowser
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3708
    |nm f s|
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3709
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3710
    nm := currentDirectory baseName.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3711
    f := (currentDirectory construct:nm) withSuffix:'prj'.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3712
    f exists ifTrue:[
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3713
        self warn:'A file named ' , f baseName , ' alredy exists.'.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3714
        ^ self.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3715
    ].
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3716
    s := f writeStream.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3717
    s nextPutAll:'
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3718
name            ''' , nm , '''
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3719
type            #classLibrary
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3720
package         #''private:' , nm , '''
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3721
prerequisites   nil
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3722
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3723
classes      #( )
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3724
'.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3725
    s close.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3726
    ProjectBrowser openOnFile:f.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3727
!
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3728
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3729
menuExit
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3730
    self closeRequest
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3731
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3732
    "Created: / 4.8.1998 / 13:41:38 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3733
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3734
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3735
menuOSCommand
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3736
    self fileExecute
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3737
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3738
    "Created: / 4.8.1998 / 14:06:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3739
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3740
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3741
menuOpen
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3742
    "same as a double-click"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3743
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3744
    "Modified: / 4.8.1998 / 13:42:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3745
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3746
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3747
menuShowFileBrowserDocumentation
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3748
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3749
    "Created: / 4.8.1998 / 14:03:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3750
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3751
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3752
openAboutThisApplication
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3753
    "opens an about box for this application."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3754
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3755
    |rev box myClass clsRev image msg|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3756
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3757
    rev := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3758
    myClass := self class.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3759
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3760
    (clsRev := myClass revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3761
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3762
    msg := '\' withCRs , myClass name asBoldText, rev.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3763
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3764
    AboutBox isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3765
	"/ this handles bad installations of ST/X,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3766
	"/ where the AboutBox is missing.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3767
	"/ (May vanish in the future)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3768
	^ self information:msg
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3769
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3770
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3771
    box := AboutBox title:msg.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3772
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3773
    image := self class defaultIcon.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3774
    image notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3775
	box image:image
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3776
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3777
    box   label:'About This Application'.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3778
    box   autoHideAfter:10 with:[].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3779
    box   showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3780
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3781
    "Modified: / 14.8.1998 / 13:20:24 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3782
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3783
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3784
openHTMLDocument:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3785
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3786
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3787
    "Created: / 4.8.1998 / 14:06:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3788
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3789
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3790
pullDownMenu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3791
    "return the top (pullDown) menu"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3792
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3793
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3794
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3795
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3796
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3797
    m := self class menuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3798
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3799
    m receiver:self.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  3800
    m findGuiResourcesIn:self.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3801
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3802
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3803
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3804
    "Created: / 14.8.1998 / 14:14:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3805
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3806
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3807
showAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3808
    ToolApplicationModel openAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3809
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3810
    "Created: / 14.8.1998 / 13:18:41 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3811
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3812
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3813
sortChanged
2020
7c9afb53b8a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
  3814
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3815
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3816
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3817
    "Created: / 14.8.1998 / 16:17:20 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3818
    "Modified: / 14.8.1998 / 16:44:00 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3819
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3820
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3821
!FileBrowser methodsFor:'menu actions - cvs'!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3822
2424
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3823
cvsAddSelection
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3824
    "add files (or all in current directory)"
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3825
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3826
    |sel log|
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3827
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3828
    log := Dialog
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3829
        requestText:(resources string:'enter initial log message')
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3830
        lines:10
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3831
        columns:70
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3832
        initialAnswer:nil.
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3833
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3834
    log notNil ifTrue:[
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3835
        sel := fileListView selection.
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3836
        sel size > 0 ifTrue:[
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3837
            sel := sel collect:[:rawIndex | fileList at:rawIndex].
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3838
            sel do:[:fn |
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3839
                self
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3840
                    doExecuteCommand:('cvs add -m ''' , log , ''' ' , fn) replace:false
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3841
            ]
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3842
        ] ifFalse:[
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3843
            self
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3844
                doExecuteCommand:('cvs add -l -m ''' , log , ''' *') replace:false
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3845
        ].
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3846
    ]
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3847
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3848
    "Modified: / 16.12.1998 / 17:30:31 / cg"
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3849
!
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  3850
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3851
cvsCommitSelection
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3852
    "commit files (or all in current directory)"
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3853
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3854
    |sel log|
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3855
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3856
    log := Dialog
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3857
        requestText:(resources string:'enter log message')
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3858
        lines:10
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3859
        columns:70
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3860
        initialAnswer:nil.
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3861
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3862
    log notNil ifTrue:[
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3863
        sel := fileListView selection.
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3864
        sel size > 0 ifTrue:[
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3865
            sel := sel collect:[:rawIndex | fileList at:rawIndex].
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3866
            sel do:[:fn |
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3867
                self
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3868
                    doExecuteCommand:('cvs commit -m ''' , log , ''' ' , fn) replace:false
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3869
            ]
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3870
        ] ifFalse:[
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3871
            self
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3872
                doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3873
        ].
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3874
    ]
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3875
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3876
    "Modified: / 16.12.1998 / 17:30:31 / cg"
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3877
!
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  3878
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3879
cvsRemoveFileAndContainer
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3880
    "remove the selected file(s) and their CVS containers.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3881
     Query if user really wants to really remove them."
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3882
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3883
    |sel q|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3884
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3885
    sel := fileListView selection.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3886
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3887
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3888
	sel size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3889
	    q := resources string:'remove %1 selected files and CVS containers ?' with:(sel size)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3890
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3891
	    q := resources string:'remove ''%1'' and CVS container ?' with:(sel first asText allBold)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3892
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3893
	(self sensor shiftDown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3894
	or:[self ask:q yesButton:'remove']) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3895
	    self withCursor:(Cursor wait) do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3896
		self doRemoveAndRemoveFromCVS:sel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3897
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3898
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3899
    ]
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3900
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3901
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3902
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3903
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3904
cvsUpdateDirectoryLocal
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3905
    "update this directory"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3906
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3907
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3908
	doExecuteCommand:'cvs upd -l' replace:false
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3909
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3910
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3911
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3912
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3913
cvsUpdateDirectoryRecursive
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3914
    "update this directory"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3915
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3916
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3917
	doExecuteCommand:'cvs upd -d' replace:false
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3918
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3919
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3920
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3921
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3922
cvsUpdateSelection
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3923
    "update selected files"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3924
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3925
    |sel|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3926
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3927
    sel := fileListView selection.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3928
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3929
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3930
	sel do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3931
	    self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3932
		doExecuteCommand:('cvs upd ' , fn) replace:false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3933
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3934
    ].
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3935
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3936
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3937
doRemoveAndRemoveFromCVS:filesToRemove
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3938
    "remove the selected file(s) and their CVS containers - no questions asked"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3939
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3940
    |msg idx needUpdate toRemove updateRunning yesToAll|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3941
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3942
    updateRunning := listUpdateProcess notNil.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3943
    self stopUpdateProcess.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3944
    toRemove := OrderedCollection new.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3945
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3946
    "/
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3947
    "/ did the directory change in the meanwhile ?
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3948
    "/
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3949
    needUpdate := (currentDirectory modificationTime > timeOfLastCheck).
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3950
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3951
    yesToAll := false.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3952
    lockUpdate := true.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3953
    [
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3954
	filesToRemove do:[:fileName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3955
	    |f|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3956
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3957
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3958
	    OperatingSystem accessDeniedErrorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3959
		"was not able to remove it"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3960
		msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3961
		self showAlert:msg with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3962
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3963
		|answer contents|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3964
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3965
		(f isSymbolicLink not) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3966
		    self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3967
			doExecuteCommand:('cvs remove -f ' , f baseName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3968
			replace:false.
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3969
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3970
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3971
		self show:nil
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3972
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3973
		    idx := fileList indexOf:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3974
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3975
			toRemove add:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3976
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3977
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3978
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3979
	].
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  3980
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3981
	lockUpdate := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3982
	fileListView setSelection:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3983
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3984
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3985
	"/ remove reverse - otherwise indices are wrong
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3986
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3987
	toRemove sort.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3988
	toRemove reverseDo:[:idx |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3989
	    fileList removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3990
	    fileListView removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3991
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3992
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3993
	updateRunning ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3994
	    self updateCurrentDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3995
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3996
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3997
	     install a new check after some time
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3998
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3999
	    needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4000
	    Processor removeTimedBlock:checkBlock.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4001
	    Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4002
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4003
    ].
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4004
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4005
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4006
	doExecuteCommand:('cvs commit -m ''removed via FileBrowser''')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4007
	replace:false.
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4008
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4009
    "Modified: / 21.10.1998 / 17:02:11 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4010
! !
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4011
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4012
!FileBrowser methodsFor:'misc user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4013
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4014
closeRequest
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4015
    "exit FileBrowser"
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4016
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4017
    (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
  4018
	      yesButton:'close') 
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4019
    ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4020
	"/ self windowGroup closeDownViews.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4021
	super closeRequest
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4022
    ]
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4023
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4024
    "Created: / 3.8.1998 / 19:55:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4025
    "Modified: / 4.8.1998 / 18:21:03 / cg"
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4026
!
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4027
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4028
discardChangesDialog
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4029
    "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
  4030
     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
  4031
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4032
    ^ 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
  4033
	       yesButton:'change'
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4034
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4035
    "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
  4036
!
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4037
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4038
filterPatternChanged
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4039
    fileListView scrollToTop.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4040
    fileListView deselect.
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4041
    self updateCurrentDirectory
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4042
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4043
    "Modified: / 3.10.1998 / 18:23:34 / cg"
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4044
!
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4045
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4046
update:what with:someArgument from:changedObject
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4047
    realized ifFalse:[^ self].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4048
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4049
    (what == #aboutToExit) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4050
	"system wants to shut down this
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4051
	 - 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
  4052
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4053
	(subView modified and:[subView contentsWasSaved not]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4054
	    self raiseDeiconified.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4055
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4056
	    (self 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4057
		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
  4058
		yesButton:'save'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4059
		noButton:'don''t save')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4060
	    ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4061
		subView acceptAction notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4062
		    subView accept
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4063
		] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4064
		    subView save
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4065
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4066
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4067
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4068
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4069
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4070
    changedObject == tabSpec ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4071
	fileListView invalidate
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4072
    ].
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4073
585
be0241bf7268 use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 564
diff changeset
  4074
    "Modified: 29.5.1996 / 16:13:43 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4075
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4076
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4077
!FileBrowser methodsFor:'pathField user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4078
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4079
addDirToJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4080
    "add the current path to javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4081
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4082
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4083
    Java addToClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4084
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4085
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4086
    "Created: 1.8.1997 / 21:25:22 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4087
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4088
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4089
addDirToJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4090
    "add the current path to javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4091
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4092
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4093
    Java addToSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4094
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4095
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4096
    "Created: 2.8.1997 / 14:11:19 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4097
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4098
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4099
changeCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4100
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4101
     otherwise ask for & change to that directory"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4102
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4103
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4104
	self queryForDirectoryToChange
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4105
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4106
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4107
    "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
  4108
    "Modified: 2.10.1997 / 14:09:02 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4109
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4110
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4111
changeDirectoryTo:aDirectoryName
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4112
    "sent from label menu to change back to a previous directory"
132
claus
parents: 126
diff changeset
  4113
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4114
    self discardChangesDialog ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4115
	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
  4116
    ].
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4117
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4118
    "Modified: / 2.10.1997 / 14:09:24 / stefan"
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4119
    "Modified: / 21.7.1998 / 16:38:03 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4120
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4121
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4122
changeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4123
    "if text was modified show a queryBox, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4124
     otherwise change immediately to the default directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4125
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4126
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4127
	 self doChangeToDefaultDirectory
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4128
    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4129
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4130
    "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
  4131
    "Modified: 2.10.1997 / 14:09:33 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4132
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4133
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4134
changeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4135
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4136
     otherwise change immediately to the home directory"
132
claus
parents: 126
diff changeset
  4137
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4138
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4139
	 self doChangeToHomeDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4140
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4141
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4142
    "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
  4143
    "Modified: 2.10.1997 / 14:09:42 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4144
!
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  4145
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4146
changeToParentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4147
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4148
     otherwise change immediately to the parent directory"
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  4149
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4150
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4151
	 self doChangeToParentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4152
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4153
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4154
    "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
  4155
    "Modified: 2.10.1997 / 14:09:55 / stefan"
98
claus
parents: 93
diff changeset
  4156
!
claus
parents: 93
diff changeset
  4157
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4158
copyPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4159
    "copy current path into cut & paste buffer"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4160
873
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  4161
    self setTextSelection:currentDirectory pathName
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  4162
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  4163
    "Modified: 14.12.1996 / 15:37:47 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4164
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4165
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4166
fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4167
    "add the current path to javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4168
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4169
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4170
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4171
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4172
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4173
    f isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4174
	^ self addDirToJavaClassPath
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4175
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4176
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4177
    Java addToClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4178
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4179
    "Created: / 9.11.1998 / 05:41:34 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4180
    "Modified: / 9.11.1998 / 05:56:00 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4181
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4182
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4183
fileAddToJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4184
    "add the current path to javas sourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4185
     (only available with ST/J System"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4186
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4187
    |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4188
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4189
    f := self getSelectedFileName.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4190
    f isNil ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4191
        ^ self addDirToJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4192
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4193
    f := currentDirectory asFilename construct:f.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4194
    Java addToSourcePath:(f pathName)
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4195
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4196
    "Created: / 9.11.1998 / 05:41:34 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4197
    "Modified: / 9.11.1998 / 05:56:00 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4198
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4199
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4200
fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4201
    "remove the current path from javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4202
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4203
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4204
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4205
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4206
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4207
    f isNil ifTrue:[
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4208
        ^ self removeDirFromJavaClassPath
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4209
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4210
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4211
    Java removeFromClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4212
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4213
    "Created: / 9.11.1998 / 05:42:05 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4214
    "Modified: / 9.11.1998 / 05:56:14 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4215
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4216
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4217
fileRemoveFromJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4218
    "remove the current path from javas sourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4219
     (only available with ST/J System"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4220
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4221
    |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4222
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4223
    f := self getSelectedFileName.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4224
    f isNil ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4225
        ^ self removeDirFromJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4226
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4227
    f := currentDirectory asFilename construct:f.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4228
    Java removeFromSourcePath:(f pathName)
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4229
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4230
    "Created: / 9.11.1998 / 05:42:05 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4231
    "Modified: / 9.11.1998 / 05:56:14 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4232
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4233
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4234
labelMenu
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4235
    "return the popUpMenu for the path label"
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4236
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  4237
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4238
2051
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4239
    |m|
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4240
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4241
    m := self class directoryMenuSpec.
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4242
    m menuPerformer:self.
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4243
    ^ m
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4244
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4245
    "Modified: / 14.8.1998 / 12:11:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4246
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4247
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4248
labelMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4249
    "return the popUpMenu for the path label"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4250
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4251
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4252
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4253
    |items menu currentIndex|
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4254
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4255
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4256
		   ('copy path'                   copyPath                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4257
		   ('-'                                                     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4258
		   ('up'                          changeToParentDirectory   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4259
		   ('back'                        changeToPreviousDirectory )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4260
		   ('change to home-directory'    changeToHomeDirectory     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4261
		   ('change to default-directory' changeToDefaultDirectory  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4262
		   ('change directory ...'        changeCurrentDirectory    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4263
	       ).             
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  4264
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  4265
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4266
	items := items , #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4267
			    ( '-')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4268
			    ( 'add to JavaClassPath'       addDirToJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4269
			    ( 'add to JavaSourcePath'      addDirToJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4270
			    ( 'remove from JavaClassPath'  removeDirFromJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4271
			    ( 'remove from JavaSourcePath' removeDirFromJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4272
			  ).
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4273
    ].
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4274
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4275
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4276
	items := items copyWith:#('-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4277
	items := items ,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4278
		 (DirectoryHistory 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4279
			collect:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4280
				    Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4281
					with:dirName 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4282
					with:#changeDirectoryTo:
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4283
					with:nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4284
					with:dirName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4285
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4286
		 ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4287
	currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4288
	currentIndex == 0 ifTrue:[currentIndex := nil].
123
claus
parents: 120
diff changeset
  4289
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4290
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4291
    menu := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4292
		itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4293
		resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4294
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4295
    previousDirectory isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4296
	menu disable:#changeToPreviousDirectory.
132
claus
parents: 126
diff changeset
  4297
    ].
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4298
    currentIndex notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4299
	menu disable:currentIndex
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4300
    ].
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  4301
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4302
	(Java classPath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4303
	    menu disable:#addDirToJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4304
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4305
	    menu disable:#removeDirFromJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4306
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4307
	(Java sourcePath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4308
	    menu disable:#addDirToJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4309
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4310
	    menu disable:#removeDirFromJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4311
	].
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4312
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4313
    ^menu.
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4314
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4315
    "Modified: / 21.7.1998 / 16:43:25 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4316
    "Created: / 14.8.1998 / 12:10:02 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4317
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4318
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4319
pathChanged:newPath
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4320
    "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
  4321
     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
  4322
2135
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4323
    |f name lcName idx|
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4324
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4325
    self discardChangesDialog ifTrue:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4326
        f := newPath asFilename.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4327
        (f isDirectory) ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4328
            self changeDirectoryTo:newPath
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4329
        ] ifFalse:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4330
            self changeDirectoryTo:(f directoryName).
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4331
"/            self changed:#path.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4332
            name := f baseName.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4333
            idx := fileList indexOf:name.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4334
            idx = 0 ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4335
                lcName := name asLowercase.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4336
                f class isCaseSensitive ifFalse:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4337
                    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
  4338
                ]
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4339
            ].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4340
            fileListView selection:idx.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4341
            self fileSelect:name.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4342
            self fileGet:true.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4343
        ].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4344
    ] ifFalse:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4345
        self changed:#path.
2135
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4346
    ].
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4347
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4348
    "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
  4349
    "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
  4350
    "Modified: / 30.4.1999 / 11:19:29 / cg"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4351
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4352
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4353
queryForDirectoryToChange
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4354
    "query for new directory"
123
claus
parents: 120
diff changeset
  4355
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4356
    |queryBox dirName|
98
claus
parents: 93
diff changeset
  4357
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4358
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4359
		    title:(resources at:'change directory to:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4360
		    okText:(resources at:'change')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4361
		    action:[:newName | dirName := newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4362
"/    queryBox initialText:''.
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4363
    queryBox showAtPointer.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4364
    queryBox destroy.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4365
    self doChangeCurrentDirectoryTo:dirName updateHistory:true.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4366
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4367
    "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
  4368
    "Modified: 28.4.1997 / 22:30:40 / dq"
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4369
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4370
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4371
removeDirFromJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4372
    "remove the current path from javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4373
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4374
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4375
    Java removeFromClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4376
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4377
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4378
    "Created: 1.8.1997 / 21:25:36 / cg"
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4379
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4380
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4381
removeDirFromJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4382
    "remove the current path from javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4383
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4384
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4385
    Java removeFromSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4386
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4387
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4388
    "Created: 2.8.1997 / 14:11:41 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4389
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4390
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4391
!FileBrowser methodsFor:'private'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4392
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4393
ask:question yesButton:yesButtonText
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4394
    "common method to ask a yes/no question; return true or false"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4395
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4396
    ^ self ask:question yesButton:yesButtonText noButton:'cancel' 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4397
!
93
claus
parents: 85
diff changeset
  4398
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4399
ask:question yesButton:yesButtonText noButton:noButtonText
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4400
    "common method to ask a yes/no question"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4401
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4402
    ^ Dialog 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4403
	confirm:question withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4404
	yesLabel:(resources at:yesButtonText)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4405
	noLabel:(resources at:noButtonText)
37
50f59bad66b1 *** empty log message ***
claus
parents: 36
diff changeset
  4406
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4407
    "Modified: 21.2.1996 / 01:19:21 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4408
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4409
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4410
askForCommandFor:fileName thenDo:aBlock
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4411
    "setup and launch a querybox to ask for unix command.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4412
     Then evaluate aBlock passing the command-string as argument."
93
claus
parents: 85
diff changeset
  4413
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4414
    |box osName|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4415
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4416
    osName := OperatingSystem platformName.
93
claus
parents: 85
diff changeset
  4417
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4418
    box := FilenameEnterBox 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4419
		title:(resources string:'execute %1 command:' with:osName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4420
	       okText:(resources string:'execute')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4421
	       action:aBlock.
79
d78f92a07d5d *** empty log message ***
claus
parents: 75
diff changeset
  4422
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4423
    fileName notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4424
	self initialCommandFor:fileName into:box.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4425
    ].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4426
    box directory:currentDirectory.
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4427
    box showAtPointer.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4428
    box destroy.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4429
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4430
    "Modified: / 7.9.1995 / 10:31:54 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4431
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4432
    "Modified: / 14.8.1998 / 14:12:52 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4433
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4434
98
claus
parents: 93
diff changeset
  4435
askIfModified:question yesButton:yesButtonText
claus
parents: 93
diff changeset
  4436
    "tell user, that code has been modified - let her confirm"
claus
parents: 93
diff changeset
  4437
claus
parents: 93
diff changeset
  4438
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4439
	^ true
98
claus
parents: 93
diff changeset
  4440
    ].
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4441
    (self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4442
	"/ reset modified flag so question is asked only once
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4443
	subView modified:false.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4444
	^ true
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4445
    ].
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4446
    ^ false
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4447
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4448
    "Modified: 2.10.1997 / 14:23:47 / stefan"
98
claus
parents: 93
diff changeset
  4449
!
claus
parents: 93
diff changeset
  4450
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4451
getSelectedFileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4452
    "returns the currently selected file; shows an error if
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4453
     multiple files are selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4454
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4455
    |sel|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4456
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4457
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4458
    (sel size > 1) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4459
	self onlyOneSelection
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4460
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4461
	sel notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4462
	    ^ fileList at:sel first ifAbsent:nil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4463
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4464
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4465
    ^ nil
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4466
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4467
    "Modified: / 3.10.1998 / 18:21:23 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4468
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4469
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4470
onlyOneSelection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4471
    "show a warning, that only one file must be selected for
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4472
     this operation"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4473
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4474
    self warn:'exactly one file must be selected !!'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4475
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4476
2512
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4477
selectFile:aFilename
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4478
    (currentDirectory filenameFor:aFilename) exists ifTrue:[
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4479
        fileListView selection:(fileList indexOf:aFilename).
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4480
        self fileDoubleClick:fileListView selection.
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4481
    ].
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4482
!
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4483
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4484
selectedFilesDo:aBlock
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4485
    "evaluate aBlock on all selected files;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4486
     show a wait cursor while doing this"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4487
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  4488
    |sel action|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4489
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4490
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4491
    sel notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4492
	sel := sel collect:[:aSelectionIndex | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4493
	    |nm|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4494
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4495
	    nm := fileList at:aSelectionIndex ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4496
	    nm notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4497
		nm := nm string.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4498
		(nm endsWith:' ...') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4499
		    nm := (nm copyWithoutLast:4) withoutSpaces
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4500
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4501
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4502
	    nm
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4503
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4504
	action := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4505
	    sel do:[:nm |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4506
		nm notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4507
		    aBlock value:nm
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4508
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4509
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4510
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4511
	Processor activeProcess == self windowGroup process ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4512
	    self withWaitCursorDo:action
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4513
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4514
	    action value
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4515
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4516
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4517
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  4518
    "Modified: / 16.12.1998 / 17:30:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4519
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4520
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4521
show:something
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4522
    "show something in subview and undef acceptAction"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4523
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4524
    subView contents:something.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4525
    subView acceptAction:nil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4526
    subView modified:false.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4527
    currentFileName := nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4528
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4529
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4530
showAlert:aString with:anErrorString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4531
    "show an alertbox, displaying the last Unix-error"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4532
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4533
    |msg|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4534
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4535
    anErrorString isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4536
	msg := aString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4537
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4538
	msg := aString , '\\(' , anErrorString , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4539
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4540
    self warn:msg withCRs
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4541
!
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
withoutHiddenFiles:aCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4544
    "remove hidden files (i.e. those that start with '.') from
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4545
     the list in aCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4546
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4547
    |newCollection|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4548
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4549
    newCollection := aCollection species new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4550
    aCollection do:[:fname |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4551
	|ignore|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4552
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4553
	ignore := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4554
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4555
	((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4556
	    showingHiddenFiles value "showDotFiles" ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4557
		ignore := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4558
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4559
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4560
	ignore ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4561
	    newCollection add:fname
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4562
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4563
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4564
    ^ newCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4565
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4566
    "Modified: / 4.8.1998 / 13:46:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4567
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4568
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4569
!FileBrowser methodsFor:'private - actions & command execution'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4570
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4571
binaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4572
    "for some binary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4573
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4574
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4575
    |cmd|
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4576
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4577
    (aFilename asFilename hasSuffix:'pdf') ifTrue:[
2434
5cf8d286f680 dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents: 2430
diff changeset
  4578
        DefaultCommandPerMIME isNil ifTrue:[
5cf8d286f680 dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents: 2430
diff changeset
  4579
            self class initializeDefaultCommands
5cf8d286f680 dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents: 2430
diff changeset
  4580
        ].
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4581
        cmd := DefaultCommandPerMIME at:'application/pdf' ifAbsent:nil.
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4582
        cmd notNil ifTrue:[
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4583
            (OperatingSystem executeCommand:(cmd bindWith:aFilename) inDirectory:currentDirectory pathName)
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4584
            ifTrue:[^true].
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4585
        ].
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4586
    ].
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4587
1330
2d8c64367afc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  4588
    (currentDirectory construct:aFilename) isExecutableProgram ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4589
        (OperatingSystem executeCommand:aFilename inDirectory:currentDirectory pathName)
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4590
        ifTrue:[^true].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4591
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4592
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4593
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4594
    "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
  4595
    "Modified: 18.9.1997 / 17:18:04 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4596
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4597
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4598
doExecuteCommand:commandArg replace:replace
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4599
    "execute a unix command inserting the output of the command.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4600
     If replace is true, all text is replaced by the commands output;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4601
     otherwise, its inserted as selected text at the cursor position."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4602
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  4603
    |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
  4604
     pauseSignal access stillReplacing pauseHolder lowerFrameView
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4605
     buttonWindowGroup|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4606
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4607
    command := commandArg asString.
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4608
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4609
    access := Semaphore forMutualExclusion name:'accessLock'.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4610
    stopSignal := Signal new.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4611
    pauseSignal := Signal new.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4612
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4613
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4614
     The following is tricky: 
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4615
     the pauseToggle & killButton will
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4616
     be handled by their own windowGroup process.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4617
     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
  4618
     I myself am reading the commands output.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4619
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4620
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4621
    commandView beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4622
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4623
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4624
     must take kill & pauseButtons out of my group
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4625
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4626
    killButton windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4627
    pauseToggle windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4628
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4629
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4630
     bring them to front, and turn hidden-mode off
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4631
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4632
    killButton raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4633
    pauseToggle raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4634
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4635
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4636
     kill will make me raise the stopSignal when pressed
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4637
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4638
    killButton 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4639
	action:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4640
	    stream notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4641
		access critical:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4642
		    myProcess interruptWith:[stopSignal raiseRequest].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4643
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4644
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4645
	].
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4646
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4647
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4648
     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
  4649
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4650
    pauseHolder := false asValue.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4651
    pauseToggle model:pauseHolder.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4652
    pauseToggle pressAction:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4653
	stream notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4654
	    access critical:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4655
		myProcess interruptWith:[pauseSignal raiseRequest].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4656
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4657
	]
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4658
    ].
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4659
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4660
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4661
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4662
     start kill button under its own windowgroup
1162
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
    killButton openAutonomous.
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4665
    buttonWindowGroup := killButton windowGroup.
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4666
    buttonWindowGroup process name:'FileBrowser sub'.
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4667
    buttonWindowGroup process processGroupId:(Processor activeProcess id).
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4668
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4669
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4670
     and add the pauseToggle to its windowGroup
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4671
    "
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4672
    pauseToggle windowGroup:buttonWindowGroup.
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4673
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4674
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4675
    lowerFrameView := subView superView.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4676
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4677
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4678
     go fork a pipe and read it
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
    self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4681
    [
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4682
      self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4683
	stopSignal catch:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4684
	    pauseSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4685
		|noPauseSema|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4686
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4687
		"/    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4688
		"/ allow interaction with
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4689
		"/ the codeView via the other windowGroup
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4690
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4691
		lowerFrameView windowGroup:buttonWindowGroup.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4692
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4693
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4694
		"/ wait for pause to be turned off
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4695
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4696
		noPauseSema := Semaphore new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4697
		pauseHolder onChangeSend:#signal to:noPauseSema.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4698
		noPauseSema wait.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4699
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4700
		"/    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4701
		"/ no interaction with the codeView ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4702
		"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4703
		lowerFrameView windowGroup:(self windowGroup).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4704
		ex proceed.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4705
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4706
		startLine := subView cursorLine.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4707
		startCol := subView cursorCol.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4708
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4709
		"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4710
		 this can be a time consuming operation; therefore lower my priority
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4711
		"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4712
		myProcess := Processor activeProcess.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4713
"/                myPriority := myProcess priority.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4714
"/                myProcess priority:(Processor userBackgroundPriority).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4715
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4716
		stream := PipeStream 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4717
			    readingFrom:command
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4718
			    errorDisposition:#inline
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4719
			    inDirectory:currentDirectory.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4720
		stream notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4721
		    [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4722
			|codeView lines noPauseSema enc|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4723
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4724
			enc := fileEncoding.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4725
			enc == #iso8859 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4726
			    enc := nil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4727
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4728
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4729
			stream buffered:true.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4730
			codeView := subView.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4731
			codeView unselect.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4732
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4733
			replace ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4734
			    codeView list:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4735
			    lnr := 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4736
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4737
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4738
			stillReplacing := replace.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4739
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4740
			[stream readWait. stream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4741
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4742
			     data available; read up to 100 lines
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4743
			     and insert as a single junk. This speeds up
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4744
			     display of long output (less line-scrolling).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4745
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4746
			    lines := OrderedCollection new:100.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4747
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4748
			    [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4749
				line := stream nextLine.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4750
				line notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4751
				    enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4752
					line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4753
				    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4754
				    lines add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4755
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4756
			    ] doWhile:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4757
				stream canReadWithoutBlocking
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4758
				and:[stream atEnd not
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4759
				and:[lines size < 100]]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4760
			    ]. 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4761
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4762
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4763
			     need this critical section; otherwise,
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4764
			     we could get the signal while waiting for
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4765
			     an expose event ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4766
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4767
			    access critical:[                        
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4768
				lines size > 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4769
				    stillReplacing ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4770
					lines do:[:line |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4771
					    codeView at:lnr put:line withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4772
					    codeView cursorToBottom; cursorDown:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4773
					    lnr := lnr + 1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4774
					    lnr > codeView list size ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4775
						stillReplacing := false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4776
					    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4777
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4778
				    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4779
					codeView insertLines:lines before:codeView cursorLine.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4780
					codeView cursorDown:lines size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4781
				    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4782
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4783
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4784
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4785
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4786
			     give others running at same prio a chance too
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4787
			     (especially other FileBrowsers doing the same)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4788
			    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4789
			    Processor yield
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4790
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4791
		    ] valueNowOrOnUnwindDo:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4792
			stream shutDown "close". stream := nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4793
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4794
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4795
		    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4796
		    "/ the command could have changed the directory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4797
		    "/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4798
		    self updateCurrentDirectoryIfChanged
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4799
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4800
		replace ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4801
		    subView modified:false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4802
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4803
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4804
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4805
      ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4806
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4807
	|wg|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4808
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4809
	self label:myName; iconLabel:myName.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4810
"/        myProcess notNil ifTrue:[myProcess priority:myPriority].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4811
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4812
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4813
	 hide the button, and make sure it will stay
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4814
	 hidden when we are realized again
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4815
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4816
	killButton beInvisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4817
	pauseToggle beInvisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4818
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4819
	commandView beVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4820
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4821
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4822
	 remove the killButton from its group
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4823
	 (otherwise, it will be destroyed when we shut down the group)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4824
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4825
	wg := killButton windowGroup.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4826
	killButton windowGroup:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4827
	pauseToggle windowGroup:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4828
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4829
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4830
	 shut down the kill buttons windowgroup
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4831
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4832
	wg notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4833
	    wg process terminate.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4834
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4835
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4836
	 clear its action (actually not needed, but
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4837
	 releases reference to thisContext earlier)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4838
	"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4839
	killButton action:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4840
	pauseToggle pressAction:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4841
	"/    
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4842
	"/ allow interaction with the codeView
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4843
	"/ (bring it back into my group)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4844
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4845
	lowerFrameView windowGroup:(self windowGroup).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4846
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4847
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4848
    currentFileName isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4849
	subView modified:false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4850
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4851
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4852
    subView size > 10000 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4853
	self warn:'text quite large now - please cut off some lines'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4854
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4855
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4856
    "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
  4857
    "Modified: / 6.3.1998 / 17:32:03 / stefan"
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4858
    "Modified: / 15.10.1998 / 12:37:52 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4859
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4860
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4861
imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4862
    "for some image files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4863
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4864
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4865
    |img errmsg|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4866
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4867
    (Image isImageFileSuffix:(aFilename asFilename suffix))
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4868
    ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4869
        Image imageLoadErrorSignal handle:[:ex |
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4870
            errmsg := ex errorString
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4871
        ] do:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4872
            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
  4873
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4874
        img notNil ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4875
            ImageEditor openOnImage:img.
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  4876
"/            img inspect.
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4877
            ^ true
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4878
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4879
        errmsg notNil ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4880
            self warn:errmsg.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4881
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4882
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4883
    ^ false
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4884
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4885
    "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
  4886
    "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
  4887
    "Modified: / 18.5.1999 / 15:45:06 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4888
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4889
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4890
initialCommandFor:fileName into:aBox
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4891
    "set a useful initial command for execute box."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4892
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4893
    |mime cmd select path suffix|
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4894
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4895
    path := currentDirectory filenameFor:fileName.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4896
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4897
    mime := MIMETypes mimeTypeForSuffix:fileName asFilename suffix.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4898
"/    mime notNil ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4899
"/        cmd := self initialCommandForMIME:mime file:path
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4900
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4901
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4902
    "/ XXX should be changed to take stuff from a config file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4903
    "/ XXX or from resources.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4904
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4905
    (path type == #regular) ifTrue:[
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4906
        path isExecutableProgram ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4907
            aBox initialText:(fileName , ' <arguments>').
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4908
            ^ self
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4909
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4910
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4911
        select := true.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4912
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4913
        "some heuristics - my personal preferences ...
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4914
         (actually this should come from a configfile)"
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4915
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4916
        (fileName endsWith:'akefile') ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4917
            aBox initialText:'make target' selectFrom:6 to:11.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4918
            ^ self
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4919
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4920
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4921
        DefaultCommandPerMIME isNil ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4922
            self class initializeDefaultCommands
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4923
        ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4924
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4925
        cmd := DefaultCommandPerMIME at:mime ifAbsent:nil.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4926
        cmd notNil ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4927
            select := false
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4928
        ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4929
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4930
        cmd isNil ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4931
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4932
            suffix := path suffix.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4933
            (suffix = 'C') ifTrue:[
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4934
                cmd := 'g++ -c %1'.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  4935
                select := 6.
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4936
            ] ifFalse:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4937
                suffix := suffix asLowercase.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4938
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4939
                (suffix = 'taz') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4940
                    aBox initialText:'zcat %1 | tar tvf -'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4941
                    select := false.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4942
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4943
                (suffix = 'tar') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4944
                    cmd := 'tar tvf %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4945
                    select := 7.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4946
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4947
                (suffix = 'zoo') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4948
                    cmd := 'zoo -list %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4949
                    select := 9.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4950
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4951
                (suffix = 'zip') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4952
                    cmd := 'unzip -l %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4953
                    select := 8.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4954
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4955
                (suffix = 'jar') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4956
                    cmd := 'unzip -l %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4957
                    select := 8.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4958
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4959
                (suffix = 'z') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4960
                    (fileName asLowercase endsWith:'tar.z') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4961
                        cmd := 'zcat %1 | tar tvf -'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4962
                        select := false.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4963
                    ] ifFalse:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4964
                        cmd := 'uncompress %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4965
                    ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4966
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4967
                (suffix = 'gz') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4968
                    (fileName asLowercase endsWith:'tar.gz') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4969
                        cmd := ('gunzip < %1 | tar tvf -' ).
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4970
                        select := false.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4971
                    ] ifFalse:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4972
                        cmd := 'gunzip %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4973
                    ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4974
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4975
                (suffix = 'html') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4976
                    cmd := 'netscape %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4977
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4978
                (suffix = 'htm') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4979
                    cmd := 'netscape %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4980
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4981
                (suffix = 'uue') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4982
                    cmd := 'uudecode %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4983
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4984
                (suffix = 'c') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4985
                    cmd := 'cc -c %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4986
                    select := 5.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4987
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4988
                (suffix = 'cc') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4989
                    cmd := 'g++ -c %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4990
                    select := 6.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4991
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4992
                (suffix = 'xbm') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4993
                    cmd := 'bitmap %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4994
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4995
                (suffix = 'ps') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4996
                    cmd := 'ghostview %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4997
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4998
                ((suffix = '1') or:[suffix = 'man']) ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  4999
                    cmd := 'nroff -man %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5000
                    select := 10.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5001
                ].
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5002
            ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5003
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5004
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5005
        cmd isNil ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5006
            DefaultCommandPerSuffix isNil ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5007
                cmd := '<cmd>'
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5008
            ] ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5009
                cmd := DefaultCommandPerSuffix 
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5010
                        at:suffix
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5011
                        ifAbsent:'<cmd>'.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5012
            ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5013
            cmd := cmd , ' %1'.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5014
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5015
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5016
        cmd := cmd bindWith:fileName.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5017
        select == false ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5018
            aBox initialText:cmd
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5019
        ] ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5020
            select class == Interval ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5021
                aBox initialText:cmd selectFrom:select start to:select stop
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5022
            ] ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5023
                select isInteger ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5024
                    select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5025
                ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5026
                aBox initialText:cmd selectFrom:1 to:select
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5027
            ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5028
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5029
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5030
1542
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  5031
    "Modified: / 24.9.1997 / 16:34:52 / stefan"
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  5032
    "Modified: / 9.4.1998 / 17:15:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5033
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5034
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5035
nonBinaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5036
    "for some nonBinary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5037
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5038
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  5039
    |fullPath|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5040
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5041
    fullPath := currentDirectory filenameFor:aFilename.
2550
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5042
    ((fullPath hasSuffix:'htm')
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5043
    or:[(fullPath hasSuffix:'HTM') 
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5044
    or:[(fullPath hasSuffix:'html')
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5045
    or:[(fullPath hasSuffix:'HTML')]]]) ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5046
        HTMLDocumentView openOn:fullPath pathName.
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5047
        ^ true
2091
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  5048
    ].
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  5049
    ((fullPath hasSuffix:'prj')  
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  5050
    and:[ProjectBrowser notNil]) ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5051
        ProjectBrowser openOnFile:fullPath pathName.
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5052
        ^ true
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5053
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5054
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5055
    OperatingSystem isUNIXlike ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5056
        (#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5057
        ifTrue:[
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5058
             HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName).
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5059
            ^ true
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5060
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5061
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5062
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5063
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5064
    "Created: 19.6.1996 / 09:36:38 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5065
    "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
  5066
    "Modified: 18.9.1997 / 16:58:40 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5067
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5068
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5069
!FileBrowser methodsFor:'private - directory stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5070
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5071
addToHistory:path
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5072
    |pos idx|
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5073
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5074
    (DirectoryHistory includes:path) ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5075
	DirectoryHistory size >= HistorySize ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5076
	    DirectoryHistory removeLast.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5077
	    DirectoryHistoryWhere removeLast
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5078
	]
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5079
    ] ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5080
	"already been there before; move the entry to
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5081
	 the beginning, so it will fall out later."
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5082
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5083
	idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5084
	DirectoryHistory removeIndex:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5085
	pos := DirectoryHistoryWhere at:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5086
	DirectoryHistoryWhere removeIndex:idx.
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5087
    ].
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5088
    DirectoryHistory addFirst:path.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5089
    DirectoryHistoryWhere addFirst:pos.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5090
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5091
    "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
  5092
!
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5093
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5094
changeToPreviousDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5095
    "if text was modified show a queryBox, 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5096
     otherwise change immediately to previous directory."
93
claus
parents: 85
diff changeset
  5097
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5098
    previousDirectory isNil ifTrue:[^ self].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  5099
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5100
	self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false 
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5101
    ]
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  5102
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  5103
    "Modified: 2.10.1997 / 14:13:40 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5104
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5105
98
claus
parents: 93
diff changeset
  5106
checkIfDirectoryHasChanged
claus
parents: 93
diff changeset
  5107
    "every checkDelta secs, check if directoy has changed and update the list if so.
claus
parents: 93
diff changeset
  5108
     Also, we check if the file shown has been touched in the meanwhile (for example,
claus
parents: 93
diff changeset
  5109
     from another browser) and say 'outdated' in the label if so. 
claus
parents: 93
diff changeset
  5110
     This avoids confusion if the same file is being edited by two browsers. (or other editors).
claus
parents: 93
diff changeset
  5111
     If the text shown in the codeView has been edited, 'modified' is shown.
claus
parents: 93
diff changeset
  5112
    "
claus
parents: 93
diff changeset
  5113
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5114
    |oldSelection nOld newState msg newLabel t|
98
claus
parents: 93
diff changeset
  5115
claus
parents: 93
diff changeset
  5116
    shown ifTrue:[
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5117
        currentDirectory notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5118
            (lockUpdate or:[doAutoUpdate value not]) ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5119
                Processor removeTimedBlock:checkBlock.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5120
                Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5121
                ^ self
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5122
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5123
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5124
            subView modified ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5125
                newState := ' (modified)'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5126
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5127
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5128
            (currentDirectory isReadable) ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5129
                Processor removeTimedBlock:checkBlock.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5130
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5131
                t := currentDirectory modificationTime.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5132
                (t notNil and:[t > timeOfLastCheck]) ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5133
                    nOld := fileListView numberOfSelections.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5134
                    oldSelection := fileListView selectionValue.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5135
                    self updateCurrentDirectory.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5136
                    nOld ~~ 0 ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5137
                        nOld > 1 ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5138
                            oldSelection do:[:element  |
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5139
                                fileListView addElementToSelection:element
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5140
                            ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5141
                        ] ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5142
                            fileListView selectElementWithoutScroll:oldSelection
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5143
                        ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5144
                    ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5145
                ] ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5146
                    Processor addTimedBlock:checkBlock afterSeconds:checkDelta
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5147
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5148
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5149
                currentFileName notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5150
                    |f|
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5151
                    f := currentDirectory construct:currentFileName.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5152
                    f exists ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5153
                        newState := ' (removed)'.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5154
                    ] ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5155
                        f modificationTime > timeOfFileRead ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5156
                            newState := ' (outdated)'.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5157
                            subView modified ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5158
                                newState := ' (modified & outdated)'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5159
                            ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5160
                        ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5161
                    ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5162
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5163
            ] ifFalse:[         
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5164
                "
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5165
                 if the directory has been deleted, or is not readable ...
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5166
                "
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5167
                (currentDirectory exists) ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5168
                    msg := 'FileBrowser:\\directory %1 is gone ?!!?'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5169
                ] ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5170
                    msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5171
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5172
                self warn:(resources string:msg with:currentDirectory pathName) withCRs.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5173
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5174
                fileListView contents:nil.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5175
                newLabel := myName , ': directory is gone !!'.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5176
                "/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5177
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5178
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5179
            newState notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5180
                newLabel := myName.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5181
                currentFileName notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5182
                    newLabel := newLabel , ': ' , currentFileName
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5183
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5184
                newLabel := newLabel , newState.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5185
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5186
            newLabel notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5187
                self label:newLabel.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5188
            ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5189
        ]
98
claus
parents: 93
diff changeset
  5190
    ]
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  5191
1380
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5192
    "Modified: / 28.4.1997 / 22:31:02 / dq"
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5193
    "Modified: / 16.9.1997 / 15:17:15 / stefan"
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5194
    "Modified: / 18.2.1998 / 17:57:49 / cg"
98
claus
parents: 93
diff changeset
  5195
!
claus
parents: 93
diff changeset
  5196
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5197
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5198
    "verify argument is name of a readable & executable directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5199
     and if so, go there"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5200
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5201
    |msg path idx f|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5202
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5203
    self label:myName; iconLabel:myName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5204
    fileName notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5205
	(f := fileName asFilename) isAbsolute ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5206
	    f := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5207
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5208
	f := f asAbsoluteFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5209
	(f isDirectory) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5210
	    (f isReadable) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5211
		(f isExecutable) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5212
		    path := currentDirectory pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5213
		    previousDirectory := path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5214
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5215
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5216
		     remember where we are positioned in the fileList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5217
		     (in case we want to return)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5218
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5219
		    idx := DirectoryHistory indexOf:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5220
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5221
			DirectoryHistoryWhere at:idx put:fileListView firstLineShown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5222
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5223
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5224
		    updateHistory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5225
			self addToHistory:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5226
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5227
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5228
		    self setCurrentDirectory:(f pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5229
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5230
		    "/ fetch the new path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5231
		    path := currentDirectory pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5232
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5233
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5234
		     if we have already been there, look for the
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5235
		     position offset, and scroll the fileList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5236
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5237
		    idx := DirectoryHistory indexOf:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5238
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5239
			|pos|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5240
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5241
			pos := DirectoryHistoryWhere at:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5242
			pos notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5243
			    fileListView scrollToLine:pos.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5244
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5245
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5246
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5247
		    updateHistory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5248
			self addToHistory:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5249
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5250
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5251
		    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5252
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5253
		msg := 'cannot change directory to ''%1'' !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5254
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5255
		msg := 'cannot read directory ''%1'' !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5256
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5257
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5258
	    OperatingSystem isVMSlike ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5259
		"/ cannot tell if it exists or is simply invisible ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5260
		msg := '''%1'' is not a directory or unreadable !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5261
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5262
		msg := '''%1'' is not a directory !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5263
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5264
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5265
	Dialog warn:(resources string:msg withCRs with:fileName).
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5266
    ]
1166
0029f77ccea7 when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
  5267
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5268
    "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
  5269
    "Modified: / 27.4.1999 / 17:10:14 / cg"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5270
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5271
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5272
doChangeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5273
    "go to parent directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5274
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5275
    self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5276
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5277
    "Created: 21.9.1997 / 23:45:59 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5278
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5279
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5280
doChangeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5281
    "go to home directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5282
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5283
    self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5284
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5285
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5286
doChangeToParentDirectory
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5287
    "go to parent directory"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5288
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5289
    self doChangeCurrentDirectoryTo:'..' updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5290
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5291
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5292
doCreateDirectory:newName
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5293
    |f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5294
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5295
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5296
    f exists ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5297
	self warn:'%1 already exists.' with:newName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5298
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5299
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5300
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5301
    f makeDirectory ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5302
	self updateCurrentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5303
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5304
	self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5305
		  with:(OperatingSystem lastErrorString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5306
    ]
1157
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  5307
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  5308
    "Modified: / 18.9.1997 / 17:21:25 / stefan"
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  5309
    "Modified: / 30.1.1999 / 16:24:12 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5310
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5311
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5312
setCurrentDirectory:aPathName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5313
    "setup for another directory"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5314
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5315
    |newDirectory|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5316
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5317
    aPathName isEmpty ifTrue:[^ self].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5318
    newDirectory := currentDirectory filenameFor:aPathName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5319
    newDirectory isDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5320
	self currentDirectory:newDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5321
	currentFileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5322
	    fileListView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5323
	    currentFileName := nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5324
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5325
	    fileListView setSelection:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5326
	    fileListView scrollToTop.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5327
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5328
	self updateCurrentDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5329
	self showInfo.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5330
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  5331
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5332
    "Modified: 21.9.1995 / 11:22:45 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5333
    "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
  5334
    "Modified: 18.9.1997 / 17:08:07 / stefan"
912
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  5335
!
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  5336
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5337
updateCurrentDirectoryIfChanged
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5338
    |t|
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5339
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5340
    OperatingSystem isMSDOSlike ifTrue:[
2636
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5341
        "/ workaround: DOS has no directory modifiation time ...
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5342
        self updateCurrentDirectory.
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5343
        ^ self
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5344
    ].
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5345
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5346
    ((t := currentDirectory modificationTime) isNil
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5347
    or:[t > timeOfLastCheck]) ifTrue:[
2636
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5348
        self updateCurrentDirectory
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5349
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5350
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5351
    "Modified: / 16.9.1997 / 15:35:52 / stefan"
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5352
    "Modified: / 16.12.1998 / 22:55:44 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5353
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5354
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5355
!FileBrowser methodsFor:'private - encoding'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5356
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5357
guessEncodingFrom:aBuffer
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5358
    "look for a string
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5359
	encoding #name
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5360
     or:
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5361
	encoding: name
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5362
     within the given buffer 
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5363
     (which is usually the first few bytes of a textFile).
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5364
     If thats not found, use heuristics (in CharacterArray) to guess."
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5365
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5366
    |n "{Class: SmallInteger }"
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5367
     binary idx s w enc|
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5368
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5369
    binary := false.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5370
    n := aBuffer size.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5371
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5372
    (idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5373
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5374
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5375
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5376
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5377
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5378
	    (idx := w indexOf:$") ~~ 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5379
		w := w copyTo:idx-1
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5380
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5381
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5382
	].
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5383
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5384
    (idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5385
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5386
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5387
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5388
	s peek == $: ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5389
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5390
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5391
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5392
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5393
	s peek == $# ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5394
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5395
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5396
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5397
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5398
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5399
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5400
	].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5401
    ].
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5402
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5403
    1 to:n do:[:i |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5404
	(aBuffer at:i) isPrintable ifFalse:[binary := true].
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5405
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5406
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5407
    binary ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5408
	"/ look for JIS7 / EUC encoding
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5409
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5410
	enc := CharacterArray guessEncodingFrom:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5411
	enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5412
	    ^ enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5413
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5414
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5415
	"/ if the encoding has been set to any non iso setting,
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5416
	"/ assume its what we defined ...
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5417
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5418
	(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5419
	    ^ #binary
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5420
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5421
	^ fileEncoding ? #binary
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5422
    ].
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5423
    ^ #ascii
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5424
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5425
    "Created: 26.2.1996 / 17:43:08 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5426
    "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
  5427
!
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5428
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5429
preferredFontEncodingFor:fileEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5430
    "given a file encoding, return corresponding preferred fontEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5431
     match pattern"
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5432
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5433
    |fe|
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5434
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5435
    fe := MIMETypes fontForCharset:fileEncoding.
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5436
    fe notNil ifTrue:[^ fe].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5437
    ^ 'iso8859*'
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5438
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5439
    "Created: 28.6.1997 / 20:47:35 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5440
    "Modified: 1.7.1997 / 00:04:56 / cg"
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5441
!
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5442
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5443
validateFontEncodingFor:newEncoding ask:ask
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5444
    "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
  5445
     which is able to display text encoded as specified by newEncoding"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5446
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5447
    |fontsEncoding msg filter f defaultFont pref|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5448
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5449
    fontsEncoding := subView font encoding.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5450
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5451
    pref := self preferredFontEncodingFor:newEncoding.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5452
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5453
    (pref match:fontsEncoding) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5454
	^ self
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5455
    ].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5456
    "/ stupid ...
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5457
    pref = 'ascii*' ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5458
	(fontsEncoding match:'iso8859*') ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5459
	    ^ self
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5460
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5461
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5462
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5463
    filter := [:f | |coding|
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5464
		    (coding := f encoding) notNil 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5465
		    and:[pref match:coding]].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5466
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5467
    defaultFont := TextView defaultFont onDevice:device.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5468
    (pref match:(defaultFont encoding)) ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5469
	defaultFont := nil.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5470
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5471
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5472
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5473
	(pref = 'ascii*'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5474
	or:[pref = 'iso8859*']) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5475
	    defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5476
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5477
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5478
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5479
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5480
	defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5481
			    listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5482
				detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5483
				ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5484
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5485
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5486
	    "/ flush list, and refetch font list
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5487
	    "/ (in case someone just changed the font path ...)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5488
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5489
	    device flushListOfAvailableFonts.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5490
	    defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5491
				listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5492
				    detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5493
				    ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5494
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5495
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5496
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5497
	    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
  5498
	    ^ self.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5499
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5500
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5501
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5502
    msg := 'switch to a %1 encoded font ?'.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5503
    (ask not or:[self confirm:(resources string:msg with:pref) withCRs])
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5504
    ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5505
	self withWaitCursorDo:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5506
	    f := FontPanel 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5507
		fontFromUserInitial:defaultFont
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5508
			      title:(resources string:'font selection')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5509
			     filter:filter.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5510
	    f notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5511
		subView font:f
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5512
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5513
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5514
    ]
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5515
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5516
    "Created: 26.10.1996 / 12:06:54 / cg"
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5517
    "Modified: 30.6.1997 / 17:46:46 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5518
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5519
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5520
!FileBrowser methodsFor:'private - file stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5521
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5522
doCreateFile:newName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5523
    "create an empty file"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5524
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5525
    |aStream f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5526
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5527
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5528
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5529
	(self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5530
	    ask:(resources string:'%1 already exists\\truncate ?' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5531
	    yesButton:'truncate'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5532
	) ifFalse:[^ self].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5533
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5534
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5535
    FileStream openErrorSignal handle:[:ex|
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5536
	^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5537
		    with:(FileStream lastErrorString)
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5538
    ] do:[    
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5539
	aStream := f newReadWriteStream.
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5540
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5541
    aStream notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5542
	aStream close.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5543
	self updateCurrentDirectoryIfChanged
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5544
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5545
	self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5546
		  with:(FileStream lastErrorString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5547
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5548
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5549
    "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
  5550
    "Modified: 18.9.1997 / 17:21:45 / stefan"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5551
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5552
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5553
doFileGet:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5554
    "get selected file - show contents in subView.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5555
     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
  5556
     When invoked via the menu (viaDoubleClick argument is false),
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5557
     the automatic file action is not performed - instead, the file is always
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5558
     shown in the codeView (if possible).
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5559
     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
  5560
     action) to be edited."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5561
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5562
    |fileName|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5563
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5564
    fileName := self getSelectedFileName.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5565
    fileName notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5566
	self doOpenFile:fileName viaDoubleClick:viaDoubleClick
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5567
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5568
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  5569
    "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
  5570
    "Modified: / 18.9.1997 / 17:35:31 / stefan"
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5571
    "Modified: / 4.2.1999 / 17:43:51 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5572
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5573
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5574
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
  5575
    |dir subDirs nameMatches contentsMatches lines contentsToCompare|
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5576
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5577
    bytesToCompareContentsOrNil notNil ifTrue:[
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5578
        contentsToCompare := bytesToCompareContentsOrNil
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5579
    ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5580
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5581
    subDirs := OrderedCollection new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5582
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5583
    dir := aDirectory asFilename.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5584
    self label:myName , '- searching ' , dir name.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5585
    (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
  5586
        |f|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5587
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5588
        f := dir construct:fn.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5589
        f isDirectory ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5590
            f isSymbolicLink ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5591
                subDirs add:f
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5592
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5593
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5594
            (nameMatches := namePatterns isNil) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5595
                ignCaseInName ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5596
                    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
  5597
                ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5598
                    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
  5599
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5600
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5601
            nameMatches ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5602
                filenameToCompareContentsOrNil notNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5603
                    "/ contents compare ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5604
                    contentsMatches := false.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5605
                    f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5606
                        f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5607
                            contentsToCompare isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5608
                                filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5609
                                    contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5610
                                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5611
                            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5612
                            contentsToCompare isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5613
                                "/ too large - compare block-wise ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5614
                                contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5615
                            ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5616
                                contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5617
                            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5618
                        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5619
                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5620
                        f isSymbolicLink ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5621
                            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
  5622
                            subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5623
                        ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5624
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5625
                ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5626
                    "/ string search ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5627
                    (contentsMatches := contentsString isNil) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5628
                        (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
  5629
                            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
  5630
                            subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5631
                        ] ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5632
                            f fileSize > (4024*1024) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5633
                                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
  5634
                                subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5635
                            ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5636
                                Stream lineTooLongErrorSignal handle:[:ex |
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5637
                                    |cont|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5638
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5639
                                    "/ 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
  5640
                                    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
  5641
                                    ignCaseInString ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5642
                                        contentsMatches := cont asLowercase includesString:contentsString
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5643
                                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5644
                                        contentsMatches := cont includesString:contentsString
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5645
                                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5646
                                ] do:[    
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5647
                                    lines := f contents ? #().
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5648
                                    ignCaseInString ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5649
                                        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
  5650
                                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5651
                                        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
  5652
                                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5653
                                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5654
                            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5655
                        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5656
                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5657
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5658
                contentsMatches ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5659
                    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
  5660
                    subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5661
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5662
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5663
        ]
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5664
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5665
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5666
    subDirs do:[:dir |
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5667
        self
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5668
            doFindFileNamed:namePatterns 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5669
            ignoreCase:ignCaseInName 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5670
            containingString:contentsString 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5671
            ignoreCaseInContents:ignCaseInString 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5672
            sameContentsAsFile:filenameToCompareContentsOrNil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5673
            sameContentsAs:contentsToCompare
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5674
            in:dir
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5675
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5676
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5677
    "Created: / 15.10.1998 / 11:37:15 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5678
    "Modified: / 15.10.1998 / 12:50:48 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5679
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5680
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5681
doOpenFile:fileName viaDoubleClick:viaDoubleClick
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5682
    "get selected file - show contents in subView.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5683
     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
  5684
     When invoked via the menu (viaDoubleClick argument is false),
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5685
     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
  5686
     shown in the codeView (if possible).
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5687
     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
  5688
     action) to be edited."
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5689
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5690
    |iconLbl winLbl f|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5691
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5692
    self withReadCursorDo:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5693
        (f := fileName asFilename) isAbsolute ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5694
            f := currentDirectory construct:fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5695
        ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5696
        f isDirectory ifTrue:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5697
            self doChangeCurrentDirectoryTo:fileName updateHistory:true.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5698
            winLbl := myName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5699
            iconLbl := myName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5700
        ] ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5701
            f exists ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5702
                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
  5703
                ^ self
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5704
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5705
            timeOfFileRead := f modificationTime.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5706
            self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5707
            currentFileName := fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5708
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5709
            self fileTypeSpecificActions.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5710
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5711
            subView acceptAction:[:theCode |
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5712
                (f modificationTime <= timeOfFileRead
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5713
                or:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5714
                    (self 
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5715
                        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
  5716
                        yesButton:'save'
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5717
                        noButton:'don''t save')]) ifTrue:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5718
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5719
                    self withCursor:(Cursor write) do:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5720
                        self writeFile:fileName text:theCode encoding:fileEncoding.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5721
                        timeOfFileRead := f modificationTime.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5722
                        self label:myName , ': ' , currentFileName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5723
                    ]
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5724
                ]
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5725
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5726
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5727
            winLbl := myName , ': ' , fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5728
            f isWritable ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5729
                winLbl := winLbl , ' (readonly)'
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5730
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5731
            iconLbl := fileName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5732
        ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5733
        self label:winLbl.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5734
        self iconLabel:iconLbl.
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5735
    ]
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5736
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5737
    "Created: / 4.2.1999 / 17:43:26 / cg"
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5738
    "Modified: / 3.5.1999 / 20:32:27 / ps"
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5739
    "Modified: / 4.5.1999 / 20:39:10 / cg"
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5740
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5741
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  5742
doRemove:filesToRemove
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5743
    "remove the selected file(s) - no questions asked"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5744
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5745
    |msg needUpdate toRemove updateRunning yesToAll mTime|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5746
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5747
    updateRunning := listUpdateProcess notNil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5748
    self stopUpdateProcess.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5749
    toRemove := OrderedCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5750
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5751
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5752
    "/ did the directory change in the meanwhile ?
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5753
    "/
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5754
    mTime := currentDirectory modificationTime.
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  5755
    needUpdate := mTime notNil and:[mTime > timeOfLastCheck].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5756
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  5757
    yesToAll := false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5758
    lockUpdate := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5759
    [
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5760
	filesToRemove keysAndValuesDo:[:idx :fileName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5761
	    |f|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5762
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5763
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5764
	    OperatingSystem accessDeniedErrorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5765
		"was not able to remove it"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5766
		msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5767
		self showAlert:msg with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5768
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5769
		|answer contents i|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5770
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5771
		(f isSymbolicLink not and:[f isDirectory]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5772
		    contents := f directoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5773
		    contents isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5774
			f remove
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5775
		    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5776
			yesToAll ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5777
			    idx == filesToRemove size ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5778
				answer := Dialog
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5779
					    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
  5780
					    labels:(resources array:#('cancel' 'remove'))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5781
					    values:#(false true) 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5782
					    default:2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5783
			    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5784
				answer := Dialog
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5785
					    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
  5786
					    labels:(resources array:#('cancel' 'remove all' 'remove'))
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5787
					    values:#(false #removeAll true) 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5788
					    default:3.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5789
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5790
			    answer == false ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5791
				^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5792
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5793
			    answer == #removeAll ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5794
				yesToAll := true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5795
			    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5796
			].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5797
			f recursiveRemove
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5798
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5799
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5800
		    f remove.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5801
		].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5802
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5803
		self show:nil
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  5804
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5805
		i := fileList indexOf:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5806
		i ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5807
		    toRemove add:i.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5808
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5809
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5810
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5811
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5812
	lockUpdate := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5813
	fileListView setSelection:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5814
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5815
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5816
	"/ remove reverse - otherwise indices are wrong
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5817
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5818
	toRemove sort.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5819
	toRemove reverseDo:[:idx |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5820
	    fileList removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5821
	    fileListView removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5822
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5823
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5824
	updateRunning ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5825
	    self updateCurrentDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5826
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5827
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5828
	     install a new check after some time
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5829
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5830
	    needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5831
	    Processor removeTimedBlock:checkBlock.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5832
	    Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5833
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5834
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5835
1374
b3a1e95a6220 Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents: 1371
diff changeset
  5836
    "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
  5837
    "Modified: / 26.4.1999 / 23:03:12 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5838
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5839
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5840
doRename:oldName to:newName
1331
73e712c85588 Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents: 1330
diff changeset
  5841
    "rename a file (or directory)"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5842
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5843
    |old new|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5844
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5845
    (oldName notNil and:[newName notNil]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5846
	(oldName isBlank or:[newName isBlank]) ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5847
	    old := currentDirectory filenameFor:oldName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5848
	    new := currentDirectory filenameFor:newName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5849
	    OperatingSystem errorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5850
		self showAlert:(resources string:'cannot rename file ''%1'' to %2 !!' 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5851
					  with:oldName with:newName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5852
			  with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5853
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5854
		new exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5855
		    (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
  5856
		    ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5857
			^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5858
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5859
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5860
		old renameTo:new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5861
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5862
	    self updateCurrentDirectoryIfChanged.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5863
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5864
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5865
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5866
    "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
  5867
    "Modified: / 3.10.1998 / 18:19:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5868
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5869
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5870
!FileBrowser methodsFor:'private - file type & info'!
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
fileCommentStrings
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5873
    "return a useful comment definition; based upon the fileName for now"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5874
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5875
    |suff mime|
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5876
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5877
    mime := MIMETypes mimeTypeForFilename:currentFileName.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5878
    mime isNil ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5879
        mime := (currentDirectory construct:currentFileName) mimeTypeOfContents.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5880
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5881
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5882
    (mime = 'application/x-make') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5883
        "/ makefile
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5884
        ^ #('#' (nil nil)).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5885
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5886
    (mime = 'application/x-sh') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5887
        "/ shell script
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5888
        ^ #('#' (nil nil)).
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5889
    ].
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5890
    (mime = 'text/html') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5891
        ^ #(nil ('<!!--' '-->')).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5892
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5893
    (mime = 'application/x-batch-script') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5894
        ^ #('rem ' (nil nil)).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5895
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5896
    (mime = 'application/x-c-source') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5897
        ^ #(nil ('/*' '*/')).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5898
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5899
    (mime = 'application/x-cpp-source') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5900
        ^ #('//' ('/*' '*/')).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5901
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5902
    (mime = 'application/x-java-source') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5903
        ^ #('//' (nil nil)).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5904
    ].
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5905
    (mime = 'application/x-asn1-source') ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5906
        ^ #('--' ('--' '--')).
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
  5907
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5908
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5909
    suff := currentFileName asFilename suffix.
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5910
    (suff = 'style') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5911
        ^ #(';' (nil nil)).
2104
4cdfa467fb7c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
  5912
    ].
2184
314404ed96a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2183
diff changeset
  5913
    (suff = 'rs') ifTrue:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5914
        ^ #(';' (nil nil)).
2104
4cdfa467fb7c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2102
diff changeset
  5915
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5916
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  5917
    "/ default: smalltalk comments
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5918
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5919
    ^ #('"/' ('"' '"')).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5920
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5921
    "Created: / 7.1.1997 / 20:30:00 / cg"
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5922
    "Modified: / 4.5.1999 / 19:42:30 / ps"
2442
481ba54b5ed1 better mimeType detection.
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5923
    "Modified: / 19.11.1999 / 15:25:24 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5924
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5925
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5926
fileTypeSpecificActions
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5927
    "any special fileTypeSpecific actions are done here,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5928
     when a new file is selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5929
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5930
    |commentStrings|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5931
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5932
    commentStrings := self fileCommentStrings.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5933
    commentStrings notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5934
	subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5935
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5936
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5937
    "Modified: 7.1.1997 / 20:30:54 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5938
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5939
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5940
getFileInfoString:longInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5941
    "get stat info on selected file - return a string which can be
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5942
     shown in a box"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5943
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5944
    |fileName f fullPath text info fileOutput type modeBits modeString s ts|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5945
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5946
    fileName := self getSelectedFileName.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5947
    fileName isNil ifTrue:[^ nil].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5948
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5949
    f := currentDirectory construct:fileName.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5950
    info := f info.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5951
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5952
    info isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5953
	self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5954
		  with:(OperatingSystem lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5955
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5956
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5957
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5958
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5959
    f isSymbolicLink ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5960
	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
  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
    type := info type.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5964
    (longInfo and:[type == #regular]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5965
	fullPath := currentDirectory pathName asFilename constructString:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5966
	fileOutput := fullPath asFilename fileType.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5967
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5968
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5969
    s := (resources at:'type:   ').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5970
    fileOutput isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5971
	s := s ,  type asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5972
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5973
	s := s , 'regular (' , fileOutput , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5974
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5975
    text add:s.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5976
    text add:(resources string:'size:   %1' with:(info size) printString).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5977
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5978
    modeBits := info mode.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5979
    modeString := self getModeString:modeBits.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5980
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5981
	text add:(resources string:'access: %1 (%2)'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5982
			      with:modeString 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5983
			      with:(modeBits printStringRadix:8))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5984
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5985
	text add:(resources string:'access: %1' with:modeString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5986
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5987
    text add:(resources string:'owner:  %1'
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5988
			  with:(OperatingSystem getUserNameFromID:(info uid))).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5989
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5990
	text add:(resources string:'group:  %1'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5991
			      with:(OperatingSystem getGroupNameFromID:(info gid))).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5992
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5993
	ts := info accessed.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5994
	text add:(resources string:'last access:       %1 %2' 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5995
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5996
			      with:(ts asDate printString)).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5997
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5998
	ts := info modified.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5999
	text add:(resources string:'last modification: %1 %2'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6000
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6001
			      with:(ts asDate printString)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6002
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6003
    ^ text asString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6004
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6005
    "Modified: 8.9.1995 / 11:59:28 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6006
    "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
  6007
    "Modified: 18.9.1997 / 16:34:31 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6008
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6009
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6010
getInfoFile
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6011
    "get filename of a description-file (.dir.info, README etc.);
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6012
     This file is automatically shown when a directory is enterred.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6013
     You can add more names below if you like."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6014
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6015
    #( 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6016
       '.dir.info'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6017
       'README'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6018
       'ReadMe'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6019
       'Readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6020
       'readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6021
       'read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6022
       'Read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6023
       'READ.ME'
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6024
       'README.TXT'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6025
       'readme.txt'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6026
       'Readme.txt'
1307
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  6027
       'Info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  6028
       'info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  6029
       'INFO.TXT'
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6030
    ) do:[:f | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6031
	|n|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6032
	n := currentDirectory construct:f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6033
	(n isReadable and:[n isDirectory not]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6034
	    ^ f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6035
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6036
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6037
    ^ nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6038
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6039
    "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
  6040
    "Modified: 16.9.1997 / 15:26:53 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6041
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6042
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6043
getModeString:modeBits
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6044
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6045
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6046
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6047
    ^ self getModeString:modeBits 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6048
		    with:#( 'owner:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6049
			    ' group:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6050
			    ' others:' $r $w $x )
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6051
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6052
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6053
getModeString:modeBits with:texts
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6054
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6055
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6056
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6057
    |bits modeString|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6058
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6059
    bits := modeBits bitAnd:8r777.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6060
    modeString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6061
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6062
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6063
    with: texts do:[:bitMask :access |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6064
	|ch|
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6065
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6066
	bitMask isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6067
	    modeString := modeString , (resources string:access)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6068
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6069
	    (bits bitAnd:bitMask) == 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6070
		ch := $-
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6071
	    ] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6072
		ch := access
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6073
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6074
	    modeString := modeString copyWith:ch 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6075
	]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  6076
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6077
    ^ modeString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6078
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6079
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6080
showInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6081
    "show directory info when dir has changed"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6082
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6083
    |info txt|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6084
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6085
    info := self getInfoFile.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6086
    info notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6087
	txt := self readFile:info
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6088
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6089
    self show:txt.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6090
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6091
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6092
sizePrintString:size
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6093
    "helper for update-directory to return a string with a files size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6094
     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
  6095
     If you dont like this, just uncomment the first statement below."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6096
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6097
    |unitString n|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6098
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6099
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6100
    ^ size printString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6101
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6102
    unitString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6103
    size < (500 * 1024) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6104
	size < 1024 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6105
	    n := size
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6106
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6107
	    n := (size * 10 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6108
	    unitString := ' Kb'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6109
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6110
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6111
	n := (size * 10 // 1024 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6112
	unitString := ' Mb'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6113
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6114
    ^ (n printStringLeftPaddedTo:5) , unitString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6115
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6116
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6117
!FileBrowser methodsFor:'private - file-I/O'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6118
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6119
readFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6120
    "read in the file, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6121
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6122
    ^ self readFile:fileName lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6123
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6124
    "Modified: 22.2.1996 / 14:57:08 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6125
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6126
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6127
readFile:fileName lineDelimiter:aCharacter encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6128
    "read in the file, return its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6129
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6130
     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
  6131
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6132
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6133
    |f stream text msg sz|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6134
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6135
    (f := fileName asFilename) isAbsolute ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6136
	f := (currentDirectory construct:fileName)
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6137
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6138
    stream := f readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6139
    stream isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6140
	msg := (resources string:'cannot read file ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6141
	self showAlert:msg with:(FileStream lastErrorString).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6142
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6143
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6144
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6145
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6146
     for very big files, give ObjectMemory a hint, to preallocate more
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6147
    "
1311
e09e4a65d8a9 filename stuff
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  6148
    (sz := stream fileSize) > 1000000 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6149
	Processor activeProcess withPriority:Processor userBackgroundPriority do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6150
	    ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6151
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6152
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6153
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6154
    text := self readStream:stream lineDelimiter:aCharacter encoding:encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6155
    stream close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6156
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6157
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6158
    "Created: / 22.2.1996 / 14:56:48 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6159
    "Modified: / 18.9.1997 / 17:06:54 / stefan"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6160
    "Modified: / 4.2.1999 / 17:52:18 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6161
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6163
readStream:aStream
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6164
    "read in from aStream, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6165
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6166
    ^ self readStream:aStream lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6167
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6168
    "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
  6169
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  6170
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6171
readStream:aStream lineDelimiter:aCharacter encoding:encoding 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6172
    "read from aStream, answer its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6173
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6174
     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
  6175
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6176
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6177
    |text line enc|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6178
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6179
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6180
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6181
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6182
    enc == #iso8859 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6183
	enc := nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6184
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6185
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6186
    aCharacter == Character cr ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6187
	FileStream lineTooLongErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6188
	    |s partialLine|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6189
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6190
	    s := ex parameter at:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6191
	    partialLine := ex parameter at:2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6192
	    ex proceedWith:(partialLine , s upTo:aCharacter)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6193
	] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6194
	    [aStream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6195
		line := aStream nextLine withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6196
		enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6197
		    line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6198
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6199
		text add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6200
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6201
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6202
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6203
	[aStream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6204
	    line := (aStream upTo:aCharacter) withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6205
	    enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6206
		line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6207
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6208
	    text add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6209
	].
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  6210
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6211
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6212
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6213
    "Created: / 22.2.1996 / 14:58:25 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6214
    "Modified: / 5.2.1999 / 00:53:22 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6215
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6216
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6217
showFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6218
    "show contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6219
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6220
    fileListView selection:(fileList indexOf:fileName).
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6221
    self fileGet
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6222
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6223
    "Modified: / 17.6.1998 / 11:26:13 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6224
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6225
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6226
showFile:fileName insert:insert encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6227
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6228
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6229
    ^ self 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6230
	showFile:fileName insert:insert encoding:encoding doubleClick:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6231
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6232
    "Modified: 19.6.1996 / 09:40:19 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6233
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6234
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6235
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6236
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6237
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6238
    |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
  6239
     fontsEncoding pref failWarning|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6240
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6241
    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
  6242
        path := currentDirectory filenameFor:fileName.
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6243
    ] ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6244
        path := fileName asFilename asAbsoluteFilename
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6245
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6246
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6247
    (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
  6248
        "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
  6249
        path exists ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6250
            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
  6251
        ] ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6252
            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
  6253
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6254
        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
  6255
        ^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6256
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6257
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6258
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6259
    "/ check if file is a text file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6260
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6261
    s := path readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6262
    s isNil ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6263
        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
  6264
                  with:(FileStream lastErrorString).
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6265
        ^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6266
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6267
1222
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  6268
    buffer := String new:4096.
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  6269
    n := s nextBytes:4096 into:buffer.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6270
    s close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6271
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6272
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6273
    ok := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6274
    guess := self guessEncodingFrom:buffer.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6275
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6276
    guess == #binary ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6277
        ok := false.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6278
        viaDoubleClick ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6279
            (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
  6280
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6281
        (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
  6282
        ifFalse:[^ self]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6283
    ] ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6284
        viaDoubleClick ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6285
            (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
  6286
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6287
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6288
        fontsEncoding := subView font encoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6289
        pref := self preferredFontEncodingFor:guess.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6290
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6291
        ok := pref match:fontsEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6292
        ok ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6293
            pref = 'iso8859*' ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6294
                ok := 'ascii*' match:fontsEncoding
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6295
            ]
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6296
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6297
        ok ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6298
            fileEncoding := guess.    
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6299
            enc := guess.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6300
        ] ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6301
            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
  6302
                           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
  6303
                           values:#(nil #show #encoding)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6304
                           default:#encoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6305
            action isNil ifTrue:[^ self].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6306
            action == #encoding ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6307
                fileEncoding := guess asSymbol.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6308
                subView externalEncoding:fileEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6309
                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
  6310
            ] ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6311
                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
  6312
            ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6313
            enc := fileEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6314
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6315
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6316
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6317
    convert := false.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6318
"/    ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6319
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6320
"/        "/ check if line delimiter is a cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6321
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6322
"/        i := buffer indexOf:Character cr.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6323
"/        i == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6324
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6325
"/            "/ no newline found - try cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6326
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6327
"/            i := buffer indexOf:(Character value:13).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6328
"/            i ~~ 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6329
"/                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
  6330
"/            ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6331
"/        ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6332
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6333
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6334
    insert ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6335
        "/ release old text first 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6336
        "/ - 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
  6337
        "/  (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
  6338
        "/   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
  6339
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6340
        subView contents:nil.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6341
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6342
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6343
    convert ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6344
        eol := Character value:13
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6345
    ] ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6346
        eol := Character cr
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6347
    ].
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6348
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  6349
    failWarning := false.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6350
    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
  6351
        |errStr|
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6352
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6353
        failWarning ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6354
            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
  6355
            (self confirm:(resources 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6356
                                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
  6357
                                with:errStr) withCRs)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6358
            ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6359
                ^ self
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6360
            ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6361
            failWarning := true.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6362
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6363
        ex proceed.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6364
    ] do:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6365
        text := self readFile:fileName lineDelimiter:eol encoding:enc.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6366
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6367
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6368
    insert ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6369
        self show:text
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6370
    ] ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6371
        subView insertSelectedStringAtCursor:text asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6372
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6373
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6374
    "Created: / 19.6.1996 / 09:39:52 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6375
    "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
  6376
    "Modified: / 18.5.1999 / 15:51:18 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6377
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6378
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6379
writeFile:fileName text:someText encoding:encoding
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6380
    |stream errReason msg startNr nLines string|
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6381
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6382
    errReason := ''.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6383
    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
  6384
        errReason := ex errorString.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6385
        ex return.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6386
    ] do:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6387
        stream := (currentDirectory filenameFor:fileName) writeStream.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6388
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6389
    stream isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6390
        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
  6391
        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
  6392
        ^ self.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6393
    ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6394
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6395
    dosEOLMode value == true ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6396
        stream eolMode:#crlf.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6397
        "/ must do it lineWise ...
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6398
        someText asStringCollection do:[:line |
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6399
            line notNil ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6400
                stream nextPutAll:line
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6401
            ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6402
            stream cr
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6403
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6404
    ] ifFalse:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6405
        (someText isString) ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6406
            stream nextPutAll:someText.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6407
        ] ifFalse:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6408
            "/
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6409
            "/ 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
  6410
            "/ 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
  6411
            "/ 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
  6412
            "/
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6413
            startNr := 1.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6414
            nLines := someText size.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6415
            [startNr <= nLines] whileTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6416
                string := someText asStringWithCRsFrom:startNr
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6417
                                                    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
  6418
                                          compressTabs:compressTabs.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6419
                encoding notNil ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6420
                    string := string encodeInto:encoding
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6421
                ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6422
                stream nextPutAll:string.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6423
                startNr := startNr + 1000 + 1.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6424
            ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6425
        ].
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6426
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6427
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6428
    stream close.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6429
    subView modified:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6430
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6431
    "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
  6432
    "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
  6433
    "Modified: / 6.5.1999 / 11:45:50 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6434
! !
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6435
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6436
!FileBrowser methodsFor:'private - presentation'!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6437
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6438
defineTabulatorsForLongList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6439
    "define the tabs for the long list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6440
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6441
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6442
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6443
"/  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
  6444
    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
  6445
    "                   icon  name   mode  owner  group  size     type"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6446
    tabSpec align:    #(#left #left  #left #right #right #decimal #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6447
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6448
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6449
    tabRulerView tabulatorSpecification:tabSpec.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6450
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6451
    "Modified: 17.4.1997 / 02:56:07 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6452
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6453
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6454
defineTabulatorsForShortList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6455
    "define the tabs for the short list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6456
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6457
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6458
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6459
"/  tabSpec positions:#(0     0.25 ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6460
    tabSpec widths:   #(0.25   2   ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6461
    "                   icon  name"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6462
    tabSpec align:    #(#left #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6463
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6464
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6465
    tabRulerView notNil ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6466
	tabRulerView tabulatorSpecification:tabSpec.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6467
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6468
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6469
    "Created: / 17.4.1997 / 02:51:41 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6470
    "Modified: / 27.7.1998 / 20:23:34 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6471
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6472
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6473
iconForFile:aFilenameString
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6474
    "given a fileName, return an appropriate icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6475
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6476
    |f icn key key2 suff mimeType|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6477
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6478
    f := currentDirectory construct:aFilenameString.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6479
    f isDirectory ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6480
        f isSymbolicLink ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6481
            key := #directoryLink
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6482
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6483
            key := #directory.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6484
            (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
  6485
                key := #directoryLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6486
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6487
        ]
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6488
    ] ifFalse:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6489
        f isSymbolicLink ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6490
            f isReadable not ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6491
                key := #fileLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6492
            ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6493
                key := #fileLink
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6494
            ]
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6495
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6496
            key := key2 := #file.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6497
            f isExecutableProgram ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6498
                key := key2 := #executableFile
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6499
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6500
            (f isReadable not) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6501
                key := #fileLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6502
            ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6503
                suff := f suffix.
2504
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6504
                (suff = 'bak' or:[suff = 'sav']) ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6505
                    suff := f withoutSuffix suffix.
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6506
                ].
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6507
                suff size > 0 ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6508
                    mimeType := MIMETypes mimeTypeForSuffix:suff.
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6509
                    mimeType notNil ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6510
                        (mimeType startsWith:'image/') ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6511
                            key := #imageFile
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6512
                        ] ifFalse:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6513
                            (mimeType startsWith:'text/') ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6514
                                key := #textFile
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6515
                            ]
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6516
                        ]
2504
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6517
                    ].
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6518
                ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6519
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6520
        ].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6521
    ].
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6522
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6523
    "/ local (device) icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6524
    icons notNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6525
        mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6526
            icn := icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6527
            icn notNil ifTrue:[^ icn].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6528
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6529
        icn := icons at:key ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6530
        icn notNil ifTrue:[^ icn].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6531
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6532
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6533
    "/ global icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6534
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6535
    Icons notNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6536
        mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6537
            icn := Icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6538
            "/ sight - check for parent-MIME types ...
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6539
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6540
            [icn isNil and:[mimeType includes:$/]] whileTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6541
                mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6542
                icn := Icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6543
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6544
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6545
        icn notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6546
            key := mimeType
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6547
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6548
            icn := Icons at:key ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6549
        ].
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6550
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6551
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  6552
    icn isNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6553
        (    (key := key2) isNil
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6554
         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
  6555
         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
  6556
        ) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6557
            ^ icn
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6558
        ]
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  6559
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6560
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6561
    "/ remember device icon
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6562
    icn := icn copy onDevice:device.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6563
    icn clearMaskedPixels.
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6564
    icons at:key put:icn.
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  6565
    ^ icn
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6566
1746
68a187e3f30f another icon for executable files.
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
  6567
    "Modified: / 18.9.1997 / 16:35:28 / stefan"
2504
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6568
    "Modified: / 23.12.1999 / 22:28:00 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6569
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6570
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6571
stopImageRenderProcess
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6572
    imageRenderProcess notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6573
	imageRenderProcess terminate.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6574
	imageRenderProcess := nil
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6575
    ].
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6576
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6577
    "Created: 19.4.1997 / 13:51:34 / cg"
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6578
!
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6579
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6580
stopUpdateProcess
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6581
    Processor removeTimedBlock:checkBlock.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6582
    listUpdateProcess notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6583
	listUpdateProcess terminate.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6584
	listUpdateProcess := nil.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6585
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6586
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6587
    "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
  6588
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6589
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6590
updateCurrentDirectory
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6591
    "update listView with directory contents"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6592
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6593
    "the code below may look somewhat complex -
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6594
     it reads the directory first for the names,
1151
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  6595
     then (in followup sweeps over the files) gets the
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  6596
     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
  6597
     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
  6598
     (i.e. stat-calls) may take long - especially on NFS-mounted directories.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6599
     The file reading is done at lower priority, to let user continue
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6600
     his work in other views. However, to be fair to other fileBrowser,
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6601
     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
  6602
     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
  6603
     Therefore, browsers which read short directories will finish first.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6604
     ST/X users love this behavior ;-)
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6605
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6606
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  6607
    self withReadCursorDo:[
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  6608
        |files matchPattern list passDone f ignoreCase|
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6609
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6610
        self stopUpdateProcess.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6611
2636
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  6612
        timeOfLastCheck := currentDirectory modificationTime.
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6613
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6614
        files := currentDirectory asFilename fullDirectoryContents.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6615
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6616
"/        (files includes:(Filename parentDirectoryName)) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6617
"/            upButton enable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6618
"/        ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6619
"/            upButton disable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6620
"/        ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6621
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6622
        "/ show files which are either directories
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6623
        "/ or match the current pattern
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6624
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6625
        matchPattern := filterField contents.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6626
        (matchPattern notNil and:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6627
         matchPattern isEmpty not and:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6628
         matchPattern ~= '*']]) ifTrue:[
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  6629
             ignoreCase := Filename isCaseSensitive not.
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6630
             files := files select:[:aName | 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6631
                         ((currentDirectory construct:aName) isDirectory)
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  6632
                         or:[matchPattern compoundMatch:aName ignoreCase:ignoreCase]
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6633
                      ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6634
        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6635
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6636
        files size == 0 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6637
            self information:('directory ', currentDirectory pathName, ' vanished').
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6638
            ^ self
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6639
        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6640
        (sortByWhat value == #name) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6641
            sortCaseless value == true ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6642
                files sort:[:a :b | a asLowercase < b asLowercase]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6643
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6644
                files sort.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6645
            ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6646
        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6647
            (sortByWhat value == #time) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6648
                files sort:[:a :b | |f1 f2 t1 t2|
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6649
                                f1 := (currentDirectory construct:a).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6650
                                f2 := (currentDirectory construct:b).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6651
                                t1 := f1 isSymbolicLink 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6652
                                        ifFalse:[f1 modificationTime]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6653
                                        ifTrue:[f1 linkInfo modified].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6654
                                t2 := f2 isSymbolicLink 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6655
                                        ifFalse:[f2 modificationTime]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6656
                                        ifTrue:[f2 linkInfo modified].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6657
                                t1 := t1 ? (AbsoluteTime now).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6658
                                t2 := t2 ? (AbsoluteTime now).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6659
                                t1 > t2
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6660
                           ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6661
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6662
                (sortByWhat value == #type) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6663
                    files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2|
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6664
                                    f1 := (currentDirectory construct:a).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6665
                                    f2 := (currentDirectory construct:b).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6666
                                    t1 := f1 type ? #xbadLink. 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6667
                                    t2 := f2 type ? #xbadLink. 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6668
                                    t1 = t2 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6669
                                        suff1 := f1 suffix.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6670
                                        suff2 := f2 suffix.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6671
                                        suff1 = suff2 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6672
                                            sortCaseless value == true ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6673
                                                a asLowercase < b asLowercase
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6674
                                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6675
                                                a < b
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6676
                                            ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6677
                                        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6678
                                            suff1 asLowercase < suff2 asLowercase
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6679
                                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6680
                                    ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6681
                                        t1 < t2
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6682
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6683
                               ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6684
                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6685
            ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6686
        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6687
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6688
        files := self withoutHiddenFiles:files.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6689
        fileList := files copy.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6690
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6691
        tabSpec isNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6692
            showingDetails value "showLongList" ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6693
                self defineTabulatorsForLongList
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6694
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6695
                self defineTabulatorsForShortList
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6696
            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6697
        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6698
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6699
        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6700
        "/ first show all the names - this can be done fast ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6701
        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6702
        list := files collect:[:fileName |
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6703
                    |entry|
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6704
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6705
                    entry := MultiColListEntry new.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6706
                    entry tabulatorSpecification:tabSpec.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6707
                    entry colAt:1 put:nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6708
                    entry colAt:2 put:fileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6709
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6710
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6711
        fileListView setList:list expandTabs:false.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6712
        passDone := Array new:list size withAll:0.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6713
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6714
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6715
         this is a time consuming operation (especially, if reading an
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6716
         NFS-mounted directory); therefore, start a low prio process,
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6717
         which fills in the remaining fields in the fileList ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6718
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6719
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6720
        listUpdateProcess := [
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6721
            |prevUid prevGid fileNameString nameString groupString 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6722
             modeString info line len
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6723
             anyImages lineIndex aFileName
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6724
             entry typ f p typeString done endIndex 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6725
             state stopAtEnd nextState img prevFirstLine prevLastLine
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6726
             numVisible dirSuffix prevWidth|
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6727
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6728
            dirSuffix := Filename directorySuffix.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6729
            dirSuffix size > 0 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6730
                dirSuffix := '.' , dirSuffix asLowercase.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6731
            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6732
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6733
            "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6734
            "/ then walk over the files, adding more info
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6735
            "/ (since we have to stat each file, this may take a while longer)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6736
            "/ Visible items are always filled first.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6737
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6738
            "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6739
            "/ the state machine
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6740
            "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6741
            nextState := IdentityDictionary new.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6742
            showingDetails value "showLongList" ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6743
                nextState add:(#visibleIcons -> #visibleAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6744
                nextState add:(#visibleAttributes -> #visibleTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6745
                nextState add:(#visibleTypes -> #visibleImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6746
                nextState add:(#visibleImages -> #nextPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6747
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6748
                nextState add:(#nextPageIcons -> #nextPageAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6749
                nextState add:(#nextPageAttributes -> #nextPageTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6750
                nextState add:(#nextPageTypes -> #nextPageImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6751
                nextState add:(#nextPageImages -> #previousPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6752
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6753
                nextState add:(#previousPageIcons -> #previousPageAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6754
                nextState add:(#previousPageAttributes -> #previousPageTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6755
                nextState add:(#previousPageTypes -> #previousPageImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6756
                nextState add:(#previousPageImages -> #remainingIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6757
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6758
                nextState add:(#remainingIcons -> #remainingAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6759
                nextState add:(#remainingAttributes -> #remainingTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6760
                nextState add:(#remainingTypes -> #remainingImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6761
                nextState add:(#remainingImages -> nil).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6762
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6763
                nextState add:(#visibleIcons -> #nextPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6764
                nextState add:(#nextPageIcons -> #previousPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6765
                nextState add:(#previousPageIcons -> #remainingIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6766
                nextState add:(#remainingIcons -> nil).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6767
            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6768
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6769
            anyImages := false.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6770
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6771
            lineIndex := prevFirstLine := fileListView firstLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6772
            endIndex := prevLastLine := fileListView lastLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6773
            endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6774
            state := #visibleIcons.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6775
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6776
            done := false.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6777
            [done] whileFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6778
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6779
                "/ if multiple FileBrowsers are reading, let others
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6780
                "/ make some progress too
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6781
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6782
                Processor yield.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6783
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6784
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6785
                "/ could be destroyed in the meanwhile ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6786
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6787
                realized ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6788
                    listUpdateProcess := nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6789
                    Processor activeProcess terminate
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6790
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6791
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6792
                ((prevFirstLine ~~ fileListView firstLineShown)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6793
                or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6794
                    "/ start all over again
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6795
                    lineIndex := prevFirstLine := fileListView firstLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6796
                    endIndex := prevLastLine := fileListView lastLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6797
                    endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6798
                    state := #visibleIcons.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6799
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6800
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6801
                showingDetails value ifTrue:[
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6802
                    prevWidth := fileListView widthOfContents.
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6803
                ].
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6804
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6805
                (lineIndex between:1 and:(files size)) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6806
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6807
                    "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6808
                    "/ expand the next entry ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6809
                    "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6810
                    aFileName := files at:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6811
                    entry := fileListView at:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6812
                    f := currentDirectory construct:aFileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6813
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6814
                    (state endsWith:'Icons') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6815
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6816
                        "/ pass 1 - icons
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6817
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6818
                        (passDone at:lineIndex) < 1 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6819
                            (f isDirectory
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6820
                              and:[(aFileName ~= '..') and:[aFileName ~= '.']]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6821
                            ) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6822
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6823
                                "/ the following suffix cutOff is not really required, 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6824
                                "/ but makes the list look better on VMS ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6825
                                fileNameString := aFileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6826
                                dirSuffix notNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6827
                                    (aFileName asLowercase endsWith:dirSuffix) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6828
                                        fileNameString := aFileName copyWithoutLast:(dirSuffix size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6829
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6830
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6831
                                fileNameString := fileNameString , ' ...'
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6832
                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6833
                                fileNameString := aFileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6834
                                OperatingSystem isVMSlike ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6835
                                    (aFileName endsWith:'.') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6836
                                        aFileName ~= '..' ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6837
                                            fileNameString := aFileName copyWithoutLast:1
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6838
                                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6839
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6840
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6841
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6842
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6843
                            showingDetails value "showLongList" ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6844
                                len := fileNameString size.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6845
                                (len > 20) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6846
                                    fileNameString := (fileNameString contractTo:20)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6847
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6848
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6849
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6850
                            entry colAt:1 put:(self iconForFile:aFileName).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6851
                            entry colAt:2 put:fileNameString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6852
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6853
                            "/fileListView at:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6854
                            fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6855
                            fileListView invalidateLine:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6856
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6857
                            anyImages ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6858
                                (Image isImageFileSuffix:(aFileName asFilename suffix))
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6859
                                ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6860
                                    anyImages := true
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6861
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6862
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6863
                            passDone at:lineIndex put:1
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6864
                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6865
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6866
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6867
                    (state endsWith:'Attributes') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6868
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6869
                        "/ pass 2 - everything except fileType (which takes very long)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6870
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6871
                        (passDone at:lineIndex) < 2 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6872
                            info := f info.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6873
                            info isNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6874
                                "not accessable - usually a symlink,
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6875
                                 to a nonexisting/nonreadable file
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6876
                                "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6877
                                f isSymbolicLink ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6878
                                    p := f linkInfo path.    
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6879
                                    typeString := 'broken symbolic link to ' , p
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6880
                                ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6881
                                    typeString := 'unknown'
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6882
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6883
                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6884
                                typ := (info type).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6885
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6886
                                modeString := self getModeString:(info at:#mode)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6887
                                                            with:#( '' $r $w $x 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6888
                                                                    '  ' $r $w $x 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6889
                                                                    '  ' $r $w $x ).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6890
                                entry colAt:3 put:modeString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6891
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6892
                                ((info uid) ~~ prevUid) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6893
                                    prevUid := (info uid).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6894
                                    nameString := OperatingSystem getUserNameFromID:prevUid.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6895
                                    nameString := nameString contractTo:10.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6896
                                    nameString := nameString , (String new:(10 - nameString size))
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6897
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6898
                                nameString isNil ifTrue:[nameString := '???'].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6899
                                entry colAt:4 put:nameString withoutSpaces.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6900
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6901
                                ((info gid) ~~ prevGid) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6902
                                    prevGid := (info gid).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6903
                                    groupString := OperatingSystem getGroupNameFromID:prevGid.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6904
                                    groupString := groupString contractTo:10.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6905
                                    groupString := groupString , (String new:(10 - groupString size))
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6906
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6907
                                groupString isNil ifTrue:[groupString := '???'].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6908
                                entry colAt:5 put:groupString withoutSpaces.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6909
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6910
                                (typ == #regular) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6911
                                    entry colAt:6 put:(self sizePrintString:(info size)).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6912
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6913
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6914
                                f isSymbolicLink ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6915
                                    p := f linkInfo path.    
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6916
                                    typeString := 'symbolic link to ' , p
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6917
                                ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6918
                                    typeString := typ asString
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6919
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6920
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6921
                            entry colAt:7 put:typeString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6922
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6923
                            "/ fileListView at:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6924
                            fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6925
                            fileListView invalidateLine:lineIndex.
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6926
                        
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6927
                            passDone at:lineIndex put:2.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6928
                        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6929
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6930
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6931
                    (state endsWith:'Types') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6932
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6933
                        "/ pass 3: add fileType
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6934
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6935
                        (passDone at:lineIndex) < 3 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6936
                            info := f info.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6937
                            info notNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6938
                                f isSymbolicLink ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6939
                                    (Image isImageFileSuffix:(f suffix)) ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6940
                                        typeString := f fileType.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6941
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6942
                                        entry colAt:7 put:typeString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6943
                                        "/ fileListView at:lineIndex put:entry
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6944
                                        fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6945
                                        fileListView invalidateLine:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6946
                                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6947
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6948
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6949
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6950
                            passDone at:lineIndex put:3
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6951
                        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6952
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6953
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6954
                    (state endsWith:'Images') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6955
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6956
                        "/ pass 4: read images
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6957
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6958
                        (passDone at:lineIndex) < 4 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6959
                            (Image isImageFileSuffix:(f suffix)) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6960
                                f isDirectory ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6961
                                    img := Image fromFile:(f pathName).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6962
                                    img notNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6963
                                        showingBigImagePreview value == true ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6964
                                            img := img magnifiedTo:32@32.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6965
                                        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6966
                                            img := img magnifiedTo:16@16.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6967
                                        ].
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
  6968
                                        img := img onDevice:self device.
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6969
                                        entry colAt:7 put:img.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6970
                                        "/ fileListView at:lineIndex put:entry
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6971
                                        fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6972
                                        fileListView invalidateLine:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6973
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6974
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6975
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6976
                            passDone at:lineIndex put:4
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6977
                        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6978
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6979
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6980
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6981
                showingDetails value ifTrue:[
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6982
                    fileListView widthOfContents ~~ prevWidth ifTrue:[
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6983
                        fileListView contentsChanged.    
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6984
                    ]
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6985
                ].
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6986
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6987
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6988
                "/ advance to the next line
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6989
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6990
                lineIndex := lineIndex + 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6991
                lineIndex > endIndex ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6992
                    "/ finished this round ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6993
                    "/ see what we are going for ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6994
                    numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6995
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6996
                    state := nextState at:state ifAbsent:nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6997
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6998
                    state isNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6999
                        done := true
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7000
                    ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7001
                        (state startsWith:'visible') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7002
                            lineIndex := fileListView firstLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7003
                            endIndex := fileListView lastLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7004
                            endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7005
                        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7006
                            (state startsWith:'nextPage') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7007
                                lineIndex := fileListView lastLineShown + 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7008
                                endIndex := lineIndex + numVisible.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7009
                                endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7010
                                lineIndex := lineIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7011
                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7012
                                (state startsWith:'previousPage') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7013
                                    endIndex := fileListView firstLineShown - 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7014
                                    lineIndex := endIndex - numVisible.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7015
                                    lineIndex := lineIndex max:1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7016
                                    endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7017
                                    endIndex := endIndex max:1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7018
                                ] ifFalse:[ 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7019
                                    "/ remaining
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7020
                                    lineIndex := 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7021
                                    endIndex := files size.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7022
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7023
                            ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7024
                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7025
                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7026
                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7027
            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7028
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7029
            listUpdateProcess := nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7030
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7031
        ] forkAt:(Processor activePriority - 1).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7032
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7033
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7034
         install a new check after some time
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7035
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7036
        Processor addTimedBlock:checkBlock afterSeconds:checkDelta
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  7037
    ]
142
claus
parents: 139
diff changeset
  7038
1487
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  7039
    "Modified: / 21.9.1995 / 11:40:23 / claus"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  7040
    "Modified: / 28.4.1997 / 22:30:30 / dq"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  7041
    "Modified: / 18.9.1997 / 18:28:30 / stefan"
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  7042
    "Modified: / 16.12.1999 / 01:25:23 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  7043
! !
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  7044
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  7045
!FileBrowser methodsFor:'queries'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  7046
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7047
fileName
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7048
    "return my current fileName - during fileIn, the file
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7049
     which is being loaded is returned.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7050
     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
  7051
     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
  7052
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7053
    |f|
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7054
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7055
    f := currentFileInFileName ? currentFileName.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7056
    f isNil ifTrue:[^ nil].
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7057
    ^ self path asFilename construct:f
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7058
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7059
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7060
     (FileBrowser openOnFileNamed:'Makefile') fileName
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7061
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7062
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7063
    "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
  7064
!
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7065
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  7066
path
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  7067
    "return my currentDirectories pathName;
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7068
     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
  7069
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7070
    "/ somewhat tricky: first ask it for the full pathName,
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7071
    "/ then convert it to a directory name
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7072
    "/ (which only makes a difference on VMS)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7073
1828
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  7074
    ^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  7075
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  7076
    "Modified: / 12.8.1998 / 14:45:48 / cg"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  7077
! !
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  7078
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  7079
!FileBrowser class methodsFor:'documentation'!
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  7080
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  7081
version
2665
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  7082
    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.369 2000-05-23 07:50:54 cg Exp $'
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  7083
! !