The Trunk: Tools-tpr.798.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-tpr.798.mcz

commits-2
tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.798.mcz

==================== Summary ====================

Name: Tools-tpr.798
Author: tpr
Time: 7 March 2018, 11:19:49.739206 am
UUID: cf6625fc-e8fc-491a-8ec9-1d907f10e710
Ancestors: Tools-mt.797

Convert usage of nasty old StandardFileMenu to gleaming new file dialogues

=============== Diff against Tools-mt.797 ===============

Item was changed:
  ----- Method: ArchiveViewer>>extractMember (in category 'member operations') -----
  extractMember
  "Extract the member after prompting for a filename.
  Answer the filename, or nil if error."
 
+ | name |
- | result name |
  self canExtractMember ifFalse: [ ^nil ].
+ name := FileSaverDialog openOn: FileDirectory default.
+ name ifNil: [ ^nil ].
- result := StandardFileMenu newFile.
- result ifNil: [ ^nil ].
- name := (result directory fullNameFor: result name).
  (archive canWriteToFileNamed: name)
  ifFalse: [ self inform: name, ' is used by one or more members
  in your archive, and cannot be overwritten.
  Try extracting to another file name'.
  ^nil ].
  self selectedMember extractToFileNamed: name.
  ^name!

Item was changed:
  ----- Method: ArchiveViewer>>writePrependingFile (in category 'archive operations') -----
  writePrependingFile
  | result name prependedName |
  self canSaveArchive ifFalse: [ ^self ].
+ name := FileSaverDialog openOn: FileDirectory default initialFilename: 'archive.zip' label: 'Choose location to save archive' translated.
+ name ifNil: [ ^self ].
- result := (StandardFileMenu newFileMenu: FileDirectory default)
- startUpWithCaption: 'Destination Zip File Name:' translated.
- result ifNil: [ ^self ].
- name := result directory fullNameFor: result name.
  (archive canWriteToFileNamed: name)
  ifFalse: [ self inform: name, ' is used by one or more members
  in your archive, and cannot be overwritten.
  Try writing to another file name' translated.
  ^self ].
+ result := FileSaverDialog openOn: FileDirectory default initialFilename: 'archive.zip' label: 'Prepended File:' translated.
- result := (StandardFileMenu oldFileMenu: FileDirectory default)
- startUpWithCaption: 'Prepended File:' translated.
  result ifNil: [ ^self ].
  prependedName := result directory fullNameFor: result name.
  [ archive writeToFileNamed: name prependingFileNamed: prependedName ]
  on: Error
  do: [ :ex | self inform: ex description. ].
  self changed: #memberList "in case CRC's and compressed sizes got set"!

Item was changed:
  ----- Method: ChangeSorter>>fileIntoNewChangeSet (in category 'changeSet menu') -----
  fileIntoNewChangeSet
  "Obtain a file designation from the user, and file its contents into a  
  new change set whose name is a function of the filename. Show the  
  new set and leave the current changeSet unaltered."
+ | aNewChangeSet stream fileName |
- | aNewChangeSet stream |
  self okToChange
  ifFalse: [^ self].
  ChangeSet promptForDefaultChangeSetDirectoryIfNecessary.
+ fileName := (FileChooserDialog openOn: ChangeSet defaultChangeSetDirectory) ifNil: [^nil].
+ stream := FileStream oldFileNamed: fileName.
+ stream ifNil: [^ self].
+
- stream := StandardFileMenu oldFileStreamFrom: ChangeSet defaultChangeSetDirectory.
- stream
- ifNil: [^ self].
  aNewChangeSet := self class
  newChangesFromStream: stream
+ named: (FileDirectory localNameFor:fileName).
- named: (FileDirectory localNameFor: stream name).
  aNewChangeSet
  ifNotNil: [self showChangeSet: aNewChangeSet]!

Item was changed:
  ----- Method: FileList class>>openFileDirectly (in category 'instance creation') -----
  openFileDirectly
 
+ | fileName |
+ (fileName :=FileChooserDialog openOn: FileDirectory default) ifNotNil:
+ [self openEditorOn: (FileStream readOnlyFileNamed: fileName) editString: nil]!
- | aResult |
- (aResult := StandardFileMenu oldFile) ifNotNil:
- [self openEditorOn: (aResult directory readOnlyFileNamed: aResult name) editString: nil]!