Behaviour of the FileDialogWindow (Was: How do I save the contents of a Workspace?)

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

Behaviour of the FileDialogWindow (Was: How do I save the contents of a Workspace?)

George Herolyants-3
2010/1/25 Schwab,Wilhelm K <[hidden email]>:
> Gary,
>
> IMHO, the correct result is the file name.  First, Squeak's streams are, how do I put this nicely...  Second, there are some plaform dependencies re ownership.  Finally, somebody might want to try Nile.
>
> Bill
>

Exactly! Another use case might be when I just don't want to save a
file immediately. So, I agree with Bill, the correct behaviour for the
FileDialogWindow is to return the full file name and let its user do
what it want.

The same for the opening of a file. Maybe even these cases can be
merged into the one.

>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Gary Chambers
> Sent: Monday, January 25, 2010 9:57 AM
> To: [hidden email]
> Subject: Re: [Pharo-project] [newbee] How do I save the contentsofaWorkspace?
>
> Actually rather more complicated than that...
> You'll want the full path I expect, also the correct OK button enablement...
>
> Any reason not to have the FileStream?
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, January 25, 2010 2:50 PM
> Subject: Re: [Pharo-project] [newbee] How do I save the contentsofaWorkspace?
>
>
>> Not at present.
>> Have a look at FileDialogWindow.
>> Perhaps you could add a couple of methods...
>>
>> saveSelectedFile
>> "Answer the name of the selected file or new filename or nil if blank."
>>
>> |d f|
>> d := self selectedFileDirectory ifNil: [^nil].
>> f := self selectedFileName ifNil: [self fileNameText withBlanksTrimmed].
>> ^f ifEmpty: [nil].
>>
>> answerSaveFileName
>> "Set the receiver to answer the selected/entered file name."
>>
>> self actionSelector: #saveSelectedFileName.
>> self changed: #okEnabled
>>
>>
>> Then, to open one...
>>
>> |fd|
>> fd := FileDialogWindow new
>>  title: title;
>>  answerSaveFileName.
>> ^(modalParentMorph openModal: fd) answer
>>
>> Choosing an appropriate modal owner.
>> If you want, you could add the convenience methods to TEasilyThemed
>> also...
>>
>> Regards, Gary
>>
>> ----- Original Message -----
>> From: "George Herolyants" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 25, 2010 12:37 PM
>> Subject: Re: [Pharo-project] [newbee] How do I save the contents
>> ofaWorkspace?
>>
>>
>>> 2010/1/25 Gary Chambers <[hidden email]>:
>>>> The base UIManager code has no accessors for file saving, though
>>>> Polymorph does support such a dialog...
>>>>
>>>> Try
>>>>
>>>> UITheme builder fileSave: "Your dialog title here'
>>>
>>> Thanks Gary! But is there a way to force this dialog to return just
>>> file name and not to create a file stream?
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Behaviour of the FileDialogWindow (Was: How do Isave the contents of a Workspace?)

Gary Chambers-4
Added to "wish list" also...
The primary reason for returning streams was to simplify the "end user" code
handling though...
No great problem to support both styles of access.

Perhaps you could describe a set of scenarios for what kind of return(s) you
would like, taking into account the many possible outcomes (path/file does
not exist, require new file, require existing file etc.)

Regards, Gary

----- Original Message -----
From: "George Herolyants" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 26, 2010 8:46 AM
Subject: [Pharo-project] Behaviour of the FileDialogWindow (Was: How do
Isave the contents of a Workspace?)


