Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

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

Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

Levente Uzonyi-2
 
On Fri, 17 Dec 2010, Javier Pimás wrote:

> OK, if I'm correct the 3449 issue is fixed and integrated now. So how do we
> solve this one? Because the method lays on VMMakerTool's code, for squeak.
> Maybe we can add a line to ConfigurationOfVMMaker>>#fixVMMakerForPharo like
> this:
>
> (Smalltalk at: #VMMakerTool) compile:
>    'loadConfig
> | fileResult file |
> fileResult := UIManager default chooseFileMatching: #(''*.config'') label:
> ''Select
> VMMaker configuration...''.
> fileResult
> ifNotNil: [file := fileResult.
> [vmMaker := VMMaker forConfigurationFile: file.
> vmMaker logger: logger.
> vmMaker platformDirectory]
> on: Error
> do: [self inform: ''Possible problem with path settings or platform
> name?''].
> self updateAllViews]'
>
>
> It's a bit of a dirty hack, maybe there's a cleaner way. What do you think?
No need to do dirty hacks, just communicate your needs properly. Ask David
to update the method. Squeak (since 3.9) also implements UIManager >>
#chooseFileMatching:label:. Note that the name of this method is a bit
misleading. The first argument is a list of "file extensions", not a list
of patterns. So this should work in both Squeak and Pharo:

fileResult := UIManager default
  chooseFileMatching: #('config')
  label: 'Select VMMaker configuration...'.

Since fileResult is a string that contains the full path, the variable
"file" is not necessary anymore.


Levente

>
> Regards,
>        Javier.
>
> On Fri, Dec 17, 2010 at 8:35 AM, Gary Chambers <[hidden email]>wrote:
>
>> It seems the implementation in MorphicUIManager uses the patterns
>> as extensions.
>>
>> So
>> fileResult := UIManager default chooseFileMatching: #('config') label:
>> 'Select
>> VMMaker configuration...'.
>>
>> would work.
>>
>> However, that misses the meaning of patterns.
>> I've raised issue http://code.google.com/p/pharo/issues/detail?id=3449with change set attached...
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: <[hidden email]>
>> To: <[hidden email]>
>> Sent: Friday, December 17, 2010 4:21 AM
>> Subject: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config
>> buttondoesn't work
>>
>>
>>
>>  Status: New
>>> Owner: ----
>>>
>>> New issue 3446 by elpochodelagente: VMMakerTool load config button doesn't
>>> work
>>> http://code.google.com/p/pharo/issues/detail?id=3446
>>>
>>> Pharo image: dev 1.1.1
>>> Pharo core version: Pharo-1.1-11411
>>> Virtual machine used: custom linux, allmost latest VMMaker, classic (not
>>> cog)
>>> Class browser used if applicable:  OBSystemBrowserAdaptor
>>>
>>> Steps to reproduce:
>>> 1. Load VMMaker with
>>> 2. Open the VMMakerTool with: "VMMakerTool openInWorld"
>>> 3. Push load config button, you get an error message
>>>
>>> The problem is that VMMaker tool makes use of StandardFileDialog, which
>>> isn't present in Pharo anymore. The method that raises the error is
>>>
>>> VMMakerTool>>#loadConfig
>>>    | fileResult file |
>>>    fileResult := (StandardFileMenu oldFileMenu: FileDirectory default
>>> withPattern: '*.config') startUpWithCaption: 'Select VMMaker
>>> configuration...'.
>>>    fileResult
>>>        ifNotNil: [
>>>            file := fileResult directory fullNameFor: fileResult name.
>>>            [
>>>                vmMaker := VMMaker forConfigurationFile: file.
>>>                vmMaker logger: logger.
>>>                vmMaker platformDirectory
>>>            ]
>>>            on: Error
>>>            do: [self inform: 'Possible problem with path settings or
>>> platform name?'].
>>>            self updateAllViews]
>>>
>>>
>>> Changing
>>>
>>> fileResult := (StandardFileMenu oldFileMenu: FileDirectory default
>>> withPattern: '*.config') startUpWithCaption: 'Select VMMaker
>>> configuration...'.
>>>
>>> for
>>>
>>> fileResult := UIManager default chooseFileMatching: nil label: 'Select
>>> VMMaker configuration...'.
>>>
>>> and
>>>
>>> file := fileResult directory fullNameFor: fileResult name.
>>>
>>> for
>>>
>>> file := fileResult
>>>
>>> Fixes it almost completely. It would be better to use chooseFileMatching:
>>> #('*.config') but it didn't work well.
>>>
>>>
>>>
>>>
>>
>>
>
>
> --
> Javier Pimás
> Ciudad de Buenos Aires
>
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

melkyades
 


2010/12/17 Levente Uzonyi <[hidden email]>
 
On Fri, 17 Dec 2010, Javier Pimás wrote:

OK, if I'm correct the 3449 issue is fixed and integrated now. So how do we
solve this one? Because the method lays on VMMakerTool's code, for squeak.
Maybe we can add a line to ConfigurationOfVMMaker>>#fixVMMakerForPharo like
this:

(Smalltalk at: #VMMakerTool) compile:
  'loadConfig
| fileResult file |
fileResult := UIManager default chooseFileMatching: #(''*.config'') label:
''Select
VMMaker configuration...''.
fileResult
ifNotNil: [file := fileResult.
[vmMaker := VMMaker forConfigurationFile: file.
vmMaker logger: logger.
vmMaker platformDirectory]
on: Error
do: [self inform: ''Possible problem with path settings or platform
name?''].
self updateAllViews]'


It's a bit of a dirty hack, maybe there's a cleaner way. What do you think?

No need to do dirty hacks, just communicate your needs properly. Ask David to update the method. Squeak (since 3.9) also implements UIManager >> #chooseFileMatching:label:. Note that the name of this method is a bit misleading. The first argument is a list of "file extensions", not a list of patterns. So this should work in both Squeak and Pharo:

fileResult := UIManager default
       chooseFileMatching: #('config')
       label: 'Select VMMaker configuration...'.

Since fileResult is a string that contains the full path, the variable "file" is not necessary anymore.


Excelent! Many thanks for the redirect!

javier

 

Levente


Regards,
      Javier.

On Fri, Dec 17, 2010 at 8:35 AM, Gary Chambers <[hidden email]>wrote:

It seems the implementation in MorphicUIManager uses the patterns
as extensions.

So
fileResult := UIManager default chooseFileMatching: #('config') label:
'Select
VMMaker configuration...'.

would work.

However, that misses the meaning of patterns.
I've raised issue http://code.google.com/p/pharo/issues/detail?id=3449with change set attached...

Regards, Gary

----- Original Message ----- From: <[hidden email]>
To: <[hidden email]>
Sent: Friday, December 17, 2010 4:21 AM
Subject: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config
buttondoesn't work



 Status: New
Owner: ----

New issue 3446 by elpochodelagente: VMMakerTool load config button doesn't
work
http://code.google.com/p/pharo/issues/detail?id=3446

Pharo image: dev 1.1.1
Pharo core version: Pharo-1.1-11411
Virtual machine used: custom linux, allmost latest VMMaker, classic (not
cog)
Class browser used if applicable:  OBSystemBrowserAdaptor

Steps to reproduce:
1. Load VMMaker with
2. Open the VMMakerTool with: "VMMakerTool openInWorld"
3. Push load config button, you get an error message

The problem is that VMMaker tool makes use of StandardFileDialog, which
isn't present in Pharo anymore. The method that raises the error is

VMMakerTool>>#loadConfig
  | fileResult file |
  fileResult := (StandardFileMenu oldFileMenu: FileDirectory default
withPattern: '*.config') startUpWithCaption: 'Select VMMaker
configuration...'.
  fileResult
      ifNotNil: [
          file := fileResult directory fullNameFor: fileResult name.
          [
              vmMaker := VMMaker forConfigurationFile: file.
              vmMaker logger: logger.
              vmMaker platformDirectory
          ]
          on: Error
          do: [self inform: 'Possible problem with path settings or
platform name?'].
          self updateAllViews]


Changing

fileResult := (StandardFileMenu oldFileMenu: FileDirectory default
withPattern: '*.config') startUpWithCaption: 'Select VMMaker
configuration...'.

for

fileResult := UIManager default chooseFileMatching: nil label: 'Select
VMMaker configuration...'.

and

file := fileResult directory fullNameFor: fileResult name.

for

file := fileResult

Fixes it almost completely. It would be better to use chooseFileMatching:
#('*.config') but it didn't work well.








--
Javier Pimás
Ciudad de Buenos Aires




--
Javier Pimás
Ciudad de Buenos Aires
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

David T. Lewis
In reply to this post by Levente Uzonyi-2
 
On Fri, Dec 17, 2010 at 06:39:33PM +0100, Levente Uzonyi wrote:
>  
> On Fri, 17 Dec 2010, Javier Pim?s wrote:
>
> >OK, if I'm correct the 3449 issue is fixed and integrated now. So how do we
> >solve this one? Because the method lays on VMMakerTool's code, for squeak.
> >Maybe we can add a line to ConfigurationOfVMMaker>>#fixVMMakerForPharo like
> >this:

<snip>

> >It's a bit of a dirty hack, maybe there's a cleaner way. What do you think?
>
> No need to do dirty hacks, just communicate your needs properly. Ask David
> to update the method. Squeak (since 3.9) also implements UIManager >>
> #chooseFileMatching:label:. Note that the name of this method is a bit
> misleading. The first argument is a list of "file extensions", not a list
> of patterns. So this should work in both Squeak and Pharo:
>
> fileResult := UIManager default
> chooseFileMatching: #('config')
> label: 'Select VMMaker configuration...'.
>
> Since fileResult is a string that contains the full path, the variable
> "file" is not necessary anymore.

This is in VMMaker-dtl.211.

The #saveConfig method had a similar problem, so I changed it to
use UIManager>>request:initialAnswer:

Both methods should work on Squeak/Pharo now.

Thanks,
Dave

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

Levente Uzonyi-2
 
On Fri, 17 Dec 2010, David T. Lewis wrote:

>
> On Fri, Dec 17, 2010 at 06:39:33PM +0100, Levente Uzonyi wrote:
>>
>> On Fri, 17 Dec 2010, Javier Pim?s wrote:
>>
>>> OK, if I'm correct the 3449 issue is fixed and integrated now. So how do we
>>> solve this one? Because the method lays on VMMakerTool's code, for squeak.
>>> Maybe we can add a line to ConfigurationOfVMMaker>>#fixVMMakerForPharo like
>>> this:
>
> <snip>
>
>>> It's a bit of a dirty hack, maybe there's a cleaner way. What do you think?
>>
>> No need to do dirty hacks, just communicate your needs properly. Ask David
>> to update the method. Squeak (since 3.9) also implements UIManager >>
>> #chooseFileMatching:label:. Note that the name of this method is a bit
>> misleading. The first argument is a list of "file extensions", not a list
>> of patterns. So this should work in both Squeak and Pharo:
>>
>> fileResult := UIManager default
>> chooseFileMatching: #('config')
>> label: 'Select VMMaker configuration...'.
>>
>> Since fileResult is a string that contains the full path, the variable
>> "file" is not necessary anymore.
>
> This is in VMMaker-dtl.211.
>
> The #saveConfig method had a similar problem, so I changed it to
> use UIManager>>request:initialAnswer:
>
> Both methods should work on Squeak/Pharo now.

Thanks.


Levente

>
> Thanks,
> Dave
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

David T. Lewis
 
On Sat, Dec 18, 2010 at 05:49:25AM +0100, Levente Uzonyi wrote:

>
> On Fri, 17 Dec 2010, David T. Lewis wrote:
>
> >
> >On Fri, Dec 17, 2010 at 06:39:33PM +0100, Levente Uzonyi wrote:
> >>
> >>On Fri, 17 Dec 2010, Javier Pim?s wrote:
> >>
> >>>OK, if I'm correct the 3449 issue is fixed and integrated now. So how do
> >>>we
> >>>solve this one? Because the method lays on VMMakerTool's code, for
> >>>squeak.
> >>>Maybe we can add a line to ConfigurationOfVMMaker>>#fixVMMakerForPharo
> >>>like
> >>>this:
> >
> ><snip>
> >
> >>>It's a bit of a dirty hack, maybe there's a cleaner way. What do you
> >>>think?
> >>
> >>No need to do dirty hacks, just communicate your needs properly. Ask David
> >>to update the method. Squeak (since 3.9) also implements UIManager >>
> >>#chooseFileMatching:label:. Note that the name of this method is a bit
> >>misleading. The first argument is a list of "file extensions", not a list
> >>of patterns. So this should work in both Squeak and Pharo:
> >>
> >>fileResult := UIManager default
> >> chooseFileMatching: #('config')
> >> label: 'Select VMMaker configuration...'.
> >>
> >>Since fileResult is a string that contains the full path, the variable
> >>"file" is not necessary anymore.
> >
> >This is in VMMaker-dtl.211.
> >
> >The #saveConfig method had a similar problem, so I changed it to
> >use UIManager>>request:initialAnswer:
> >
> >Both methods should work on Squeak/Pharo now.
>
> Thanks.

Levente,

Thanks for providing the fix. I also added you as a developer on
SqueakSource/VMMaker so will be able to commit directly if you like.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Issue 3446 in pharo: VMMakerTool load config buttondoesn't work

Levente Uzonyi-2
 
On Sat, 18 Dec 2010, David T. Lewis wrote:

>
> On Sat, Dec 18, 2010 at 05:49:25AM +0100, Levente Uzonyi wrote:
>>
>> On Fri, 17 Dec 2010, David T. Lewis wrote:
>>
>>>
>>> On Fri, Dec 17, 2010 at 06:39:33PM +0100, Levente Uzonyi wrote:
>>>>
>>>> On Fri, 17 Dec 2010, Javier Pim?s wrote:
>>>>
>>>>> OK, if I'm correct the 3449 issue is fixed and integrated now. So how do
>>>>> we
>>>>> solve this one? Because the method lays on VMMakerTool's code, for
>>>>> squeak.
>>>>> Maybe we can add a line to ConfigurationOfVMMaker>>#fixVMMakerForPharo
>>>>> like
>>>>> this:
>>>
>>> <snip>
>>>
>>>>> It's a bit of a dirty hack, maybe there's a cleaner way. What do you
>>>>> think?
>>>>
>>>> No need to do dirty hacks, just communicate your needs properly. Ask David
>>>> to update the method. Squeak (since 3.9) also implements UIManager >>
>>>> #chooseFileMatching:label:. Note that the name of this method is a bit
>>>> misleading. The first argument is a list of "file extensions", not a list
>>>> of patterns. So this should work in both Squeak and Pharo:
>>>>
>>>> fileResult := UIManager default
>>>> chooseFileMatching: #('config')
>>>> label: 'Select VMMaker configuration...'.
>>>>
>>>> Since fileResult is a string that contains the full path, the variable
>>>> "file" is not necessary anymore.
>>>
>>> This is in VMMaker-dtl.211.
>>>
>>> The #saveConfig method had a similar problem, so I changed it to
>>> use UIManager>>request:initialAnswer:
>>>
>>> Both methods should work on Squeak/Pharo now.
>>
>> Thanks.
>
> Levente,
>
> Thanks for providing the fix. I also added you as a developer on
> SqueakSource/VMMaker so will be able to commit directly if you like.

Thanks David.


Levente

>
> Dave
>
>