FileBrowser.st
author Claus Gittinger <cg@exept.de>
Tue, 18 Sep 2001 10:23:13 +0200
changeset 3172 053d50fe2f6b
parent 3072 7cdb61c5472b
child 3185 438e22824ee8
permissions -rw-r--r--
menu reorganized
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
2688
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    16
	instanceVariableNames:'menuPanel labelView filterField fileListView subView
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    17
		currentDirectory fileList checkBlock checkDelta timeOfLastCheck
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    18
		myName killButton pauseToggle compressTabs lockUpdate
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    19
		previousDirectory currentFileName timeOfFileRead tabSpec
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    20
		commandView commandIndex fileEncoding tabRulerView scrollView
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    21
		icons listUpdateProcess currentFileInFileName
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    22
		lastFileDiffDirectory sortByWhat sortCaseless showingDetails
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
    23
		showingHiddenFiles showingBigImagePreview imagePreviewView
2779
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
    24
		imageRenderProcess dosEOLMode doAutoUpdate doNotShowFontDialog'
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
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
    27
		DefaultCommandPerMIME VisitedFileHistory'
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
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    90
on:aDirectoryPath
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    91
    "return a new FileBrowser in a pathname"
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    92
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    93
    ^ (self new currentDirectory:aDirectoryPath)
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    94
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    95
    "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    96
     (FileBrowser on:'/usr/local/bin') open
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    97
     (FileBrowser on:'/etc'          ) open
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    98
     (FileBrowser on:'..'            ) open
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
    99
     (FileBrowser on:'.'             ) open
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   100
    "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   101
!
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   102
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   103
openOn:aDirectoryPath
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   104
    "start a new FileBrowser in a pathname"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   105
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   106
    ^ (self on:aDirectoryPath) open
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   107
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   108
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   109
     FileBrowser openOn:'/etc'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   110
     FileBrowser openOn:'..'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   111
     FileBrowser openOn:'.'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   112
    "
93
claus
parents: 85
diff changeset
   113
!
claus
parents: 85
diff changeset
   114
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   115
openOn:aDirectoryPath withExtent:extent
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   116
    "start a new FileBrowser in a pathname"
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   117
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   118
    ^ (self on:aDirectoryPath) openWithExtent:extent
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   119
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   120
    "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   121
     FileBrowser openOn:'/etc'           withExtent:200@300
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   122
     FileBrowser openOn:'..'             withExtent:200@300
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   123
     FileBrowser openOn:'.'              withExtent:200@300
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   124
    "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   125
!
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   126
93
claus
parents: 85
diff changeset
   127
openOnFileNamed:aFilename
claus
parents: 85
diff changeset
   128
    "start a new FileBrowser on a file"
claus
parents: 85
diff changeset
   129
claus
parents: 85
diff changeset
   130
    |f browser|
claus
parents: 85
diff changeset
   131
claus
parents: 85
diff changeset
   132
    f := aFilename asFilename.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   133
    f isDirectory ifTrue:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   134
        ^ self openOn:aFilename
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   135
    ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   136
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
   137
    browser := self on:f directoryName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   138
    browser updateCurrentDirectory.
93
claus
parents: 85
diff changeset
   139
    browser showFile:f baseName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   140
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   141
    ^ browser open.
93
claus
parents: 85
diff changeset
   142
claus
parents: 85
diff changeset
   143
    "
claus
parents: 85
diff changeset
   144
     FileBrowser openOnFileNamed:'Makefile'
claus
parents: 85
diff changeset
   145
     FileBrowser openOnFileNamed:'../Makefile'
claus
parents: 85
diff changeset
   146
     FileBrowser openOnFileNamed:'/tmp/foo'
claus
parents: 85
diff changeset
   147
    "
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   148
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   149
    "Modified: / 17.6.1998 / 11:25:29 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   150
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   151
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   152
!FileBrowser class methodsFor:'aspects'!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   153
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   154
hasVisitHistory
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   155
    ^ [DirectoryHistory size > 0]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   156
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   157
    "Created: / 14.8.1998 / 19:17:02 / cg"
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   158
    "Modified: / 14.8.1998 / 19:17:17 / cg"
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   159
! !
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   160
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   161
!FileBrowser class methodsFor:'class initialization'!
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   162
2676
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   163
icons
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   164
    Icons isNil ifTrue:[
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   165
        self initializeIcons
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   166
    ].
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   167
    ^ Icons
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   168
!
06199a1e7dba access method to retrive Icons
ca
parents: 2669
diff changeset
   169
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   170
initializeDefaultCommands
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   171
    DefaultCommandPerMIME := Dictionary new.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   172
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   173
    DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   174
    DefaultCommandPerMIME at:'application/pdf'              put:'acroread %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   175
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   176
    "
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   177
     self initializeDefaultCommands
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   178
    "
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   179
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   180
    "Modified: / 1.8.1998 / 17:39:27 / cg"
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   181
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   182
!
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   183
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   184
initializeIcons
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   185
    |resources|
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   186
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   187
    resources := self classResources.
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   188
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   189
    Icons := Dictionary new.
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   190
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   191
    #(
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   192
        "/ internal-type to icon mappings.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   193
        (#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
   194
        (#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
   195
        (#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
   196
        (#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
   197
        (#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
   198
        (#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
   199
        (#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
   200
        (#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
   201
        (#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
   202
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   203
        "/ mime-type to icon mappings.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   204
        ('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
   205
        ('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
   206
        ('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
   207
        ('application/x-smalltalk-source' nil     'tiny_file_st.xpm'          )
2320
1c6abdeb68ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2257
diff changeset
   208
        ('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
   209
        ('image'                          nil     'tiny_file_pix.xpm'         )
2794
39c27727bd3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2791
diff changeset
   210
        ('audio'                          nil     'tiny_file_sound.xpm'       )
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   211
     ) do:[:entry |
2491
0222b19ee371 new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
   212
        |key resource defaultName nm img|
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   213
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   214
        key := entry at:1.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   215
        resource := entry at:2.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   216
        defaultName := entry at:3.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   217
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   218
        resource notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   219
            nm := resources at:resource default:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   220
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   221
        nm isNil ifTrue:[
2491
0222b19ee371 new icon search (search under goodies package)
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
   222
            nm := 'xpmBitmaps/document_images/' , defaultName
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
   223
        ].
2492
055eef2763e3 moved icon search to smalltalk utility method
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   224
        Icons at:key put:(Smalltalk imageFromFileNamed:nm forClass:self).
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   225
    ]
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   226
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   227
    "
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   228
     self initializeIcons
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
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   231
    "Modified: / 1.8.1998 / 17:39:27 / cg"
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   232
! !
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   233
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   234
!FileBrowser class methodsFor:'defaults'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   235
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   236
defaultIcon
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   237
    "return the file browsers default window icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   238
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   239
    <resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)>
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   240
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   241
    |nm i res|
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   242
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   243
    (i := DefaultIcon) isNil ifTrue:[
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   244
        res := self classResources.
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   245
        i := res at:'FILEBROWSER_ICON' default:nil.
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   246
        i isNil ifTrue:[
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   247
            nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'.
2476
866fdfe9b2d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
   248
            i := Smalltalk imageFromFileNamed:nm forClass:self.
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   249
            i isNil ifTrue:[
2453
63c50508c4cd try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
   250
                i := StandardSystemView defaultIcon
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   251
            ]
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   252
        ].
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   253
        i notNil ifTrue:[
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   254
            DefaultIcon := i := i onDevice:Display
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
   255
        ]
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   256
    ].
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   257
    ^ i
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   258
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   259
    "Modified: 19.3.1997 / 20:48:34 / ca"
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   260
    "Modified: 15.8.1997 / 15:27:19 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   261
! !
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   262
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   263
!FileBrowser class methodsFor:'history'!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   264
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   265
addToCommandHistory:aCommandString for:aFilename
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   266
    |cmd suffix|
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   267
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   268
    (aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   269
	CommandHistory notNil ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   270
	    CommandHistory addFirst:aCommandString.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   271
	    CommandHistory size > CommandHistorySize ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   272
		CommandHistory removeLast
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   273
	    ]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   274
	].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   275
	aFilename notNil ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   276
	    cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   277
	    DefaultCommandPerSuffix isNil ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   278
		DefaultCommandPerSuffix := Dictionary new.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   279
	    ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   280
	    suffix := aFilename asFilename suffix.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   281
	    suffix notNil ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   282
		DefaultCommandPerSuffix at:suffix put:cmd.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   283
	    ]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   284
	]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   285
    ]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   286
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   287
    "Created: 14.11.1996 / 14:58:13 / cg"
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   288
!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   289
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   290
addToHistory:path
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   291
    |pos idx|
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   292
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   293
    idx := DirectoryHistory indexOf:path.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   294
    idx == 0 ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   295
        DirectoryHistory size >= HistorySize ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   296
            DirectoryHistory removeLast.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   297
            DirectoryHistoryWhere removeLast
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   298
        ]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   299
    ] ifFalse:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   300
        "already been there before; move the entry to
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   301
         the beginning, so it will fall out later."
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   302
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   303
        DirectoryHistory removeIndex:idx.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   304
        pos := DirectoryHistoryWhere at:idx.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   305
        DirectoryHistoryWhere removeIndex:idx.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   306
    ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   307
    DirectoryHistory addFirst:path.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   308
    DirectoryHistoryWhere addFirst:pos.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   309
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   310
    "Created: / 8.11.1997 / 17:16:29 / cg"
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   311
!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   312
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   313
addToVisitedFileHistory:path
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   314
    |idx|
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   315
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   316
    idx := VisitedFileHistory indexOf:path.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   317
    idx == 0 ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   318
        VisitedFileHistory size >= HistorySize ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   319
            VisitedFileHistory removeLast.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   320
        ]
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   321
    ] ifFalse:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   322
        "already been there before; move the entry to
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   323
         the beginning, so it will fall out later."
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   324
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   325
        VisitedFileHistory removeIndex:idx.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   326
    ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   327
    VisitedFileHistory addFirst:path.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   328
! !
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   329
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   330
!FileBrowser class methodsFor:'interface specs'!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   331
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   332
fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   333
    "This resource specification was automatically generated
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   334
     by the UIPainter of ST/X."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   335
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   336
    "Do not manually edit this!! If it is corrupted,
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   337
     the UIPainter may not be able to read the specification."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   338
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   339
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   340
     UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   341
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   342
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   343
    <resource: #canvas>
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   344
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   345
    ^
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   346
     
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   347
       #(#FullSpec
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   348
	  #window: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   349
	   #(#WindowSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   350
	      #name: 'File Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   351
	      #layout: #(#LayoutFrame 4 0 50 0 315 0 349 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   352
	      #level: 0
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   353
	      #label: 'File Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   354
	      #min: #(#Point 10 10)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   355
	      #max: #(#Point 1280 1024)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   356
	      #bounds: #(#Rectangle 4 50 316 350)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   357
	      #usePreferredExtent: false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   358
	      #returnIsOKInDialog: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   359
	      #escapeIsCancelInDialog: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   360
	  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   361
	  #component: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   362
	   #(#SpecCollection
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   363
	      #collection: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   364
	       #(
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   365
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   366
		    #name: 'Label1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   367
		    #layout: #(#LayoutFrame 0 0 10 0 0 1 32 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   368
		    #label: 'Search for files named:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   369
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   370
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   371
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   372
		 #(#InputFieldSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   373
		    #name: 'EntryField1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   374
		    #layout: #(#LayoutFrame 10 0 36 0 305 0 58 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   375
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   376
		    #model: #namePatternHolder
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   377
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   378
		 #(#CheckBoxSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   379
		    #name: 'CheckBox1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   380
		    #layout: #(#LayoutFrame 7 0 66 0 143 0 88 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   381
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   382
		    #model: #ignoreCaseInName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   383
		    #label: 'Ignore case'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   384
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   385
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   386
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   387
		    #name: 'Label2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   388
		    #layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   389
		    #label: 'Containing the string:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   390
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   391
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   392
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   393
		 #(#InputFieldSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   394
		    #name: 'EntryField2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   395
		    #layout: #(#LayoutFrame 10 0 133 0 305 0 155 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   396
		    #enableChannel: #notSearchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   397
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   398
		    #model: #contentsPatternHolder
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   399
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   400
		 #(#CheckBoxSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   401
		    #name: 'CheckBox2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   402
		    #layout: #(#LayoutFrame 6 0 163 0 142 0 185 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   403
		    #enableChannel: #notSearchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   404
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   405
		    #model: #ignoreCaseInContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   406
		    #label: 'Ignore case'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   407
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   408
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   409
		 #(#LabelSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   410
		    #name: 'Label3'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   411
		    #layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   412
		    #label: 'Containing same contents as selected:'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   413
		    #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   414
		    #adjust: #left
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   415
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   416
		 #(#DividerSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   417
		    #name: 'Separator1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   418
		    #layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   419
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   420
		 #(#CheckToggleSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   421
		    #name: 'CheckToggle1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   422
		    #layout: #(#LayoutOrigin -25 1 225 0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   423
		    #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   424
		    #model: #searchForSameContents
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   425
		    #enableChannel: #searchForSameContentsEnabled
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   426
		    #isTriggerOnDown: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   427
		    #showLamp: false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   428
		    #lampColor: #(#Color 100.0 100.0 0.0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   429
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   430
		 #(#HorizontalPanelViewSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   431
		    #name: 'HorizontalPanel1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   432
		    #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   433
		    #component: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   434
		     #(#SpecCollection
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   435
			#collection: 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   436
			 #(
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   437
			   #(#ActionButtonSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   438
			      #name: 'Button1'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   439
			      #label: 'Cancel'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   440
			      #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   441
			      #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   442
			      #model: #cancel
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   443
			      #extent: #(#Point 151 25)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   444
			  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   445
			   #(#ActionButtonSpec
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   446
			      #name: 'Button2'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   447
			      #label: 'Search'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   448
			      #translateLabel: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   449
			      #tabable: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   450
			      #model: #accept
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   451
			      #isDefault: true
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   452
			      #extent: #(#Point 152 25)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   453
			  )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   454
			)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   455
		    )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   456
		    #horizontalLayout: #fitSpace
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   457
		    #verticalLayout: #centerMax
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   458
		    #horizontalSpace: 3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   459
		    #verticalSpace: 3
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   460
		)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   461
	      )
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   462
	  )
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   463
      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   464
! !
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   465
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   466
!FileBrowser class methodsFor:'menu specs'!
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
baseDirectoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   469
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   470
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   471
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   472
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   473
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   474
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   475
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   476
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   477
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   478
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   479
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   480
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   481
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   482
    ^
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
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   485
          
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   486
	   #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   487
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   488
		#label: 'Copy Path'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   489
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   490
		#value: #copyPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   491
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   492
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   493
		#label: '-'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   494
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   495
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   496
		#label: 'Up'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   497
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   498
		#value: #changeToParentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   499
		#enabled: #currentDirectoryIsNotTop
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   500
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   501
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   502
		#label: 'Back'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   503
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   504
		#value: #changeToPreviousDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   505
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   506
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   507
		#label: 'Home'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   508
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   509
		#value: #changeToHomeDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   510
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   511
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   512
		#label: 'Default'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   513
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   514
		#value: #changeToDefaultDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   515
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   516
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   517
		#label: 'Goto...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   518
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   519
		#value: #changeCurrentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   520
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   521
	  ) nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   522
	  nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   523
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   524
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   525
    "Created: / 4.8.1998 / 17:21:16 / cg"
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   526
    "Modified: / 14.8.1998 / 19:19:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   527
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   528
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   529
directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   530
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   531
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   532
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   533
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   534
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   535
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   536
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   537
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   538
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   539
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   540
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   541
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   542
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   543
    |m|
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   544
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   545
    m := self baseDirectoryMenuSpec.
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   546
    m := m decodeAsLiteralArray.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   547
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   548
    "/ add the history items ...
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   549
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   550
    DirectoryHistory size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   551
	m addItem:(MenuItem labeled:'-').
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   552
	DirectoryHistory do:[:dirName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   553
	    m addItem:((MenuItem label:dirName value:#changeDirectoryTo:)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   554
			    argument:dirName;
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   555
			    yourself).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
   556
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   557
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   558
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   559
    m findGuiResourcesIn:self.
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   560
    ^ m
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   561
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   562
    "Modified: / 17.8.1998 / 10:13:05 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   563
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   564
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   565
menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   566
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   567
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   568
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   569
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   570
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   571
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   572
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   573
     MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   574
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   575
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   576
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   577
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   578
2185
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
     #(#Menu
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   581
        #(
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   582
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   583
            #label: 'Spawn'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   584
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   585
            #value: #fileSpawn
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   586
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   587
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   588
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   589
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   590
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   591
            #label: 'Get Contents'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   592
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   593
            #value: #fileGet
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   594
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   595
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   596
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   597
            #label: 'Insert Contents'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   598
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   599
            #value: #fileInsert
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   600
            #enabled: #hasSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   601
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   602
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   603
            #label: 'FileIn'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   604
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   605
            #value: #fileFileIn
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   606
            #enabled: #hasSelection
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
   607
            #shortcutKeyCharacter: #Accept
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   608
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   609
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   610
            #label: '-'
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
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   613
            #label: 'New'
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   614
            #translateLabel: true
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   615
            #submenu: 
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   616
           #(#Menu
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   617
              #(
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   618
               #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   619
                  #label: 'Directory...'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   620
                  #translateLabel: true
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   621
                  #value: #newDirectory
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   622
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   623
               #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   624
                  #label: 'File...'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   625
                  #translateLabel: true
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   626
                  #value: #newFile
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   627
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   628
               #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   629
                  #label: 'Hard Link...'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   630
                  #translateLabel: true
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   631
                  #isVisible: #systemIsUnix
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   632
                  #value: #newHardLink
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   633
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   634
               #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   635
                  #label: 'Symbolic Link...'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   636
                  #translateLabel: true
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   637
                  #isVisible: #systemIsUnix
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   638
                  #value: #newSoftLink
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   639
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   640
               )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   641
              nil
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   642
              nil
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   643
            )
2185
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
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   646
            #label: 'Remove...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   647
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   648
            #value: #fileRemove
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   649
            #enabled: #hasSelection
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
   650
            #shortcutKeyCharacter: #Cut
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   651
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   652
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   653
            #label: 'Rename...'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   654
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   655
            #value: #fileRename
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   656
            #enabled: #hasSelection
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
   657
            #shortcutKeyCharacter: #Replace
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   658
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   659
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   660
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   661
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   662
         #(#MenuItem
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   663
            #label: 'Properties...'
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   664
            #translateLabel: true
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   665
            #value: #fileGetLongInfo
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   666
            #enabled: #hasSelection
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   667
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   668
         #(#MenuItem
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   669
            #label: '-'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   670
          )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   671
         #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   672
            #label: 'Tools'
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   673
            #translateLabel: true
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   674
            #submenuChannel: #toolsMenuSpec
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   675
            #shortcutKeyCharacter: #Ctrl
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   676
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   677
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   678
            #label: '-'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   679
          )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   680
         #(#MenuItem
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   681
            #label: 'Update'
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   682
            #translateLabel: true
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   683
            #value: #updateCurrentDirectory
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
         )
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   686
        nil
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
   687
        nil
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
   688
      )
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
   689
!
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
menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   692
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   693
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   694
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   695
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   696
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   697
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
     MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   700
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   701
    "
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
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   704
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
   705
    ^ 
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
   706
     #(#Menu
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   707
        #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   708
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   709
            #label: 'About'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   710
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   711
            #labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   712
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   713
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   714
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   715
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   716
                  #label: 'About Smalltalk/X...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   717
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   718
                  #value: #showAboutSTX
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   719
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   720
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   721
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   722
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   723
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   724
                  #label: 'About FileBrowser...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   725
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   726
                  #value: #openAboutThisApplication
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   727
                )
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
              nil
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
            )
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
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   734
            #label: 'File'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   735
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   736
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   737
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   738
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   739
               #(#MenuItem
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   740
                  #label: 'Spawn'
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   741
                  #translateLabel: true
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   742
                  #value: #fileSpawn
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   743
                )
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   744
               #(#MenuItem
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   745
                  #label: '-'
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   746
                )
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   747
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   748
                  #label: 'Open'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   749
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   750
                  #value: #menuOpen
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   751
                  #enabled: #hasSelection
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   752
                  #isVisible: false
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   753
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   754
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   755
                  #label: 'Open selected Filename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   756
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   757
                  #isVisible: #hasFilenameSelectionInCodeView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   758
                  #value: #openSelectedFilename
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   759
                  #enabled: #hasFilenameSelectionInCodeView
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   760
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   761
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   762
                  #label: 'FileIn'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   763
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   764
                  #value: #fileFileIn
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   765
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   766
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   767
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   768
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   769
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   770
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   771
                  #label: 'New'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   772
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   773
                  #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   774
                 #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   775
                    #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   776
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   777
                        #label: 'Directory...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   778
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   779
                        #value: #newDirectory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   780
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   781
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   782
                        #label: 'File...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   783
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   784
                        #value: #newFile
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   785
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   786
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   787
                        #label: 'Hard Link...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   788
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   789
                        #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   790
                        #value: #newHardLink
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   791
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   792
                     #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   793
                        #label: 'Symbolic Link...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   794
                        #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   795
                        #isVisible: #systemIsUnix
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   796
                        #value: #newSoftLink
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   797
                      )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   798
                     )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   799
                    nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   800
                    nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   801
                  )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   802
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   803
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   804
                  #label: 'Remove'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   805
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   806
                  #value: #fileRemove
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   807
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   808
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   809
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   810
                  #label: 'Rename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   811
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   812
                  #value: #fileRename
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   813
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   814
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   815
               #(#MenuItem
2143
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   816
                  #label: '-'
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   817
                )
cdb7124285c6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2142
diff changeset
   818
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   819
                  #label: 'Properties...'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   820
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   821
                  #value: #fileGetLongInfo
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   822
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   823
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   824
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   825
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   826
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   827
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   828
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   829
                  #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
   830
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   831
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   832
                  #value: #fileAddToJavaClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   833
                  #enabled: #canAddToClassPath
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   834
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   835
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   836
                  #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
   837
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   838
                  #isVisible: #javaSupportLoaded
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   839
                  #value: #fileRemoveFromJavaClassPath
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   840
                  #enabled: #canRemoveFromClassPath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   841
                )
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   842
               #(#MenuItem
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   843
                  #label: 'Add to Java SourcePath'
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   844
                  #translateLabel: true
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   845
                  #isVisible: #javaSupportLoaded
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   846
                  #value: #fileAddToJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   847
                  #enabled: #canAddToSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   848
                )
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   849
               #(#MenuItem
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   850
                  #label: 'Remove from Java SourcePath'
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   851
                  #translateLabel: true
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   852
                  #isVisible: #javaSupportLoaded
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   853
                  #value: #fileRemoveFromJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   854
                  #enabled: #canRemoveFromSourcePath
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   855
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   856
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   857
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   858
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   859
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   860
                  #label: 'Exit'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   861
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   862
                  #value: #menuExit
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   863
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   864
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   865
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   866
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   867
            )
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: 'Directory'
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
            #submenuChannel: #directoryMenuSpec
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
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   875
            #label: 'Edit'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   876
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   877
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   878
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   879
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   880
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   881
                  #label: 'Get Contents'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   882
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   883
                  #value: #fileGet
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   884
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   885
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   886
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   887
                  #label: 'Insert Contents'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   888
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   889
                  #value: #fileInsert
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   890
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   891
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   892
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   893
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   894
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   895
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   896
                  #label: 'Copy File List'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   897
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   898
                  #value: #copyFileList
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   899
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   900
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   901
                  #label: 'Copy Selected Filename'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   902
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   903
                  #value: #copySelectedFileName
3010
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   904
                  #enabled: #hasSelection
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   905
                )
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   906
               #(#MenuItem
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   907
                  #label: 'Copy Selected Pathname'
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   908
                  #translateLabel: true
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   909
                  #value: #copySelectedPathName
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
   910
                  #enabled: #hasSelection
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   911
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   912
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   913
                  #label: 'Copy Command History'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   914
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   915
                  #value: #copyCommandHistory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   916
                )
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   917
               #(#MenuItem
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   918
                  #label: '-'
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   919
                )
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   920
               #(#MenuItem
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   921
                  #label: 'Visited Files'
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   922
                  #translateLabel: true
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   923
                  #submenuChannel: #visitedFileMenuSpec
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   924
                )
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   925
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   926
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   927
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   928
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   929
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   930
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   931
            #label: 'View'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   932
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   933
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   934
           #(#Menu
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: 'Details'
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: #showingDetails
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: 'Show Hidden Files'
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: #showingHiddenFiles
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: 'Big Image Preview'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   948
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   949
                  #indication: #showingBigImagePreview
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   950
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   951
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   952
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   953
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   954
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   955
                  #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
   956
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   957
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   958
                  #choiceValue: #name
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   959
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   960
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   961
                  #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
   962
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   963
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   964
                  #choiceValue: #type
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   965
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   966
               #(#MenuItem
2155
a8f40fccac62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
   967
                  #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
   968
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   969
                  #choice: #sortByWhat
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   970
                  #choiceValue: #time
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   971
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   972
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   973
                  #label: 'Ignore Case'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   974
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   975
                  #indication: #sortCaseless
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   976
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   977
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   978
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   979
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   980
               #(#MenuItem
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   981
                  #label: 'Encoding...'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   982
                  #translateLabel: true
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   983
                  #value: #fileEncoding
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   984
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   985
               #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   986
                  #label: 'DOS EndOfLine Mode'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   987
                  #translateLabel: true
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   988
                  #indication: #dosEOLMode
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   989
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   990
               #(#MenuItem
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   991
                  #label: '-'
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   992
                )
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
   993
               #(#MenuItem
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   994
                  #label: 'Update'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   995
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   996
                  #value: #updateCurrentDirectory
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
   997
                )
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   998
               #(#MenuItem
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
   999
                  #label: 'AutoUpdate'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1000
                  #translateLabel: true
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1001
                  #indication: #autoUpdate
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1002
                )
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1003
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1004
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1005
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1006
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1007
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1008
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1009
            #label: 'Tools'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1010
            #translateLabel: true
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1011
            #submenuChannel: #toolsMenuSpec
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1012
          )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1013
         #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1014
            #label: 'CVS'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1015
            #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1016
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1017
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1018
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1019
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1020
                  #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
  1021
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1022
                  #value: #cvsUpdateSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1023
                  #enabled: #hasSelection
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1024
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1025
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1026
                  #label: 'Update directory local'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1027
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1028
                  #value: #cvsUpdateDirectoryLocal
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1029
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1030
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1031
                  #label: 'Update directory recursive'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1032
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1033
                  #value: #cvsUpdateDirectoryRecursive
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1034
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1035
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1036
                  #label: '-'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1037
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1038
               #(#MenuItem
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1039
                  #label: 'Commit...'
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1040
                  #translateLabel: true
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1041
                  #value: #cvsCommitSelection
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1042
                )
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1043
               #(#MenuItem
2424
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1044
                  #label: 'Add...'
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1045
                  #translateLabel: true
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1046
                  #value: #cvsAddSelection
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1047
                )
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  1048
               #(#MenuItem
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1049
                  #label: '-'
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1050
                )
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  1051
               #(#MenuItem