> 2010/1/25 Schwab,Wilhelm K <[hidden email]>:
>> Gary,
>>
>> IMHO, the correct result is the file name.  First, Squeak's streams are,
>> how do I put this nicely...  Second, there are some plaform dependencies
>> re ownership.  Finally, somebody might want to try Nile.
>>
>> Bill
>>
>
> Exactly! Another use case might be when I just don't want to save a
> file immediately. So, I agree with Bill, the correct behaviour for the
> FileDialogWindow is to return the full file name and let its user do
> what it want.
>
> The same for the opening of a file. Maybe even these cases can be
> merged into the one.
>
>>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Gary
>> Chambers
>> Sent: Monday, January 25, 2010 9:57 AM
>> To: [hidden email]
>> Subject: Re: [Pharo-project] [newbee] How do I save the
>> contentsofaWorkspace?
>>
>> Actually rather more complicated than that...
>> You'll want the full path I expect, also the correct OK button
>> enablement...
>>
>> Any reason not to have the FileStream?
>>
>> Regards, Gary
>>
>> ----- Original Message -----
>> From: "Gary Chambers" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 25, 2010 2:50 PM
>> Subject: Re: [Pharo-project] [newbee] How do I save the
>> contentsofaWorkspace?
>>
>>
>>> Not at present.
>>> Have a look at FileDialogWindow.
>>> Perhaps you could add a couple of methods...
>>>
>>> saveSelectedFile
>>> "Answer the name of the selected file or new filename or nil if blank."
>>>
>>> |d f|
>>> d := self selectedFileDirectory ifNil: [^nil].
>>> f := self selectedFileName ifNil: [self fileNameText withBlanksTrimmed].
>>> ^f ifEmpty: [nil].
>>>
>>> answerSaveFileName
>>> "Set the receiver to answer the selected/entered file name."
>>>
>>> self actionSelector: #saveSelectedFileName.
>>> self changed: #okEnabled
>>>
>>>
>>> Then, to open one...
>>>
>>> |fd|
>>> fd := FileDialogWindow new
>>>  title: title;
>>>  answerSaveFileName.
>>> ^(modalParentMorph openModal: fd) answer
>>>
>>> Choosing an appropriate modal owner.
>>> If you want, you could add the convenience methods to TEasilyThemed
>>> also...
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message -----
>>> From: "George Herolyants" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 25, 2010 12:37 PM
>>> Subject: Re: [Pharo-project] [newbee] How do I save the contents
>>> ofaWorkspace?
>>>
>>>
>>>> 2010/1/25 Gary Chambers <[hidden email]>:
>>>>> The base UIManager code has no accessors for file saving, though
>>>>> Polymorph does support such a dialog...
>>>>>
>>>>> Try
>>>>>
>>>>> UITheme builder fileSave: "Your dialog title here'
>>>>
>>>> Thanks Gary! But is there a way to force this dialog to return just
>>>> file name and not to create a file stream?
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project 


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Behaviour of the FileDialogWindow (Was: How do Isave the contents of a Workspace?)

Mariano Martinez Peck


Perhaps you could describe a set of scenarios for what kind of return(s) you
would like, taking into account the many possible outcomes (path/file does
not exist, require new file, require existing file etc.)

Someone here is shouting "Unit Tests!!!!"
 

Regards, Gary

----- Original Message -----
From: "George Herolyants" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 26, 2010 8:46 AM
Subject: [Pharo-project] Behaviour of the FileDialogWindow (Was: How do
Isave the contents of a Workspace?)


> 2010/1/25 Schwab,Wilhelm K <[hidden email]>:
>> Gary,
>>
>> IMHO, the correct result is the file name.  First, Squeak's streams are,
>> how do I put this nicely...  Second, there are some plaform dependencies
>> re ownership.  Finally, somebody might want to try Nile.
>>
>> Bill
>>
>
> Exactly! Another use case might be when I just don't want to save a
> file immediately. So, I agree with Bill, the correct behaviour for the
> FileDialogWindow is to return the full file name and let its user do
> what it want.
>
> The same for the opening of a file. Maybe even these cases can be
> merged into the one.
>
>>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Gary
>> Chambers
>> Sent: Monday, January 25, 2010 9:57 AM
>> To: [hidden email]
>> Subject: Re: [Pharo-project] [newbee] How do I save the
>> contentsofaWorkspace?
>>
>> Actually rather more complicated than that...
>> You'll want the full path I expect, also the correct OK button
>> enablement...
>>
>> Any reason not to have the FileStream?
>>
>> Regards, Gary
>>
>> ----- Original Message -----
>> From: "Gary Chambers" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 25, 2010 2:50 PM
>> Subject: Re: [Pharo-project] [newbee] How do I save the
>> contentsofaWorkspace?
>>
>>
>>> Not at present.
>>> Have a look at FileDialogWindow.
>>> Perhaps you could add a couple of methods...
>>>
>>> saveSelectedFile
>>> "Answer the name of the selected file or new filename or nil if blank."
>>>
>>> |d f|
>>> d := self selectedFileDirectory ifNil: [^nil].
>>> f := self selectedFileName ifNil: [self fileNameText withBlanksTrimmed].
>>> ^f ifEmpty: [nil].
>>>
>>> answerSaveFileName
>>> "Set the receiver to answer the selected/entered file name."
>>>
>>> self actionSelector: #saveSelectedFileName.
>>> self changed: #okEnabled
>>>
>>>
>>> Then, to open one...
>>>
>>> |fd|
>>> fd := FileDialogWindow new
>>>  title: title;
>>>  answerSaveFileName.
>>> ^(modalParentMorph openModal: fd) answer
>>>
>>> Choosing an appropriate modal owner.
>>> If you want, you could add the convenience methods to TEasilyThemed
>>> also...
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message -----
>>> From: "George Herolyants" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 25, 2010 12:37 PM
>>> Subject: Re: [Pharo-project] [newbee] How do I save the contents
>>> ofaWorkspace?
>>>
>>>
>>>> 2010/1/25 Gary Chambers <[hidden email]>:
>>>>> The base UIManager code has no accessors for file saving, though
>>>>> Polymorph does support such a dialog...
>>>>>
>>>>> Try
>>>>>
>>>>> UITheme builder fileSave: "Your dialog title here'
>>>>
>>>> Thanks Gary! But is there a way to force this dialog to return just
>>>> file name and not to create a file stream?
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Behaviour of the FileDialogWindow (Was: How doIsave the contents of a Workspace?)

