[newbee] How do I save the contents of a Workspace?

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

Re: [Pharo-project] [newbee] How do I save the contents of a Workspace?

George Herolyants-3
2009/12/17 Stéphane Ducasse <[hidden email]>:
> If a brave soul send the code we will just add it.
> No doubt. If this is useful it does not hurt us.

So I did it :). See on the tracker
http://code.google.com/p/pharo/issues/detail?id=1859.

I started from the changes, mentioned here by Keith Hodges, but it
turns out that I used them for inspiration almost :) (Thanks Keith!).
The result is completely different from what you have now in Squeak.
You have now association with the file and you don't have to enter
file name every time you want to save file as you do in Squeak.
And as someone suggested here the default extension is .ws.

I hope it will be useful.

Cheers,
George

_______________________________________________
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: [Pharo-project] [newbee] How do I save the contents of a Workspace?

Schwab,Wilhelm K
Thanks for doing this!  How did you modify the menu?  I have *no* clue how to do that.

Two comments, the first horribly pedantic.  The prompt for the file name reads "Enter file name to save the workspace to" - we have no shortage of dangling prepositions.  "Ener file name" would be preferable.  More substantively, it does not prompt for a directory.  I agree that the image directory is the most likely default, but Pinesoft probably has given us a suitable file dialog, and if not, we should identify the omission.

Bill


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of George Herolyants
Sent: Thursday, January 21, 2010 11:07 AM
To: [hidden email]
Subject: Re: [Pharo-project] [newbee] How do I save the contents of a Workspace?

2009/12/17 Stéphane Ducasse <[hidden email]>:
> If a brave soul send the code we will just add it.
> No doubt. If this is useful it does not hurt us.

So I did it :). See on the tracker
http://code.google.com/p/pharo/issues/detail?id=1859.

I started from the changes, mentioned here by Keith Hodges, but it turns out that I used them for inspiration almost :) (Thanks Keith!).
The result is completely different from what you have now in Squeak.
You have now association with the file and you don't have to enter file name every time you want to save file as you do in Squeak.
And as someone suggested here the default extension is .ws.

I hope it will be useful.

Cheers,
George

_______________________________________________
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: [Pharo-project] [newbee] How do I save the contents of a Workspace?

Mariano Martinez Peck
Cool George! Thanks! 

On Thu, Jan 21, 2010 at 5:47 PM, Schwab,Wilhelm K <[hidden email]> wrote:
Thanks for doing this!  How did you modify the menu?  I have *no* clue how to do that.

Two comments, the first horribly pedantic.  The prompt for the file name reads "Enter file name to save the workspace to" - we have no shortage of dangling prepositions.  "Ener file name" would be preferable.  More substantively, it does not prompt for a directory.  I agree that the image directory is the most likely default, but Pinesoft probably has given us a suitable file dialog, and if not, we should identify the omission.

Bill


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of George Herolyants
Sent: Thursday, January 21, 2010 11:07 AM
To: [hidden email]
Subject: Re: [Pharo-project] [newbee] How do I save the contents of a Workspace?

2009/12/17 Stéphane Ducasse <[hidden email]>:
> If a brave soul send the code we will just add it.
> No doubt. If this is useful it does not hurt us.

So I did it :). See on the tracker
http://code.google.com/p/pharo/issues/detail?id=1859.

I started from the changes, mentioned here by Keith Hodges, but it turns out that I used them for inspiration almost :) (Thanks Keith!).
The result is completely different from what you have now in Squeak.
You have now association with the file and you don't have to enter file name every time you want to save file as you do in Squeak.
And as someone suggested here the default extension is .ws.

I hope it will be useful.

Cheers,
George

_______________________________________________
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: [Pharo-project] [newbee] How do I save the contents of a Workspace?

George Herolyants-3
In reply to this post by Schwab,Wilhelm K
Bill, Mariano thanks for the feedback!

2010/1/21 Schwab,Wilhelm K <[hidden email]>:
> Thanks for doing this!  How did you modify the menu?  I have *no* clue how to do that.

There is a method addModelItemsToWindowMenu:, which do the job.

> Two comments, the first horribly pedantic.  The prompt for the file name reads "Enter file name to save the workspace to" - we have no shortage of dangling prepositions.  "Ener file name" would be preferable.

I agree.

> More substantively, it does not prompt for a directory.  I agree that the image directory is the most likely default, but Pinesoft probably > has given us a suitable file dialog, and if not, we should identify the omission.

There is such a dialog. FileDialogWindow. I use it when I ask user for
file name to open. But I didn't find any way to force this dialog to
ask for the new file name. I may be wrong, but it only allows user to
choose from existing file names. Some comments from more experienced
people would be helpful though.


George

_______________________________________________
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: [Pharo-project] [newbee] How do I save the contents of a Workspace?

Schwab,Wilhelm K
George,

Thanks for the tip on the menus.  If FileDialogWindow is indeed missing a way to create a new name, I suspect Gary will eventually add that ability because it is important for end users wanting to save files.

Bill



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of George Herolyants
Sent: Monday, January 25, 2010 6:07 AM
To: [hidden email]
Subject: Re: [Pharo-project] [newbee] How do I save the contents of a Workspace?

Bill, Mariano thanks for the feedback!

2010/1/21 Schwab,Wilhelm K <[hidden email]>:
> Thanks for doing this!  How did you modify the menu?  I have *no* clue how to do that.

There is a method addModelItemsToWindowMenu:, which do the job.

> Two comments, the first horribly pedantic.  The prompt for the file name reads "Enter file name to save the workspace to" - we have no shortage of dangling prepositions.  "Ener file name" would be preferable.

I agree.

> More substantively, it does not prompt for a directory.  I agree that the image directory is the most likely default, but Pinesoft probably > has given us a suitable file dialog, and if not, we should identify the omission.

There is such a dialog. FileDialogWindow. I use it when I ask user for file name to open. But I didn't find any way to force this dialog to ask for the new file name. I may be wrong, but it only allows user to choose from existing file names. Some comments from more experienced people would be helpful though.


George

_______________________________________________
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: [Pharo-project] [newbee] How do I save the contents of aWorkspace?

Gary Chambers-4
In reply to this post by George Herolyants-3
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'

Regards, Gary

----- Original Message -----
From: "George Herolyants" <[hidden email]>
To: <[hidden email]>
Sent: Monday, January 25, 2010 11:07 AM
Subject: Re: [Pharo-project] [newbee] How do I save the contents of
aWorkspace?


Bill, Mariano thanks for the feedback!

2010/1/21 Schwab,Wilhelm K <[hidden email]>:
> Thanks for doing this! How did you modify the menu? I have *no* clue how
> to do that.

There is a method addModelItemsToWindowMenu:, which do the job.

> Two comments, the first horribly pedantic. The prompt for the file name
> reads "Enter file name to save the workspace to" - we have no shortage of
> dangling prepositions. "Ener file name" would be preferable.

I agree.

> More substantively, it does not prompt for a directory. I agree that the
> image directory is the most likely default, but Pinesoft probably > has
> given us a suitable file dialog, and if not, we should identify the
> omission.

There is such a dialog. FileDialogWindow. I use it when I ask user for
file name to open. But I didn't find any way to force this dialog to
ask for the new file name. I may be wrong, but it only allows user to
choose from existing file names. Some comments from more experienced
people would be helpful though.


George

_______________________________________________
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: [Pharo-project] [newbee] How do I save the contents of aWorkspace?

George Herolyants-3
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
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] [newbee] How do I save the contents ofaWorkspace?

Gary Chambers-4
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
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] [newbee] How do I save the contentsofaWorkspace?

Gary Chambers-4
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
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] [newbee] How do I save the contentsofaWorkspace?

Schwab,Wilhelm K
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


-----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
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] [newbee] How do I save the contents of a Workspace?

hernanmd
In reply to this post by Alex Schenkman
Hi Alex,
  Notice that you don't need files to save workspaces, you may like
the ScriptManager package, to install simply evaluate:

Gofer new
        squeaksource: 'DeveloperWorkspace';
        package: 'ScriptManager';
        load.

and open it from Tools -> More -> Script Manager
Cheers,

Hernán

2009/12/16 alesch <[hidden email]>:

>
> I remember I used a menu item in Squeak, but I cannot find in Pharo.
>
> Thanks!
> --
> View this message in context: http://n2.nabble.com/newbee-How-do-I-save-the-contents-of-a-Workspace-tp4174313p4174313.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
123