Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004799 [Squeak] Kernel minor always 09-09-06 14:44 09-09-06 14:44
Reporter Krivanek View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.10
Summary 0004799: [KernelImageOverride] StandardFileStream fileExistsUserHandling:
Description StandardFileStream >> fileExistsUserHandling:

original:

fileExistsUserHandling: fullFileName
    | dir localName choice newName newFullFileName |
    dir := FileDirectory forFileName: fullFileName.
    localName := FileDirectory localNameFor: fullFileName.
    choice := (PopUpMenu
        labels:
'overwrite that file\choose another name\cancel' withCRs)
        startUpWithCaption: localName, '
already exists.'.

    choice = 1 ifTrue: [
        dir deleteFileNamed: localName
            ifAbsent: [self error: 'Could not delete the old version of that file'].
        ^ self new open: fullFileName forWrite: true].

    choice = 2 ifTrue: [
        newName := FillInTheBlank request: 'Enter a new file name' initialAnswer: fullFileName.
        newFullFileName := self fullName: newName.
        ^ self newFileNamed: newFullFileName].

    self error: 'Please close this to abort file opening'

override:

fileExistsUserHandling: fullFileName
    | dir localName choice newName newFullFileName |
    dir := FileDirectory forFileName: fullFileName.
    localName := FileDirectory localNameFor: fullFileName.
    choice := UIManager default
        chooseFrom: #('overwrite that file' 'choose another name' 'cancel' ) title: localName, '
already exists.'.

    choice = 1 ifTrue: [
        dir deleteFileNamed: localName
            ifAbsent: [self error: 'Could not delete the old version of that file'].
        ^ self new open: fullFileName forWrite: true].

    choice = 2 ifTrue: [
        newName := UIManager default request: 'Enter a new file name' initialAnswer: fullFileName.
        newFullFileName := self fullName: newName.
        ^ self newFileNamed: newFullFileName].

    self error: 'Please close this to abort file opening'


UI dependent code replaced with UIManager call
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
09-09-06 14:44 Krivanek New Issue


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
27 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker