--- a/AbstractFileBrowser.st Sat Nov 26 22:22:17 2016 +0000
+++ b/AbstractFileBrowser.st Tue Nov 29 13:34:37 2016 +0000
@@ -1988,13 +1988,11 @@
#(#MenuItem
#label: 'Hard Link...'
#translateLabel: true
- #isVisible: #systemIsUnix
#value: #newHardLink
)
#(#MenuItem
#label: 'Symbolic Link...'
#translateLabel: true
- #isVisible: #systemIsUnix
#value: #newSoftLink
)
)
@@ -5933,7 +5931,7 @@
prevFiles := ''.
].
- OperatingSystem accessDeniedErrorSignal handle:[:ex|
+ OsError handle:[:ex|
"was not able to remove it"
| lastError msg |
lastError := OperatingSystem lastErrorString.
--- a/FileApplicationNoteBook.st Sat Nov 26 22:22:17 2016 +0000
+++ b/FileApplicationNoteBook.st Tue Nov 29 13:34:37 2016 +0000
@@ -5892,7 +5892,7 @@
fnDir exists ifFalse:[
[
fnDir recursiveMakeDirectory.
- ] on:OperatingSystem accessDeniedErrorSignal do:[:ex|
+ ] on:OsError do:[:ex|
Dialog warn:(ex description).
^ self.
]
--- a/FileBrowser.st Sat Nov 26 22:22:17 2016 +0000
+++ b/FileBrowser.st Tue Nov 29 13:34:37 2016 +0000
@@ -749,151 +749,132 @@
"Do not manually edit this!! If it is corrupted,
the MenuEditor may not be able to read the specification."
+
"
- MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec
- (Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp
+ MenuEditor new openOnClass:FileBrowser andSelector:#fileMenuSpec
+ (Menu new fromLiteralArrayEncoding:(FileBrowser fileMenuSpec)) startUp
"
<resource: #menu>
^
#(Menu
+ (
+ (MenuItem
+ label: 'Spawn'
+ itemValue: fileSpawn
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ enabled: hasSelection
+ label: 'Open'
+ itemValue: menuOpen
+ isVisible: false
+ )
+ (MenuItem
+ enabled: hasFilenameSelectionInCodeView
+ label: 'Open selected Filename'
+ itemValue: openSelectedFilename
+ isVisible: hasFilenameSelectionInCodeView
+ )
+ (MenuItem
+ enabled: hasSelection
+ label: 'FileIn'
+ itemValue: fileFileIn
+ )
+ (MenuItem
+ enabled: hasSelection
+ label: 'FileInTo NameSpace...'
+ itemValue: fileFileInToNameSpace
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'New'
+ submenu:
+ (Menu
(
(MenuItem
- label: 'Spawn'
- itemValue: fileSpawn
- translateLabel: true
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- enabled: hasSelection
- label: 'Open'
- itemValue: menuOpen
- translateLabel: true
- isVisible: false
- )
- (MenuItem
- enabled: hasFilenameSelectionInCodeView
- label: 'Open selected Filename'
- itemValue: openSelectedFilename
- translateLabel: true
- isVisible: hasFilenameSelectionInCodeView
- )
- (MenuItem
- enabled: hasSelection
- label: 'FileIn'
- itemValue: fileFileIn
- translateLabel: true
- )
- (MenuItem
- enabled: hasSelection
- label: 'FileInTo NameSpace...'
- itemValue: fileFileInToNameSpace
- translateLabel: true
- )
- (MenuItem
- label: '-'
+ label: 'Directory...'
+ itemValue: newDirectory
)
(MenuItem
- label: 'New'
- translateLabel: true
- submenu:
- (Menu
- (
- (MenuItem
- label: 'Directory...'
- itemValue: newDirectory
- translateLabel: true
- )
- (MenuItem
- label: 'File...'
- itemValue: newFile
- translateLabel: true
- )
- (MenuItem
- label: 'Hard Link...'
- itemValue: newHardLink
- translateLabel: true
- isVisible: systemIsUnix
- )
- (MenuItem
- label: 'Symbolic Link...'
- itemValue: newSoftLink
- translateLabel: true
- isVisible: systemIsUnix
- )
- )
- nil
- nil
- )
- )
- (MenuItem
- enabled: hasSelection
- label: 'Remove'
- itemValue: fileRemove
- translateLabel: true
- )
- (MenuItem
- enabled: hasSelection
- label: 'Rename'
- itemValue: fileRename
- translateLabel: true
+ label: 'File...'
+ itemValue: newFile
)
(MenuItem
- label: '-'
- )
- (MenuItem
- enabled: hasSelection
- label: 'Properties...'
- itemValue: fileGetLongInfo
- translateLabel: true
- )
- (MenuItem
- label: '-'
- isVisible: javaSupportLoaded
- )
- (MenuItem
- enabled: canAddToClassPath
- label: 'Add to Java ClassPath'
- itemValue: fileAddToJavaClassPath
- translateLabel: true
- isVisible: javaSupportLoaded
+ label: 'Hard Link...'
+ itemValue: newHardLink
)
(MenuItem
- enabled: canRemoveFromClassPath
- label: 'Remove from Java ClassPath'
- itemValue: fileRemoveFromJavaClassPath
- translateLabel: true
- isVisible: javaSupportLoaded
- )
- (MenuItem
- enabled: canAddToSourcePath
- label: 'Add to Java SourcePath'
- itemValue: fileAddToJavaSourcePath
- translateLabel: true
- isVisible: javaSupportLoaded
- )
- (MenuItem
- enabled: canRemoveFromSourcePath
- label: 'Remove from Java SourcePath'
- itemValue: fileRemoveFromJavaSourcePath
- translateLabel: true
- isVisible: javaSupportLoaded
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Exit'
- itemValue: menuExit
- translateLabel: true
+ label: 'Symbolic Link...'
+ itemValue: newSoftLink
)
)
nil
nil
)
+ )
+ (MenuItem
+ enabled: hasSelection
+ label: 'Remove'
+ itemValue: fileRemove
+ )
+ (MenuItem
+ enabled: hasSelection
+ label: 'Rename'
+ itemValue: fileRename
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ enabled: hasSelection
+ label: 'Properties...'
+ itemValue: fileGetLongInfo
+ )
+ (MenuItem
+ label: '-'
+ isVisible: javaSupportLoaded
+ )
+ (MenuItem
+ enabled: canAddToClassPath
+ label: 'Add to Java ClassPath'
+ itemValue: fileAddToJavaClassPath
+ isVisible: javaSupportLoaded
+ )
+ (MenuItem
+ enabled: canRemoveFromClassPath
+ label: 'Remove from Java ClassPath'
+ itemValue: fileRemoveFromJavaClassPath
+ isVisible: javaSupportLoaded
+ )
+ (MenuItem
+ enabled: canAddToSourcePath
+ label: 'Add to Java SourcePath'
+ itemValue: fileAddToJavaSourcePath
+ isVisible: javaSupportLoaded
+ )
+ (MenuItem
+ enabled: canRemoveFromSourcePath
+ label: 'Remove from Java SourcePath'
+ itemValue: fileRemoveFromJavaSourcePath
+ isVisible: javaSupportLoaded
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Exit'
+ itemValue: menuExit
+ )
+ )
+ nil
+ nil
+ )
!
helpMenuSpec
@@ -977,6 +958,7 @@
"Do not manually edit this!! If it is corrupted,
the MenuEditor may not be able to read the specification."
+
"
MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp
(Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp
@@ -990,7 +972,6 @@
(MenuItem
label: 'Spawn'
itemValue: fileSpawn
- translateLabel: true
)
(MenuItem
label: '-'
@@ -999,19 +980,16 @@
enabled: hasSelection
label: 'Edit File'
itemValue: fileGet
- translateLabel: true
)
(MenuItem
enabled: hasSelection
label: 'Insert File'
itemValue: fileInsert
- translateLabel: true
)
(MenuItem
enabled: hasSelection
label: 'FileIn'
itemValue: fileFileIn
- translateLabel: true
shortcutKey: Accept
)
(MenuItem
@@ -1019,31 +997,24 @@
)
(MenuItem
label: 'New'
- translateLabel: true
submenu:
(Menu
(
(MenuItem
label: 'Directory...'
itemValue: newDirectory
- translateLabel: true
)
(MenuItem
label: 'File...'
itemValue: newFile
- translateLabel: true
)
(MenuItem
label: 'Hard Link...'
itemValue: newHardLink
- translateLabel: true
- isVisible: systemIsUnix
)
(MenuItem
label: 'Symbolic Link...'
itemValue: newSoftLink
- translateLabel: true
- isVisible: systemIsUnix
)
)
nil
@@ -1054,14 +1025,12 @@
enabled: hasSelection
label: 'Remove...'
itemValue: fileRemove
- translateLabel: true
shortcutKey: Cut
)
(MenuItem
enabled: hasSelection
label: 'Rename...'
itemValue: fileRename
- translateLabel: true
shortcutKey: Rename
)
(MenuItem
@@ -1071,14 +1040,12 @@
enabled: hasSelection
label: 'Properties...'
itemValue: fileGetLongInfo
- translateLabel: true
)
(MenuItem
label: '-'
)
(MenuItem
label: 'Tools'
- translateLabel: true
submenuChannel: toolsMenuSpec
shortcutKey: Ctrl
keepLinkedMenu: true
@@ -1089,7 +1056,6 @@
(MenuItem
label: 'Update'
itemValue: updateCurrentDirectory
- translateLabel: true
)
)
nil
@@ -3456,13 +3422,11 @@
Error handle:[:ex |
err := ex description
] do:[
- hardOrSoftSymbol == #soft
- ifTrue:[
- OperatingSystem createSymbolicLinkFrom:name1 to:name2
- ]
- ifFalse:[
- OperatingSystem createHardLinkFrom:name1 to:name2
- ]
+ hardOrSoftSymbol == #soft ifTrue:[
+ f2 createAsSymbolicLinkTo:f1.
+ ] ifFalse:[
+ f2 createAsHardLinkTo:f1.
+ ]
]
]
]
@@ -4711,10 +4675,10 @@
|f|
f := currentDirectory construct:fileName.
- OperatingSystem accessDeniedErrorSignal handle:[:ex|
+ OsError handle:[:ex|
"was not able to remove it"
msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
- self showAlert:msg with:(OperatingSystem lastErrorString)
+ self showAlert:msg with:(ex description)
] do:[
|answer contents|
@@ -6588,10 +6552,10 @@
|f|
f := currentDirectory construct:fileName.
- OperatingSystem accessDeniedErrorSignal handle:[:ex|
+ OsError handle:[:ex|
"was not able to remove it"
msg := (resources string:'Cannot remove ''%1'' !!' with:fileName).
- self showAlert:msg with:(OperatingSystem lastErrorString)
+ self showAlert:msg with:(ex description)
] do:[
|answer i|
--- a/FileOperation.st Sat Nov 26 22:22:17 2016 +0000
+++ b/FileOperation.st Tue Nov 29 13:34:37 2016 +0000
@@ -989,64 +989,63 @@
doCreateLinkFrom:oldPath to:newPathArg soft:symbolic
"actually create a soft or hard link"
- |resources err newPath newPathFile oldPathFile|
+ |resources newPath newPathFile oldPathFile|
newPath := newPathArg.
resources := AbstractFileBrowser classResources.
- (oldPath size == 0) ifTrue:[
- self operationError:'Missing source'.
- ^ self.
+ oldPath isNil ifTrue:[
+ self operationError:'Missing source'.
+ ^ self.
].
- (newPath size == 0) ifTrue:[
- self operationError:'Missing link name (target)'.
- ^ self.
+ newPath isNil ifTrue:[
+ self operationError:'Missing link name (target)'.
+ ^ self.
].
newPathFile := newPath asFilename.
oldPathFile := oldPath asFilename.
newPathFile exists ifTrue:[
- newPathFile isDirectory ifTrue:[
- newPathFile := newPathFile construct:(oldPathFile baseName).
- newPath := newPathFile name.
- ].
+ newPathFile isDirectory ifTrue:[
+ newPathFile := newPathFile construct:(oldPathFile baseName).
+ newPath := newPathFile name.
+ ].
].
newPathFile exists ifTrue:[
- self operationError:(resources string:'%1 already exists' with:newPath allBold).
- ^ self.
+ self operationError:(resources string:'%1 already exists' with:newPath allBold).
+ ^ self.
].
oldPathFile exists ifFalse:[
- symbolic ifTrue:[
- oldPathFile isAbsolute ifTrue:[
- self operationError:(resources string:'%1 does not exist' with:oldPath allBold).
- ^ self.
- ].
- (newPathFile directory construct:oldPath) exists ifFalse:[
- Dialog warn:(resources string:'%1 does not exist (Warning only)' with:oldPath allBold).
- ].
- ] ifFalse:[
- self operationError:(resources string:'%1 does not exist' with:oldPath allBold).
- ^ self.
- ].
+ symbolic ifTrue:[
+ oldPathFile isAbsolute ifTrue:[
+ self operationError:(resources string:'%1 does not exist' with:oldPath allBold).
+ ^ self.
+ ].
+ (newPathFile directory construct:oldPath) exists ifFalse:[
+ Dialog warn:(resources string:'%1 does not exist (Warning only)' with:oldPath allBold).
+ ].
+ ] ifFalse:[
+ self operationError:(resources string:'%1 does not exist' with:oldPath allBold).
+ ^ self.
+ ].
].
((symbolic not) and:[oldPathFile isDirectory]) ifTrue:[
- self operationError:(resources string:'%1 is a directory' with:oldPath allBold).
- ^ self.
+ self operationError:(resources string:'%1 is a directory' with:oldPath allBold).
+ ^ self.
].
ErrorSignal handle:[:ex |
- err := ex errorString.
- self operationError:err.
+ self operationError:ex description.
] do:[
- symbolic ifTrue:[
- OperatingSystem createSymbolicLinkFrom:oldPath to:newPath.
- ] ifFalse:[
- OperatingSystem createHardLinkFrom:oldPath to:newPath
- ].
- self createdFile:newPathFile.
- self result:true.
+ symbolic ifTrue:[
+ newPathFile createAsSymbolicLinkTo:oldPathFile.
+ ] ifFalse:[
+ newPathFile createAsHardLinkTo:oldPathFile.
+ ].
+ self createdFile:newPathFile.
+ self result:true.
].
! !