2145
5fa2a25b576b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2143
diff changeset
  1052
                  #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
  1053
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1054
                  #value: #cvsRemoveFileAndContainer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1055
                  #enabled: #canRemoveCVSContainer
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1056
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1057
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1058
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1059
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1060
            )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1061
          )
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: 'Help'
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
            #startGroup: #right
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1066
            #submenu: 
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1067
           #(#Menu
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1068
              #(
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1069
               #(#MenuItem
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1070
                  #label: 'FileBrowser Documentation'
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1071
                  #translateLabel: true
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1072
                  #value: #openHTMLDocument:
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1073
                  #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
  1074
                )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1075
               )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1076
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1077
              nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1078
            )
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
         )
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1081
        nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1082
        nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1083
      )
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1084
!
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1085
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1086
toolsMenuSpec
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1087
    "This resource specification was automatically generated
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1088
     by the MenuEditor of ST/X."
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1089
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1090
    "Do not manually edit this!! If it is corrupted,
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1091
     the MenuEditor may not be able to read the specification."
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1092
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1093
    "
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1094
     MenuEditor new openOnClass:FileBrowser andSelector:#toolsMenuSpec
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1095
     (Menu new fromLiteralArrayEncoding:(FileBrowser toolsMenuSpec)) startUp
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1096
    "
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1097
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1098
    <resource: #menu>
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1099
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1100
    ^ 
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1101
     #(#Menu
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1102
        #(
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1103
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1104
            #label: 'Unix Command...'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1105
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1106
            #isVisible: #systemIsUnix
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1107
            #value: #menuOSCommand
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1108
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1109
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1110
            #label: 'DOS Command...'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1111
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1112
            #isVisible: #systemIsDOS
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1113
            #value: #menuOSCommand
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1114
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1115
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1116
            #label: 'VMS Command...'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1117
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1118
            #isVisible: #systemIsVMS
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1119
            #value: #menuOSCommand
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1120
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1121
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1122
            #label: 'Shell Terminal'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1123
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1124
            #isVisible: #canDoTerminal
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1125
            #value: #openTerminal
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1126
            #enabled: #canDoTerminal
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1127
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1128
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1129
            #label: '-'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1130
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1131
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1132
            #label: 'Changes Browser'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1133
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1134
            #value: #openChangesBrowser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1135
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1136
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1137
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1138
            #label: 'Snapshot Image Browser'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1139
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1140
            #value: #openSnapshotImageBrowser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1141
            #enabled: #hasSnapshotSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1142
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1143
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1144
            #label: 'Create Smalltalk Project'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1145
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1146
            #value: #createProjectAndOpenProjectBrowser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1147
            #enabled: #canCreateNewProject
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1148
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1149
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1150
            #label: 'Install autoloaded'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1151
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1152
            #value: #readAbbrevFile
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1153
            #enabled: #canReadAbbrevFile
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1154
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1155
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1156
            #label: 'Editor'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1157
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1158
            #value: #openEditor
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1159
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1160
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1161
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1162
            #label: 'HTML Reader'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1163
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1164
            #value: #openHTMLReader
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1165
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1166
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1167
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1168
            #label: 'ASN1 Browser'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1169
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1170
            #isVisible: #hasASN1
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1171
            #value: #openASN1Browser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1172
            #enabled: #hasASN1AndSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1173
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1174
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1175
            #label: 'C Browser'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1176
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1177
            #isVisible: #hasCBrowser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1178
            #value: #openCBrowser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1179
            #enabled: #hasCBrowser
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1180
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1181
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1182
            #label: 'Applet Viewer'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1183
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1184
            #isVisible: #hasJava
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1185
            #value: #openAppletViewer
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1186
            #enabled: #hasJavaAndSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1187
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1188
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1189
            #label: 'Image Inspector'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1190
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1191
            #value: #openImageInspector
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1192
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1193
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1194
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1195
            #label: 'Image Preview'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1196
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1197
            #value: #openImagePreview
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1198
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1199
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1200
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1201
            #label: 'Image Editor'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1202
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1203
            #value: #openImageEditor
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1204
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1205
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1206
         #(#MenuItem
3001
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1207
            #label: 'MP3 Player'
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1208
            #translateLabel: true
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1209
            #isVisible: #hasMP3Player
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1210
            #value: #openMP3Player
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1211
            #enabled: #hasMP3PlayerAndSelection
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1212
          )
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1213
         #(#MenuItem
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1214
            #label: 'ZipFile Tool'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1215
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1216
            #value: #openZipTool
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1217
            #enabled: #hasZipFileSelected
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1218
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1219
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1220
            #label: 'File Differences...'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1221
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1222
            #value: #openDiffView
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1223
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1224
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1225
            #label: 'Find Duplicate Files'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1226
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1227
            #value: #fileFindDuplicates
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1228
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1229
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1230
            #label: 'Find All Duplicate Files (recursive)'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1231
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1232
            #value: #fileFindAllDuplicates
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1233
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1234
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1235
            #label: 'Find a File...'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1236
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1237
            #value: #fileFindFile
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1238
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1239
         #(#MenuItem
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1240
            #label: 'Hex Dump'
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1241
            #translateLabel: true
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1242
            #value: #fileHexDump
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1243
            #enabled: #hasSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1244
          )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1245
         )
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1246
        nil
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1247
        nil
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  1248
      )
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1249
!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1250
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1251
visitedFileMenuSpec
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1252
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1253
    <resource: #programMenu>
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1254
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1255
    |m|
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1256
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1257
    VisitedFileHistory size == 0 ifTrue:[^ nil].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1258
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1259
    m := Menu new.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1260
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1261
    "/ add the history items ...
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1262
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1263
    VisitedFileHistory do:[:pathName |
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1264
        m addItem:((MenuItem label:pathName asFilename baseName value:#revisitFile:)
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1265
                        argument:pathName;
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1266
                        yourself).
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1267
    ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  1268
    ^ m
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  1269
! !
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1270
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1271
!FileBrowser class methodsFor:'queries'!
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1272
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1273
isVisualStartable
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  1274
    "return true, if this application can be started via #open.
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  1275
     (to allow start of a change browser via double-click in the browser)"
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1276
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1277
    ^ true
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1278
! !
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  1279
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1280
!FileBrowser methodsFor:'aspects'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1281
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1282
autoUpdate
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1283
    ^ doAutoUpdate
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1284
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1285
    "Created: / 6.5.1999 / 11:37:25 / cg"
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1286
    "Modified: / 6.5.1999 / 11:39:38 / cg"
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1287
!
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  1288
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1289
canAddToClassPath
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1290
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1291
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1292
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1293
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1294
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1295
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1296
            f notNil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1297
            and:[(Java classPath includes:f pathName) not
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1298
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1299
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1300
                 or:[(f hasSuffix:'zip')]]]].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1301
        ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1302
      ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1303
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1304
    "Modified: / 1.2.1999 / 20:38:42 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1305
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1306
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1307
canAddToSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1308
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1309
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1310
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1311
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1312
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1313
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1314
            f notNil
2438
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1315
            and:[(Java sourcePath isNil
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1316
                 or:[(Java sourcePath includes:f pathName) not])
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1317
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1318
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1319
                 or:[(f hasSuffix:'zip')]]]].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1320
        ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1321
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1322
1989
728996560b15 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1323
    "Modified: / 1.2.1999 / 20:38:42 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1324
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1325
2562
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1326
canCreateNewProject
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1327
    ^ [ 
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1328
        currentDirectory notNil
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1329
        and:[((currentDirectory directoryContents 
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1330
                select:[:f| f endsWith:'.prj']) size == 0)
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1331
        and:[((currentDirectory directoryContents 
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1332
                select:[:f| f endsWith:'.st']) size > 0)
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1333
      ]]]
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1334
!
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  1335
2129
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1336
canDoTerminal
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1337
    ^ OperatingSystem isUNIXlike
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1338
      or:[OperatingSystem isMSWINDOWSlike]
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1339
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1340
    "Created: / 4.8.1998 / 13:37:13 / cg"
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1341
    "Modified: / 28.4.1999 / 11:54:17 / cg"
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1342
!
39126a1fb3d5 termian works with windows
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1343
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1344
canReadAbbrevFile
3013
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1345
    ^ [|sel f fn suff ok|
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1346
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1347
        sel := fileListView selection.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1348
        sel size == 1 ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1349
            f := fileList at:sel first ifAbsent:nil.
3013
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1350
            ok := (f = 'abbrev.stc').
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1351
        ].
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1352
        ok ifFalse:[
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1353
            ok := currentDirectory notNil
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1354
                  and:[(currentDirectory asFilename construct:'abbrev.stc') exists].
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1355
        ].
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  1356
        ok
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1357
      ]
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1358
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1359
    "Modified: / 30.1.1999 / 19:05:59 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1360
    "Created: / 29.1.2000 / 13:00:57 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1361
!
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1362
2101
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1363
canRemoveCVSContainer
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1364
    ^ [ |cvsDir|
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1365
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1366
	currentDirectory notNil
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1367
	and:[fileListView selection size > 0
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1368
	and:[(cvsDir := currentDirectory construct:'CVS') exists
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1369
	and:[cvsDir isDirectory]]]]
2101
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1370
!
54dd9ce332bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1371
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1372
canRemoveFromClassPath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1373
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1374
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1375
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1376
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1377
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1378
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1379
            f notNil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1380
            and:[(Java classPath includes:f pathName)
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1381
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1382
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1383
                 or:[(f hasSuffix:'zip')]]]]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1384
          ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1385
      ]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1386
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1387
    "Modified: / 1.2.1999 / 20:39:25 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1388
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1389
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1390
canRemoveFromSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1391
    ^ [ |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1392
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1393
        (Java isNil or:[Java isLoaded not]) ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1394
            false
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1395
        ] ifFalse:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1396
            f := self singleSelectedFileOrCurrentDirectory.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1397
            f notNil
2438
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1398
            and:[(Java sourcePath isNil
63738977d5f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  1399
                 or:[(Java sourcePath includes:f pathName)])
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1400
            and:[f isDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1401
                 or:[(f hasSuffix:'jar')
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1402
                 or:[(f hasSuffix:'zip')]]]]
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1403
          ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1404
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1405
1989
728996560b15 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1406
    "Modified: / 1.2.1999 / 20:39:25 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1407
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1408
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1409
currentDirectoryIsNotTop
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1410
    ^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1411
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1412
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1413
    "Created: / 14.8.1998 / 12:07:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1414
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1415
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1416
dosEOLMode
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1417
    ^ dosEOLMode
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1418
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1419
    "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
  1420
    "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
  1421
!
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  1422
2185
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1423
hasASN1
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1424
    ^ [ OSI::ASN1Parser notNil 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1425
        and:[OSI::ASN1Parser isLoaded]]
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1426
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1427
!
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1428
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1429
hasASN1AndSelection
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1430
    ^ [ fileListView selection size > 0
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1431
        and:[OSI::ASN1Parser notNil 
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1432
        and:[OSI::ASN1Parser isLoaded]]]
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1433
!
a56f1fad5042 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2184
diff changeset
  1434
2814
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  1435
hasCBrowser
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  1436
    ^ [ CC::Browser notNil ]
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  1437
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  1438
!
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  1439
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1440
hasFilenameSelectionInCodeView
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1441
    ^ [ |val sel|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1442
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1443
	val := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1444
	sel := subView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1445
	sel notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1446
	    sel := sel asString withoutSeparators.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1447
	    sel asFilename exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1448
		val := sel asFilename isReadable
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1449
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1450
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1451
	val
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1452
    ]
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1453
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1454
    "Created: / 4.2.1999 / 17:34:57 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1455
    "Modified: / 4.2.1999 / 17:39:32 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1456
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  1457
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1458
hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1459
    ^ [ JavaClassReader notNil 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1460
	and:[JavaClassReader isLoaded]]
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1461
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1462
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1463
    "Created: / 17.10.1998 / 22:58:25 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1464
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1465
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1466
hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1467
    ^ [ fileListView selection size > 0
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1468
	and:[JavaClassReader notNil 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1469
	and:[JavaClassReader isLoaded]]]
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1470
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1471
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1472
    "Created: / 17.10.1998 / 22:58:03 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1473
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1474
3001
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1475
hasMP3Player
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1476
    ^ [ MP3PlayerApplication notNil
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1477
        or:[SaugFix::MP3PlayerApplication notNil ]]
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1478
!
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1479
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1480
hasMP3PlayerAndSelection
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1481
    ^ [ fileListView selection size > 0
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1482
        and:[ self hasMP3Player value]]
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1483
!
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  1484
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1485
hasSelection
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1486
    ^ [fileListView selection size > 0]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1487
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1488
    "Created: / 4.8.1998 / 14:10:31 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1489
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1490
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1491
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1492
hasSnapshotSelection
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1493
    ^ [ 
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1494
        (fileListView selection size == 1)
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1495
        and:[ fileListView selectionValue first string withoutSeparators asFilename hasSuffix:'img' ]
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1496
      ]
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1497
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1498
    "Created: / 4.8.1998 / 14:10:31 / cg"
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1499
    "Modified: / 4.8.1998 / 14:10:57 / cg"
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1500
!
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  1501
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1502
hasZipFileSelected
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1503
    ^ [|sel f fn suff|
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1504
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1505
	sel := fileListView selection.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1506
	sel size == 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1507
	    f := fileList at:sel first ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1508
	    f notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1509
		suff := f asFilename suffix asLowercase.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1510
		suff = 'zip' or:[suff = 'jar']
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1511
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1512
		false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1513
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1514
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1515
	    false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1516
	]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1517
      ]
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1518
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1519
    "Created: / 26.8.1998 / 16:15:26 / cg"
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  1520
    "Modified: / 30.1.1999 / 19:05:59 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1521
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1522
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1523
javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1524
    ^ [ JavaClassReader notNil 
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1525
	and:[JavaClassReader isLoaded]]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1526
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1527
    "Created: / 9.11.1998 / 05:33:17 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1528
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1529
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1530
showingBigImagePreview
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1531
    ^ showingBigImagePreview
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1532
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1533
    "Created: / 14.8.1998 / 14:15:44 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1534
!
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1535
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1536
showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1537
    ^ showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1538
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1539
    "Created: / 14.8.1998 / 14:15:15 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1540
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1541
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1542
showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1543
    ^ showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1544
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1545
    "Created: / 14.8.1998 / 14:15:44 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1546
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1547
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1548
singleSelectedFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1549
    |f sel|
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1550
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1551
    sel := fileListView selection.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1552
    sel size ~~ 1 ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1553
        ^ nil
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1554
    ].
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1555
    f := fileList at:sel first ifAbsent:nil.
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1556
    f notNil ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1557
        ^ currentDirectory asFilename construct:f
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1558
    ].
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1559
    ^ nil
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1560
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1561
    "Created: / 29.1.2000 / 13:09:09 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1562
!
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  1563
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1564
singleSelectedFileOrCurrentDirectory
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1565
    |f sel|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1566
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1567
    sel := fileListView selection.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1568
    sel size > 1 ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1569
        ^ nil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1570
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1571
    sel size == 0 ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1572
        ^ currentDirectory asFilename
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1573
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1574
    f := fileList at:sel first ifAbsent:nil.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1575
    f notNil ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1576
        ^ currentDirectory asFilename construct:f
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1577
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1578
    ^ nil
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1579
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  1580
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1581
sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1582
    ^ sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1583
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1584
    "Created: / 14.8.1998 / 15:55:18 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1585
    "Modified: / 14.8.1998 / 15:56:08 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1586
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1587
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1588
sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1589
    ^ sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1590
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1591
    "Created: / 14.8.1998 / 14:21:21 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1592
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1593
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1594
systemIsDOS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1595
    ^ OperatingSystem isMSDOSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1596
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1597
    "Created: / 4.8.1998 / 13:37:28 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1598
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1599
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1600
systemIsUnix
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1601
    ^ OperatingSystem isUNIXlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1602
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1603
    "Created: / 4.8.1998 / 13:37:13 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1604
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1605
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1606
systemIsVMS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1607
    ^ OperatingSystem isVMSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1608
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1609
    "Created: / 4.8.1998 / 13:37:37 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1610
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1611
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1612
!FileBrowser methodsFor:'drag & drop'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1613
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1614
canDrop:aCollectionOfDropObjects
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1615
    "I accept fileObjects only"
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1616
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1617
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1618
	aDropObject isFileObject ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1619
	    aDropObject isTextObject ifFalse:[^ false].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1620
	]
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1621
    ].
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1622
    ^ true
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1623
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1624
    "Modified: 11.4.1997 / 12:41:59 / cg"
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1625
!
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1626
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1627
drop:aCollectionOfDropObjects at:aPoint
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1628
    "handle drops"
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1629
3061
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1630
    "/ for now ... only allow single drop
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1631
    aCollectionOfDropObjects size > 1 ifTrue:[
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1632
        (self confirm:'Drop the last file only ?') ifFalse:[
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1633
            ^ self
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1634
        ].
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1635
        self dropSingleObject:aCollectionOfDropObjects first at:aPoint.
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1636
        ^ self
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  1637
    ].
3045
99d4bcb69efd ignore drop from myself
Claus Gittinger <cg@exept.de>
parents: 3029
diff changeset
  1638
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1639
    aCollectionOfDropObjects do:[:aDropObject |
3045
99d4bcb69efd ignore drop from myself
Claus Gittinger <cg@exept.de>
parents: 3029
diff changeset
  1640
        self dropSingleObject:aDropObject at:aPoint
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1641
    ]
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1642
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1643
    "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
  1644
!
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1645
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1646
dropSingleObject:someObject at:aPoint
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1647
    "handle drops; if its a directory, change to it.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1648
     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
  1649
     If its text, paste it into the codeView."
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1650
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1651
    |newDir newFile|
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1652
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1653
    someObject isFileObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1654
	someObject isDirectory ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1655
	    newDir := someObject theObject pathName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1656
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1657
	    newDir := someObject theObject directoryName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1658
	    newFile := someObject theObject baseName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1659
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1660
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1661
	newDir notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1662
	    newDir ~= currentDirectory pathName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1663
		self changeDirectoryTo:newDir.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1664
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1665
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1666
	newFile notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1667
	    newFile ~= currentFileName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1668
		fileListView selection:(fileList indexOf:newFile).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1669
		self doFileGet:false.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1670
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1671
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1672
	^ self
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1673
    ].
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1674
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1675
    someObject isTextObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1676
	subView paste:someObject theObject.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1677
	^ self
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1678
    ].
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1679
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1680
    "Modified: 6.4.1997 / 14:46:44 / cg"
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1681
! !
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1682
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1683
!FileBrowser methodsFor:'events'!
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1684
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1685
handlesKeyPress:key inView:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1686
    "this method is reached via delegation: are we prepared to handle
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1687
     a keyPress in some other view ?"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1688
