# HG changeset patch # User sr # Date 1540282843 -7200 # Node ID 861c9acf54ed27ad20b3be0a762f0def5830ee74 # Parent b9821260d1abdb066a3991753c3892b450172f7a #FEATURE by sr call new implementation of native file dialog class: ImageEditor changed: #doLoadFromFile #doSaveImageFileAs diff -r b9821260d1ab -r 861c9acf54ed ImageEditor.st --- a/ImageEditor.st Sun Oct 14 14:50:43 2018 +0200 +++ b/ImageEditor.st Tue Oct 23 10:20:43 2018 +0200 @@ -9219,20 +9219,23 @@ (UserPreferences current useNativeFileDialog and:[Screen current isWindowsPlatform]) ifTrue:[ self withWaitCursorDo:[ + file isNil ifTrue:[ + file := LastDirectory. + file notNil ifTrue:[ + file := file asFilename / 'image.png'. + ]. + ]. + file := Screen current - nativeFileDialogFor:(self window topView id) - save:false - title:title - inDirectory:(file notNil ifTrue:[file asFilename directory pathName] ifFalse:[LastDirectory]) - initialAnswer:(file notNil ifTrue:[file asFilename baseName] ifFalse:['image.png']) - "/ flags:#( ENABLESIZING "HIDEREADONLY" EXPLORER NOCHANGEDIR) - filter: - { - { (resources string:'Image Files') . '*.tif;*.png;*.gif;*.bmp;*.jpg' } . - { (resources string:'All Files') . '*.*' } - } - extension:nil - "blocking:false". + nativeFileDialogWithTitle:title + defaultFilename:file + owningTopView:self window topView + filter:{ + {(resources string:'Image Files'). '*.tif;*.png;*.gif;*.bmp;*.jpg'}. + {(resources string:'All Files'). '*.*'} + } + filterIndex:nil + doSave:false. ]. ] ifFalse:[ filters := FileSelectionBrowser loadImageFileNameFilters. @@ -9255,6 +9258,7 @@ ] "Modified: / 16-02-2017 / 10:53:41 / cg" + "Modified: / 23-10-2018 / 10:02:51 / sr" ! doLoadFromURL @@ -9558,21 +9562,23 @@ (UserPreferences current useNativeFileDialog and:[Screen current isWindowsPlatform]) ifTrue:[ self withWaitCursorDo:[ - "/ windows only + file isNil ifTrue:[ + file := LastDirectory. + file notNil ifTrue:[ + file := file asFilename / 'image.png'. + ]. + ]. + file := Screen current - nativeFileDialogFor:(self window topView id) - save:true - title:(resources string:'Save Image in File') - inDirectory:(file notNil ifTrue:[file asFilename directory pathName] ifFalse:[LastDirectory]) - initialAnswer:(file notNil ifTrue:[file asFilename baseName] ifFalse:['image.png']) - "/ flags:#( ENABLESIZING "HIDEREADONLY" EXPLORER NOCHANGEDIR) - filter: - { - { (resources string:'Image Files') . '*.tif;*.png;*.gif;*.bmp' } . - { (resources string:'All Files') . '*.*' } - } - extension:nil - "blocking:false". + nativeFileDialogWithTitle:(resources string:'Save Image in File') + defaultFilename:file + owningTopView:self window topView + filter:{ + {(resources string:'Image Files'). '*.tif;*.png;*.gif;*.bmp'}. + {(resources string:'All Files'). '*.*'} + } + filterIndex:nil + doSave:true. ]. ] ifFalse:[ img fileName isNil ifTrue:[ @@ -9617,6 +9623,7 @@ ] "Modified: / 27-02-2017 / 01:26:05 / cg" + "Modified: / 23-10-2018 / 10:02:44 / sr" ! doSaveImageMaskFileAs