Gary Chambers-4
Feel free... we have a backlog of UnitTest stuff to do... though not covering "UI" things yet, in general (would be nice to have a UI driver for tests...)

Regards, Gary
----- Original Message -----
Sent: Thursday, January 28, 2010 4:26 PM
Subject: Re: [Pharo-project] Behaviour of the FileDialogWindow (Was: How doIsave the contents of a Workspace?)



Perhaps you could describe a set of scenarios for what kind of return(s) you
would like, taking into account the many possible outcomes (path/file does
not exist, require new file, require existing file etc.)

Someone here is shouting "Unit Tests!!!!"
 

Regards, Gary

----- Original Message -----
From: "George Herolyants" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 26, 2010 8:46 AM
Subject: [Pharo-project] Behaviour of the FileDialogWindow (Was: How do
Isave the contents of a Workspace?)


> 2010/1/25 Schwab,Wilhelm K <[hidden email]>:
>> Gary,
>>
>> IMHO, the correct result is the file name.  First, Squeak's streams are,
>> how do I put this nicely...  Second, there are some plaform dependencies
>> re ownership.  Finally, somebody might want to try Nile.
>>
>> Bill
>>
>
> Exactly! Another use case might be when I just don't want to save a
> file immediately. So, I agree with Bill, the correct behaviour for the
> FileDialogWindow is to return the full file name and let its user do
> what it want.
>
> The same for the opening of a file. Maybe even these cases can be
> merged into the one.
>
>>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Gary
>> Chambers
>> Sent: Monday, January 25, 2010 9:57 AM
>> To: [hidden email]
>> Subject: Re: [Pharo-project] [newbee] How do I save the
>> contentsofaWorkspace?
>>
>> Actually rather more complicated than that...
>> You'll want the full path I expect, also the correct OK button
>> enablement...
>>
>> Any reason not to have the FileStream?
>>
>> Regards, Gary
>>
>> ----- Original Message -----
>> From: "Gary Chambers" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 25, 2010 2:50 PM
>> Subject: Re: [Pharo-project] [newbee] How do I save the
>> contentsofaWorkspace?
>>
>>
>>> Not at present.
>>> Have a look at FileDialogWindow.
>>> Perhaps you could add a couple of methods...
>>>
>>> saveSelectedFile
>>> "Answer the name of the selected file or new filename or nil if blank."
>>>
>>> |d f|
>>> d := self selectedFileDirectory ifNil: [^nil].
>>> f := self selectedFileName ifNil: [self fileNameText withBlanksTrimmed].
>>> ^f ifEmpty: [nil].
>>>
>>> answerSaveFileName
>>> "Set the receiver to answer the selected/entered file name."
>>>
>>> self actionSelector: #saveSelectedFileName.
>>> self changed: #okEnabled
>>>
>>>
>>> Then, to open one...
>>>
>>> |fd|
>>> fd := FileDialogWindow new
>>>  title: title;
>>>  answerSaveFileName.
>>> ^(modalParentMorph openModal: fd) answer
>>>
>>> Choosing an appropriate modal owner.
>>> If you want, you could add the convenience methods to TEasilyThemed
>>> also...
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message -----
>>> From: "George Herolyants" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 25, 2010 12:37 PM
>>> Subject: Re: [Pharo-project] [newbee] How do I save the contents
>>> ofaWorkspace?
>>>
>>>
>>>> 2010/1/25 Gary Chambers <[hidden email]>:
>>>>> The base UIManager code has no accessors for file saving, though
>>>>> Polymorph does support such a dialog...
>>>>>
>>>>> Try
>>>>>
>>>>> UITheme builder fileSave: "Your dialog title here'
>>>>
>>>> Thanks Gary! But is there a way to force this dialog to return just
>>>> file name and not to create a file stream?
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project