Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

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

Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

moose-technology
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 941 by [hidden email]: Can't export moose model to MSE  
file from pharo 2.0
http://code.google.com/p/moose-technology/issues/detail?id=941

When calling export to MSE from Moose Panel, exporting to a file doesn't  
work.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

moose-technology

Comment #1 on issue 941 by [hidden email]: Can't export moose model  
to MSE file from pharo 2.0
http://code.google.com/p/moose-technology/issues/detail?id=941

Corrected

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

moose-technology
Updates:
        Status: Fixed
        Labels: Component-MooseCore

Comment #2 on issue 941 by [hidden email]: Can't export moose model  
to MSE file from pharo 2.0
http://code.google.com/p/moose-technology/issues/detail?id=941

(No comment was entered for this change.)

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

moose-technology
Updates:
        Status: Started
        Labels: Milestone-4.8

Comment #3 on issue 941 by [hidden email]: Can't export moose model  
to MSE file from pharo 2.0
http://code.google.com/p/moose-technology/issues/detail?id=941

Wait. Please take the time to explain what was wrong.

How can I reproduce the problem?
What was the fix about?

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

moose-technology

Comment #4 on issue 941 by [hidden email]: Can't export moose model  
to MSE file from pharo 2.0
http://code.google.com/p/moose-technology/issues/detail?id=941

The file picker 'UITheme' returns a 'FileReference' object instead of  
a 'Stream'.
So I have converted the 'FileReference' in a 'Stream' by adding  
the 'writeStream' message.

To reproduce :
- Create a MooseModel
- Open the contextual menu by clicking on the Model on the left of the  
Moose Panel.
- Choose 'Export model to MSE' in the category: 'Import / Export'

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 941 in moose-technology: Can't export moose model to MSE file from pharo 2.0

moose-technology
Updates:
        Status: Fixed

Comment #5 on issue 941 by [hidden email]: Can't export moose model  
to MSE file from pharo 2.0
http://code.google.com/p/moose-technology/issues/detail?id=941

Thanks for the explanations. I reviewed the code, and the fix was not quite  
complete.

Your fix looked like that:

exportToMSE
        <menuItem: 'Export model to MSE' category: 'Import / Export'>
        | stream |
        stream := UITheme builder
                fileSave: 'Your title here'
                extensions: #('mse')
                path: nil.
        stream isNil ifFalse: [
                self exportToMSEStream: stream writeStream.
                stream close.
                Notification signal: 'Save successful!' ]

The problem was that "stream close" raised an exception because stream is a  
FileReference.

I fixed this now and the code looks like:

exportToMSE
        <menuItem: 'Export model to MSE' category: 'Import / Export'>
        | fileReference |
        fileReference := UITheme builder
                fileSave: 'Your title here'
                extensions: #('mse')
                path: nil.
        fileReference isNil ifFalse: [
                fileReference writeStreamDo: [ :stream |
                        self exportToMSEStream: stream.
                        Notification signal: 'Save successful!' ] ]

In any case, thanks for spotting the issue.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev