The Trunk: EToys-tpr.321.mcz

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

The Trunk: EToys-tpr.321.mcz

commits-2
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tpr.321.mcz

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

Name: EToys-tpr.321
Author: tpr
Time: 6 March 2018, 12:47:26.51527 pm
UUID: 082ac20c-c54a-4c29-b5a1-af5f91ca4418
Ancestors: EToys-dtl.320

Change CrosticPanel & FileInput to use the new file dialogues instead of the nasty old StandardFileMenu.

Submitted to inbox because EToys is not my world and it may be important to others to do sometihng different.

=============== Diff against EToys-dtl.320 ===============

Item was changed:
  ----- Method: CrosticPanel>>openFile (in category 'menu') -----
  openFile
+ | fileName crostic file |
+
+ fileName := FileChooserDialog openOn: FileDirectory default suffixList: { 'crostic' } label: 'Select a Crostic file...' translated.
+ fileName ifNil: [^nil].
+
+ file := FileStream readOnlyFileNamed: fileName.
- | stdFileMenuResult crostic file |
- stdFileMenuResult := (StandardFileMenu new pattern: '*.crostic';
- oldFileFrom: FileDirectory default) startUpWithCaption: 'Select a Crostic File...' translated.
- stdFileMenuResult
- ifNil: [^ nil].
- file := stdFileMenuResult directory readOnlyFileNamed: stdFileMenuResult name.
  crostic := CrosticPanel newFromFile: file.
  file close.
  (self isClean
  or: [self confirm: 'Is it OK to discard this crostic?' translated])
  ifTrue: [self world
  addMorphFront: (crostic position: self position).
  self delete]
  ifFalse: [self world addMorphFront: crostic]!

Item was changed:
  ----- Method: FileInput>>browse (in category 'accessing') -----
  browse
+ | fileName |
+ fileName := (FileChooserDialog openOn: self directory) ifNil: [^nil].
- | file |
- file := (StandardFileMenu oldFileFrom: self directory) ifNil: [^nil].
- file directory isNil ifTrue: [^ nil].
 
+ textMorph setText: fileName;
- textMorph setText: (file directory pathName, FileDirectory slash, file name);
  hasUnacceptedEdits: true;
  accept!