2669
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1689
    <resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu 
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1690
                          #DoIt #Delete #BackSpace #Accept #CmdF #CmdD
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1691
                          #CursorLeft #CursorRight
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1692
                         )>
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1693
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1694
    view == fileListView ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1695
        (key == #Delete 
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1696
        or:[key == #BackSpace
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1697
        or:[key == #Accept
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1698
        or:[key == #CmdI
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1699
        or:[key == #CmdF
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1700
        or:[key == #CmdD
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1701
        or:[key == #Cmdu
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1702
        or:[key == #Cut
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1703
        or:[key == #Cmdr
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1704
        or:[key == #Replace
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1705
        or:[key == #InspectIt
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1706
        or:[key == #GotoLine
2665
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1707
        or:[key == #CursorLeft
2669
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1708
        or:[key == #CursorRight
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1709
        or:[key == #DoIt]]]]]]]]]]]]]]) ifTrue:[^ true].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1710
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1711
    ^ false
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1712
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1713
    "Created: / 28.1.1997 / 14:03:20 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1714
    "Modified: / 20.6.1997 / 16:35:01 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1715
    "Modified: / 16.1.1998 / 16:50:39 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1716
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1717
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1718
keyPress:key x:x y:y view:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1719
    "this method is reached via delegation from the fileListView"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1720
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1721
    <resource: #keyboard (#GotoLine #InspectIt  
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1722
                          #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept
2669
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1723
                          #Cmdr #Cut #CursorLeft #CursorRight)>
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1724
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1725
    (key == #Delete 
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1726
    or:[key == #Cut
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1727
    or:[key == #BackSpace]]) ifTrue:[
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1728
        self fileRemove.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1729
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1730
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1731
    (key == #Accept) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1732
        self fileFileIn.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1733
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1734
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1735
    (key == #GotoLine) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1736
        self fileGet.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1737
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1738
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1739
    (key == #DoIt) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1740
        self fileExecute.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1741
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1742
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1743
    (key == #InspectIt) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1744
        self fileGetInfo.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1745
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1746
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1747
    (key == #CmdI) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1748
        self fileGetLongInfo.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1749
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1750
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1751
    (key == #Cmdu) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1752
        self updateCurrentDirectory.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1753
        ^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1754
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1755
    (key == #CmdF) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1756
        self newFile.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1757
        ^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1758
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1759
    (key == #CmdD) ifTrue:[
2543
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1760
        self newDirectory.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1761
        ^ self
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1762
    ].
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1763
    ((key == #Cmdr) or:[key == #Replace]) ifTrue:[
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1764
        self fileRename.
3e41de02014b CmdR - rename
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  1765
        ^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1766
    ].
2665
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1767
    (key == #CursorLeft) ifTrue:[
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1768
        self changeToParentDirectory.
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1769
        ^ self
3601bc8c5ae2 cursorLeft - change to parent dir
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
  1770
    ].
2669
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1771
    (key == #CursorRight) ifTrue:[
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1772
        self changeToPreviousDirectory.
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1773
        ^ self
677ca47d8d11 cursor-right --> change to previous directory
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1774
    ].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1775
    fileListView keyPress:key x:x y:y
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1776
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1777
    "Created: / 28.1.1997 / 14:03:56 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1778
    "Modified: / 20.6.1997 / 16:35:08 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1779
    "Modified: / 16.1.1998 / 16:51:38 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1780
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1781
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1782
mapped 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1783
    super mapped.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1784
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1785
     whant to know about changed history
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1786
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1787
    self updateCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1788
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1789
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1790
visibilityChange:how
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1791
    |wasVisible|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1792
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1793
    wasVisible := shown.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1794
    super visibilityChange:how.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1795
    (wasVisible not and:[shown]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1796
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1797
	 start checking again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1798
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1799
	Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1800
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1801
    ]
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1802
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1803
    "Modified: / 18.2.1998 / 17:57:44 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1804
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1805
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1806
!FileBrowser methodsFor:'fileList user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1807
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1808
bigImagePreviewSettingChanged
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1809
    "invoked, when big image preview flag changed"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1810
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1811
    |fh|
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1812
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1813
    (showingBigImagePreview value == true 
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1814
    and:[showingDetails value == true]) ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1815
	fh := fileListView font height.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1816
	fileListView lineSpacing:(34 - fh max:0).
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1817
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1818
	fileListView clear.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1819
	self updateCurrentDirectory.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1820
	fileListView lineSpacing:2.
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1821
    ].
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1822
    fileListView clear.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1823
    self updateCurrentDirectory
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1824
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1825
    "Modified: / 4.8.1998 / 13:43:54 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1826
    "Created: / 14.8.1998 / 14:17:49 / cg"
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1827
!
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1828
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1829
changeDisplayMode
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1830
    "toggle from long to short listing (and vice-versa)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1831
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1832
    showingDetails value:(showingDetails value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1833
    "/ showLongList := showLongList not.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  1834
    self showOrHideTabView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1835
    self updateCurrentDirectory
747
a50e8643c666 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
  1836
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1837
    "Modified: / 4.8.1998 / 13:43:54 / cg"
172
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
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1840
changeDotFileVisibility
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1841
    "turn on/off visibility of files whose name starts with '.'"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1842
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1843
    showingHiddenFiles value:(showingHiddenFiles value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1844
    "/ showDotFiles := showDotFiles not.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1845
    self updateCurrentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1846
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1847
    "Modified: / 4.8.1998 / 13:45:46 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1848
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1849
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1850
detailsSettingChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1851
    "invoked, when detail (i.e. long / short) listing flag changed"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1852
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1853
    self showOrHideTabView.
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  1854
    self bigImagePreviewSettingChanged
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1855
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1856
    "Modified: / 4.8.1998 / 13:43:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1857
    "Created: / 14.8.1998 / 14:17:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1858
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1859
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1860
fileDoubleClick:lineNr
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1861
    "double click on a file - get its contents"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1862
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1863
    self fileSelect:lineNr.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1864
    self fileGet:true
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1865
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1866
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1867
fileEncoding
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1868
    "open a dialog to allow change of the files character encoding.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1869
     Files are converted to internal encoding when read, and converted back
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1870
     to this encoding when saved.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1871
     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
  1872
     the internal encoding (which is iso8859).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1873
     Notice: currently, not too many encodings are supported by the system."
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1874
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1875
    |dialog list descr encodings encodingNames idx|
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1876
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1877
    list := SelectionInList new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1878
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1879
    descr := CharacterArray supportedExternalEncodings.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1880
    encodings := descr at:2.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1881
    encodingNames := descr at:1.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1882
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1883
    list list:encodingNames.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1884
    list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1885
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1886
    dialog := Dialog new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1887
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1888
    dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1889
    dialog addVerticalSpace.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1890
    dialog addListBoxOn:list withNumberOfLines:5.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1891
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  1892
    dialog addAbortAndOkButtons.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1893
    dialog open.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1894
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1895
    dialog accepted ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1896
	idx := list selectionIndex.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1897
	fileEncoding := encodings at:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1898
	subView externalEncoding:fileEncoding.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1899
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  1900
	self validateFontEncodingFor:fileEncoding ask:true.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1901
    ].
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1902
1219
8495da2ea4cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  1903
    "Modified: 30.6.1997 / 14:41:12 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1904
!
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1905
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1906
fileExecute
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1907
    "if text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1908
     otherwise pop up execute box immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1909
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1910
    |action sel fileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1911
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1912
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1913
     this replaces everything by the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1914
    "
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1915
    action := [:command | 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1916
		self class addToCommandHistory:command for:fileName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1917
		self doExecuteCommand:command replace:true
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1918
	      ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1919
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1920
    (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
  1921
	      yesButton:'execute') ifFalse:[^ self].
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
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1924
"/     this inserts the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1925
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1926
"/    action := [:command| self doExecuteCommand:command replace:false].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1927
"/
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1928
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1929
    sel := fileListView selection.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1930
    sel size == 1 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1931
	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
  1932
    ].
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1933
    self askForCommandFor:fileName thenDo:action
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1934
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1935
    "Modified: 14.11.1996 / 14:59:34 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1936
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1937
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1938
fileFileIn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1939
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1940
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1941
    self fileFileInLazy:false 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1942
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1943
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1944
fileFileInLazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1945
    "fileIn the selected file(s). Do a quick load (no compilation)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1946
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1947
    self fileFileInLazy:true 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1948
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1949
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1950
fileFileInLazy:lazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1951
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1952
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1953
    |aStream path wasLazy bos prevCurrentFileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1954
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1955
    self selectedFilesDo:[:fileName |
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1956
        path := currentDirectory filenameFor:fileName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1957
        path type == #regular ifTrue:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1958
            prevCurrentFileName := currentFileInFileName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1959
            currentFileInFileName := fileName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1960
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1961
            (ObjectFileLoader notNil
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1962
            and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1963
                Object abortSignal catch:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1964
                    |p|
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1965
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1966
                    "/
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1967
                    "/ look if already loaded ...  then unload first
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1968
                    "/
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1969
                    p := path pathName.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1970
                    (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1971
                        (Dialog confirm:(resources 
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1972
                                            string:'%1 is already loaded; load anyway ?'
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1973
                                            with:p)) ifFalse:[
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1974
                            ^ self
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1975
                        ].
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1976
                        Transcript showCR:'unloading old ' , p , ' ...'.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1977
                        ObjectFileLoader unloadObjectFile:p. 
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1978
                    ].
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1979
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1980
                    Transcript showCR:'loading ' , p , ' ...'.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1981
                    ObjectFileLoader loadObjectFile:p.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1982
                    Class addInfoRecord:('fileIn ' , fileName) 
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1983
                ]
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1984
            ] ifFalse:[ (path hasSuffix:'cls') ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1985
                "/ loading a binary class file
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1986
                aStream := path readStream.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1987
                aStream notNil ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1988
                    bos := BinaryObjectStorage onOld:aStream.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1989
                    Class nameSpaceQuerySignal 
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1990
                        answer:Smalltalk
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1991
                        do:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1992
                            bos next.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1993
                        ].
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1994
                    bos close
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1995
                ]
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1996
            ] ifFalse:[
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1997
                ((path hasSuffix:'class')
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1998
                or:[(path hasSuffix:'cla')]) ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  1999
                    "/ loading a java class file
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2000
                    JavaClassReader notNil ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2001
                        JavaClassReader loadFile:(path pathName)
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2002
                    ]
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2003
                ] ifFalse:[ (path hasSuffix:'sif') ifTrue:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2004
                    "/ loading a sif (smalltalk interchange format) file
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2005
                    SmalltalkInterchangeFileManager newForFileIn
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2006
                        fileName: path pathName;
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2007
                        fileIn.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2008
                ] ifFalse:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2009
                    "/ loading a regular (chunk) or xml source file
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2010
                    aStream := path readStream.
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2011
                    aStream notNil ifTrue:[
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2012
                        [
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2013
                            Class withoutUpdatingChangesDo:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2014
                                wasLazy := Compiler compileLazy:lazy.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2015
                                aStream fileIn.
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2016
                            ].
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2017
                            Class addInfoRecord:('fileIn ' , fileName) 
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2018
                        ] valueNowOrOnUnwindDo:[
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2019
                            Compiler compileLazy:wasLazy.
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2020
                            aStream close
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2021
                        ]
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2022
                    ]
2640
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2023
                ]]
49fe3af4260d support for sif-fileIn
Claus Gittinger <cg@exept.de>
parents: 2639
diff changeset
  2024
            ]]
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2025
        ].
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2026
        currentFileInFileName := prevCurrentFileName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2027
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2028
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  2029
    "Modified: / 19.9.1997 / 23:42:22 / stefan"
2430
bf865ca60cd9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2030
    "Modified: / 16.10.1999 / 12:16:31 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2031
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2032
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2033
fileFindAllDuplicates
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2034
    "scan directory and all subdirs for duplicate files"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2035
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2036
    |fileNames dir infoDir filesBySize
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2037
     result info dirPrefix|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2038
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2039
    (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
  2040
	      yesButton:'proceed') ifFalse:[^ self].
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2041
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2042
    self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2043
	result := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2044
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2045
	dir := currentDirectory asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2046
	self label:myName , '- gathering file names ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2047
	fileNames := dir recursiveDirectoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2048
	fileNames := fileNames collect:[:fn | dir construct:fn].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2049
	fileNames := fileNames select:[:fn | fn isDirectory not].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2050
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2051
	self label:myName , '- gathering sizes ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2052
	infoDir := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2053
	fileNames do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2054
	    infoDir at:fn put:(fn fileSize)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2055
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2056
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2057
	"/ for each, get the files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2058
	"/ in a first pass, look for files of the same size and
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2059
	"/ compare them ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2060
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2061
	self label:myName , '- preselect possible duplicates ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2062
	filesBySize := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2063
	infoDir keysAndValuesDo:[:fn :sz |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2064
	    |entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2065
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2066
	    entry := filesBySize at:sz ifAbsentPut:[Set new].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2067
	    entry add:fn.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2068
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2069
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2070
	"/ any of same size ?
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2071
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2072
	self label:myName , '- checking for duplicates ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2073
	filesBySize do:[:entry |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2074
	    |files|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2075
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2076
	    entry size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2077
		files := entry asArray.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2078
		1 to:files size-1 do:[:idx1 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2079
		    idx1+1 to:files size do:[:idx2 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2080
			|fn1 fn2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2081
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2082
			fn1 := files at:idx1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2083
			fn2 := files at:idx2.
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2084
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2085
"/                        self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2086
			(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2087
			    "/ compare the files
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2088
			    (fn1 sameContentsAs:fn2) ifTrue:[
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2089
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2090
				result at:fn1 put:fn2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2091
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2092
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2093
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2094
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2095
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2096
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2097
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2098
	self label:myName , '- sorting ...'.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2099
	dirPrefix := currentDirectory asFilename pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2100
	result := result associations.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2101
	result := result collect:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2102
					|f1 f2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2103
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2104
					f1 := assoc key name.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2105
					f2 := assoc value name.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2106
					(f1 startsWith:dirPrefix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2107
					    f1 := f1 copyFrom:dirPrefix size + 2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2108
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2109
					(f2 startsWith:dirPrefix) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2110
					    f2 := f2 copyFrom:dirPrefix size + 2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2111
					].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2112
					f1 < f2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2113
					    f2 -> f1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2114
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2115
					    f1 -> f2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2116
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2117
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2118
	result sort:[:f1 :f2 | f2 value < f1 value].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2119
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2120
	info := OrderedCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2121
	result do:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2122
	    info add:(assoc key , ' same as ' , assoc value)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2123
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2124
	info isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2125
	    info := 'No duplicate files found.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2126
	].
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2127
    ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2128
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2129
    subView contents:info.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2130
    self label:myName.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2131
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2132
    "Created: / 28.11.1998 / 17:47:53 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2133
    "Modified: / 10.12.1998 / 17:13:14 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2134
!
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2135
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2136
fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2137
    "scan directory for duplicate files"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2138
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2139
    |fileNames dir infoDir filesBySize
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2140
     result info|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2141
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2142
    (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
  2143
	      yesButton:'proceed') ifFalse:[^ self].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2144
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2145
    self withWaitCursorDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2146
	result := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2147
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2148
	dir := currentDirectory asFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2149
	fileNames := dir directoryContents.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2150
	fileNames := fileNames collect:[:fn | dir construct:fn].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2151
	fileNames := fileNames select:[:fn | fn isDirectory not].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2152
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2153
	infoDir := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2154
	fileNames do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2155
	    infoDir at:fn put:(fn info)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2156
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2157
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2158
	"/ for each, get the files size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2159
	"/ in a first pass, look for files of the same size and
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2160
	"/ compare them ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2161
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2162
	filesBySize := Dictionary new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2163
	infoDir keysAndValuesDo:[:fn :info |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2164
	    |sz entry|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2165
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2166
	    sz := info size.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2167
	    entry := filesBySize at:sz ifAbsentPut:[Set new].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2168
	    entry add:fn.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2169
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2170
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2171
	"/ any of same size ?
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2172
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2173
	filesBySize do:[:entry |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2174
	    |files|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2175
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2176
	    entry size > 1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2177
		files := entry asArray.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2178
		1 to:files size-1 do:[:idx1 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2179
		    idx1+1 to:files size do:[:idx2 |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2180
			|fn1 fn2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2181
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2182
			fn1 := files at:idx1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2183
			fn2 := files at:idx2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2184
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2185
			(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2186
			    "/ compare the files
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2187
			    (fn1 sameContentsAs:fn2) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2188
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2189
				result at:fn1 put:fn2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2190
			    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2191
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2192
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2193
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2194
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2195
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2196
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2197
	result := result associations.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2198
	result := result collect:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2199
					|f1 f2|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2200
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2201
					f1 := assoc key baseName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2202
					f2 := assoc value baseName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2203
					f1 < f2 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2204
					    f2 -> f1
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2205
					] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2206
					    f1 -> f2
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2207
					]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2208
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2209
	result sort:[:f1 :f2 | f2 value < f1 value].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2210
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2211
	info := OrderedCollection new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2212
	result do:[:assoc |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2213
	    info add:(assoc key , ' same as ' , assoc value)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2214
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2215
	info isEmpty ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2216
	    info := 'No duplicate files found.'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2217
	].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2218
    ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2219
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2220
    subView contents:info
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2221
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2222
    "Created: / 3.10.1998 / 17:59:00 / cg"
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  2223
    "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
  2224
!
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  2225
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2226
fileFindFile
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2227
    |sel bindings
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2228
     namePatternHolder contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2229
     ignoreCaseInName ignoreCaseInContents
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2230
     namePattern namePatterns contentsPattern 
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2231
     searchForSameContentsEnabled searchForSameContents|
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2232
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2233
    (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
  2234
              yesButton:'proceed') ifFalse:[^ self].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2235
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2236
    subView contents:nil; scrollToTop.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2237
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2238
    bindings := IdentityDictionary new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2239
    bindings at:#namePatternHolder put:(namePatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2240
    bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2241
    bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2242
    bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2243
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2244
    searchForSameContentsEnabled := false.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2245
    sel := fileListView selectionValue.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2246
    sel size == 1 ifTrue:[
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2247
        searchForSameContentsEnabled := true.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2248
        sel := sel first string withoutSeparators
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2249
    ].
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2250
    bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2251
    bindings at:#searchForSameContents put:(searchForSameContents := false asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2252
    bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2253
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  2254
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2255
    (SimpleDialog new 
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2256
        openFor:self
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2257
        interfaceSpec:(self class fileSearchDialogSpec)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2258
        withBindings:bindings) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2259
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2260
        namePattern := namePatternHolder value.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2261
        namePattern size == 0 ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2262
            namePatterns := nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2263
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2264
            ignoreCaseInName value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2265
                namePattern := namePattern asLowercase
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
            namePatterns := namePattern asCollectionOfSubstringsSeparatedBy:$;
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2268
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2269
        contentsPattern := contentsPatternHolder value.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2270
        contentsPattern size == 0 ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2271
            contentsPattern := nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2272
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2273
            ignoreCaseInContents value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2274
                contentsPattern := contentsPattern asLowercase
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2275
            ]
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
        self withWaitCursorDo:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2279
            |stopSignal access myProcess lowerFrameView|
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
            myProcess := Processor activeProcess.
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
            access := Semaphore forMutualExclusion name:'accessLock'.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2284
            stopSignal := Signal new.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2285
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2286
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2287
             The following is tricky: 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2288
             the pauseToggle & killButton will
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2289
             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
  2290
             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
  2291
             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
  2292
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2293
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2294
            commandView beInvisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2295
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2296
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2297
             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
  2298
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2299
            killButton windowGroup:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2300
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2301
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2302
             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
  2303
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2304
            killButton label:(resources string:'stop').
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2305
            killButton raise; beVisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2306
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2307
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2308
             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
  2309
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2310
            killButton 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2311
                action:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2312
                    access critical:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2313
                        myProcess interruptWith:[stopSignal raiseRequest].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2314
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2315
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2316
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2317
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2318
             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
  2319
            "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2320
            killButton openAutonomous.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2321
            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
  2322
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2323
            lowerFrameView := subView superView.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2324
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2325
            [
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2326
                stopSignal catch:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2327
                    searchForSameContents value ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2328
                        self 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2329
                            doFindFileNamed:namePatterns
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2330
                            ignoreCase:ignoreCaseInName value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2331
                            containingString:nil
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2332
                            ignoreCaseInContents:ignoreCaseInContents value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2333
                            sameContentsAsFile:(currentDirectory asFilename construct:sel) 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2334
                            sameContentsAs:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2335
                            in:currentDirectory.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2336
                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2337
                        (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
  2338
                            self 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2339
                                doFindFileNamed:namePatterns
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2340
                                ignoreCase:ignoreCaseInName value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2341
                                containingString:contentsPattern
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2342
                                ignoreCaseInContents:ignoreCaseInContents value
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2343
                                sameContentsAsFile:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2344
                                sameContentsAs:nil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2345
                                in:currentDirectory.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2346
                        ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2347
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2348
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2349
            ] valueNowOrOnUnwindDo:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2350
                |wg|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2351
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2352
                self label:myName; iconLabel:myName.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2353
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2354
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2355
                 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
  2356
                 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
  2357
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2358
                killButton beInvisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2359
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2360
                commandView beVisible.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2361
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2362
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2363
                 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
  2364
                 (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
  2365
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2366
                wg := killButton windowGroup.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2367
                killButton windowGroup:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2368
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2369
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2370
                 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
  2371
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2372
                wg notNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2373
                    wg process terminate.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2374
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2375
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2376
                 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
  2377
                 releases reference to thisContext earlier)
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2378
                "
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2379
                killButton action:nil.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2380
                killButton label:(resources string:'kill').
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2381
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2382
                "/    
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2383
                "/ allow interaction with the codeView
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2384
                "/ (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
  2385
                "/
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2386
                lowerFrameView windowGroup:(self windowGroup).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2387
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2388
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2389
        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2390
        self label:myName.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2391
        currentFileName isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2392
            subView modified:false.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  2393
        ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2394
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2395
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2396
    "Created: / 15.10.1998 / 11:32:57 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2397
    "Modified: / 15.10.1998 / 12:41:09 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2398
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2399
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2400
fileGet
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2401
    "get contents of selected file into subView.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2402
     If text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2403
     otherwise get it immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2404
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2405
    self fileGet:false
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2406
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2407
    "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
  2408
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2409
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2410
fileGet:viaDoubleClick
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2411
    "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
  2412
     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
  2413
     otherwise get it immediately"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2414
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2415
    |fileName msg label|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2416
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  2417
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2418
	self doFileGet:viaDoubleClick.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2419
	^ self
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  2420
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2421
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2422
    fileName notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2423
	(currentDirectory filenameFor:fileName) isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2424
	    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
  2425
	    label := 'change'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2426
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2427
	    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
  2428
	    label := 'get'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2429
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2430
	(self ask:(resources at:msg) yesButton:label) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2431
	    subView modified:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2432
	    self doFileGet:viaDoubleClick
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2433
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2434
    ]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2435
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  2436
    "Created: 19.6.1996 / 09:38:35 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2437
    "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
  2438
    "Modified: 18.9.1997 / 16:27:34 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2439
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2440
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2441
fileGetInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2442
    "show short file (stat)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2443
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2444
    self fileGetInfo:false
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2445
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2446
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2447
fileGetInfo:longInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2448
    "get info on selected file - show it in a box"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2449
1672
9df905f8bfa3 update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  2450
    |string box updater|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2451
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2452
    string := self getFileInfoString:longInfo.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2453
    string notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2454
	box := InfoBox title:string.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2455
	updater := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2456
	    [true] whileTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2457
		Delay waitForSeconds:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2458
		string := self getFileInfoString:longInfo.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2459
		box title:string
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2460
	    ] 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2461
	] fork.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2462
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2463
	box showAtPointer.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2464
	updater terminate.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2465
	box destroy
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2466
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2467
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2468
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2469
fileGetLongInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2470
    "show long stat (file)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2471
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2472
    self fileGetInfo:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2473
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2474
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2475
fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2476
    "show a hex dump (similar to od -x)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2477
     Only needed with non-Unix systems."
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2478
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2479
    self withReadCursorDo:[
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2480
        |fileName f stream data offs 
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2481
         addrDigits col line lineStream asciiLineStream lines|
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2482
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2483
        fileName := self getSelectedFileName.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2484
        fileName notNil ifTrue:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2485
            f := currentDirectory construct:fileName.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2486
            f isDirectory ifTrue:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2487
                ^ self warn:(resources string:'%1 is a directory.' with:fileName).
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2488
            ].
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2489
            f exists ifFalse:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2490
                self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName).
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2491
                ^ self
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2492
            ].
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2493
            f isReadable ifFalse:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2494
                self warn:(resources string:'''%1'' is unreadable.' with:fileName).
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2495
                ^ self
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2496
            ].
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2497
            f fileSize > (512*1024) ifTrue:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2498
                (self confirm:'Warning: the file is big (', (f fileSize//1024) printString , 'Kb). Show anyway ?')
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2499
                ifFalse:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2500
                    ^ self
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2501
                ]
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2502
            ].
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2503
            stream := f readStream binary.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2504
            data := stream contents.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2505
            stream close.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2506
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2507
            subView list:nil.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2508
            col := 1.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2509
            offs := 0.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2510
            lines := StringCollection new.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2511
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2512
            addrDigits := ((f fileSize + 1) log:16) truncated + 1.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2513
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2514
            lineStream := '' writeStream.
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2515
            asciiLineStream := '' writeStream.
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2516
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2517
            lineStream nextPutAll:(offs hexPrintString:addrDigits).
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2518
            lineStream nextPutAll:': '.
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2519
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2520
            data do:[:byte |
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2521
                lineStream nextPutAll:(byte hexPrintString:2).
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2522
                (byte between:32 and:127) ifTrue:[
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2523
                    asciiLineStream nextPut:(Character value:byte)
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2524
                ] ifFalse:[
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2525
                    asciiLineStream nextPut:$.
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2526
                ].
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2527
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2528
                offs := offs + 1.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2529
                col := col + 1.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2530
                col > 16 ifTrue:[
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2531
                    lineStream nextPutAll:'        '.
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2532
                    lineStream nextPutAll:asciiLineStream contents.
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2533
                    lines add:(lineStream contents).
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2534
                    (offs bitAnd:16rFF) == 0 ifTrue:[
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2535
                        lines add:nil
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2536
                    ].
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2537
                    lineStream reset.
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2538
                    asciiLineStream reset.
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2539
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2540
                    lineStream nextPutAll:(offs hexPrintString:addrDigits).
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2541
                    lineStream nextPutAll:': '.
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2542
                    col := 1.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2543
                ] ifFalse:[
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2544
                    lineStream space
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2545
                ]
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2546
            ].
2701
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2547
            line := lineStream contents paddedTo:(3*16 + addrDigits + 1).
78171ebe64f5 less memory need for hexDump
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  2548
            lines add:(line , '        ' , asciiLineStream contents).
2666
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2549
            self show:lines.
9441a29e67d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  2550
        ]
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2551
    ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2552
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2553
    "Modified: / 7.9.1998 / 15:37:47 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2554
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2555
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2556
fileInsert
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2557
    "insert contents of file at the cursor position"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2558
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2559
    |fileName|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2560
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2561
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2562
    fileName notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2563
	self showFile:fileName insert:true encoding:fileEncoding
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2564
    ]
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  2565
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2566
    "Modified: 23.4.1997 / 13:06:06 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2567
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2568
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2569
fileListMenu
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2570
    "return the menu to show in the fileList"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2571
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  2572
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2573
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2574
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2575
3002
ad427d45cf01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3001
diff changeset
  2576
    self sensor ctrlDown ifTrue:[
ad427d45cf01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3001
diff changeset
  2577
        m := self class toolsMenuSpec.
ad427d45cf01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3001
diff changeset
  2578
    ] ifFalse:[
ad427d45cf01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3001
diff changeset
  2579
        m := self class menuPopUp.
ad427d45cf01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3001
diff changeset
  2580
    ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2581
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2582
    m receiver:self.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2583
    m findGuiResourcesIn:self.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2584
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2585
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2586
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2587
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2588
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2589
fileListMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2590
    "return the menu to show in the fileList"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2591
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2592
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2593
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2594
    |items m sel ns subMenu subItems|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2595
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2596
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2597
		 ('spawn'            fileSpawn        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2598
		 ('-'                nil              )  
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2599
		 ('get contents'     fileGet          GotoLine)      
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2600
		 ('insert contents'  fileInsert       )            
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2601
		 ('show info'        fileGetInfo      InspectIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2602
		 ('show full info'   fileGetLongInfo  CmdI)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2603
	       ).
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2604
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2605
    ((ns := Project current defaultNameSpace) notNil 
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2606
    and:[ns ~~ Smalltalk]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2607
	items := items copyWith:(Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2608
				    with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2609
				    with:#fileFileIn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2610
				    with:#Accept)
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2611
                                
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2612
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2613
	items := items copyWith:#( 'fileIn'  #fileFileIn  #Accept)
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2614
    ].
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2615
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2616
    items := items , #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2617
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2618
		 ('update'                    updateCurrentDirectory    Cmdu)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2619
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2620
		 ('execute unix command ...'  fileExecute               DoIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2621
		 ('st/x tools'                stxTools                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2622
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2623
		 ('remove'                    fileRemove                Delete)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2624
		 ('rename ...'                fileRename                )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2625
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2626
		 ('display long list'         changeDisplayMode         )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2627
		 ('show all files'            changeDotFileVisibility   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2628
		 ('encoding ...'              fileEncoding              )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2629
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2630
		 ('create directory ...'      newDirectory              CmdD)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2631
		 ('create file ...'           newFile                   CmdF)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2632
	       ).             
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2633
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2634
    m := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2635
	    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2636
	    resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2637
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2638
    showingHiddenFiles value "showDotFiles" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2639
	m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2640
    ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2641
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2642
	m labelAt:#changeDisplayMode put:(resources string:'display short list')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2643
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2644
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2645
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2646
			      ('Changes browser'       openChangesBrowser  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2647
			      ('Editor'                openEditor          )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2648
			      ('HTML reader'           openHTMLReader      )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2649
			      ('Image inspect'         openImageInspector  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2650
			      ('show file differences' openDiffView        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2651
		  ).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2652
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2653
    OperatingSystem isUNIXlike ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2654
	items := items , #( ('terminal'              openTerminal )).
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2655
    ].
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2656
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2657
    JavaInterpreter notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2658
	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
  2659
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2660
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2661
    m subMenuAt:#stxTools 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2662
	    put:(PopUpMenu
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2663
		    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2664
		    resources:resources).
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2665
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2666
    ((sel := fileListView selection) isNil 
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2667
    or:[sel isEmpty]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2668
	m disableAll:#(fileGet fileInsert
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2669
		       fileGetInfo fileGetLongInfo
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2670
		       fileFileIn fileFileInLazy
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2671
		       fileRemove fileRename).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2672
	(m subMenuAt:#stxTools)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2673
	    disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector)
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2674
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2675
	fileListView selection size > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2676
	    m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2677
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2678
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2679
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2680
    ^m
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2681
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2682
    "Modified: / 16.1.1998 / 16:42:59 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2683
    "Modified: / 4.8.1998 / 13:45:56 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2684
    "Created: / 13.8.1998 / 20:51:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2685
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2686
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2687
filePrint
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2688
    "send a files contents to the printer (not in the menu)"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2689
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2690
    |fileName path inStream printStream line|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2691
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2692
    self withWaitCursorDo:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2693
	fileName := self getSelectedFileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2694
	fileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2695
	    path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2696
	    (path type == #regular) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2697
		inStream := path readStream.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2698
		inStream isNil ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2699
		    printStream := PrinterStream new.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2700
		    printStream notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2701
			[inStream atEnd] whileFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2702
			    line := inStream nextLine.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2703
			    printStream nextPutLine:line.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2704
			].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2705
			printStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2706
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2707
		    inStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2708
		]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2709
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2710
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2711
	0 "compiler hint"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2712
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2713
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2714
    "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
  2715
    "Modified: 18.9.1997 / 16:29:17 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2716
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2717
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2718
fileRemove
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2719
    "remove the selected file(s).
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2720
     Query if user really wants to remove the file.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2721
     - should be enhanced, to look for a ~/.trash directory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2722
     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
  2723
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2724
    |sel q|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2725
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2726
    sel := fileListView selection.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2727
    sel size > 0 ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2728
        sel := sel collect:[:rawIndex | fileList at:rawIndex].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2729
        sel size > 1 ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2730
            q := resources string:'remove %1 selected files ?' with:(sel size)
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2731
        ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2732
            q := resources string:'remove ''%1'' ?' with:(sel first allBold)
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2733
        ].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2734
        (self sensor shiftDown
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2735
        or:[self ask:q yesButton:'remove']) ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2736
            self withCursor:(Cursor wait) do:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2737
                self doRemove:sel
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2738
            ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2739
        ]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2740
    ]
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2741
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2742
    "Modified: / 16.12.1998 / 17:30:31 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2743
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2744
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2745
fileRename
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2746
    "rename the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2747
3066
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2748
    |queryBox b lastNewName lastOldName prefix initialText|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2749
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2750
    queryBox := FilenameEnterBox new.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2751
    queryBox okText:(resources at:'rename').
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2752
    fileListView selection size > 1 ifTrue:[
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2753
        b := queryBox addAbortButtonLabelled:(resources at:'cancel All').
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2754
        b action:[^ self ].
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2755
    ].
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2756
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2757
    self selectedFilesDo:[:oldName |
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2758
        queryBox title:(resources string:'rename ''%1'' to:' with:oldName).
3066
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2759
        initialText := oldName.
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2760
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2761
        (lastNewName notNil
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2762
        and:[lastNewName endsWith:lastOldName]) ifTrue:[
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2763
            "/ intelligent default ...
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2764
            prefix := lastNewName copyTo:(lastNewName size - lastOldName size).
3066
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2765
            initialText := (prefix , oldName).
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2766
        ] ifFalse:[
3066
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2767
            (lastNewName notNil
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2768
            and:[lastOldName endsWith:lastNewName]) ifTrue:[
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2769
                prefix := lastOldName copyTo:(lastOldName size - lastNewName size).
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2770
                initialText := (oldName copyFrom:prefix size+1).
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2771
            ]
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2772
        ].
3066
7daebd50006e intelligent default in rename
Claus Gittinger <cg@exept.de>
parents: 3061
diff changeset
  2773
        queryBox initialText:initialText.
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2774
        queryBox action:[:newName | 
3060
9b71c5b29197 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3059
diff changeset
  2775
                            fileListView removeFromSelection:(fileList indexOf:oldName).
3059
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2776
                            self doRename:oldName to:newName. 
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2777
                            lastOldName := oldName.
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2778
                            lastNewName := newName.
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2779
                        ].
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2780
    
ced4d5b13ad2 cancelAll if renaming multiple files
Claus Gittinger <cg@exept.de>
parents: 3045
diff changeset
  2781
        queryBox showAtPointer
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2782
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2783
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2784
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2785
fileSelect:lineNr
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2786
    "selected a file - do nothing here"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2787
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2788
    |fn|
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  2789
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  2790
    imagePreviewView notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2791
	self stopImageRenderProcess.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2792
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2793
	fn := self getSelectedFileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2794
	(Image isImageFileSuffix:(fn asFilename suffix)) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2795
	    imageRenderProcess := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2796
		self loadImageAndPerform:[:img | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2797
						imagePreviewView beVisible.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2798
						imagePreviewView image:img
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2799
					 ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2800
	    ] forkAt:(Processor activePriority - 1).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2801
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2802
	    imagePreviewView beInvisible
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2803
	].
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  2804
    ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2805
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2806
    "Modified: 23.4.1997 / 13:04:55 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2807
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2808
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2809
fileSpawn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2810
    "start another FileBrowser on the selected directory or
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2811
     on the same directory if none is selected."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2812
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2813
    |any path|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2814
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2815
    any := false.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2816
    self selectedFilesDo:[:fileName |
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  2817
        path := currentDirectory filenameFor:fileName.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  2818
        path isDirectory ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  2819
            self class openOn:(path pathName).
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  2820
            any := true
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  2821
        ]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2822
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2823
    any ifFalse:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  2824
        self class openOn:currentDirectory pathName withExtent:self topView extent
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2825
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2826
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2827
    "Modified: 18.9.1997 / 16:32:39 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2828
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2829
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2830
loadImageAndPerform:aSelectorOrBlock
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2831
    |img path|
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2832
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2833
    self selectedFilesDo:[:fileName |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2834
	path := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2835
	path isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2836
	    img := Image fromFile:(path pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2837
	    img notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2838
		aSelectorOrBlock isSymbol ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2839
		    img perform:aSelectorOrBlock
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2840
		] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2841
		    aSelectorOrBlock value:img
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2842
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2843
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2844
		self warn:'unknown format: ' , fileName
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2845
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  2846
	]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2847
    ].
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2848
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2849
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2850
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2851
    "Created: / 26.8.1998 / 16:20:18 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2852
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2853
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2854
newDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2855
    "ask for and create a new directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2856
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2857
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2858
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2859
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2860
		    title:(resources at:'create new directory:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2861
		    okText:(resources at:'create')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2862
		    action:[:newName | self doCreateDirectory:newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2863
    queryBox showAtPointer
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2864
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2865
    "Modified: 23.4.1997 / 13:04:27 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2866
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2867
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2868
newFile
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2869
    "ask for and create a new file"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2870
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2871
    |sel queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2872
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2873
    queryBox := FilenameEnterBox 
2512
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2874
                    title:(resources at:'create new file:') withCRs
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2875
                    okText:(resources at:'create')
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2876
                    action:[:newName | newName isEmpty ifFalse:[
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2877
                                           self doCreateFile:newName.
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2878
                                           self selectFile:newName.
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2879
                                       ]
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2880
                           ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2881
    sel := subView selection.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2882
    sel notNil ifTrue:[
2512
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  2883
        queryBox initialText:(sel asString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2884
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2885
    queryBox showAtPointer
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  2886
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2887
    "Modified: / 23.4.1997 / 13:04:38 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2888
    "Modified: / 16.1.1998 / 16:54:00 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2889
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2890
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2891
newHardLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2892
    "ask for and create a hard link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2893
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2894
    |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
  2895
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2896
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2897
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2898
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2899
    (sel size > 0) ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2900
        (currentDirectory construct:sel) isDirectory ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2901
            orgName1 := sel
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2902
        ]
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2903
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2904
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2905
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2906
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2907
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2908
    box := DialogBox new.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2909
    (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
  2910
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  2911
    (box addTextLabel:(resources string:'to:')) adjust:#left.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2912
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2913
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2914
    box addAbortAndOkButtons.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2915
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2916
    orgName1 size > 0 ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2917
        box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2918
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2919
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2920
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2921
    box accepted ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2922
        name1 := name1 value.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2923
        (name1 size == 0) ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2924
            err := 'no name entered'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2925
        ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2926
            f1 := name1 asFilename.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2927
            name2 := name2 value.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2928
            (name2 size == 0) ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2929
                err := 'no name entered'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2930
            ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2931
                f2 := name2 asFilename.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2932
                f2 exists ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2933
                    err := '''%2'' already exists'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2934
                ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2935
                    f1 exists ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2936
                        err := '''%1'' does not exist'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2937
                    ] ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2938
                        f1 isDirectory ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2939
                            err := '''%1'' is a directory'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2940
                        ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2941
                            ErrorSignal handle:[:ex |
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2942
                                err := ex errorString
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2943
                            ] do:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2944
                                OperatingSystem createHardLinkFrom:name1 to:name2
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2945
                            ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2946
                        ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2947
                    ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2948
                ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2949
            ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2950
        ].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2951
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2952
        err notNil ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2953
            self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold).
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2954
            ^ self
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2955
        ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2956
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2957
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2958
    "Modified: / 13.8.1998 / 21:47:01 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2959
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2960
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2961
newSoftLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2962
    "ask for and create a soft link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2963
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2964
    |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
  2965
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2966
    sel := self getSelectedFileName.
2832
6a559d66fdb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2825
diff changeset
  2967
    here := currentDirectory pathName.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2968
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2969
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2970
    (sel size > 0) ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2971
        orgName1 := sel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2972
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2973
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2974
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2975
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2976
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2977
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2978
    (box addTextLabel:'Create symbolic link to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2979
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2980
    (box addTextLabel:'as:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2981
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2982
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  2983
    box addAbortAndOkButtons.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2984
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2985
    orgName1 size > 0 ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2986
        box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2987
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2988
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2989
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2990
    box accepted ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2991
        name1 := name1 value.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2992
        (name1 size == 0) ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2993
            err := 'no name entered'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2994
        ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2995
            f1 := name1 asFilename.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2996
            name2 := name2 value.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2997
            (name2 size == 0) ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2998
                err := 'no name entered'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  2999
            ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3000
                f2 := name2 asFilename.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3001
                f2 exists ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3002
                    err := '''%2'' already exists'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3003
                ] ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3004
                    f1 exists ifFalse:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3005
                        err := '''%1'' does not exist (link created anyway)'.
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3006
                    ].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3007
                    ErrorSignal handle:[:ex |
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3008
                        err := ex errorString
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3009
                    ] do:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3010
                        OperatingSystem createSymbolicLinkFrom:name1 to:name2
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3011
                    ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3012
                ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3013
            ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3014
        ].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3015
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3016
        err notNil ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3017
            self warn:(resources string:err with:(name1 ? '') allBold with:(name2 ? '') allBold).
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3018
            ^ self
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  3019
        ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3020
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3021
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3022
    "Modified: / 13.8.1998 / 21:26:59 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3023
    "Created: / 13.8.1998 / 21:47:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3024
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3025
2186
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3026
openASN1Browser
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3027
    self openTool:OSI::ASN1Browser 
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3028
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3029
    "Modified: / 7.9.1998 / 21:31:58 / cg"
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3030
!
dff4334a683b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3031
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3032
openAppletViewer
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3033
    |numItems|
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3034
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3035
    (numItems := fileListView selection size) > 2 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3036
	(self 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3037
	    confirm:(resources string:'open for each of the %1 items ?' 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3038
				 with:numItems)) ifFalse:[^ self].
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3039
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3040
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  3041
    Java startupJavaSystem.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  3042
"/    Java markAllClassesUninitialized.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  3043
"/    Java initAllStaticFields.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  3044
"/    Java initAllClasses.
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3045
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3046
    self selectedFilesDo:[:fileName |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3047
	|p path|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3048
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3049
	path := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3050
	path isDirectory ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3051
	    p := Java 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3052
		    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3053
		    argumentString:path pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3054
	    p resume.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3055
	]
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3056
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3057
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  3058
    "Modified: / 18.9.1997 / 17:00:59 / stefan"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  3059
    "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
  3060
!
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  3061
2814
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3062
openCBrowser
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3063
    CC::Browser openIn:currentDirectory.
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3064
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3065
!
15718df139c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
  3066
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3067
openChangesBrowser
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3068
    "open a change browser on the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3069
1939
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  3070
    self openTool:(UserPreferences current changesBrowserClass)
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  3071
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  3072
    "Modified: / 17.10.1998 / 14:39:15 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3073
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3074
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3075
openDiffView
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3076
    "open a diff-view"
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3077
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3078
    |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
  3079
2969
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3080
    sel := fileListView selection.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3081
    (sel size == 2) ifTrue:[
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3082
        name1 := fileList at:sel first.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3083
        name2 := fileList at:sel last.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3084
    ] ifFalse:[
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3085
        sel := self getSelectedFileName.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3086
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3087
        orgName1 := ''.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3088
        (sel size > 0
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3089
        and:[lastFileDiffDirectory notNil
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3090
        and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3091
            f := lastFileDiffDirectory asFilename construct:sel.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3092
            (f exists
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3093
            and:[f isReadable]) ifTrue:[
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3094
                orgName1 := f name
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3095
            ]
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3096
        ].
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3097
        name1 := orgName1 asValue.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3098
        name2 := self getSelectedFileName asValue.
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3099
    ].
1ec854b0f2fd openDiff-viewer - allow two-file-selection
Claus Gittinger <cg@exept.de>
parents: 2956
diff changeset
  3100
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3101
    here := currentDirectory pathName.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3102
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3103
    box := DialogBox new.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  3104
    (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
  3105
    box addFilenameInputFieldOn:name1 in:here tabable:true.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  3106
    (box addTextLabel:'and file2:') adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3107
    box addFilenameInputFieldOn:name2 in:here tabable:true.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3108
2048
f8c010698b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
  3109
    box addAbortAndOkButtons.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3110
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3111
    box showAtPointer.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3112
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3113
    box accepted ifTrue:[
2140
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3114
        name1 := name1 value.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3115
        (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
  3116
"/            text1 := subView contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3117
            text1 := subView list asStringCollection withTabs.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3118
            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
  3119
            name1 := nil.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3120
            l1 := 'browser contents'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3121
        ] ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3122
            name1 := currentDirectory filenameFor:name1.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3123
            name1 isReadable ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3124
                nm := name1.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3125
                name1 exists ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3126
                    err := '%1 does not exist'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3127
                ] ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3128
                    err := '%1 is not readable'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3129
                ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3130
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3131
            l1 := name1 pathName
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3132
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3133
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3134
        name2 := currentDirectory filenameFor:name2 value.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3135
        err isNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3136
            name2 isReadable ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3137
                nm := name2.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3138
                name2 exists ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3139
                    err := '%1 does not exist'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3140
                ] ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3141
                    err := '%1 is not readable'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3142
                ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3143
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3144
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3145
        err notNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3146
            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
  3147
            ^ self
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3148
        ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3149
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3150
        self withWaitCursorDo:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3151
            (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
  3152
                lastFileDiffDirectory := name1 directoryName
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3153
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3154
            name1 notNil ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3155
                text1 := name1 contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3156
            ].
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3157
            text2 := name2 contents.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3158
            text1 = text2 ifTrue:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3159
                self information:'same contents'
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3160
            ] ifFalse:[
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3161
                d := DiffTextView 
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3162
                        openOn:text1 label:l1
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3163
                        and:text2 label:name2 pathName.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3164
                d label:'file differences'.
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3165
            ]
1614b0a4dcd3 preexpand tabs in contents before sending it to diff
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
  3166
        ]
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3167
    ].
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  3168
1735
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  3169
    "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
  3170
    "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
  3171
    "Modified: / 5.5.1999 / 16:04:10 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3172
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3173
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3174
openEditor
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3175
    self openTool:EditTextView
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3176
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3177
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3178
openHTMLReader
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3179
    self openTool:HTMLDocumentView ignoreDirectories:false
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3180
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3181
    "Modified: / 7.9.1998 / 21:31:58 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3182
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3183
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3184
openImageEditor
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3185
    [self loadImageAndPerform:#edit] fork
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3186
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3187
    "Modified: / 17.9.1995 / 17:41:24 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3188
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3189
    "Created: / 13.8.1998 / 22:07:09 / cg"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3190
    "Modified: / 7.9.1998 / 21:31:41 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3191
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3192
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3193
openImageInspector
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3194
    [self loadImageAndPerform:#inspect] fork
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3195
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3196
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3197
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3198
    "Modified: / 7.9.1998 / 21:31:30 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3199
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3200
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3201
openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3202
    [self loadImageAndPerform:[:img |
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3203
				|i top viewer|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3204
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3205
				top := StandardSystemView new.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3206
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3207
				viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3208
				i := img.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3209
				top extent:200@200.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3210
				top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3211
				top openAndWait.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3212
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3213
				(i width > 200 or:[i height > 200]) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3214
				    i := i magnifiedPreservingRatioTo:200@200.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3215
				].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3216
				viewer image:i.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3217
			      ].
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3218
    ] fork
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3219
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3220
    "Modified: / 4.12.1998 / 15:49:03 / cg"
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3221
!
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3222
3001
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3223
openMP3Player
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3224
    |file|
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3225
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3226
    file := self getSelectedFileName.
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3227
    (file isNil) ifTrue:[
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3228
        ^ self.
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3229
    ].
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3230
    file := currentDirectory filenameFor:file.
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3231
    (MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file.
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3232
!
b6852e9e57f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
  3233
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3234
openSelectedFilename
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3235
    |sel|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3236
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3237
    sel := subView selection.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3238
    sel notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3239
	sel := sel asString withoutSeparators.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3240
	sel asFilename exists ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3241
	    self doOpenFile:sel viaDoubleClick:false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3242
	]
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3243
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3244
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3245
    "Created: / 4.2.1999 / 17:40:42 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3246
    "Modified: / 4.2.1999 / 17:47:06 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3247
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  3248
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3249
openSnapshotImageBrowser
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  3250
    ^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  3251
!
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3252
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3253
openTerminal
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  3254
    VT100TerminalView openShellIn:currentDirectory
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3255
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3256
    "Created: / 20.7.1998 / 18:18:15 / cg"
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  3257
    "Modified: / 20.7.1998 / 18:32:28 / cg"
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3258
!
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  3259
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3260
openTool:aToolClass
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3261
    "open a tool on the selected file(s)"
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3262
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3263
    ^ self openTool:aToolClass ignoreDirectories:true
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3264
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3265
    "Modified: / 7.9.1998 / 19:32:10 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3266
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3267
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3268
openTool:aToolClass ignoreDirectories:ignoreDirs
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3269
    "open a tool on the selected file(s)"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3270
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3271
    ^ self
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3272
        openTool:aToolClass 
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3273
        with:#openOn: 
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  3274
        ignoreDirectories:ignoreDirs
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  3275
!
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3276
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3277
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3278
    "open a tool on the selected file(s)"
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3279
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3280
    |numItems path tool|
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3281
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3282
    aToolClass isNil ifTrue:[
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3283
        self warn:'Sorry, that tool seems to be not available'.
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3284
        ^ nil.
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3285
    ].
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3286
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3287
    (numItems := fileListView selection size) > 2 ifTrue:[
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3288
        (self 
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3289
            confirm:(resources string:'open for each of the %1 items ?' 
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3290
                                 with:numItems)) ifFalse:[^ self].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3291
    ].
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3292
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3293
    self selectedFilesDo:[:fileName |
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3294
        path := currentDirectory filenameFor:fileName.
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3295
        (ignoreDirs not
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3296
        or:[path isDirectory not]) ifTrue:[
2825
fb93c4772441 added snapShotImageBrowser to menu
Claus Gittinger <cg@exept.de>
parents: 2814
diff changeset
  3297
            tool := aToolClass perform:aSelector with:(path pathName).
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3298
        ]
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  3299
    ].
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3300
    ^ tool
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  3301
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3302
    "Modified: / 18.9.1997 / 17:06:18 / stefan"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  3303
    "Created: / 7.9.1998 / 19:31:49 / cg"
2844
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  3304
    "Modified: / 25.5.1999 / 16:30:35 / cg"
9b5742ab47d6 comment only
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
  3305
!
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3306
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3307
openZipTool
2015
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3308
    |zipTool|
db114dca9c32 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  3309
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3310
    (zipTool := self openTool:ZipTool) notNil ifTrue:[
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3311
        zipTool initialExtractDirectory:currentDirectory
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3312
    ].
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3313
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3314
    "Created: / 26.8.1998 / 16:20:55 / cg"
2170
e9078e7a7e40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2166
diff changeset
  3315
    "Modified: / 25.5.1999 / 16:30:54 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3316
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  3317
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3318
readAbbrevFile
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3319
    |sel|
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3320
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3321
    sel := self singleSelectedFile.
3013
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  3322
    sel isNil ifTrue:[
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  3323
        sel := currentDirectory asFilename construct:'abbrev.stc'.
1a4bdf64c187 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3010
diff changeset
  3324
    ].
2567
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3325
    sel notNil ifTrue:[
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3326
        Smalltalk installAutoloadedClassesFrom:sel
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3327
    ].
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3328
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3329
    "Created: / 4.2.1999 / 17:40:42 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3330
    "Modified: / 29.1.2000 / 13:10:01 / cg"
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3331
!
dd029fea485d added installAutoloaded menuItem
Claus Gittinger <cg@exept.de>
parents: 2562
diff changeset
  3332
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3333
revisitFile:aFileName
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3334
    |lineNr|
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3335
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3336
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' 
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3337
         yesButton:'proceed') ifFalse:[ ^self ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3338
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3339
    self doChangeCurrentDirectoryTo:aFileName asFilename directory updateHistory:false.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3340
    lineNr := fileList indexOf:aFileName asFilename baseName.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3341
    fileListView selection:lineNr.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3342
    self fileGet:true.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3343
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3344
!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3345
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3346
showOrHideTabView
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3347
    "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
  3348
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3349
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3350
	tabRulerView isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3351
	    self createTabRulerIn:scrollView superView.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3352
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3353
	tabRulerView beVisible.
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3354
        
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3355
	false "self is3D" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3356
	    scrollView topInset:(tabRulerView superView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3357
	    tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3358
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3359
	    scrollView topInset:(tabRulerView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3360
	    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3361
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3362
	tabRulerView hiddenTabs:#(1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3363
	tabRulerView fixedTabs:#(1).
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3364
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3365
	tabRulerView notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3366
	    tabRulerView beInvisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3367
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3368
	scrollView topInset:0
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3369
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3370
    tabSpec := nil.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3371
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3372
    "Created: / 19.4.1997 / 09:50:02 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3373
    "Modified: / 4.8.1998 / 13:44:14 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3374
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3375
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3376
!FileBrowser methodsFor:'help '!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3377
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3378
helpTextFor:aComponent
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3379
    |s|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3380
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3381
    aComponent == subView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3382
	s := 'HELP_SUBVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3383
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3384
    aComponent == fileListView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3385
	s := 'HELP_FILELIST'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3386
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3387
    aComponent == filterField ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3388
	s := 'HELP_FILTER'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3389
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3390
    aComponent == labelView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3391
	s := 'HELP_PATHFIELD'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3392
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3393
    aComponent == commandView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3394
	s := 'HELP_COMMANDVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3395
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3396
    s notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3397
	^ resources string:s
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3398
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3399
    ^ nil
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3400
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3401
2116
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3402
!FileBrowser methodsFor:'initialize / release'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3403
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3404
createTabRulerIn:topFrame
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3405
    |v|
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3406
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3407
    false "self is3D" ifTrue:[
2256
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3408
        v := View in:topFrame.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3409
        v level:-1.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3410
        tabRulerView := TabSpecRuler in:v.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3411
        tabRulerView level:1.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3412
        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
  3413
        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
  3414
    ] ifFalse:[
2256
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3415
        tabRulerView := TabSpecRuler in:topFrame.
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3416
        tabRulerView origin:(0.0@0.0) corner:(1.0@10).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3417
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3418
    tabRulerView borderWidth:0.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3419
    tabRulerView synchronousOperation:true.
2256
3ea6c549b035 let the tabRuler scroll with the fileList.
Claus Gittinger <cg@exept.de>
parents: 2255
diff changeset
  3420
    tabRulerView masterView:scrollView scrolledView
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3421
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3422
    "Created: / 27.7.1998 / 20:23:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3423
    "Modified: / 27.7.1998 / 20:30:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3424
!
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3425
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3426
currentDirectory:aDirectoryPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3427
    "set the directory to be browsed"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3428
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3429
    |newDirectory|
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3430
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3431
    newDirectory := aDirectoryPath asFilename.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3432
    newDirectory = currentDirectory ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3433
        ^ self
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3434
    ].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3435
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3436
    currentDirectory := aDirectoryPath asFilename.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3437
    self changed:#path.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3438
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3439
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3440
     tell my subview (whatever that is) to start its file-dialog
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3441
     (i.e. save-as etc.) in that directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3442
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3443
    (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
  3444
        subView directoryForFileDialog:currentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3445
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3446
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3447
    "Modified: 16.9.1997 / 14:56:17 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3448
    "Modified: 21.9.1997 / 11:28:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3449
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3450
2116
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3451
destroy
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3452
    "destroy view and boxes"
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3453
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3454
    ObjectMemory removeDependent:self.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3455
    self stopUpdateProcess.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3456
    self stopImageRenderProcess.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3457
    checkBlock := nil.
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3458
    super destroy
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3459
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3460
    "Modified: 19.4.1997 / 13:51:48 / cg"
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3461
!
44f36afc96bc category change
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3462
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3463
focusSequence
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3464
    "return the sequence in which ALT-CursorRight steps focus"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3465
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3466
    |fs|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3467
2688
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3468
    fs := Array
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3469
        with:menuPanel
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3470
        with:labelView
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3471
        with:filterField 
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3472
        with:fileListView 
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3473
        with:subView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3474
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3475
    commandView notNil ifTrue:[
2688
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3476
        fs := fs copyWith:commandView
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3477
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3478
    ^fs
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3479
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3480
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3481
initEvents
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3482
    super initEvents.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3483
    self enableEvent:#visibilityChange.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3484
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3485
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3486
initialize
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3487
    |frame spacing halfSpacing v topFrame labelFrame filterModel
2688
9bb22571f558 include menuPanel in focusSequence
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
  3488
     buttonPanel img mH lowerFrame|
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3489
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3490
    super initialize.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3491
819
b78a26650047 initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
  3492
    fileEncoding := #iso8859.        "/ native ST/X encoding
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  3493
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3494
    "if true, will replace leading spaces by tabs on
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3495
     file write. If false, they will be written as spaces
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3496
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3497
    compressTabs := resources at:'COMPRESS_TABS' default:true.
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3498
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3499
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3500
     showing long or short by default
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3501
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3502
    "/ showLongList := resources at:'LONG_LIST' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3503
    showingDetails := (resources at:'LONG_LIST' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3504
    showingDetails onChangeSend:#detailsSettingChanged to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3505
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3506
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3507
     show hidden files or not ?
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3508
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3509
    "/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3510
    showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3511
    showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3512
2031
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3513
    "
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3514
     showing small icons by default
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3515
    "
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3516
    showingBigImagePreview := (resources at:'BIG_IMAGE_PREVIEW' default:false) asValue.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3517
    showingBigImagePreview onChangeSend:#bigImagePreviewSettingChanged to:self.
5ea9d1631a14 bigger previews
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
  3518
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3519
    sortByWhat := #name asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3520
    sortByWhat onChangeSend:#sortChanged to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3521
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3522
    sortCaseless := (Filename isCaseSensitive not) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3523
    sortCaseless onChangeSend:#updateCurrentDirectory to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3524
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3525
    dosEOLMode := false asValue.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3526
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3527
    lockUpdate := false.
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3528
132
claus
parents: 126
diff changeset
  3529
    CommandHistory isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3530
        CommandHistory := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3531
        CommandHistorySize := 50
132
claus
parents: 126
diff changeset
  3532
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3533
    DirectoryHistory isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3534
        DirectoryHistory := OrderedCollection new.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3535
        DirectoryHistoryWhere := OrderedCollection new.
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3536
    ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3537
    VisitedFileHistory isNil ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3538
        VisitedFileHistory := OrderedCollection new.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3539
    ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3540
    HistorySize isNil ifTrue:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  3541
        HistorySize := 15
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3542
    ].
132
claus
parents: 126
diff changeset
  3543
    commandIndex := 0.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3544
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  3545
    icons := Dictionary new.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3546
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3547
    Icons isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3548
        self class initializeIcons
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3549
    ].
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  3550
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3551
    myName := (resources string:self class name).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3552
    self label:myName.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3553
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3554
    menuPanel := MenuPanel in:self.
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  3555
    menuPanel level:1.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3556
    menuPanel verticalLayout:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3557
    menuPanel receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3558
    menuPanel menu:(self pullDownMenu).
2050
5ef6404d6172 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2048
diff changeset
  3559
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3560
    mH := menuPanel preferredExtent y.
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3561
    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
  3562
93
claus
parents: 85
diff changeset
  3563
    labelFrame := View 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3564
                        origin:(0.0 @ mH)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3565
                        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
  3566
                        in:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  3567
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3568
    (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
  3569
        labelFrame level:1.
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3570
"/        labelFrame rightInset:-1.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3571
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3572
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3573
    spacing := ViewSpacing.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3574
    halfSpacing := spacing // 2.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3575
1100
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3576
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3577
      checkBlock is executed by the Processor every checkDelta seconds.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3578
      We use #pushEvent: to perform the directory update
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3579
      in our windowgroups process.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3580
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  3581
    checkBlock := [self pushEvent:#checkIfDirectoryHasChanged].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3582
    checkDelta := resources at:'CHECK_DELTA' default:10.
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  3583
    doAutoUpdate := true asValue.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3584
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3585
    currentDirectory := Filename currentDirectory.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3586
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3587
    filterModel := '*' asValue.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3588
    filterField := EditField in:labelFrame.
1071
Claus Gittinger <cg@exept.de>
parents: 1040
diff changeset
  3589
    filterField 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3590
        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
  3591
        corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ).
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3592
    filterField rightInset:(ViewSpacing - halfSpacing).
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3593
    filterField model:filterModel.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3594
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3595
    labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)).
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  3596
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3597
    self initializeFilterPattern.
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3598
    filterModel onChangeSend:#filterPatternChanged to:self.
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3599
"/    filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3600
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3601
"/    labelView := Label in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3602
"/    labelView origin:(halfSpacing @ halfSpacing)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3603
"/              extent:[((width // 4 * 3) - spacing - borderWidth)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3604
"/                       @
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3605
"/                       (filterField heightIncludingBorder)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3606
"/                       "(font height + font descent)"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3607
"/                     ].
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3608
"/    labelView adjust:#right.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3609
"/    labelView borderWidth:0.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3610
"/    labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3611
"/    labelFrame model:self; menu:#labelMenu.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3612
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3613
    labelView := FilenameEditField in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3614
    labelView 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3615
        origin:(halfSpacing @ (halfSpacing))
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3616
        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
  3617
                @
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3618
                (filterField heightIncludingBorder)
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3619
                "(font height + font descent)"
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3620
               ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3621
    labelView menu:#labelMenu; 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3622
            aspect:#path; changeMessage:#pathChanged:.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3623
    labelView model:self.
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  3624
    labelView acceptOnExpand:true.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3625
    labelView backgroundColor:(labelFrame viewBackground).
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  3626
    labelFrame model:self; menu:#labelMenu.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3627
    labelView cursorType:#solidCaret; cursorTypeNoFocus:#none.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3628
    labelView level:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3629
    labelView borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3630
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3631
    killButton := Button label:(resources string:'kill') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3632
"/    killButton origin:(halfSpacing @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3633
"/               extent:(killButton width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3634
    killButton origin:(halfSpacing @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3635
    killButton topInset:(killButton height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3636
    killButton beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3637
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3638
    pauseToggle := Toggle label:(resources string:'pause') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3639
"/    pauseToggle origin:((killButton corner x + 50) @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3640
"/                extent:(pauseToggle width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3641
    pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3642
    pauseToggle topInset:(pauseToggle height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3643
    pauseToggle beInvisible.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3644
132
claus
parents: 126
diff changeset
  3645
    self initializeCommandViewIn:self.
claus
parents: 126
diff changeset
  3646
claus
parents: 126
diff changeset
  3647
"/    frame := VariableVerticalPanel
claus
parents: 126
diff changeset
  3648
"/                 origin:[frame borderWidth negated 
claus
parents: 126
diff changeset
  3649
"/                         @ 
claus
parents: 126
diff changeset
  3650
"/                         labelFrame height
claus
parents: 126
diff changeset
  3651
"/                         "/ (labelView height + labelView origin y + spacing)
claus
parents: 126
diff changeset
  3652
"/                        ]
claus
parents: 126
diff changeset
  3653
"/                 corner:(1.0 @ 1.0)
claus
parents: 126
diff changeset
  3654
"/                     in:self.
claus
parents: 126
diff changeset
  3655
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3656
    frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self.
2739
1b0b1520670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2701
diff changeset
  3657
    frame snapMode:#both.
132
claus
parents: 126
diff changeset
  3658
    frame topInset:labelFrame height.
claus
parents: 126
diff changeset
  3659
    commandView notNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3660
        frame bottomInset:(commandView height + spacing + spacing)
132
claus
parents: 126
diff changeset
  3661
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3662
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3663
    topFrame := View in:frame.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3664
    topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3665
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3666
false ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3667
    self createTabRulerIn:topFrame.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3668
].
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3669
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3670
    scrollView := ScrollableView in:topFrame.
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3671
    scrollView 
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3672
        verticalScrollable:true;
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3673
        verticalMini:false;
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3674
        horizontalScrollable:true;
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3675
        horizontalMini:true;
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3676
        autoHideHorizontalScrollBar:true;
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3677
        autoHideVerticalScrollBar:false;
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3678
        origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3679
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3680
    fileListView := SelectionInListView new.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3681
    scrollView scrolledView:fileListView.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3682
    fileListView action:[:lineNr | self fileSelect:lineNr].
1326
aab1605ad945 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  3683
    fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3684
    fileListView multipleSelectOk:true.
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  3685
    fileListView delegate:self.
98
claus
parents: 93
diff changeset
  3686
    fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu.
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  3687
    fileListView allowDrag:true.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3688
    fileListView dragObjectConverter:[:obj | 
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3689
                                        |dir nm path idx|
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3690
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3691
                                        nm := obj theObject asString.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3692
                                        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
  3693
                                        idx == 0 ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3694
                                            "/ cannot happen ...
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3695
                                            nil
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3696
                                        ] ifFalse:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3697
                                            nm := fileList at:idx.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3698
                                            dir := currentDirectory pathName asFilename.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3699
                                            path := dir constructString:nm.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3700
                                            DropObject newFile:path.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3701
                                        ]
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  3702
                                     ].
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3703
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3704
    "/ sigh - must be delayed - origin is not yet fixe
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3705
"/    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3706
"/    self showOrHideTabView.
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3707
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3708
    lowerFrame := View in:frame.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3709
    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
  3710
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3711
    v := self initializeSubViewIn:lowerFrame.
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3712
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3713
    subView := v scrolledView.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3714
    (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
  3715
        subView directoryForFileDialog:currentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3716
    ].
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3717
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3718
"/    buttonPanel := HorizontalPanelView in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3719
"/    buttonPanel horizontalLayout:#leftSpace.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3720
"/    buttonPanel verticalSpace:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3721
"/    "/ buttonPanel verticalLayout:#top.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3722
"/    buttonPanel borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3723
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3724
"/    buttonPanel 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3725
"/        origin:(0.5 @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3726
"/        extent:[((width // 4) - spacing - borderWidth)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3727
"/                @
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3728
"/                (buttonPanel preferredExtent y max:(labelView height))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3729
"/               ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3730
"/    "/ buttonPanel level:-1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3731
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3732
"/    upButton := Button in:buttonPanel.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3733
"/    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
  3734
"/    upButton label:(img ? 'up').
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3735
"/    upButton action:[self changeToParentDirectory].
1328
9588cd743755 Fix kill and pause buttons.
Stefan Vogel <sv@exept.de>
parents: 1327
diff changeset
  3736
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3737
    ObjectMemory addDependent:self.
132
claus
parents: 126
diff changeset
  3738
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3739
    "Modified: / 6.9.1995 / 20:26:06 / claus"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3740
    "Modified: / 16.9.1997 / 14:52:46 / stefan"
2252
9709a3b2b411 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2220
diff changeset
  3741
    "Modified: / 12.7.1999 / 12:59:47 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3742
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3743
132
claus
parents: 126
diff changeset
  3744
initializeCommandViewIn:frame
claus
parents: 126
diff changeset
  3745
    "set up the command view - can be redefined in subclasses as empty,
claus
parents: 126
diff changeset
  3746
     if no commandView is wanted"
claus
parents: 126
diff changeset
  3747
claus
parents: 126
diff changeset
  3748
claus
parents: 126
diff changeset
  3749
    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
  3750
    commandView allInset:ViewSpacing//2.
132
claus
parents: 126
diff changeset
  3751
    commandView topInset:(commandView preferredExtent y negated - ViewSpacing).
claus
parents: 126
diff changeset
  3752
133
claus
parents: 132
diff changeset
  3753
"/    commandView contents:'** no commands which require input here **'.
132
claus
parents: 126
diff changeset
  3754
142
claus
parents: 139
diff changeset
  3755
    commandView entryCompletionBlock:[:contents |
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3756
        |newString|
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3757
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3758
        newString := self entryCompletion:contents.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3759
        newString notNil ifTrue:[
2803
5c913909a56b fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
  3760
            commandView contents:newString.
5c913909a56b fileNameCompletion now does exactly that;
Claus Gittinger <cg@exept.de>
parents: 2796
diff changeset
  3761
            commandView cursorToEndOfLine.
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3762
        ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3763
    ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  3764
132
claus
parents: 126
diff changeset
  3765
    commandView leaveAction:[:key | 
2522
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3766
        |cmd nCmd empty|
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3767
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3768
        (key == #CursorDown 
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3769
        or:[key == #CursorUp]) ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3770
            nCmd := CommandHistory size.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3771
            nCmd == 0 ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3772
                empty := true
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3773
            ] ifFalse:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3774
                key == #CursorUp ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3775
                    commandIndex == nCmd ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3776
                        commandView flash.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3777
                    ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3778
                    commandIndex := (commandIndex + 1) min:nCmd
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3779
                ] ifFalse:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3780
                    commandIndex == 1 ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3781
                        commandView flash.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3782
                        empty := true.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3783
                    ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3784
                    commandIndex := (commandIndex - 1) max:1.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3785
                ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3786
            ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3787
            empty == true ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3788
                commandView contents:nil
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3789
            ] ifFalse:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3790
                commandView contents:(CommandHistory at:commandIndex).
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3791
            ]        
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3792
        ].
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3793
        key == #Return ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3794
            cmd := commandView contents string.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3795
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3796
            subView insertLine:(
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3797
                                Text string:('>> ' , cmd)
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3798
                                     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
  3799
"/                                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
  3800
                                )
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3801
                    before:(subView cursorLine).
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3802
            subView cursorDown:1.
133
claus
parents: 132
diff changeset
  3803
claus
parents: 132
diff changeset
  3804
"/            subView insertStringAtCursor:cmd.
claus
parents: 132
diff changeset
  3805
"/            subView insertCharAtCursor:(Character cr).
132
claus
parents: 126
diff changeset
  3806
2522
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3807
            (cmd notNil and:[cmd notEmpty]) ifTrue:[
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3808
                self class addToCommandHistory:cmd for:nil.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3809
                self doExecuteCommand:cmd replace:false.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3810
                commandView contents:nil.
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3811
                commandIndex := 0
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3812
            ]
036e46c50ac9 care for emphasized text in the command view
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
  3813
        ]
132
claus
parents: 126
diff changeset
  3814
    ].
claus
parents: 126
diff changeset
  3815
133
claus
parents: 132
diff changeset
  3816
    "Modified: 7.9.1995 / 15:48:45 / claus"
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  3817
    "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
  3818
    "Modified: 18.9.1997 / 16:55:01 / stefan"
132
claus
parents: 126
diff changeset
  3819
!
claus
parents: 126
diff changeset
  3820
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3821
initializeFilterPattern
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3822
    "set an initial matchpattern - can be redefined in subclasses"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3823
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3824
    filterField model value:'*'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3825
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3826
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3827
initializeSubViewIn:frame
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3828
    "set up the contents view - can be redefined in subclasses for
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3829
     different view types (SoundFileBrowser/ImageBrowsers etc.)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3830
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3831
    |textView|
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3832
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3833
    textView := HVScrollableView 
2572
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3834
        for:CodeView 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3835
        miniScrollerH:true 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3836
        miniScrollerV:false 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3837
        in:frame.
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3838
    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
  3839
2095
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3840
"/    imagePreviewView := HVScrollableView 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3841
"/        for:ImageView 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3842
"/        miniScrollerH:true 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3843
"/        miniScrollerV:false 
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3844
"/        in:frame.
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3845
"/    imagePreviewView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3846
"/
805583c09bc2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  3847
"/    imagePreviewView beInvisible.
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3848
2572
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3849
    textView doItAction:[:theCode |
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3850
        PositionableStream currentFileInDirectoryQuerySignal 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3851
        answer:(currentDirectory asFilename)
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3852
        do:[
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3853
            Compiler 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3854
                evaluate:theCode 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3855
                in:nil 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3856
                receiver:nil 
2607
fa77c15f43bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  3857
                notifying:textView 
2572
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3858
                logged:true 
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3859
                ifFail:nil
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3860
        ]
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3861
    ].
bdb14ce83fd0 also provide the currentFileInDirectory in doIts.
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  3862
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  3863
    ^ textView.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3864
!
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3865
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3866
postRealize
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3867
    super postRealize.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3868
    self showOrHideTabView.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3869
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3870
    "Created: 24.7.1997 / 18:13:46 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3871
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3872
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3873
!FileBrowser methodsFor:'menu actions'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3874
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3875
copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3876
    "copy the command history to the clipBoard"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3877
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3878
    self setTextSelection:(CommandHistory asStringCollection asString).
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3879
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3880
    "Modified: / 29.10.1998 / 12:17:14 / cg"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3881
!
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3882
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3883
copyFileList
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3884
    "copy fileList to the clipBoard"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3885
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3886
    self setTextSelection:(fileListView list 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3887
			      collect:[:l | |ll|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3888
					ll := l string withoutSeparators.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3889
					(ll endsWith:' ...') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3890
					    ll copyWithoutLast:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3891
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3892
					    ll
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3893
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3894
				      ]) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3895
				asStringCollection asString.
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3896
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3897
    "Modified: / 17.8.1998 / 10:13:10 / cg"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3898
!
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3899
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3900
copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3901
    "copy the selected filename to the clipBoard (for easy paste)"
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3902
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3903
    |sel fileName|
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3904
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3905
    sel := fileListView selection.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3906
    sel size == 1 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3907
	fileName := fileList at:sel first.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  3908
	self setTextSelection:fileName
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3909
    ].
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3910
!
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3911
3010
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3912
copySelectedPathName
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3913
    "copy the selected files pathname to the clipBoard (for easy paste)"
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3914
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3915
    |sel fileName|
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3916
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3917
    sel := fileListView selection.
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3918
    sel size == 1 ifTrue:[
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3919
        fileName := currentDirectory constructString:(fileList at:sel first).
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3920
        self setTextSelection:fileName
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3921
    ].
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3922
!
e6879d50db85 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3007
diff changeset
  3923
2562
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3924
createProjectAndOpenProjectBrowser
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3925
    |nm f s|
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3926
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3927
    nm := currentDirectory baseName.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3928
    f := (currentDirectory construct:nm) withSuffix:'prj'.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3929
    f exists ifTrue:[
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3930
        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
  3931
        ^ self.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3932
    ].
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3933
    s := f writeStream.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3934
    s nextPutAll:'
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3935
name            ''' , nm , '''
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3936
type            #classLibrary
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3937
package         #''private:' , nm , '''
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3938
prerequisites   nil
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3939
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3940
classes      #( )
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3941
'.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3942
    s close.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3943
    ProjectBrowser openOnFile:f.
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3944
!
da7680fe8407 first attempt in 'create project' function
Claus Gittinger <cg@exept.de>
parents: 2550
diff changeset
  3945
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3946
menuExit
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3947
    self closeRequest
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3948
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3949
    "Created: / 4.8.1998 / 13:41:38 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3950
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3951
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3952
menuOSCommand
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3953
    self fileExecute
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3954
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3955
    "Created: / 4.8.1998 / 14:06:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3956
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3957
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3958
menuShowFileBrowserDocumentation
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3959
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3960
    "Created: / 4.8.1998 / 14:03:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3961
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3962
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3963
openAboutThisApplication
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3964
    "opens an about box for this application."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3965
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3966
    |rev box myClass clsRev image msg|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3967
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3968
    rev := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3969
    myClass := self class.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3970
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3971
    (clsRev := myClass revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3972
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3973
    msg := '\' withCRs , myClass name asBoldText, rev.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3974
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3975
    AboutBox isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3976
	"/ this handles bad installations of ST/X,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3977
	"/ where the AboutBox is missing.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3978
	"/ (May vanish in the future)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3979
	^ self information:msg
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3980
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3981
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3982
    box := AboutBox title:msg.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3983
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3984
    image := self class defaultIcon.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3985
    image notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3986
	box image:image
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3987
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3988
    box   label:'About This Application'.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3989
    box   autoHideAfter:10 with:[].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3990
    box   showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3991
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3992
    "Modified: / 14.8.1998 / 13:20:24 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3993
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3994
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3995
openHTMLDocument:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3996
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3997
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3998
    "Created: / 4.8.1998 / 14:06:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3999
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4000
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4001
pullDownMenu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4002
    "return the top (pullDown) menu"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4003
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4004
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4005
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4006
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4007
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4008
    m := self class menuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4009
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4010
    m receiver:self.
2035
307ed5143d8b national language stuff - again
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  4011
    m findGuiResourcesIn:self.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4012
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4013
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4014
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4015
    "Created: / 14.8.1998 / 14:14:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4016
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4017
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4018
showAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4019
    ToolApplicationModel openAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4020
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4021
    "Created: / 14.8.1998 / 13:18:41 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4022
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4023
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4024
sortChanged
2020
7c9afb53b8a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
  4025
"/ Transcript show:'fBrowser:'; showCR:sortByWhat value.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4026
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4027
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4028
    "Created: / 14.8.1998 / 16:17:20 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4029
    "Modified: / 14.8.1998 / 16:44:00 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4030
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4031
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4032
!FileBrowser methodsFor:'menu actions - cvs'!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4033
2424
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4034
cvsAddSelection
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4035
    "add files (or all in current directory)"
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4036
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4037
    |sel log|
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4038
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4039
    log := Dialog
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4040
        requestText:(resources string:'enter initial log message')
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4041
        lines:10
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4042
        columns:70
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4043
        initialAnswer:nil.
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4044
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4045
    log notNil ifTrue:[
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4046
        sel := fileListView selection.
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4047
        sel size > 0 ifTrue:[
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4048
            sel := sel collect:[:rawIndex | fileList at:rawIndex].
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4049
            sel do:[:fn |
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4050
                self
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4051
                    doExecuteCommand:('cvs add -m ''' , log , ''' ' , fn) replace:false
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4052
            ]
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4053
        ] ifFalse:[
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4054
            self
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4055
                doExecuteCommand:('cvs add -l -m ''' , log , ''' *') replace:false
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4056
        ].
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4057
    ]
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4058
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4059
    "Modified: / 16.12.1998 / 17:30:31 / cg"
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4060
!
5d04594f10cd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2386
diff changeset
  4061
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4062
cvsCommitSelection
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4063
    "commit files (or all in current directory)"
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4064
2956
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4065
    |nSel sel log msg|
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4066
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4067
    nSel := fileListView selection size.
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4068
    nSel == 1 ifTrue:[
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4069
        msg := resources string:'enter log message for checkIn of ''%1''' with:(fileList at:fileListView selection first)
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4070
    ] ifFalse:[
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4071
        nSel > 1 ifTrue:[
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4072
            msg := resources string:'enter log message for %1 files to checkIn' with:nSel printString
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4073
        ] ifFalse:[
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4074
            msg := resources string:'enter log message for checkIn'
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4075
        ]
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4076
    ].
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4077
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4078
    log := Dialog
2956
58cc84d4881e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2951
diff changeset
  4079
        requestText:msg
2386
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4080
        lines:10
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4081
        columns:70
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4082
        initialAnswer:nil.
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4083
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4084
    log notNil ifTrue:[
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4085
        sel := fileListView selection.
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4086
        sel size > 0 ifTrue:[
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4087
            sel := sel collect:[:rawIndex | fileList at:rawIndex].
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4088
            sel do:[:fn |
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4089
                self
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4090
                    doExecuteCommand:('cvs commit -m ''' , log , ''' ' , fn) replace:false
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4091
            ]
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4092
        ] ifFalse:[
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4093
            self
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4094
                doExecuteCommand:('cvs commit -l -m ''' , log , '''') replace:false
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4095
        ].
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4096
    ]
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4097
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4098
    "Modified: / 16.12.1998 / 17:30:31 / cg"
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4099
!
dd80997d7725 added commit
Claus Gittinger <cg@exept.de>
parents: 2385
diff changeset
  4100
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4101
cvsRemoveFileAndContainer
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4102
    "remove the selected file(s) and their CVS containers.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4103
     Query if user really wants to really remove them."
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4104
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4105
    |sel q|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4106
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4107
    sel := fileListView selection.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4108
    sel size > 0 ifTrue:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4109
        sel := sel collect:[:rawIndex | fileList at:rawIndex].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4110
        sel size > 1 ifTrue:[
2939
b6196abe3f31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  4111
            q := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size)
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4112
        ] ifFalse:[
2939
b6196abe3f31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2871
diff changeset
  4113
            q := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first allBold)
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4114
        ].
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4115
        (self sensor shiftDown
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4116
        or:[self ask:q yesButton:'remove']) ifTrue:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4117
            self withCursor:(Cursor wait) do:[
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4118
                self doRemoveAndRemoveFromCVS:sel
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4119
            ]
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  4120
        ]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4121
    ]
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4122
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4123
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4124
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4125
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4126
cvsUpdateDirectoryLocal
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4127
    "update this directory"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4128
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4129
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4130
	doExecuteCommand:'cvs upd -l' replace:false
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4131
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4132
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4133
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4134
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4135
cvsUpdateDirectoryRecursive
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4136
    "update this directory"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4137
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4138
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4139
	doExecuteCommand:'cvs upd -d' replace:false
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4140
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4141
    "Modified: / 16.12.1998 / 17:30:31 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4142
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4143
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4144
cvsUpdateSelection
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4145
    "update selected files"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4146
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4147
    |sel|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4148
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4149
    sel := fileListView selection.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4150
    sel size > 0 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4151
	sel := sel collect:[:rawIndex | fileList at:rawIndex].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4152
	sel do:[:fn |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4153
	    self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4154
		doExecuteCommand:('cvs upd ' , fn) replace:false
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4155
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4156
    ].
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4157
!
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4158
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4159
doRemoveAndRemoveFromCVS:filesToRemove
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4160
    "remove the selected file(s) and their CVS containers - no questions asked"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4161
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4162
    |msg idx needUpdate toRemove updateRunning yesToAll|
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4163
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4164
    updateRunning := listUpdateProcess notNil.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4165
    self stopUpdateProcess.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4166
    toRemove := OrderedCollection new.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4167
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4168
    "/
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4169
    "/ did the directory change in the meanwhile ?
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4170
    "/
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4171
    needUpdate := (currentDirectory modificationTime > timeOfLastCheck).
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4172
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4173
    yesToAll := false.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4174
    lockUpdate := true.
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4175
    [
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4176
	filesToRemove do:[:fileName |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4177
	    |f|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4178
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4179
	    f := currentDirectory construct:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4180
	    OperatingSystem accessDeniedErrorSignal handle:[:ex|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4181
		"was not able to remove it"
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4182
		msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4183
		self showAlert:msg with:(OperatingSystem lastErrorString)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4184
	    ] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4185
		|answer contents|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4186
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4187
		(f isSymbolicLink not) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4188
		    self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4189
			doExecuteCommand:('cvs remove -f ' , f baseName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4190
			replace:false.
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4191
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4192
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4193
		self show:nil
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4194
"
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4195
		    idx := fileList indexOf:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4196
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4197
			toRemove add:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4198
		    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4199
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4200
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4201
	].
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4202
    ] valueNowOrOnUnwindDo:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4203
	lockUpdate := false.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4204
	fileListView setSelection:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4205
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4206
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4207
	"/ remove reverse - otherwise indices are wrong
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4208
	"/
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4209
	toRemove sort.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4210
	toRemove reverseDo:[:idx |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4211
	    fileList removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4212
	    fileListView removeIndex:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4213
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4214
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4215
	updateRunning ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4216
	    self updateCurrentDirectory
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4217
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4218
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4219
	     install a new check after some time
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4220
	    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4221
	    needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4222
	    Processor removeTimedBlock:checkBlock.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4223
	    Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4224
	]
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4225
    ].
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4226
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4227
    self
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4228
	doExecuteCommand:('cvs commit -m ''removed via FileBrowser''')
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4229
	replace:false.
2102
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4230
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4231
    "Modified: / 21.10.1998 / 17:02:11 / cg"
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4232
! !
da9a9deccee0 more CVS
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
  4233
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4234
!FileBrowser methodsFor:'misc user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4235
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4236
closeRequest
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4237
    "exit FileBrowser"
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4238
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4239
    (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
  4240
	      yesButton:'close') 
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4241
    ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4242
	"/ self windowGroup closeDownViews.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4243
	super closeRequest
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4244
    ]
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4245
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4246
    "Created: / 3.8.1998 / 19:55:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4247
    "Modified: / 4.8.1998 / 18:21:03 / cg"
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4248
!
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  4249
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4250
discardChangesDialog
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4251
    "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
  4252
     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
  4253
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4254
    ^ 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
  4255
	       yesButton:'change'
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4256
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4257
    "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
  4258
!
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4259
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4260
entryCompletion:contents
3022
1063cadd13f7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
  4261
    |newString words lastWord expandedWord idx onlyOne addSpace fn|
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4262
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4263
    "/ find the last word.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4264
    "/ used to be 'contents asCollectionOfWords last',
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4265
    "/ but we have to care for escaped spaces here (unix) ...
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4266
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4267
    idx := contents size.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4268
    OperatingSystem isUNIXlike ifFalse:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4269
        "/ under MSDOS, the backslash is a directory separator
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4270
        idx := contents lastIndexOf:Character space startingAt:idx.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4271
    ] ifTrue:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4272
        "/ under UNIX, the backslash is a special character escape
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4273
        idx := idx + 1.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4274
        [
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4275
            idx := contents lastIndexOf:Character space startingAt:idx-1.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4276
        ] doWhile:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4277
            idx > 1 and:[ (contents at:idx-1) = $\ ]
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4278
        ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4279
    ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4280
    idx == 0 ifTrue:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4281
        commandView flash.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4282
        ^ nil.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4283
    ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4284
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4285
    lastWord := contents copyFrom:idx + 1.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4286
    OperatingSystem isUNIXlike ifTrue:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4287
        (lastWord includes:$\) ifTrue:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4288
            lastWord := lastWord copyReplaceAll:$\ withAll:''.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4289
        ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4290
    ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4291
3020
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4292
    onlyOne := true.
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4293
    expandedWord := Filename 
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4294
                    filenameCompletionFor:lastWord 
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4295
                    directory:currentDirectory 
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4296
                    directoriesOnly:false 
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4297
                    filesOnly:false 
3020
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4298
                    ifMultiple:[:dir | onlyOne := false. commandView flash.].
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4299
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4300
    addSpace := false.
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4301
    onlyOne ifTrue:[
3022
1063cadd13f7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
  4302
        fn := currentDirectory construct:expandedWord.
1063cadd13f7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
  4303
        (fn exists and:[fn isDirectory not]) ifTrue:[
3020
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4304
            addSpace := true.
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4305
        ].
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4306
    ].
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4307
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4308
    OperatingSystem isUNIXlike ifTrue:[
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4309
        expandedWord := expandedWord copyReplaceAll:(Character space) withAll:'\ '.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4310
        expandedWord := expandedWord copyReplaceAll:($') withAll:'\'''.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4311
        expandedWord := expandedWord copyReplaceAll:($() withAll:'\('.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4312
        expandedWord := expandedWord copyReplaceAll:($)) withAll:'\)'.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4313
        expandedWord := expandedWord copyReplaceAll:($[) withAll:'\['.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4314
        expandedWord := expandedWord copyReplaceAll:($]) withAll:'\]'.
2999
e9a5c559080f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2998
diff changeset
  4315
        expandedWord := expandedWord copyReplaceAll:($&) withAll:'\&'.
e9a5c559080f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2998
diff changeset
  4316
        expandedWord := expandedWord copyReplaceAll:($|) withAll:'\|'.
e9a5c559080f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2998
diff changeset
  4317
        expandedWord := expandedWord copyReplaceAll:($;) withAll:'\;'.
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4318
    ].
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4319
3020
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4320
    addSpace ifTrue:[
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4321
        expandedWord := expandedWord , ' '
0882f3df7999 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3015
diff changeset
  4322
    ].
2998
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4323
    newString := (contents copyTo:idx) ,  expandedWord.
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4324
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4325
    ^ newString
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4326
!
48eb938bbb7e fixed filename completion when
Claus Gittinger <cg@exept.de>
parents: 2989
diff changeset
  4327
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4328
filterPatternChanged
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4329
    fileListView scrollToTop.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4330
    fileListView deselect.
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4331
    self updateCurrentDirectory
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4332
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4333
    "Modified: / 3.10.1998 / 18:23:34 / cg"
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4334
!
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  4335
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4336
update:what with:someArgument from:changedObject
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4337
    realized ifFalse:[^ self].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4338
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4339
    (what == #aboutToExit) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4340
	"system wants to shut down this
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4341
	 - 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
  4342
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4343
	(subView modified and:[subView contentsWasSaved not]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4344
	    self raiseDeiconified.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4345
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4346
	    (self 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4347
		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
  4348
		yesButton:'save'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4349
		noButton:'don''t save')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4350
	    ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4351
		subView acceptAction notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4352
		    subView accept
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4353
		] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4354
		    subView save
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4355
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4356
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4357
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4358
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4359
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4360
    changedObject == tabSpec ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4361
	fileListView invalidate
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4362
    ].
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4363
585
be0241bf7268 use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 564
diff changeset
  4364
    "Modified: 29.5.1996 / 16:13:43 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4365
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4366
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4367
!FileBrowser methodsFor:'pathField user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4368
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4369
addDirToJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4370
    "add the current path to javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4371
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4372
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4373
    Java addToClassPath:currentDirectory pathName
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
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4376
    "Created: 1.8.1997 / 21:25:22 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4377
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4378
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4379
addDirToJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4380
    "add the current path to javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4381
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4382
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4383
    Java addToSourcePath:currentDirectory pathName
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
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4386
    "Created: 2.8.1997 / 14:11:19 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4387
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4388
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4389
changeCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4390
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4391
     otherwise ask for & change to that directory"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4392
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4393
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4394
	self queryForDirectoryToChange
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4395
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4396
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4397
    "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
  4398
    "Modified: 2.10.1997 / 14:09:02 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4399
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4400
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4401
changeDirectoryTo:aDirectoryName
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4402
    "sent from label menu to change back to a previous directory"
132
claus
parents: 126
diff changeset
  4403
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4404
    self discardChangesDialog ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4405
	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
  4406
    ].
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4407
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4408
    "Modified: / 2.10.1997 / 14:09:24 / stefan"
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4409
    "Modified: / 21.7.1998 / 16:38:03 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4410
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4411
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4412
changeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4413
    "if text was modified show a queryBox, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4414
     otherwise change immediately to the default directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4415
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4416
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4417
	 self doChangeToDefaultDirectory
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4418
    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4419
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4420
    "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
  4421
    "Modified: 2.10.1997 / 14:09:33 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4422
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4423
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4424
changeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4425
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4426
     otherwise change immediately to the home directory"
132
claus
parents: 126
diff changeset
  4427
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4428
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4429
	 self doChangeToHomeDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4430
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4431
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4432
    "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
  4433
    "Modified: 2.10.1997 / 14:09:42 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4434
!
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  4435
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4436
changeToParentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4437
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4438
     otherwise change immediately to the parent directory"
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  4439
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4440
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4441
	 self doChangeToParentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4442
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4443
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4444
    "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
  4445
    "Modified: 2.10.1997 / 14:09:55 / stefan"
98
claus
parents: 93
diff changeset
  4446
!
claus
parents: 93
diff changeset
  4447
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4448
copyPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4449
    "copy current path into cut & paste buffer"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4450
873
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  4451
    self setTextSelection:currentDirectory pathName
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  4452
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  4453
    "Modified: 14.12.1996 / 15:37:47 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4454
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4455
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4456
fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4457
    "add the current path to javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4458
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4459
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4460
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4461
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4462
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4463
    f isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4464
	^ self addDirToJavaClassPath
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4465
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4466
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4467
    Java addToClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4468
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4469
    "Created: / 9.11.1998 / 05:41:34 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4470
    "Modified: / 9.11.1998 / 05:56:00 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4471
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4472
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4473
fileAddToJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4474
    "add the current path to javas sourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4475
     (only available with ST/J System"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4476
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4477
    |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4478
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4479
    f := self getSelectedFileName.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4480
    f isNil ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4481
        ^ self addDirToJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4482
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4483
    f := currentDirectory asFilename construct:f.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4484
    Java addToSourcePath:(f pathName)
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4485
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4486
    "Created: / 9.11.1998 / 05:41:34 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4487
    "Modified: / 9.11.1998 / 05:56:00 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4488
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4489
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4490
fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4491
    "remove the current path from javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4492
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4493
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4494
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4495
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4496
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4497
    f isNil ifTrue:[
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4498
        ^ self removeDirFromJavaClassPath
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4499
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4500
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4501
    Java removeFromClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4502
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4503
    "Created: / 9.11.1998 / 05:42:05 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4504
    "Modified: / 9.11.1998 / 05:56:14 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4505
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4506
2368
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4507
fileRemoveFromJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4508
    "remove the current path from javas sourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4509
     (only available with ST/J System"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4510
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4511
    |f|
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4512
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4513
    f := self getSelectedFileName.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4514
    f isNil ifTrue:[
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4515
        ^ self removeDirFromJavaSourcePath
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4516
    ].
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4517
    f := currentDirectory asFilename construct:f.
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4518
    Java removeFromSourcePath:(f pathName)
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4519
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4520
    "Created: / 9.11.1998 / 05:42:05 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4521
    "Modified: / 9.11.1998 / 05:56:14 / cg"
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4522
!
e6e90f6b144a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
  4523
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4524
labelMenu
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4525
    "return the popUpMenu for the path label"
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4526
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  4527
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4528
2051
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4529
    |m|
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4530
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4531
    m := self class directoryMenuSpec.
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4532
    m menuPerformer:self.
3fb19889b83d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4533
    ^ m
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4534
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4535
    "Modified: / 14.8.1998 / 12:11:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4536
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4537
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4538
labelMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4539
    "return the popUpMenu for the path label"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4540
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4541
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4542
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4543
    |items menu currentIndex|
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4544
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4545
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4546
		   ('copy path'                   copyPath                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4547
		   ('-'                                                     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4548
		   ('up'                          changeToParentDirectory   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4549
		   ('back'                        changeToPreviousDirectory )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4550
		   ('change to home-directory'    changeToHomeDirectory     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4551
		   ('change to default-directory' changeToDefaultDirectory  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4552
		   ('change directory ...'        changeCurrentDirectory    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4553
	       ).             
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  4554
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  4555
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4556
	items := items , #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4557
			    ( '-')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4558
			    ( 'add to JavaClassPath'       addDirToJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4559
			    ( 'add to JavaSourcePath'      addDirToJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4560
			    ( 'remove from JavaClassPath'  removeDirFromJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4561
			    ( 'remove from JavaSourcePath' removeDirFromJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4562
			  ).
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4563
    ].
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4564
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4565
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4566
	items := items copyWith:#('-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4567
	items := items ,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4568
		 (DirectoryHistory 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4569
			collect:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4570
				    Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4571
					with:dirName 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4572
					with:#changeDirectoryTo:
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4573
					with:nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4574
					with:dirName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4575
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4576
		 ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4577
	currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4578
	currentIndex == 0 ifTrue:[currentIndex := nil].
123
claus
parents: 120
diff changeset
  4579
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4580
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4581
    menu := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4582
		itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4583
		resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4584
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4585
    previousDirectory isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4586
	menu disable:#changeToPreviousDirectory.
132
claus
parents: 126
diff changeset
  4587
    ].
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4588
    currentIndex notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4589
	menu disable:currentIndex
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4590
    ].
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  4591
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4592
	(Java classPath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4593
	    menu disable:#addDirToJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4594
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4595
	    menu disable:#removeDirFromJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4596
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4597
	(Java sourcePath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4598
	    menu disable:#addDirToJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4599
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4600
	    menu disable:#removeDirFromJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4601
	].
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4602
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4603
    ^menu.
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  4604
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  4605
    "Modified: / 21.7.1998 / 16:43:25 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4606
    "Created: / 14.8.1998 / 12:10:02 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4607
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4608
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4609
pathChanged:newPath
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4610
    "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
  4611
     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
  4612
2135
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4613
    |f name lcName idx|
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4614
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4615
    self discardChangesDialog ifTrue:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4616
        f := newPath asFilename.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4617
        (f isDirectory) ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4618
            self changeDirectoryTo:newPath
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4619
        ] ifFalse:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4620
            self changeDirectoryTo:(f directoryName).
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4621
"/            self changed:#path.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4622
            name := f baseName.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4623
            idx := fileList indexOf:name.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4624
            idx = 0 ifTrue:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4625
                lcName := name asLowercase.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4626
                f class isCaseSensitive ifFalse:[
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4627
                    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
  4628
                ]
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4629
            ].
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4630
            fileListView selection:idx.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4631
            self fileSelect:name.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4632
            self fileGet:true.
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4633
        ].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4634
    ] ifFalse:[
2216
b84ee099f484 dont cut of fileName part if same directory in pathField.
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
  4635
        self changed:#path.
2135
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4636
    ].
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4637
88eb91efc5dd care for caseless systems when entering a fileName
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
  4638
    "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
  4639
    "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
  4640
    "Modified: / 30.4.1999 / 11:19:29 / cg"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4641
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  4642
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4643
queryForDirectoryToChange
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4644
    "query for new directory"
123
claus
parents: 120
diff changeset
  4645
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4646
    |queryBox dirName|
98
claus
parents: 93
diff changeset
  4647
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4648
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4649
		    title:(resources at:'change directory to:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4650
		    okText:(resources at:'change')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4651
		    action:[:newName | dirName := newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4652
"/    queryBox initialText:''.
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4653
    queryBox showAtPointer.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4654
    queryBox destroy.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4655
    self doChangeCurrentDirectoryTo:dirName updateHistory:true.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4656
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4657
    "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
  4658
    "Modified: 28.4.1997 / 22:30:40 / dq"
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4659
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4660
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4661
removeDirFromJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4662
    "remove the current path from javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4663
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4664
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4665
    Java removeFromClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4666
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4667
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  4668
    "Created: 1.8.1997 / 21:25:36 / cg"
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4669
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4670
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4671
removeDirFromJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4672
    "remove the current path from javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4673
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4674
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4675
    Java removeFromSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4676
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4677
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4678
    "Created: 2.8.1997 / 14:11:41 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4679
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4680
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4681
!FileBrowser methodsFor:'private'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4682
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4683
ask:question yesButton:yesButtonText
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4684
    "common method to ask a yes/no question; return true or false"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4685
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4686
    ^ self ask:question yesButton:yesButtonText noButton:'cancel' 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4687
!
93
claus
parents: 85
diff changeset
  4688
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4689
ask:question yesButton:yesButtonText noButton:noButtonText
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4690
    "common method to ask a yes/no question"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4691
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4692
    ^ Dialog 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4693
	confirm:question withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4694
	yesLabel:(resources at:yesButtonText)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4695
	noLabel:(resources at:noButtonText)
37
50f59bad66b1 *** empty log message ***
claus
parents: 36
diff changeset
  4696
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  4697
    "Modified: 21.2.1996 / 01:19:21 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4698
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4699
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4700
askForCommandFor:fileName thenDo:aBlock
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4701
    "setup and launch a querybox to ask for unix command.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4702
     Then evaluate aBlock passing the command-string as argument."
93
claus
parents: 85
diff changeset
  4703
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4704
    |box osName|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4705
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4706
    osName := OperatingSystem platformName.
93
claus
parents: 85
diff changeset
  4707
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4708
    box := FilenameEnterBox 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4709
		title:(resources string:'execute %1 command:' with:osName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4710
	       okText:(resources string:'execute')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4711
	       action:aBlock.
79
d78f92a07d5d *** empty log message ***
claus
parents: 75
diff changeset
  4712
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4713
    fileName notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4714
	self initialCommandFor:fileName into:box.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4715
    ].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4716
    box directory:currentDirectory.
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4717
    box showAtPointer.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  4718
    box destroy.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4719
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4720
    "Modified: / 7.9.1995 / 10:31:54 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4721
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4722
    "Modified: / 14.8.1998 / 14:12:52 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4723
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4724
98
claus
parents: 93
diff changeset
  4725
askIfModified:question yesButton:yesButtonText
claus
parents: 93
diff changeset
  4726
    "tell user, that code has been modified - let her confirm"
claus
parents: 93
diff changeset
  4727
claus
parents: 93
diff changeset
  4728
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4729
	^ true
98
claus
parents: 93
diff changeset
  4730
    ].
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4731
    (self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4732
	"/ reset modified flag so question is asked only once
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4733
	subView modified:false.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4734
	^ true
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4735
    ].
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  4736
    ^ false
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4737
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4738
    "Modified: 2.10.1997 / 14:23:47 / stefan"
98
claus
parents: 93
diff changeset
  4739
!
claus
parents: 93
diff changeset
  4740
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4741
getSelectedFileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4742
    "returns the currently selected file; shows an error if
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4743
     multiple files are selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4744
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4745
    |sel|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4746
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4747
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4748
    (sel size > 1) ifTrue:[
2791
18149e5546a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  4749
        self onlyOneSelection
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4750
    ] ifFalse:[
2791
18149e5546a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  4751
        sel size > 0 ifTrue:[
18149e5546a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  4752
            ^ fileList at:sel first ifAbsent:nil
18149e5546a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  4753
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4754
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4755
    ^ nil
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4756
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4757
    "Modified: / 3.10.1998 / 18:21:23 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4758
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4759
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4760
onlyOneSelection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4761
    "show a warning, that only one file must be selected for
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4762
     this operation"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4763
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4764
    self warn:'exactly one file must be selected !!'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4765
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4766
2512
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4767
selectFile:aFilename
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4768
    (currentDirectory filenameFor:aFilename) exists ifTrue:[
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4769
        fileListView selection:(fileList indexOf:aFilename).
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4770
        self fileDoubleClick:fileListView selection.
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4771
    ].
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4772
!
35d2092df60f autoselect a new created file
Claus Gittinger <cg@exept.de>
parents: 2504
diff changeset
  4773
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4774
selectedFilesDo:aBlock
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4775
    "evaluate aBlock on all selected files;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4776
     show a wait cursor while doing this"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4777
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  4778
    |sel action|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4779
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4780
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4781
    sel notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4782
	sel := sel collect:[:aSelectionIndex | 
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4783
	    |nm|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4784
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4785
	    nm := fileList at:aSelectionIndex ifAbsent:nil.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4786
	    nm notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4787
		nm := nm string.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4788
		(nm endsWith:' ...') ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4789
		    nm := (nm copyWithoutLast:4) withoutSpaces
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4790
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4791
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4792
	    nm
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4793
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4794
	action := [
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4795
	    sel do:[:nm |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4796
		nm notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4797
		    aBlock value:nm
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4798
		]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4799
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4800
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4801
	Processor activeProcess == self windowGroup process ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4802
	    self withWaitCursorDo:action
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4803
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4804
	    action value
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  4805
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4806
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4807
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  4808
    "Modified: / 16.12.1998 / 17:30:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4809
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4810
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4811
show:something
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4812
    "show something in subview and undef acceptAction"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4813
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4814
    subView contents:something.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4815
    subView acceptAction:nil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4816
    subView modified:false.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4817
    currentFileName := nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4818
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4819
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4820
showAlert:aString with:anErrorString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4821
    "show an alertbox, displaying the last Unix-error"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4822
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4823
    |msg|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4824
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4825
    anErrorString isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4826
	msg := aString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4827
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4828
	msg := aString , '\\(' , anErrorString , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4829
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4830
    self warn:msg withCRs
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4831
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4832
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4833
withoutHiddenFiles:aCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4834
    "remove hidden files (i.e. those that start with '.') from
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4835
     the list in aCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4836
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4837
    |newCollection|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4838
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4839
    newCollection := aCollection species new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4840
    aCollection do:[:fname |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4841
	|ignore|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4842
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4843
	ignore := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4844
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4845
	((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4846
	    showingHiddenFiles value "showDotFiles" ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4847
		ignore := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4848
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4849
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4850
	ignore ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4851
	    newCollection add:fname
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4852
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4853
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4854
    ^ newCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4855
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  4856
    "Modified: / 4.8.1998 / 13:46:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4857
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4858
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4859
!FileBrowser methodsFor:'private - actions & command execution'!
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
binaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4862
    "for some binary 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
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4865
    |cmd|
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4866
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4867
    (aFilename asFilename hasSuffix:'pdf') ifTrue:[
2434
5cf8d286f680 dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents: 2430
diff changeset
  4868
        DefaultCommandPerMIME isNil ifTrue:[
5cf8d286f680 dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents: 2430
diff changeset
  4869
            self class initializeDefaultCommands
5cf8d286f680 dont crash if DefaultCommandPerMIME is undefined
Claus Gittinger <cg@exept.de>
parents: 2430
diff changeset
  4870
        ].
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4871
        cmd := DefaultCommandPerMIME at:'application/pdf' ifAbsent:nil.
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4872
        cmd notNil ifTrue:[
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4873
            (OperatingSystem executeCommand:(cmd bindWith:aFilename) inDirectory:currentDirectory pathName)
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4874
            ifTrue:[^true].
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4875
        ].
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4876
    ].
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4877
1330
2d8c64367afc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  4878
    (currentDirectory construct:aFilename) isExecutableProgram ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4879
        (OperatingSystem executeCommand:aFilename inDirectory:currentDirectory pathName)
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4880
        ifTrue:[^true].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4881
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4882
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4883
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4884
    "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
  4885
    "Modified: 18.9.1997 / 17:18:04 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4886
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4887
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4888
doExecuteCommand:commandArg replace:replace
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4889
    "execute a unix command inserting the output of the command.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4890
     If replace is true, all text is replaced by the commands output;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4891
     otherwise, its inserted as selected text at the cursor position."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4892
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  4893
    |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
  4894
     pauseSignal access stillReplacing pauseHolder lowerFrameView
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4895
     buttonWindowGroup|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4896
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4897
    command := commandArg asString.
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4898
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4899
    access := Semaphore forMutualExclusion name:'accessLock'.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4900
    stopSignal := Signal new.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4901
    pauseSignal := Signal new.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4902
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4903
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4904
     The following is tricky: 
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4905
     the pauseToggle & killButton will
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4906
     be handled by their own windowGroup process.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4907
     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
  4908
     I myself am reading the commands output.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4909
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4910
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4911
    commandView beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4912
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4913
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4914
     must take kill & pauseButtons out of my group
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4915
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4916
    killButton windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4917
    pauseToggle windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4918
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4919
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4920
     bring them to front, and turn hidden-mode off
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4921
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4922
    killButton raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4923
    pauseToggle raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4924
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4925
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4926
     kill will make me raise the stopSignal when pressed
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4927
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4928
    killButton 
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4929
        action:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4930
            stream notNil ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4931
                access critical:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4932
                    myProcess interruptWith:[stopSignal raiseRequest].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4933
                ]
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4934
            ]
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4935
        ].
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4936
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4937
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4938
     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
  4939
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4940
    pauseHolder := false asValue.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4941
    pauseToggle model:pauseHolder.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4942
    pauseToggle pressAction:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4943
        stream notNil ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4944
            access critical:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4945
                myProcess interruptWith:[pauseSignal raiseRequest].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4946
            ]
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4947
        ]
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4948
    ].
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  4949
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4950
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4951
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4952
     start kill button under its own windowgroup
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4953
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4954
    killButton openAutonomous.
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4955
    buttonWindowGroup := killButton windowGroup.
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4956
    buttonWindowGroup process name:'FileBrowser sub'.
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4957
    buttonWindowGroup process processGroupId:(Processor activeProcess id).
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4958
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4959
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4960
     and add the pauseToggle to its windowGroup
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4961
    "
1983
50157c992ef9 subprocess name of button event handler
Claus Gittinger <cg@exept.de>
parents: 1981
diff changeset
  4962
    pauseToggle windowGroup:buttonWindowGroup.
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4963
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4964
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  4965
    lowerFrameView := subView superView.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4966
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4967
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4968
     go fork a pipe and read it
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4969
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4970
    self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4971
    [
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4972
      self withWaitCursorDo:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4973
        stopSignal catch:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4974
            pauseSignal handle:[:ex|
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4975
                |noPauseSema|
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4976
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4977
                "/    
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4978
                "/ allow interaction with
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4979
                "/ the codeView via the other windowGroup
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4980
                "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4981
                lowerFrameView windowGroup:buttonWindowGroup.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4982
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4983
                "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4984
                "/ wait for pause to be turned off
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4985
                "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4986
                noPauseSema := Semaphore new.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4987
                pauseHolder onChangeSend:#signal to:noPauseSema.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4988
                noPauseSema wait.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4989
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4990
                "/    
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4991
                "/ no interaction with the codeView ...
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4992
                "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4993
                lowerFrameView windowGroup:(self windowGroup).
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4994
                ex proceed.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4995
            ] do:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4996
                startLine := subView cursorLine.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4997
                startCol := subView cursorCol.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4998
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  4999
                "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5000
                 this can be a time consuming operation; therefore lower my priority
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5001
                "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5002
                myProcess := Processor activeProcess.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  5003
"/                myPriority := myProcess priority.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  5004
"/                myProcess priority:(Processor userBackgroundPriority).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  5005
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5006
                stream := PipeStream 
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5007
                            readingFrom:command
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5008
                            errorDisposition:#inline
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5009
                            inDirectory:currentDirectory.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5010
                stream notNil ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5011
                    [
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5012
                        |codeView lines noPauseSema enc|
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5013
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5014
                        enc := fileEncoding.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5015
                        enc == #iso8859 ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5016
                            enc := nil
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5017
                        ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5018
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5019
                        stream buffered:true.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5020
                        codeView := subView.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5021
                        codeView unselect.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5022
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5023
                        replace ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5024
                            codeView list:nil.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5025
                            lnr := 1.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5026
                        ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5027
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5028
                        stillReplacing := replace.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5029
3027
81a76b3a519c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3026
diff changeset
  5030
                        [
3029
87150ba9b293 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3027
diff changeset
  5031
                            stream readWaitWithTimeout:1.
87150ba9b293 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3027
diff changeset
  5032
                            stream atEnd not
3027
81a76b3a519c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3026
diff changeset
  5033
                        ] whileTrue:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5034
                            "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5035
                             data available; read up to 100 lines
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5036
                             and insert as a single junk. This speeds up
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5037
                             display of long output (less line-scrolling).
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5038
                            "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5039
                            lines := OrderedCollection new:100.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5040
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5041
                            [
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5042
                                line := stream nextLine.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5043
                                line notNil ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5044
                                    enc notNil ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5045
                                        line := line decodeFrom:enc
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5046
                                    ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5047
                                    lines add:line
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5048
                                ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5049
                            ] doWhile:[
3027
81a76b3a519c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3026
diff changeset
  5050
                                stream pid notNil
81a76b3a519c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3026
diff changeset
  5051
                                and:[stream canReadWithoutBlocking
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5052
                                and:[stream atEnd not
3027
81a76b3a519c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3026
diff changeset
  5053
                                and:[lines size < 100]]]
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5054
                            ]. 
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5055
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5056
                            "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5057
                             need this critical section; otherwise,
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5058
                             we could get the signal while waiting for
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5059
                             an expose event ...
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5060
                            "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5061
                            access critical:[                        
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5062
                                lines size > 0 ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5063
                                    stillReplacing ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5064
                                        lines do:[:line |
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5065
                                            codeView at:lnr put:line withTabsExpanded.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5066
                                            codeView cursorToBottom; cursorDown:1.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5067
                                            lnr := lnr + 1.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5068
                                            lnr > codeView list size ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5069
                                                stillReplacing := false
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5070
                                            ]
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5071
                                        ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5072
                                    ] ifFalse:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5073
                                        codeView insertLines:lines before:codeView cursorLine.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5074
                                        codeView cursorDown:lines size.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5075
                                    ]
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5076
                                ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5077
                            ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5078
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5079
                            "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5080
                             give others running at same prio a chance too
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5081
                             (especially other FileBrowsers doing the same)
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5082
                            "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5083
                            Processor yield
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5084
                        ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5085
                    ] valueNowOrOnUnwindDo:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5086
                        stream shutDown "close". stream := nil.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5087
                    ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5088
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5089
                    "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5090
                    "/ the command could have changed the directory
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5091
                    "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5092
                    self updateCurrentDirectoryIfChanged
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5093
                ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5094
                replace ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5095
                    subView modified:false.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5096
                ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5097
            ]
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5098
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5099
      ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5100
    ] valueNowOrOnUnwindDo:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5101
        |wg|
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5102
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5103
        self label:myName; iconLabel:myName.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  5104
"/        myProcess notNil ifTrue:[myProcess priority:myPriority].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  5105
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5106
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5107
         hide the button, and make sure it will stay
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5108
         hidden when we are realized again
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5109
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5110
        killButton beInvisible.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5111
        pauseToggle beInvisible.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5112
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5113
        commandView beVisible.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5114
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5115
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5116
         remove the killButton from its group
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5117
         (otherwise, it will be destroyed when we shut down the group)
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5118
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5119
        wg := killButton windowGroup.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5120
        killButton windowGroup:nil.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5121
        pauseToggle windowGroup:nil.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5122
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5123
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5124
         shut down the kill buttons windowgroup
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5125
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5126
        wg notNil ifTrue:[
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5127
            wg process terminate.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5128
        ].
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5129
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5130
         clear its action (actually not needed, but
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5131
         releases reference to thisContext earlier)
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5132
        "
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5133
        killButton action:nil.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5134
        pauseToggle pressAction:nil.
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5135
        "/    
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5136
        "/ allow interaction with the codeView
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5137
        "/ (bring it back into my group)
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5138
        "/
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5139
        lowerFrameView windowGroup:(self windowGroup).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5140
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5141
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5142
    currentFileName isNil ifTrue:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5143
        subView modified:false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5144
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5145
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5146
    subView size > 10000 ifTrue:[
3025
a1d9d7b0d0b3 preserve extent in spawn
Claus Gittinger <cg@exept.de>
parents: 3022
diff changeset
  5147
        self warn:'text quite large now - please cut off some lines'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5148
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5149
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  5150
    "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
  5151
    "Modified: / 6.3.1998 / 17:32:03 / stefan"
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5152
    "Modified: / 15.10.1998 / 12:37:52 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5153
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5154
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5155
imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5156
    "for some image files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5157
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5158
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5159
    |img errmsg|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5160
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5161
    (Image isImageFileSuffix:(aFilename asFilename suffix))
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5162
    ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5163
        Image imageLoadErrorSignal handle:[:ex |
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5164
            errmsg := ex errorString
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5165
        ] do:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5166
            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
  5167
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5168
        img notNil ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5169
            ImageEditor openOnImage:img.
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  5170
"/            img inspect.
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5171
            ^ true
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5172
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5173
        errmsg notNil ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5174
            self warn:errmsg.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5175
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5176
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5177
    ^ false
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5178
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  5179
    "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
  5180
    "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
  5181
    "Modified: / 18.5.1999 / 15:45:06 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5182
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5183
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5184
initialCommandFor:fileName into:aBox
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5185
    "set a useful initial command for execute box."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5186
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5187
    |mime cmd select path suffix|
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5188
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5189
    path := currentDirectory filenameFor:fileName.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5190
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5191
    mime := MIMETypes mimeTypeForSuffix:fileName asFilename suffix.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5192
"/    mime notNil ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5193
"/        cmd := self initialCommandForMIME:mime file:path
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5194
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5195
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5196
    "/ XXX should be changed to take stuff from a config file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5197
    "/ XXX or from resources.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5198
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5199
    (path type == #regular) ifTrue:[
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5200
        path isExecutableProgram ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5201
            aBox initialText:(fileName , ' <arguments>').
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5202
            ^ self
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5203
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5204
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5205
        select := true.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5206
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5207
        "some heuristics - my personal preferences ...
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5208
         (actually this should come from a configfile)"
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5209
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5210
        (fileName endsWith:'akefile') ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5211
            aBox initialText:'make target' selectFrom:6 to:11.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5212
            ^ self
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5213
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5214
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5215
        DefaultCommandPerMIME isNil ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5216
            self class initializeDefaultCommands
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5217
        ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5218
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5219
        cmd := DefaultCommandPerMIME at:mime ifAbsent:nil.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5220
        cmd notNil ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5221
            select := false
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5222
        ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5223
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5224
        cmd isNil ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5225
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5226
            suffix := path suffix.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5227
            (suffix = 'C') ifTrue:[
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5228
                cmd := 'g++ -c %1'.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5229
                select := 6.
2346
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5230
            ] ifFalse:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5231
                suffix := suffix asLowercase.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5232
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5233
                (suffix = 'taz') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5234
                    aBox initialText:'zcat %1 | tar tvf -'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5235
                    select := false.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5236
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5237
                (suffix = 'tar') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5238
                    cmd := 'tar tvf %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5239
                    select := 7.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5240
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5241
                (suffix = 'zoo') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5242
                    cmd := 'zoo -list %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5243
                    select := 9.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5244
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5245
                (suffix = 'zip') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5246
                    cmd := 'unzip -l %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5247
                    select := 8.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5248
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5249
                (suffix = 'jar') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5250
                    cmd := 'unzip -l %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5251
                    select := 8.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5252
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5253
                (suffix = 'z') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5254
                    (fileName asLowercase endsWith:'tar.z') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5255
                        cmd := 'zcat %1 | tar tvf -'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5256
                        select := false.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5257
                    ] ifFalse:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5258
                        cmd := 'uncompress %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5259
                    ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5260
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5261
                (suffix = 'gz') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5262
                    (fileName asLowercase endsWith:'tar.gz') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5263
                        cmd := ('gunzip < %1 | tar tvf -' ).
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5264
                        select := false.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5265
                    ] ifFalse:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5266
                        cmd := 'gunzip %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5267
                    ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5268
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5269
                (suffix = 'html') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5270
                    cmd := 'netscape %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5271
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5272
                (suffix = 'htm') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5273
                    cmd := 'netscape %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5274
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5275
                (suffix = 'uue') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5276
                    cmd := 'uudecode %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5277
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5278
                (suffix = 'c') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5279
                    cmd := 'cc -c %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5280
                    select := 5.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5281
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5282
                (suffix = 'cc') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5283
                    cmd := 'g++ -c %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5284
                    select := 6.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5285
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5286
                (suffix = 'xbm') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5287
                    cmd := 'bitmap %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5288
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5289
                (suffix = 'ps') ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5290
                    cmd := 'ghostview %1'
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5291
                ].
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5292
                ((suffix = '1') or:[suffix = 'man']) ifTrue:[
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5293
                    cmd := 'nroff -man %1'.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5294
                    select := 10.
a4ffb45a53ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
  5295
                ].
2345
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5296
            ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5297
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5298
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5299
        cmd isNil ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5300
            DefaultCommandPerSuffix isNil ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5301
                cmd := '<cmd>'
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5302
            ] ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5303
                cmd := DefaultCommandPerSuffix 
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5304
                        at:suffix
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5305
                        ifAbsent:'<cmd>'.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5306
            ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5307
            cmd := cmd , ' %1'.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5308
        ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5309
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5310
        cmd := cmd bindWith:fileName.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5311
        select == false ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5312
            aBox initialText:cmd
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5313
        ] ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5314
            select class == Interval ifTrue:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5315
                aBox initialText:cmd selectFrom:select start to:select stop
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5316
            ] ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5317
                select isInteger ifFalse:[
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5318
                    select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5319
                ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5320
                aBox initialText:cmd selectFrom:1 to:select
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5321
            ].
ac8a951e07e9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5322
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5323
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5324
1542
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  5325
    "Modified: / 24.9.1997 / 16:34:52 / stefan"
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  5326
    "Modified: / 9.4.1998 / 17:15:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5327
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5328
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5329
nonBinaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5330
    "for some nonBinary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5331
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5332
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  5333
    |fullPath|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5334
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5335
    fullPath := currentDirectory filenameFor:aFilename.
2550
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5336
    ((fullPath hasSuffix:'htm')
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5337
    or:[(fullPath hasSuffix:'HTM') 
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5338
    or:[(fullPath hasSuffix:'html')
59346d7bb54a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  5339
    or:[(fullPath hasSuffix:'HTML')]]]) ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5340
        HTMLDocumentView openOn:fullPath pathName.
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5341
        ^ true
2091
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  5342
    ].
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  5343
    ((fullPath hasSuffix:'prj')  
17cad39945c8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  5344
    and:[ProjectBrowser notNil]) ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5345
        ProjectBrowser openOnFile:fullPath pathName.
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5346
        ^ true
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5347
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5348
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5349
    OperatingSystem isUNIXlike ifTrue:[
2385
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5350
        (#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5351
        ifTrue:[
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5352
             HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName).
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5353
            ^ true
826381fe9586 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5354
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5355
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5356
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5357
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5358
    "Created: 19.6.1996 / 09:36:38 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5359
    "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
  5360
    "Modified: 18.9.1997 / 16:58:40 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5361
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5362
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5363
!FileBrowser methodsFor:'private - directory stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5364
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5365
addToHistory:path
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  5366
    self class addToHistory:path
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5367
!
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5368
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5369
changeToPreviousDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5370
    "if text was modified show a queryBox, 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5371
     otherwise change immediately to previous directory."
93
claus
parents: 85
diff changeset
  5372
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5373
    previousDirectory isNil ifTrue:[^ self].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  5374
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5375
	self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false 
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5376
    ]
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  5377
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  5378
    "Modified: 2.10.1997 / 14:13:40 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5379
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5380
98
claus
parents: 93
diff changeset
  5381
checkIfDirectoryHasChanged
claus
parents: 93
diff changeset
  5382
    "every checkDelta secs, check if directoy has changed and update the list if so.
claus
parents: 93
diff changeset
  5383
     Also, we check if the file shown has been touched in the meanwhile (for example,
claus
parents: 93
diff changeset
  5384
     from another browser) and say 'outdated' in the label if so. 
claus
parents: 93
diff changeset
  5385
     This avoids confusion if the same file is being edited by two browsers. (or other editors).
claus
parents: 93
diff changeset
  5386
     If the text shown in the codeView has been edited, 'modified' is shown.
claus
parents: 93
diff changeset
  5387
    "
claus
parents: 93
diff changeset
  5388
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5389
    |oldSelection nOld newState msg newLabel t|
98
claus
parents: 93
diff changeset
  5390
claus
parents: 93
diff changeset
  5391
    shown ifTrue:[
2220
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5392
        currentDirectory notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5393
            (lockUpdate or:[doAutoUpdate value not]) ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5394
                Processor removeTimedBlock:checkBlock.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5395
                Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5396
                ^ self
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5397
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5398
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5399
            subView modified ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5400
                newState := ' (modified)'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5401
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5402
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5403
            (currentDirectory isReadable) ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5404
                Processor removeTimedBlock:checkBlock.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5405
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5406
                t := currentDirectory modificationTime.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5407
                (t notNil and:[t > timeOfLastCheck]) ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5408
                    nOld := fileListView numberOfSelections.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5409
                    oldSelection := fileListView selectionValue.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5410
                    self updateCurrentDirectory.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5411
                    nOld ~~ 0 ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5412
                        nOld > 1 ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5413
                            oldSelection do:[:element  |
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5414
                                fileListView addElementToSelection:element
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5415
                            ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5416
                        ] ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5417
                            fileListView selectElementWithoutScroll:oldSelection
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5418
                        ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5419
                    ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5420
                ] ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5421
                    Processor addTimedBlock:checkBlock afterSeconds:checkDelta
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5422
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5423
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5424
                currentFileName notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5425
                    |f|
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5426
                    f := currentDirectory construct:currentFileName.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5427
                    f exists ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5428
                        newState := ' (removed)'.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5429
                    ] ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5430
                        f modificationTime > timeOfFileRead ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5431
                            newState := ' (outdated)'.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5432
                            subView modified ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5433
                                newState := ' (modified & outdated)'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5434
                            ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5435
                        ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5436
                    ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5437
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5438
            ] ifFalse:[         
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5439
                "
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5440
                 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
  5441
                "
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5442
                (currentDirectory exists) ifFalse:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5443
                    msg := 'FileBrowser:\\directory %1 is gone ?!!?'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5444
                ] ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5445
                    msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?'
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5446
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5447
                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
  5448
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5449
                fileListView contents:nil.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5450
                newLabel := myName , ': directory is gone !!'.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5451
                "/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5452
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5453
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5454
            newState notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5455
                newLabel := myName.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5456
                currentFileName notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5457
                    newLabel := newLabel , ': ' , currentFileName
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5458
                ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5459
                newLabel := newLabel , newState.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5460
            ].
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5461
            newLabel notNil ifTrue:[
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5462
                self label:newLabel.
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5463
            ]
1ec72aa513c8 added menu-toggle to disable autoUpdate
Claus Gittinger <cg@exept.de>
parents: 2216
diff changeset
  5464
        ]
98
claus
parents: 93
diff changeset
  5465
    ]
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  5466
1380
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5467
    "Modified: / 28.4.1997 / 22:31:02 / dq"
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  5468
    "Modified: / 16.9.1997 / 15:17:15 / stefan"
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5469
    "Modified: / 18.2.1998 / 17:57:49 / cg"
98
claus
parents: 93
diff changeset
  5470
!
claus
parents: 93
diff changeset
  5471
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5472
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5473
    "verify argument is name of a readable & executable directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5474
     and if so, go there"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5475
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5476
    |msg path idx f|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5477
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5478
    self label:myName; iconLabel:myName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5479
    fileName notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5480
	(f := fileName asFilename) isAbsolute ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5481
	    f := currentDirectory filenameFor:fileName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5482
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5483
	f := f asAbsoluteFilename.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5484
	(f isDirectory) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5485
	    (f isReadable) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5486
		(f isExecutable) ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5487
		    path := currentDirectory pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5488
		    previousDirectory := path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5489
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5490
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5491
		     remember where we are positioned in the fileList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5492
		     (in case we want to return)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5493
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5494
		    idx := DirectoryHistory indexOf:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5495
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5496
			DirectoryHistoryWhere at:idx put:fileListView firstLineShown
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5497
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5498
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5499
		    updateHistory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5500
			self addToHistory:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5501
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5502
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5503
		    self setCurrentDirectory:(f pathName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5504
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5505
		    "/ fetch the new path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5506
		    path := currentDirectory pathName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5507
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5508
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5509
		     if we have already been there, look for the
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5510
		     position offset, and scroll the fileList
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5511
		    "
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5512
		    idx := DirectoryHistory indexOf:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5513
		    idx ~~ 0 ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5514
			|pos|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5515
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5516
			pos := DirectoryHistoryWhere at:idx.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5517
			pos notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5518
			    fileListView scrollToLine:pos.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5519
			]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5520
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5521
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5522
		    updateHistory ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5523
			self addToHistory:path.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5524
		    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5525
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5526
		    ^ self
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5527
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5528
		msg := 'cannot change directory to ''%1'' !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5529
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5530
		msg := 'cannot read directory ''%1'' !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5531
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5532
	] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5533
	    OperatingSystem isVMSlike ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5534
		"/ cannot tell if it exists or is simply invisible ...
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5535
		msg := '''%1'' is not a directory or unreadable !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5536
	    ] ifFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5537
		msg := '''%1'' is not a directory !!'
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5538
	    ]
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5539
	].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5540
	Dialog warn:(resources string:msg withCRs with:fileName).
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5541
    ]
1166
0029f77ccea7 when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
  5542
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  5543
    "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
  5544
    "Modified: / 27.4.1999 / 17:10:14 / cg"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5545
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5546
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5547
doChangeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5548
    "go to parent directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5549
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5550
    self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5551
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5552
    "Created: 21.9.1997 / 23:45:59 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5553
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5554
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5555
doChangeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5556
    "go to home directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5557
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5558
    self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5559
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5560
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5561
doChangeToParentDirectory
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5562
    "go to parent directory"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5563
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5564
    self doChangeCurrentDirectoryTo:'..' updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5565
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5566
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5567
doCreateDirectory:newName
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5568
    |f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5569
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5570
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5571
    f exists ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5572
	self warn:'%1 already exists.' with:newName.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5573
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5574
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5575
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5576
    f makeDirectory ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5577
	self updateCurrentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5578
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5579
	self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5580
		  with:(OperatingSystem lastErrorString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5581
    ]
1157
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  5582
1988
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  5583
    "Modified: / 18.9.1997 / 17:21:25 / stefan"
86c2e464bd3a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
  5584
    "Modified: / 30.1.1999 / 16:24:12 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5585
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5586
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5587
setCurrentDirectory:aPathName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5588
    "setup for another directory"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5589
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5590
    |newDirectory|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5591
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5592
    aPathName isEmpty ifTrue:[^ self].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5593
    newDirectory := currentDirectory filenameFor:aPathName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5594
    newDirectory isDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5595
	self currentDirectory:newDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5596
	currentFileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5597
	    fileListView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5598
	    currentFileName := nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5599
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5600
	    fileListView setSelection:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5601
	    fileListView scrollToTop.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5602
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5603
	self updateCurrentDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5604
	self showInfo.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5605
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  5606
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5607
    "Modified: 21.9.1995 / 11:22:45 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5608
    "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
  5609
    "Modified: 18.9.1997 / 17:08:07 / stefan"
912
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  5610
!
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  5611
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5612
updateCurrentDirectoryIfChanged
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5613
    |t|
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5614
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5615
    OperatingSystem isMSDOSlike ifTrue:[
2636
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5616
        "/ workaround: DOS has no directory modifiation time ...
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5617
        self updateCurrentDirectory.
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5618
        ^ self
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5619
    ].
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5620
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5621
    ((t := currentDirectory modificationTime) isNil
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5622
    or:[t > timeOfLastCheck]) ifTrue:[
2636
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  5623
        self updateCurrentDirectory
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5624
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5625
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  5626
    "Modified: / 16.9.1997 / 15:35:52 / stefan"
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  5627
    "Modified: / 16.12.1998 / 22:55:44 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5628
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5629
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5630
!FileBrowser methodsFor:'private - encoding'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5631
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5632
guessEncodingFrom:aBuffer
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5633
    "look for a string
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5634
	encoding #name
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5635
     or:
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5636
	encoding: name
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5637
     within the given buffer 
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5638
     (which is usually the first few bytes of a textFile).
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5639
     If thats not found, use heuristics (in CharacterArray) to guess."
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5640
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5641
    |n "{Class: SmallInteger }"
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  5642
     binary idx s w enc|
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5643
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5644
    binary := false.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5645
    n := aBuffer size.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5646
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5647
    (idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5648
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5649
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5650
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5651
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5652
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5653
	    (idx := w indexOf:$") ~~ 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5654
		w := w copyTo:idx-1
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5655
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5656
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5657
	].
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5658
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5659
    (idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5660
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5661
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5662
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5663
	s peek == $: ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5664
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5665
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5666
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5667
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5668
	s peek == $# ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5669
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5670
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5671
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5672
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5673
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5674
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5675
	].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5676
    ].
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5677
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5678
    1 to:n do:[:i |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5679
	(aBuffer at:i) isPrintable ifFalse:[binary := true].
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5680
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  5681
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5682
    binary ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5683
	"/ look for JIS7 / EUC encoding
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5684
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5685
	enc := CharacterArray guessEncodingFrom:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5686
	enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5687
	    ^ enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5688
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5689
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5690
	"/ if the encoding has been set to any non iso setting,
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5691
	"/ assume its what we defined ...
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5692
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5693
	(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5694
	    ^ #binary
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5695
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5696
	^ fileEncoding ? #binary
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5697
    ].
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5698
    ^ #ascii
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5699
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5700
    "Created: 26.2.1996 / 17:43:08 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5701
    "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
  5702
!
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5703
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5704
preferredFontEncodingFor:fileEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5705
    "given a file encoding, return corresponding preferred fontEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5706
     match pattern"
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5707
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5708
    |fe|
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5709
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5710
    fe := MIMETypes fontForCharset:fileEncoding.
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5711
    fe notNil ifTrue:[^ fe].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5712
    ^ 'iso8859*'
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5713
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5714
    "Created: 28.6.1997 / 20:47:35 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  5715
    "Modified: 1.7.1997 / 00:04:56 / cg"
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5716
!
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  5717
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5718
validateFontEncodingFor:newEncoding ask:ask
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5719
    "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
  5720
     which is able to display text encoded as specified by newEncoding"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5721
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5722
    |fontsEncoding msg filter f defaultFont pref|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5723
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5724
    fontsEncoding := subView font encoding.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5725
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5726
    pref := self preferredFontEncodingFor:newEncoding.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5727
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5728
    (pref match:fontsEncoding) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5729
	^ self
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5730
    ].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5731
    "/ stupid ...
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5732
    pref = 'ascii*' ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5733
	(fontsEncoding match:'iso8859*') ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5734
	    ^ self
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5735
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5736
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5737
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5738
    filter := [:f | |coding|
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5739
		    (coding := f encoding) notNil 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5740
		    and:[pref match:coding]].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5741
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5742
    defaultFont := TextView defaultFont onDevice:device.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5743
    (pref match:(defaultFont encoding)) ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5744
	defaultFont := nil.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5745
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5746
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5747
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5748
	(pref = 'ascii*'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5749
	or:[pref = 'iso8859*']) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5750
	    defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5751
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5752
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5753
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5754
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5755
	defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5756
			    listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5757
				detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5758
				ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5759
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5760
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5761
	    "/ flush list, and refetch font list
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5762
	    "/ (in case someone just changed the font path ...)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5763
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5764
	    device flushListOfAvailableFonts.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5765
	    defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5766
				listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5767
				    detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5768
				    ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5769
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5770
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5771
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5772
	    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
  5773
	    ^ self.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5774
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5775
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5776
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5777
    msg := 'switch to a %1 encoded font ?'.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5778
    (ask not or:[self confirm:(resources string:msg with:pref) withCRs])
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5779
    ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5780
	self withWaitCursorDo:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5781
	    f := FontPanel 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5782
		fontFromUserInitial:defaultFont
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5783
			      title:(resources string:'font selection')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5784
			     filter:filter.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5785
	    f notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5786
		subView font:f
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5787
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5788
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5789
    ]
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5790
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5791
    "Created: 26.10.1996 / 12:06:54 / cg"
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  5792
    "Modified: 30.6.1997 / 17:46:46 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5793
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5794
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5795
!FileBrowser methodsFor:'private - file stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5796
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5797
doCreateFile:newName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5798
    "create an empty file"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5799
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5800
    |aStream f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5801
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5802
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5803
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5804
	(self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5805
	    ask:(resources string:'%1 already exists\\truncate ?' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5806
	    yesButton:'truncate'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5807
	) ifFalse:[^ self].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5808
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5809
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5810
    FileStream openErrorSignal handle:[:ex|
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5811
	^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5812
		    with:(FileStream lastErrorString)
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5813
    ] do:[    
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5814
	aStream := f newReadWriteStream.
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5815
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5816
    aStream notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5817
	aStream close.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5818
	self updateCurrentDirectoryIfChanged
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5819
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5820
	self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5821
		  with:(FileStream lastErrorString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5822
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5823
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5824
    "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
  5825
    "Modified: 18.9.1997 / 17:21:45 / stefan"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5826
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5827
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5828
doFileGet:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5829
    "get selected file - show contents in subView.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5830
     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
  5831
     When invoked via the menu (viaDoubleClick argument is false),
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5832
     the automatic file action is not performed - instead, the file is always
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5833
     shown in the codeView (if possible).
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5834
     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
  5835
     action) to be edited."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5836
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5837
    |fileName|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5838
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5839
    fileName := self getSelectedFileName.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5840
    fileName notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  5841
	self doOpenFile:fileName viaDoubleClick:viaDoubleClick
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5842
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5843
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  5844
    "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
  5845
    "Modified: / 18.9.1997 / 17:35:31 / stefan"
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5846
    "Modified: / 4.2.1999 / 17:43:51 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5847
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5848
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5849
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
  5850
    |dir subDirs nameMatches contentsMatches lines contentsToCompare|
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5851
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5852
    bytesToCompareContentsOrNil notNil ifTrue:[
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5853
        contentsToCompare := bytesToCompareContentsOrNil
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  5854
    ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5855
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5856
    subDirs := OrderedCollection new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5857
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5858
    dir := aDirectory asFilename.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5859
    self label:myName , '- searching ' , dir name.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5860
    (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
  5861
        |f|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5862
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5863
        f := dir construct:fn.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5864
        f isDirectory ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5865
            f isSymbolicLink ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5866
                subDirs add:f
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5867
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5868
        ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5869
            (nameMatches := namePatterns isNil) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5870
                ignCaseInName ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5871
                    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
  5872
                ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5873
                    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
  5874
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5875
            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5876
            nameMatches ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5877
                filenameToCompareContentsOrNil notNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5878
                    "/ contents compare ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5879
                    contentsMatches := false.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5880
                    f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5881
                        f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5882
                            contentsToCompare isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5883
                                filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5884
                                    contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5885
                                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5886
                            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5887
                            contentsToCompare isNil ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5888
                                "/ too large - compare block-wise ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5889
                                contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5890
                            ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5891
                                contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile).
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5892
                            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5893
                        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5894
                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5895
                        f isSymbolicLink ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5896
                            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
  5897
                            subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5898
                        ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5899
                    ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5900
                ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5901
                    "/ string search ...
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5902
                    (contentsMatches := contentsString isNil) ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5903
                        (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
  5904
                            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
  5905
                            subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5906
                        ] ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5907
                            f fileSize > (4024*1024) ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5908
                                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
  5909
                                subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5910
                            ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5911
                                Stream lineTooLongErrorSignal handle:[:ex |
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5912
                                    |cont|
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5913
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5914
                                    "/ 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
  5915
                                    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
  5916
                                    ignCaseInString ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5917
                                        contentsMatches := cont asLowercase includesString:contentsString
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5918
                                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5919
                                        contentsMatches := cont includesString:contentsString
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5920
                                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5921
                                ] do:[    
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5922
                                    lines := f contents ? #().
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5923
                                    ignCaseInString ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5924
                                        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
  5925
                                    ] ifFalse:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5926
                                        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
  5927
                                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5928
                                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5929
                            ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5930
                        ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5931
                    ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5932
                ].
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5933
                contentsMatches ifTrue:[
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5934
                    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
  5935
                    subView cursorDown.
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5936
                ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5937
            ]
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5938
        ]
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5939
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5940
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5941
    subDirs do:[:dir |
2166
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5942
        self
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5943
            doFindFileNamed:namePatterns 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5944
            ignoreCase:ignCaseInName 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5945
            containingString:contentsString 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5946
            ignoreCaseInContents:ignCaseInString 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5947
            sameContentsAsFile:filenameToCompareContentsOrNil 
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5948
            sameContentsAs:contentsToCompare
e1b98bde42c4 allow for multiple file-patters in find-file dialog
Claus Gittinger <cg@exept.de>
parents: 2158
diff changeset
  5949
            in:dir
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5950
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5951
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5952
    "Created: / 15.10.1998 / 11:37:15 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5953
    "Modified: / 15.10.1998 / 12:50:48 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5954
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5955
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5956
doOpenFile:fileName viaDoubleClick:viaDoubleClick
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5957
    "get selected file - show contents in subView.
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5958
     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
  5959
     When invoked via the menu (viaDoubleClick argument is false),
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5960
     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
  5961
     shown in the codeView (if possible).
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5962
     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
  5963
     action) to be edited."
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5964
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5965
    |iconLbl winLbl f|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5966
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  5967
    self withReadCursorDo:[
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5968
        (f := fileName asFilename) isAbsolute ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5969
            f := currentDirectory construct:fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5970
        ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5971
        f isDirectory ifTrue:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5972
            self doChangeCurrentDirectoryTo:fileName updateHistory:true.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5973
            winLbl := myName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5974
            iconLbl := myName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5975
        ] ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5976
            f exists ifFalse:[
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  5977
                Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' withCRs with:f pathName allBold).
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5978
                ^ self
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5979
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5980
            timeOfFileRead := f modificationTime.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5981
            self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5982
            currentFileName := fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5983
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5984
            self fileTypeSpecificActions.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5985
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5986
            subView acceptAction:[:theCode |
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5987
                (f modificationTime <= timeOfFileRead
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5988
                or:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5989
                    (self 
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5990
                        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
  5991
                        yesButton:'save'
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5992
                        noButton:'don''t save')]) ifTrue:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5993
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5994
                    self withCursor:(Cursor write) do:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5995
                        self writeFile:fileName text:theCode encoding:fileEncoding.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5996
                        timeOfFileRead := f modificationTime.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5997
                        self label:myName , ': ' , currentFileName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5998
                    ]
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  5999
                ]
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6000
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6001
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6002
            winLbl := myName , ': ' , fileName.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6003
            f isWritable ifFalse:[
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6004
                winLbl := winLbl , ' (readonly)'
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6005
            ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6006
            iconLbl := fileName
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6007
        ].
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6008
        self label:winLbl.
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6009
        self iconLabel:iconLbl.
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6010
    ]
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6011
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6012
    "Created: / 4.2.1999 / 17:43:26 / cg"
2139
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6013
    "Modified: / 3.5.1999 / 20:32:27 / ps"
a18b0d2a958f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  6014
    "Modified: / 4.5.1999 / 20:39:10 / cg"
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6015
!
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6016
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  6017
doRemove:filesToRemove
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6018
    "remove the selected file(s) - no questions asked"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6019
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  6020
    |msg needUpdate toRemove updateRunning yesToAll mTime|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6021
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6022
    updateRunning := listUpdateProcess notNil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6023
    self stopUpdateProcess.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6024
    toRemove := OrderedCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6025
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6026
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6027
    "/ did the directory change in the meanwhile ?
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6028
    "/
2124
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  6029
    mTime := currentDirectory modificationTime.
826a16d63a93 care for win32 - no file modificationTime
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  6030
    needUpdate := mTime notNil and:[mTime > timeOfLastCheck].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6031
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  6032
    yesToAll := false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6033
    lockUpdate := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6034
    [
2772
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6035
        filesToRemove keysAndValuesDo:[:idx :fileName |
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6036
            |f|
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6037
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6038
            f := currentDirectory construct:fileName.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6039
            OperatingSystem accessDeniedErrorSignal handle:[:ex|
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6040
                "was not able to remove it"
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6041
                msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6042
                self showAlert:msg with:(OperatingSystem lastErrorString)
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6043
            ] do:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6044
                |answer contents i|
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6045
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6046
                (f isSymbolicLink not and:[f isDirectory]) ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6047
                    contents := f directoryContents.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6048
                    contents isEmpty ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6049
                        f remove
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6050
                    ] ifFalse:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6051
                        yesToAll ifFalse:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6052
                            idx == filesToRemove size ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6053
                                answer := Dialog
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  6054
                                            confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs
2772
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6055
                                            labels:(resources array:#('cancel' 'remove'))
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6056
                                            values:#(false true) 
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6057
                                            default:2.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6058
                            ] ifFalse:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6059
                                answer := Dialog
2868
c52efd14d44f asText allBold -> allBold
Claus Gittinger <cg@exept.de>
parents: 2844
diff changeset
  6060
                                            confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName allBold) withCRs
2772
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6061
                                            labels:(resources array:#('cancel' 'remove all' 'remove'))
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6062
                                            values:#(false #removeAll true) 
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6063
                                            default:3.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6064
                            ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6065
                            answer == false ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6066
                                ^ self
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6067
                            ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6068
                            answer == #removeAll ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6069
                                yesToAll := true
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6070
                            ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6071
                        ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6072
                        f recursiveRemove
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6073
                    ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6074
                ] ifFalse:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6075
                    f removeFile.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6076
                ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6077
"
2772
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6078
                self show:nil
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  6079
"
2772
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6080
                i := fileList indexOf:fileName.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6081
                i ~~ 0 ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6082
                    toRemove add:i.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6083
                ]
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6084
            ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6085
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6086
    ] valueNowOrOnUnwindDo:[
2772
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6087
        lockUpdate := false.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6088
        fileListView setSelection:nil.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6089
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6090
        "/
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6091
        "/ remove reverse - otherwise indices are wrong
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6092
        "/
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6093
        toRemove sort.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6094
        toRemove reverseDo:[:idx |
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6095
            fileList removeIndex:idx.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6096
            fileListView removeIndex:idx.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6097
        ].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6098
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6099
        updateRunning ifTrue:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6100
            self updateCurrentDirectory
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6101
        ] ifFalse:[
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6102
            "
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6103
             install a new check after some time
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6104
            "
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6105
            needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6106
            Processor removeTimedBlock:checkBlock.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6107
            Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
84029fca1f3d use removeFile (a bit faster) if known to be a file
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  6108
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6109
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6110
1374
b3a1e95a6220 Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents: 1371
diff changeset
  6111
    "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
  6112
    "Modified: / 26.4.1999 / 23:03:12 / cg"
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
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6115
doRename:oldName to:newName
1331
73e712c85588 Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents: 1330
diff changeset
  6116
    "rename a file (or directory)"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6117
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6118
    |old new|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6119
2989
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6120
    (oldName isNil or:[newName isNil]) ifTrue:[
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6121
        ^ self
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6122
    ].
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6123
    (oldName isBlank or:[newName isBlank]) ifTrue:[
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6124
        ^ self
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6125
    ].
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6126
    (oldName = newName) ifTrue:[
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6127
        ^ self
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6128
    ].
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6129
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6130
    old := currentDirectory filenameFor:oldName.
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6131
    new := currentDirectory filenameFor:newName.
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6132
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6133
    OperatingSystem errorSignal handle:[:ex|
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6134
        self showAlert:(resources string:'cannot rename file ''%1'' to %2 !!' 
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6135
                                  with:oldName with:newName)
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6136
                  with:(OperatingSystem lastErrorString)
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6137
    ] do:[
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6138
        new exists ifTrue:[
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6139
            (self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName allBold))
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6140
            ifFalse:[
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6141
                ^ self
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6142
            ]
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6143
        ].
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6144
        old renameTo:new.
7bc80b96c24c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
  6145
    ].
3007
bbb789d5b313 update after rename
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  6146
    self updateCurrentDirectory
bbb789d5b313 update after rename
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  6147
    "/ self updateCurrentDirectoryIfChanged.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6148
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  6149
    "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
  6150
    "Modified: / 3.10.1998 / 18:19:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6151
! !
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
!FileBrowser methodsFor:'private - file type & info'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6154
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6155
fileCommentStrings
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6156
    "return a useful comment definition; based upon the fileName for now"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6157
3015
84b5619bd78d comment strings functionality moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  6158
    ^ MIMETypes commentStringsForFilename:currentFileName
3072
7cdb61c5472b comments default to st-comments
tm
parents: 3066
diff changeset
  6159
                ifUnknown:[
7cdb61c5472b comments default to st-comments
tm
parents: 3066
diff changeset
  6160
                                "/ st:
7cdb61c5472b comments default to st-comments
tm
parents: 3066
diff changeset
  6161
                                #('"/' ('"' '"'))
7cdb61c5472b comments default to st-comments
tm
parents: 3066
diff changeset
  6162
                          ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6163
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6164
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6165
fileTypeSpecificActions
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6166
    "any special fileTypeSpecific actions are done here,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6167
     when a new file is selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6168
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6169
    |commentStrings|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6170
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6171
    commentStrings := self fileCommentStrings.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6172
    commentStrings notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6173
	subView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6174
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6175
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6176
    "Modified: 7.1.1997 / 20:30:54 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6177
!
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
getFileInfoString:longInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6180
    "get stat info on selected file - return a string which can be
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6181
     shown in a box"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6182
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6183
    |fileName f fullPath text info fileOutput type modeBits modeString s ts|
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
    fileName := self getSelectedFileName.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6186
    fileName isNil ifTrue:[^ nil].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6187
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6188
    f := currentDirectory construct:fileName.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6189
    info := f info.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6190
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6191
    info isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6192
	self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6193
		  with:(OperatingSystem lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6194
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6195
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6196
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6197
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6198
    f isSymbolicLink ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6199
	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
  6200
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6201
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6202
    type := info type.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6203
    (longInfo and:[type == #regular]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6204
	fullPath := currentDirectory pathName asFilename constructString:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6205
	fileOutput := fullPath asFilename fileType.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6206
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6207
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6208
    s := (resources at:'type:   ').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6209
    fileOutput isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6210
	s := s ,  type asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6211
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6212
	s := s , 'regular (' , fileOutput , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6213
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6214
    text add:s.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6215
    text add:(resources string:'size:   %1' with:(info size) printString).
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
    modeBits := info mode.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6218
    modeString := self getModeString:modeBits.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6219
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6220
	text add:(resources string:'access: %1 (%2)'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6221
			      with:modeString 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6222
			      with:(modeBits printStringRadix:8))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6223
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6224
	text add:(resources string:'access: %1' with:modeString)
1162
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
    text add:(resources string:'owner:  %1'
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6227
			  with:(OperatingSystem getUserNameFromID:(info uid))).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6228
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6229
	text add:(resources string:'group:  %1'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6230
			      with:(OperatingSystem getGroupNameFromID:(info gid))).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6231
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6232
	ts := info accessed.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6233
	text add:(resources string:'last access:       %1 %2' 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6234
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6235
			      with:(ts asDate printString)).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6236
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6237
	ts := info modified.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6238
	text add:(resources string:'last modification: %1 %2'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6239
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6240
			      with:(ts asDate printString)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6241
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6242
    ^ text asString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6243
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6244
    "Modified: 8.9.1995 / 11:59:28 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6245
    "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
  6246
    "Modified: 18.9.1997 / 16:34:31 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6247
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6248
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6249
getInfoFile
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6250
    "get filename of a description-file (.dir.info, README etc.);
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6251
     This file is automatically shown when a directory is enterred.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6252
     You can add more names below if you like."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6253
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6254
    #( 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6255
       '.dir.info'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6256
       'README'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6257
       'ReadMe'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6258
       'Readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6259
       'readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6260
       'read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6261
       'Read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6262
       'READ.ME'
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6263
       'README.TXT'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6264
       'readme.txt'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6265
       'Readme.txt'
1307
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  6266
       'Info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  6267
       'info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  6268
       'INFO.TXT'
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6269
    ) do:[:f | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6270
	|n|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6271
	n := currentDirectory construct:f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6272
	(n isReadable and:[n isDirectory not]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6273
	    ^ f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6274
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6275
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6276
    ^ nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6277
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  6278
    "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
  6279
    "Modified: 16.9.1997 / 15:26:53 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6280
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6281
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6282
getModeString:modeBits
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6283
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6284
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6285
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6286
    ^ self getModeString:modeBits 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6287
		    with:#( 'owner:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6288
			    ' group:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6289
			    ' others:' $r $w $x )
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6290
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6291
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6292
getModeString:modeBits with:texts
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6293
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6294
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6295
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6296
    |bits modeString|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6297
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6298
    bits := modeBits bitAnd:8r777.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6299
    modeString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6300
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6301
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6302
    with: texts do:[:bitMask :access |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6303
	|ch|
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6304
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6305
	bitMask isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6306
	    modeString := modeString , (resources string:access)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6307
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6308
	    (bits bitAnd:bitMask) == 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6309
		ch := $-
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6310
	    ] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6311
		ch := access
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6312
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6313
	    modeString := modeString copyWith:ch 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6314
	]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  6315
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6316
    ^ modeString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6317
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6318
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6319
showInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6320
    "show directory info when dir has changed"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6321
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6322
    |info txt|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6323
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6324
    info := self getInfoFile.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6325
    info notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6326
	txt := self readFile:info
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6327
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6328
    self show:txt.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6329
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6330
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6331
sizePrintString:size
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6332
    "helper for update-directory to return a string with a files size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6333
     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
  6334
     If you dont like this, just uncomment the first statement below."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6335
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6336
    |unitString n|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6337
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6338
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6339
    ^ size printString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6340
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6341
    unitString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6342
    size < (500 * 1024) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6343
	size < 1024 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6344
	    n := size
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6345
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6346
	    n := (size * 10 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6347
	    unitString := ' Kb'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6348
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6349
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6350
	n := (size * 10 // 1024 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6351
	unitString := ' Mb'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6352
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6353
    ^ (n printStringLeftPaddedTo:5) , unitString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6354
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6355
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6356
!FileBrowser methodsFor:'private - file-I/O'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6357
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6358
readFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6359
    "read in the file, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6360
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6361
    ^ self readFile:fileName lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6362
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6363
    "Modified: 22.2.1996 / 14:57:08 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6364
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6365
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6366
readFile:fileName lineDelimiter:aCharacter encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6367
    "read in the file, return its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6368
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6369
     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
  6370
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6371
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6372
    |f stream text msg sz|
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6373
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6374
    (f := fileName asFilename) isAbsolute ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6375
	f := (currentDirectory construct:fileName)
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6376
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6377
    stream := f readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6378
    stream isNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6379
	msg := (resources string:'cannot read file ''%1'' !!' with:fileName).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6380
	self showAlert:msg with:(FileStream lastErrorString).
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6381
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6382
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6383
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6384
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6385
     for very big files, give ObjectMemory a hint, to preallocate more
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6386
    "
1311
e09e4a65d8a9 filename stuff
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  6387
    (sz := stream fileSize) > 1000000 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6388
	Processor activeProcess withPriority:Processor userBackgroundPriority do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6389
	    ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6390
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6391
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6392
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6393
    text := self readStream:stream lineDelimiter:aCharacter encoding:encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6394
    stream close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6395
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6396
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6397
    "Created: / 22.2.1996 / 14:56:48 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6398
    "Modified: / 18.9.1997 / 17:06:54 / stefan"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6399
    "Modified: / 4.2.1999 / 17:52:18 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6400
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6401
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6402
readStream:aStream
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6403
    "read in from aStream, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6404
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6405
    ^ self readStream:aStream lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6406
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6407
    "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
  6408
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  6409
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6410
readStream:aStream lineDelimiter:aCharacter encoding:encoding 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6411
    "read from aStream, answer its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6412
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6413
     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
  6414
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6415
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6416
    |text line enc|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6417
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6418
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6419
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6420
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6421
    enc == #iso8859 ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6422
	enc := nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6423
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6424
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6425
    aCharacter == Character cr ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6426
	FileStream lineTooLongErrorSignal handle:[:ex |
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6427
	    |s partialLine|
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6428
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6429
	    s := ex parameter at:1.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6430
	    partialLine := ex parameter at:2.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6431
	    ex proceedWith:(partialLine , s upTo:aCharacter)
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6432
	] do:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6433
	    [aStream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6434
		line := aStream nextLine withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6435
		enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6436
		    line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6437
		].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6438
		text add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6439
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6440
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6441
    ] ifFalse:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6442
	[aStream atEnd] whileFalse:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6443
	    line := (aStream upTo:aCharacter) withTabsExpanded.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6444
	    enc notNil ifTrue:[
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6445
		line := line decodeFrom:enc
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6446
	    ].
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6447
	    text add:line
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6448
	].
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  6449
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6450
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6451
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6452
    "Created: / 22.2.1996 / 14:58:25 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6453
    "Modified: / 5.2.1999 / 00:53:22 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6454
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6455
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6456
showFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6457
    "show contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6458
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6459
    fileListView selection:(fileList indexOf:fileName).
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6460
    self fileGet
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6461
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  6462
    "Modified: / 17.6.1998 / 11:26:13 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6463
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6464
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6465
showFile:fileName insert:insert encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6466
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6467
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6468
    ^ self 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6469
	showFile:fileName insert:insert encoding:encoding doubleClick:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6470
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6471
    "Modified: 19.6.1996 / 09:40:19 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6472
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6473
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6474
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6475
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6476
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6477
    |path buffer s n i ok convert text msg eol guess action enc 
3026
3fb47b4a366c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3025
diff changeset
  6478
     fontsEncoding pref failWarning f answer|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6479
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6480
    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
  6481
        path := currentDirectory filenameFor:fileName.
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6482
    ] ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6483
        path := fileName asFilename asAbsoluteFilename
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6484
    ].
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6485
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6486
    (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
  6487
        "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
  6488
        path exists ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6489
            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
  6490
        ] ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6491
            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
  6492
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6493
        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
  6494
        ^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6495
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6496
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6497
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6498
    "/ check if file is a text file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6499
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6500
    s := path readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6501
    s isNil ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6502
        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
  6503
                  with:(FileStream lastErrorString).
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6504
        ^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6505
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6506
1222
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  6507
    buffer := String new:4096.
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  6508
    n := s nextBytes:4096 into:buffer.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6509
    s close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6510
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6511
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6512
    ok := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6513
    guess := self guessEncodingFrom:buffer.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6514
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6515
    guess == #binary ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6516
        ok := false.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6517
        viaDoubleClick ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6518
            (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
  6519
        ].
3061
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  6520
        answer := self confirmWithCancel:(resources string:'''%1'' seems to be a binary file (or unsupported format) - show anyway ?' with:fileName).
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  6521
        answer == false ifTrue:[^ self].
ce4336b44041 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3060
diff changeset
  6522
        answer isNil ifTrue:[AbortSignal raise].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6523
    ] ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6524
        viaDoubleClick ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6525
            (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
  6526
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6527
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6528
        fontsEncoding := subView font encoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6529
        pref := self preferredFontEncodingFor:guess.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6530
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6531
        ok := pref match:fontsEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6532
        ok ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6533
            pref = 'iso8859*' ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6534
                ok := 'ascii*' match:fontsEncoding
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6535
            ]
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6536
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6537
        ok ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6538
            fileEncoding := guess.    
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6539
            enc := guess.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6540
        ] ifFalse:[
2779
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6541
            doNotShowFontDialog == true ifTrue:[
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6542
                action := #show
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6543
            ] ifFalse:[
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6544
                action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileName with:pref)
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6545
                               labels:(resources array:#('cancel' 'show' 'dont ask again' 'change font'))
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6546
                               values:#(nil #show #showAlways #encoding)
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6547
                               default:#encoding.
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6548
            ].
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6549
            action == #showAlways ifTrue:[
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6550
                doNotShowFontDialog := true.
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6551
                action := #show.
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6552
            ].
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6553
            action isNil ifTrue:[^ self].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6554
            action == #encoding ifTrue:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6555
                fileEncoding := guess asSymbol.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6556
                subView externalEncoding:fileEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6557
                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
  6558
            ] ifFalse:[
2779
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6559
                doNotShowFontDialog ~~ true ifTrue:[
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6560
                    self information:(resources string:'Individual characters may be invisible/wrong in this font.')
c48395d6cb56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
  6561
                ]
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6562
            ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6563
            enc := fileEncoding.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6564
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6565
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6566
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6567
    convert := false.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6568
"/    ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6569
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6570
"/        "/ check if line delimiter is a cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6571
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6572
"/        i := buffer indexOf:Character cr.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6573
"/        i == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6574
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6575
"/            "/ no newline found - try cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6576
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6577
"/            i := buffer indexOf:(Character value:13).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6578
"/            i ~~ 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6579
"/                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
  6580
"/            ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6581
"/        ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6582
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6583
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6584
    insert ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6585
        "/ release old text first 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6586
        "/ - 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
  6587
        "/  (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
  6588
        "/   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
  6589
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6590
        subView contents:nil.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6591
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6592
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6593
    convert ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6594
        eol := Character value:13
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6595
    ] ifFalse:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6596
        eol := Character cr
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6597
    ].
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6598
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  6599
    failWarning := false.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6600
    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
  6601
        |errStr|
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6602
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6603
        failWarning ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6604
            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
  6605
            (self confirm:(resources 
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6606
                                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
  6607
                                with:errStr) withCRs)
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6608
            ifFalse:[
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6609
                ^ self
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6610
            ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6611
            failWarning := true.
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6612
        ].
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6613
        ex proceed.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6614
    ] do:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6615
        text := self readFile:fileName lineDelimiter:eol encoding:enc.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  6616
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6617
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6618
    insert ifFalse:[
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  6619
        (f := fileName asFilename) isAbsolute ifFalse:[
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  6620
            f := (currentDirectory construct:fileName)
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  6621
        ].
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  6622
        self class addToVisitedFileHistory:f pathName.
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  6623
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6624
        self show:text
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6625
    ] ifTrue:[
2158
edf13d7fd732 give a better error message when clicking on an unsupported
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  6626
        subView insertSelectedStringAtCursor:text asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6627
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6628
1994
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6629
    "Created: / 19.6.1996 / 09:39:52 / cg"
c081e04a4519 handle long lines
Claus Gittinger <cg@exept.de>
parents: 1989
diff changeset
  6630
    "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
  6631
    "Modified: / 18.5.1999 / 15:51:18 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6632
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6633
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6634
writeFile:fileName text:someText encoding:encoding
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6635
    |stream errReason msg startNr nLines string|
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6636
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6637
    errReason := ''.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6638
    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
  6639
        errReason := ex errorString.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6640
        ex return.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6641
    ] do:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6642
        stream := (currentDirectory filenameFor:fileName) writeStream.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6643
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6644
    stream isNil ifTrue:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6645
        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
  6646
        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
  6647
        ^ self.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6648
    ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6649
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6650
    dosEOLMode value == true ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6651
        stream eolMode:#crlf.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6652
        "/ must do it lineWise ...
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6653
        someText asStringCollection do:[:line |
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6654
            line notNil ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6655
                stream nextPutAll:line
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6656
            ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6657
            stream cr
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6658
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6659
    ] ifFalse:[
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6660
        (someText isString) ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6661
            stream nextPutAll:someText.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6662
        ] ifFalse:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6663
            "/
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6664
            "/ 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
  6665
            "/ 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
  6666
            "/ 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
  6667
            "/
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6668
            startNr := 1.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6669
            nLines := someText size.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6670
            [startNr <= nLines] whileTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6671
                string := someText asStringWithCRsFrom:startNr
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6672
                                                    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
  6673
                                          compressTabs:compressTabs.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6674
                encoding notNil ifTrue:[
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6675
                    string := string encodeInto:encoding
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6676
                ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6677
                stream nextPutAll:string.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6678
                startNr := startNr + 1000 + 1.
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6679
            ].
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6680
        ].
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6681
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6682
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6683
    stream close.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  6684
    subView modified:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  6685
2142
8897f7ed79fc added DOS crlf lineMode (req'd to edit .bat-files)
Claus Gittinger <cg@exept.de>
parents: 2140
diff changeset
  6686
    "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
  6687
    "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
  6688
    "Modified: / 6.5.1999 / 11:45:50 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6689
! !
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6690
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6691
!FileBrowser methodsFor:'private - presentation'!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6692
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6693
defineTabulatorsForLongList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6694
    "define the tabs for the long list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6695
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6696
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6697
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6698
"/  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
  6699
    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
  6700
    "                   icon  name   mode  owner  group  size     type"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6701
    tabSpec align:    #(#left #left  #left #right #right #decimal #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6702
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6703
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6704
    tabRulerView tabulatorSpecification:tabSpec.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6705
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6706
    "Modified: 17.4.1997 / 02:56:07 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6707
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6708
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6709
defineTabulatorsForShortList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6710
    "define the tabs for the short list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6711
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6712
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6713
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6714
"/  tabSpec positions:#(0     0.25 ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6715
    tabSpec widths:   #(0.25   2   ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6716
    "                   icon  name"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6717
    tabSpec align:    #(#left #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6718
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6719
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6720
    tabRulerView notNil ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6721
	tabRulerView tabulatorSpecification:tabSpec.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6722
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6723
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6724
    "Created: / 17.4.1997 / 02:51:41 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  6725
    "Modified: / 27.7.1998 / 20:23:34 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6726
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6727
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6728
iconForFile:aFilenameString
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6729
    "given a fileName, return an appropriate icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6730
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6731
    |f icn key key2 suff mimeType|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6732
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  6733
    f := currentDirectory construct:aFilenameString.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  6734
    f isDirectory ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6735
        f isSymbolicLink ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6736
            key := #directoryLink
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6737
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6738
            key := #directory.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6739
            (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
  6740
                key := #directoryLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6741
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6742
        ]
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6743
    ] ifFalse:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6744
        f isSymbolicLink ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6745
            f isReadable not ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6746
                key := #fileLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6747
            ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6748
                key := #fileLink
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6749
            ]
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6750
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6751
            key := key2 := #file.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6752
            f isExecutableProgram ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6753
                key := key2 := #executableFile
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6754
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6755
            (f isReadable not) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6756
                key := #fileLocked
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6757
            ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6758
                suff := f suffix.
2504
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6759
                (suff = 'bak' or:[suff = 'sav']) ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6760
                    suff := f withoutSuffix suffix.
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6761
                ].
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6762
                suff size > 0 ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6763
                    mimeType := MIMETypes mimeTypeForSuffix:suff.
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6764
                    mimeType notNil ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6765
                        (mimeType startsWith:'image/') ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6766
                            key := #imageFile
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6767
                        ] ifFalse:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6768
                            (mimeType startsWith:'text/') ifTrue:[
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6769
                                key := #textFile
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6770
                            ]
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6771
                        ]
2504
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6772
                    ].
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6773
                ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6774
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6775
        ].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6776
    ].
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  6777
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6778
    "/ local (device) icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6779
    icons notNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6780
        mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6781
            icn := icons at:mimeType ifAbsent:nil.
2796
cd63775b2daf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  6782
        ] ifFalse:[
cd63775b2daf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  6783
            icn := icons at:key ifAbsent:nil.
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6784
        ].
2796
cd63775b2daf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2795
diff changeset
  6785
        icn notNil ifTrue:[^ icn].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6786
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6787
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6788
    "/ global icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6789
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6790
    Icons notNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6791
        mimeType notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6792
            icn := Icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6793
            "/ sight - check for parent-MIME types ...
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6794
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6795
            [icn isNil and:[mimeType includes:$/]] whileTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6796
                mimeType := mimeType copyTo:(mimeType lastIndexOf:$/) - 1.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6797
                icn := Icons at:mimeType ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6798
            ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6799
        ].
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6800
        icn notNil ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6801
            key := mimeType
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6802
        ] ifFalse:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6803
            icn := Icons at:key ifAbsent:nil.
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6804
        ].
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6805
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6806
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  6807
    icn isNil ifTrue:[
2187
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6808
        (    (key := key2) isNil
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6809
         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
  6810
         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
  6811
        ) ifTrue:[
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6812
            ^ icn
59aff09bfc2d added comment strings for .html and .bat files.
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  6813
        ]
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  6814
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6815
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6816
    "/ remember device icon
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  6817
    icn := icn copy onDevice:device.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6818
    icn clearMaskedPixels.
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  6819
    icons at:key put:icn.
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  6820
    ^ icn
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  6821
1746
68a187e3f30f another icon for executable files.
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
  6822
    "Modified: / 18.9.1997 / 16:35:28 / stefan"
2504
a902e3d9f868 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
  6823
    "Modified: / 23.12.1999 / 22:28:00 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6824
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6825
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6826
stopImageRenderProcess
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6827
    imageRenderProcess notNil ifTrue:[
2138
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6828
	imageRenderProcess terminate.
b01e74a4b8e5 comment strings for *.mak
ps
parents: 2137
diff changeset
  6829
	imageRenderProcess := nil
2094
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6830
    ].
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6831
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6832
    "Created: 19.4.1997 / 13:51:34 / cg"
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6833
!
6d02c898c387 show an image preview
Claus Gittinger <cg@exept.de>
parents: 2091
diff changeset
  6834
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6835
stopUpdateProcess
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6836
    Processor removeTimedBlock:checkBlock.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6837
    listUpdateProcess notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6838
	listUpdateProcess terminate.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  6839
	listUpdateProcess := nil.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6840
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6841
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6842
    "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
  6843
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  6844
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6845
updateCurrentDirectory
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6846
    "update listView with directory contents"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6847
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6848
    "the code below may look somewhat complex -
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6849
     it reads the directory first for the names,
1151
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  6850
     then (in followup sweeps over the files) gets the
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  6851
     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
  6852
     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
  6853
     (i.e. stat-calls) may take long - especially on NFS-mounted directories.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6854
     The file reading is done at lower priority, to let user continue
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6855
     his work in other views. However, to be fair to other fileBrowser,
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6856
     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
  6857
     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
  6858
     Therefore, browsers which read short directories will finish first.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6859
     ST/X users love this behavior ;-)
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6860
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6861
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  6862
    self withReadCursorDo:[
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  6863
        |files matchPattern list passDone f ignoreCase|
2255
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
        self stopUpdateProcess.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6866
2636
51946a32c09e time check fix
Claus Gittinger <cg@exept.de>
parents: 2607
diff changeset
  6867
        timeOfLastCheck := currentDirectory modificationTime.
2255
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
        files := currentDirectory asFilename fullDirectoryContents.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6870
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6871
"/        (files includes:(Filename parentDirectoryName)) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6872
"/            upButton enable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6873
"/        ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6874
"/            upButton disable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6875
"/        ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6876
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6877
        "/ show files which are either directories
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6878
        "/ or match the current pattern
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6879
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6880
        matchPattern := filterField contents.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6881
        (matchPattern notNil and:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6882
         matchPattern isEmpty not and:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6883
         matchPattern ~= '*']]) ifTrue:[
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  6884
             ignoreCase := Filename isCaseSensitive not.
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6885
             files := files select:[:aName | 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6886
                         ((currentDirectory construct:aName) isDirectory)
2498
77c52f2004a4 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 2492
diff changeset
  6887
                         or:[matchPattern compoundMatch:aName ignoreCase:ignoreCase]
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6888
                      ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6889
        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6890
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6891
        files size == 0 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6892
            self information:('directory ', currentDirectory pathName, ' vanished').
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6893
            ^ self
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6894
        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6895
        (sortByWhat value == #name) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6896
            sortCaseless value == true ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6897
                files sort:[:a :b | a asLowercase < b asLowercase]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6898
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6899
                files sort.
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
        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6902
            (sortByWhat value == #time) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6903
                files sort:[:a :b | |f1 f2 t1 t2|
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6904
                                f1 := (currentDirectory construct:a).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6905
                                f2 := (currentDirectory construct:b).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6906
                                t1 := f1 isSymbolicLink 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6907
                                        ifFalse:[f1 modificationTime]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6908
                                        ifTrue:[f1 linkInfo modified].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6909
                                t2 := f2 isSymbolicLink 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6910
                                        ifFalse:[f2 modificationTime]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6911
                                        ifTrue:[f2 linkInfo modified].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6912
                                t1 := t1 ? (AbsoluteTime now).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6913
                                t2 := t2 ? (AbsoluteTime now).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6914
                                t1 > t2
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6915
                           ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6916
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6917
                (sortByWhat value == #type) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6918
                    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
  6919
                                    f1 := (currentDirectory construct:a).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6920
                                    f2 := (currentDirectory construct:b).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6921
                                    t1 := f1 type ? #xbadLink. 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6922
                                    t2 := f2 type ? #xbadLink. 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6923
                                    t1 = t2 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6924
                                        suff1 := f1 suffix.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6925
                                        suff2 := f2 suffix.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6926
                                        suff1 = suff2 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6927
                                            sortCaseless value == true ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6928
                                                a asLowercase < b asLowercase
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6929
                                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6930
                                                a < b
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6931
                                            ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6932
                                        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6933
                                            suff1 asLowercase < suff2 asLowercase
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
                                    ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6936
                                        t1 < t2
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6937
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6938
                               ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6939
                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6940
            ]
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
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6943
        files := self withoutHiddenFiles:files.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6944
        fileList := files copy.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6945
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6946
        tabSpec isNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6947
            showingDetails value "showLongList" ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6948
                self defineTabulatorsForLongList
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6949
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6950
                self defineTabulatorsForShortList
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
        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6955
        "/ 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
  6956
        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6957
        list := files collect:[:fileName |
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6958
                    |entry|
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6959
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6960
                    entry := MultiColListEntry new.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6961
                    entry tabulatorSpecification:tabSpec.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6962
                    entry colAt:1 put:nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6963
                    entry colAt:2 put:fileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6964
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6965
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6966
        fileListView setList:list expandTabs:false.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6967
        passDone := Array new:list size withAll:0.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6968
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6969
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6970
         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
  6971
         NFS-mounted directory); therefore, start a low prio process,
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6972
         which fills in the remaining fields in the fileList ...
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
        listUpdateProcess := [
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6976
            |prevUid prevGid fileNameString nameString groupString 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6977
             modeString info line len
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6978
             anyImages lineIndex aFileName
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6979
             entry typ f p typeString done endIndex 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6980
             state stopAtEnd nextState img prevFirstLine prevLastLine
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  6981
             numVisible dirSuffix prevWidth|
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6982
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6983
            dirSuffix := Filename directorySuffix.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6984
            dirSuffix size > 0 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6985
                dirSuffix := '.' , dirSuffix asLowercase.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6986
            ].
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
            "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6989
            "/ then walk over the files, adding more info
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6990
            "/ (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
  6991
            "/ Visible items are always filled first.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6992
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6993
            "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6994
            "/ the state machine
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
            nextState := IdentityDictionary new.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6997
            showingDetails value "showLongList" ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6998
                nextState add:(#visibleIcons -> #visibleAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  6999
                nextState add:(#visibleAttributes -> #visibleTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7000
                nextState add:(#visibleTypes -> #visibleImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7001
                nextState add:(#visibleImages -> #nextPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7002
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7003
                nextState add:(#nextPageIcons -> #nextPageAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7004
                nextState add:(#nextPageAttributes -> #nextPageTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7005
                nextState add:(#nextPageTypes -> #nextPageImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7006
                nextState add:(#nextPageImages -> #previousPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7007
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7008
                nextState add:(#previousPageIcons -> #previousPageAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7009
                nextState add:(#previousPageAttributes -> #previousPageTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7010
                nextState add:(#previousPageTypes -> #previousPageImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7011
                nextState add:(#previousPageImages -> #remainingIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7012
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7013
                nextState add:(#remainingIcons -> #remainingAttributes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7014
                nextState add:(#remainingAttributes -> #remainingTypes).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7015
                nextState add:(#remainingTypes -> #remainingImages).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7016
                nextState add:(#remainingImages -> nil).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7017
            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7018
                nextState add:(#visibleIcons -> #nextPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7019
                nextState add:(#nextPageIcons -> #previousPageIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7020
                nextState add:(#previousPageIcons -> #remainingIcons).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7021
                nextState add:(#remainingIcons -> nil).
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
            anyImages := false.
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
            lineIndex := prevFirstLine := fileListView firstLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7027
            endIndex := prevLastLine := fileListView lastLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7028
            endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7029
            state := #visibleIcons.
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
            done := false.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7032
            [done] whileFalse:[
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
                "/ if multiple FileBrowsers are reading, let others
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7035
                "/ make some progress too
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7036
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7037
                Processor yield.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7038
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7039
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7040
                "/ could be destroyed in the meanwhile ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7041
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7042
                realized ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7043
                    listUpdateProcess := nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7044
                    Processor activeProcess terminate
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7045
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7046
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7047
                ((prevFirstLine ~~ fileListView firstLineShown)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7048
                or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7049
                    "/ start all over again
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7050
                    lineIndex := prevFirstLine := fileListView firstLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7051
                    endIndex := prevLastLine := fileListView lastLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7052
                    endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7053
                    state := #visibleIcons.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7054
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7055
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7056
                showingDetails value ifTrue:[
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7057
                    prevWidth := fileListView widthOfContents.
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7058
                ].
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7059
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7060
                (lineIndex between:1 and:(files size)) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7061
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7062
                    "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7063
                    "/ expand the next entry ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7064
                    "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7065
                    aFileName := files at:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7066
                    entry := fileListView at:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7067
                    f := currentDirectory construct:aFileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7068
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7069
                    (state endsWith:'Icons') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7070
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7071
                        "/ pass 1 - icons
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7072
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7073
                        (passDone at:lineIndex) < 1 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7074
                            (f isDirectory
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7075
                              and:[(aFileName ~= '..') and:[aFileName ~= '.']]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7076
                            ) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7077
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7078
                                "/ the following suffix cutOff is not really required, 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7079
                                "/ but makes the list look better on VMS ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7080
                                fileNameString := aFileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7081
                                dirSuffix notNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7082
                                    (aFileName asLowercase endsWith:dirSuffix) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7083
                                        fileNameString := aFileName copyWithoutLast:(dirSuffix size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7084
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7085
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7086
                                fileNameString := fileNameString , ' ...'
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7087
                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7088
                                fileNameString := aFileName.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7089
                                OperatingSystem isVMSlike ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7090
                                    (aFileName endsWith:'.') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7091
                                        aFileName ~= '..' ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7092
                                            fileNameString := aFileName copyWithoutLast:1
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7093
                                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7094
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7095
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7096
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7097
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7098
                            showingDetails value "showLongList" ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7099
                                len := fileNameString size.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7100
                                (len > 20) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7101
                                    fileNameString := (fileNameString contractTo:20)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7102
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7103
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7104
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7105
                            entry colAt:1 put:(self iconForFile:aFileName).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7106
                            entry colAt:2 put:fileNameString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7107
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7108
                            "/fileListView at:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7109
                            fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7110
                            fileListView invalidateLine:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7111
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7112
                            anyImages ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7113
                                (Image isImageFileSuffix:(aFileName asFilename suffix))
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7114
                                ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7115
                                    anyImages := true
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7116
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7117
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7118
                            passDone at:lineIndex put:1
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7119
                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7120
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7121
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7122
                    (state endsWith:'Attributes') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7123
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7124
                        "/ pass 2 - everything except fileType (which takes very long)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7125
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7126
                        (passDone at:lineIndex) < 2 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7127
                            info := f info.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7128
                            info isNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7129
                                "not accessable - usually a symlink,
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7130
                                 to a nonexisting/nonreadable file
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7131
                                "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7132
                                f isSymbolicLink ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7133
                                    p := f linkInfo path.    
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7134
                                    typeString := 'broken symbolic link to ' , p
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7135
                                ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7136
                                    typeString := 'unknown'
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7137
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7138
                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7139
                                typ := (info type).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7140
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7141
                                modeString := self getModeString:(info at:#mode)
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7142
                                                            with:#( '' $r $w $x 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7143
                                                                    '  ' $r $w $x 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7144
                                                                    '  ' $r $w $x ).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7145
                                entry colAt:3 put:modeString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7146
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7147
                                ((info uid) ~~ prevUid) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7148
                                    prevUid := (info uid).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7149
                                    nameString := OperatingSystem getUserNameFromID:prevUid.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7150
                                    nameString := nameString contractTo:10.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7151
                                    nameString := nameString , (String new:(10 - nameString size))
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7152
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7153
                                nameString isNil ifTrue:[nameString := '???'].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7154
                                entry colAt:4 put:nameString withoutSpaces.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7155
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7156
                                ((info gid) ~~ prevGid) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7157
                                    prevGid := (info gid).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7158
                                    groupString := OperatingSystem getGroupNameFromID:prevGid.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7159
                                    groupString := groupString contractTo:10.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7160
                                    groupString := groupString , (String new:(10 - groupString size))
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7161
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7162
                                groupString isNil ifTrue:[groupString := '???'].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7163
                                entry colAt:5 put:groupString withoutSpaces.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7164
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7165
                                (typ == #regular) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7166
                                    entry colAt:6 put:(self sizePrintString:(info size)).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7167
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7168
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7169
                                f isSymbolicLink ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7170
                                    p := f linkInfo path.    
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7171
                                    typeString := 'symbolic link to ' , p
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7172
                                ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7173
                                    typeString := typ asString
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7174
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7175
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7176
                            entry colAt:7 put:typeString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7177
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7178
                            "/ fileListView at:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7179
                            fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7180
                            fileListView invalidateLine:lineIndex.
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7181
                        
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7182
                            passDone at:lineIndex put:2.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7183
                        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7184
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7185
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7186
                    (state endsWith:'Types') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7187
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7188
                        "/ pass 3: add fileType
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7189
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7190
                        (passDone at:lineIndex) < 3 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7191
                            info := f info.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7192
                            info notNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7193
                                f isSymbolicLink ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7194
                                    (Image isImageFileSuffix:(f suffix)) ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7195
                                        typeString := f fileType.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7196
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7197
                                        entry colAt:7 put:typeString.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7198
                                        "/ fileListView at:lineIndex put:entry
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7199
                                        fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7200
                                        fileListView invalidateLine:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7201
                                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7202
                                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7203
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7204
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7205
                            passDone at:lineIndex put:3
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7206
                        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7207
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7208
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7209
                    (state endsWith:'Images') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7210
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7211
                        "/ pass 4: read images
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7212
                        "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7213
                        (passDone at:lineIndex) < 4 ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7214
                            (Image isImageFileSuffix:(f suffix)) ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7215
                                f isDirectory ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7216
                                    img := Image fromFile:(f pathName).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7217
                                    img notNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7218
                                        showingBigImagePreview value == true ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7219
                                            img := img magnifiedTo:32@32.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7220
                                        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7221
                                            img := img magnifiedTo:16@16.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7222
                                        ].
2339
46603ba745c6 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2320
diff changeset
  7223
                                        img := img onDevice:self device.
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7224
                                        entry colAt:7 put:img.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7225
                                        "/ fileListView at:lineIndex put:entry
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7226
                                        fileListView withoutRedrawAt:lineIndex put:entry.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7227
                                        fileListView invalidateLine:lineIndex.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7228
                                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7229
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7230
                            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7231
                            passDone at:lineIndex put:4
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7232
                        ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7233
                    ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7234
                ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7235
2257
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7236
                showingDetails value ifTrue:[
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7237
                    fileListView widthOfContents ~~ prevWidth ifTrue:[
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7238
                        fileListView contentsChanged.    
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7239
                    ]
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7240
                ].
02dc5c0000e1 oops - must send size-changeNotification manually
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
  7241
2255
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7242
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7243
                "/ advance to the next line
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7244
                "/
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7245
                lineIndex := lineIndex + 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7246
                lineIndex > endIndex ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7247
                    "/ finished this round ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7248
                    "/ see what we are going for ...
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7249
                    numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7250
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7251
                    state := nextState at:state ifAbsent:nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7252
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7253
                    state isNil ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7254
                        done := true
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7255
                    ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7256
                        (state startsWith:'visible') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7257
                            lineIndex := fileListView firstLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7258
                            endIndex := fileListView lastLineShown.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7259
                            endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7260
                        ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7261
                            (state startsWith:'nextPage') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7262
                                lineIndex := fileListView lastLineShown + 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7263
                                endIndex := lineIndex + numVisible.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7264
                                endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7265
                                lineIndex := lineIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7266
                            ] ifFalse:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7267
                                (state startsWith:'previousPage') ifTrue:[
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7268
                                    endIndex := fileListView firstLineShown - 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7269
                                    lineIndex := endIndex - numVisible.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7270
                                    lineIndex := lineIndex max:1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7271
                                    endIndex := endIndex min:(files size).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7272
                                    endIndex := endIndex max:1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7273
                                ] ifFalse:[ 
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7274
                                    "/ remaining
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7275
                                    lineIndex := 1.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7276
                                    endIndex := files size.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7277
                                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7278
                            ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7279
                        ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7280
                    ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7281
                ]
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7282
            ].
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7283
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7284
            listUpdateProcess := nil.
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7285
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7286
        ] forkAt:(Processor activePriority - 1).
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7287
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7288
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7289
         install a new check after some time
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7290
        "
cc33278ab00a autoHide horiz. scrollBar of fileList
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  7291
        Processor addTimedBlock:checkBlock afterSeconds:checkDelta
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  7292
    ]
142
claus
parents: 139
diff changeset
  7293
1487
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  7294
    "Modified: / 21.9.1995 / 11:40:23 / claus"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  7295
    "Modified: / 28.4.1997 / 22:30:30 / dq"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  7296
    "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
  7297
    "Modified: / 16.12.1999 / 01:25:23 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  7298
! !
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  7299
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  7300
!FileBrowser methodsFor:'queries'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  7301
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7302
fileName
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7303
    "return my current fileName - during fileIn, the file
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7304
     which is being loaded is returned.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7305
     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
  7306
     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
  7307
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7308
    |f|
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7309
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7310
    f := currentFileInFileName ? currentFileName.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7311
    f isNil ifTrue:[^ nil].
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7312
    ^ self path asFilename construct:f
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7313
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7314
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7315
     (FileBrowser openOnFileNamed:'Makefile') fileName
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7316
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7317
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  7318
    "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
  7319
!
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  7320
2951
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  7321
hasVisitHistory
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  7322
    ^ self class hasVisitHistory
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  7323
!
f2dff3a912ef keep history of edited files
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
  7324
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  7325
path
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  7326
    "return my currentDirectories pathName;
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7327
     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
  7328
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7329
    "/ somewhat tricky: first ask it for the full pathName,
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7330
    "/ then convert it to a directory name
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7331
    "/ (which only makes a difference on VMS)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  7332
1828
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  7333
    ^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  7334
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  7335
    "Modified: / 12.8.1998 / 14:45:48 / cg"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  7336
! !
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  7337
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  7338
!FileBrowser class methodsFor:'documentation'!
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  7339
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  7340
version
3172
053d50fe2f6b menu reorganized
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
  7341
    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.417 2001-09-18 08:23:13 cg Exp $'
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  7342
! !