LogicalFont deepCopy infinite loop with Arial font

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

LogicalFont deepCopy infinite loop with Arial font

Alain Plantec-4
Hi all,
I would like to improve the PreferencesBrowser so that it includes
standard Fonts preferences (see joined snapshot).
It's almost done except that, if a preference font is set to Arial,
clicking on Save button leads to an infinite loop.

To reproduce it, set button font to Arial-12 and
Preferences standardButtonFont deepCopy.

Cheers
alain

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

FontsInPreferences.png (59K) Download Attachment
FTFdeepcopy.png (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: LogicalFont deepCopy infinite loop with Arial font

Alexandre Bergel
Go go Alain!
This is great!

Alexandre


On 11 Feb 2009, at 16:22, Alain Plantec wrote:

> Hi all,
> I would like to improve the PreferencesBrowser so that it includes
> standard Fonts preferences (see joined snapshot).
> It's almost done except that, if a preference font is set to Arial,
> clicking on Save button leads to an infinite loop.
>
> To reproduce it, set button font to Arial-12 and
> Preferences standardButtonFont deepCopy.
>
> Cheers
> alain
> <
> FontsInPreferences
> .png><FTFdeepcopy.png>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
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: LogicalFont deepCopy infinite loop with Arial font

Alain Plantec-4
Alexandre Bergel a écrit :
> Go go Alain!
> This is great!
>
> Alexandre
Thank, I'm sure that you are tired of having to set

fonts each time you take a fresh image :)

> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>  
>> Hi all,
>> I would like to improve the PreferencesBrowser so that it includes
>> standard Fonts preferences (see joined snapshot).
>> It's almost done except that, if a preference font is set to Arial,
>> clicking on Save button leads to an infinite loop.
>>
>> To reproduce it, set button font to Arial-12 and
>> Preferences standardButtonFont deepCopy.
>>
>> Cheers
>> alain
>> <
>> FontsInPreferences
>> .png><FTFdeepcopy.png>_______________________________________________
>> 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: LogicalFont deepCopy infinite loop with Arial font

Gary Chambers-4
In reply to this post by Alain Plantec-4
Saved preferences seems broken in other ways... it seems to lead to odd
obsoletions of the PBPreferenceView subclasses... probably due to the
deepcopy. I'm not sure deep copying is really wanted here, there's probably
a better way.

Regards, Gary

----- Original Message -----
From: "Alain Plantec" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, February 11, 2009 3:22 PM
Subject: [Pharo-project] LogicalFont deepCopy infinite loop with Arial font


> Hi all,
> I would like to improve the PreferencesBrowser so that it includes
> standard Fonts preferences (see joined snapshot).
> It's almost done except that, if a preference font is set to Arial,
> clicking on Save button leads to an infinite loop.
>
> To reproduce it, set button font to Arial-12 and
> Preferences standardButtonFont deepCopy.
>
> Cheers
> alain
>


--------------------------------------------------------------------------------


> _______________________________________________
> 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: LogicalFont deepCopy infinite loop with Arial font

Alexandre Bergel
In reply to this post by Alain Plantec-4
> Thank, I'm sure that you are tired of having to set
>
> fonts each time you take a fresh image :)

More than this :-)
"tired" is a weak word...

Alexandre

>
>
>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>
>>> Hi all,
>>> I would like to improve the PreferencesBrowser so that it includes
>>> standard Fonts preferences (see joined snapshot).
>>> It's almost done except that, if a preference font is set to Arial,
>>> clicking on Save button leads to an infinite loop.
>>>
>>> To reproduce it, set button font to Arial-12 and
>>> Preferences standardButtonFont deepCopy.
>>>
>>> Cheers
>>> alain
>>> <
>>> FontsInPreferences
>>> .png
>>> ><FTFdeepcopy.png>_______________________________________________
>>> 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
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
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: LogicalFont deepCopy infinite loop with Arial font

Alain Plantec-4
In reply to this post by Gary Chambers-4
Gary Chambers a écrit :
> Saved preferences seems broken in other ways... it seems to lead to
> odd obsoletions of the PBPreferenceView subclasses... probably due to
> the deepcopy. I'm not sure deep copying is really wanted here, there's
> probably a better way.
ok, I will try to repare and improve it.
alain

>
> Regards, Gary
>
> ----- Original Message ----- From: "Alain Plantec"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, February 11, 2009 3:22 PM
> Subject: [Pharo-project] LogicalFont deepCopy infinite loop with Arial
> font
>
>
>> Hi all,
>> I would like to improve the PreferencesBrowser so that it includes
>> standard Fonts preferences (see joined snapshot).
>> It's almost done except that, if a preference font is set to Arial,
>> clicking on Save button leads to an infinite loop.
>>
>> To reproduce it, set button font to Arial-12 and
>> Preferences standardButtonFont deepCopy.
>>
>> Cheers
>> alain
>>
>
>
> --------------------------------------------------------------------------------
>
>
>
>> _______________________________________________
>> 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: LogicalFont deepCopy infinite loop with Arial font

Gary Chambers-4
Good luck!

Regards, Gary

----- Original Message -----
From: "Alain Plantec" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, February 11, 2009 5:02 PM
Subject: Re: [Pharo-project] LogicalFont deepCopy infinite loop with Arial
font


Gary Chambers a écrit :
> Saved preferences seems broken in other ways... it seems to lead to
> odd obsoletions of the PBPreferenceView subclasses... probably due to
> the deepcopy. I'm not sure deep copying is really wanted here, there's
> probably a better way.
ok, I will try to repare and improve it.
alain

>
> Regards, Gary
>
> ----- Original Message ----- From: "Alain Plantec"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, February 11, 2009 3:22 PM
> Subject: [Pharo-project] LogicalFont deepCopy infinite loop with Arial
> font
>
>
>> Hi all,
>> I would like to improve the PreferencesBrowser so that it includes
>> standard Fonts preferences (see joined snapshot).
>> It's almost done except that, if a preference font is set to Arial,
>> clicking on Save button leads to an infinite loop.
>>
>> To reproduce it, set button font to Arial-12 and
>> Preferences standardButtonFont deepCopy.
>>
>> Cheers
>> alain
>>
>
>
> --------------------------------------------------------------------------------
>
>
>
>> _______________________________________________
>> 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: LogicalFont deepCopy infinite loop with Arial font

Alain Plantec-2
In reply to this post by Alexandre Bergel
Alexandre Bergel a écrit :

>> Thank, I'm sure that you are tired of having to set
>>
>> fonts each time you take a fresh image :)
>>    
>
> More than this :-)
> "tired" is a weak word...
>
> Alexandre
>  
Hi all,
Here is a changeset with a new version of the PreferencesBrowser.
It is for testing. I can improve it a little bit
(by including display depth, desktop color, gradient color and author
initials)
and provide a slice if it is ok.

I've investigated how preferences are implemented and it seems to me that
current situation is the result of succesives hacks.
I would like to clean out this part of the system.
I will provide a roadmap before any coding.
Can I start working on it ?

Cheers
alain

>>    
>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>
>>>      
>>>> Hi all,
>>>> I would like to improve the PreferencesBrowser so that it includes
>>>> standard Fonts preferences (see joined snapshot).
>>>> It's almost done except that, if a preference font is set to Arial,
>>>> clicking on Save button leads to an infinite loop.
>>>>
>>>> To reproduce it, set button font to Arial-12 and
>>>> Preferences standardButtonFont deepCopy.
>>>>
>>>> Cheers
>>>> alain
>>>> <
>>>> FontsInPreferences
>>>> .png
>>>>        
>>>>> <FTFdeepcopy.png>_______________________________________________
>>>>>          
>>>> 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

PBFont.8.cs.gz (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: LogicalFont deepCopy infinite loop with Arial font

Stéphane Ducasse
Alain

It would be nice to redesign completely preferences.
Did you read the thread
        Re: [Pharo-project] About Preference Flow
        of 4 of Feb ?

Summary here

        Instead of having the current situation ie

        MyTool>>doSomething

                ....
                Preferences useNewDiffTool
                        ifTrue: [kjlhkjhjkh ]
                        ifFalse: [nkjhkjkjhkj]


        and not been able to remove the preferences (or that the preference is
        just a configuration layer).

        I would like to have the preference made that way

                MyTool class>>useNewDiff

                MyTool class>> useOldDiff

                        **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!


                Preferences useNewDiffTool
                        MyTool useNewDiff

I like the idea of lukas to use pragmas.

        Why not use pragmas on accessors of the class side that would be
        picked up by the preference browser? Then all state would be local to
        the affected code.

        Something along these lines:

        MCMonticelloBrowser>>showAdvanceDiffTool: aBoolean
            <preference: 'Show advanced diff tool' group: 'Monticello' type:  
#Boolean>

            advancedDiffTool := aBoolean


>>> Hi all,
> Here is a changeset with a new version of the PreferencesBrowser.
> It is for testing. I can improve it a little bit
> (by including display depth, desktop color, gradient color and  
> author initials)
> and provide a slice if it is ok.
>
> I've investigated how preferences are implemented and it seems to me  
> that
> current situation is the result of succesives hacks.
> I would like to clean out this part of the system.
> I will provide a roadmap before any coding.
> Can I start working on it ?
>
> Cheers
> alain
>>>
>>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>>
>>>>
>>>>> Hi all,
>>>>> I would like to improve the PreferencesBrowser so that it includes
>>>>> standard Fonts preferences (see joined snapshot).
>>>>> It's almost done except that, if a preference font is set to  
>>>>> Arial,
>>>>> clicking on Save button leads to an infinite loop.
>>>>>
>>>>> To reproduce it, set button font to Arial-12 and
>>>>> Preferences standardButtonFont deepCopy.
>>>>>
>>>>> Cheers
>>>>> alain
>>>>> <
>>>>> FontsInPreferences
>>>>> .png
>>>>>
>>>>>> <FTFdeepcopy.png>_______________________________________________
>>>>>>
>>>>> 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
>>>
>>>
>>
>>
>
> <PBFont.8.cs.gz>_______________________________________________
> 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: Preferences refactoring

Alain Plantec-2
Stéphane Ducasse a écrit :
> Alain
>
> It would be nice to redesign completely preferences.
yes, it is the reason why I don't want to spend to much time on
the improvement of actual PreferenceBrowser.
> Did you read the thread
>     Re: [Pharo-project] About Preference Flow
>     of 4 of Feb ?
yes, I had it in mind.
Do someone know where I can find documentation on pragmas ?
thanks
alain

>
> Summary here
>
>     Instead of having the current situation ie
>
>     MyTool>>doSomething
>
>         ....
>         Preferences useNewDiffTool
>             ifTrue: [kjlhkjhjkh ]
>             ifFalse: [nkjhkjkjhkj]
>
>
>     and not been able to remove the preferences (or that the
> preference is
>     just a configuration layer).
>
>     I would like to have the preference made that way
>
>         MyTool class>>useNewDiff
>
>         MyTool class>> useOldDiff
>
>             **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>
>
>         Preferences useNewDiffTool
>             MyTool useNewDiff
>
> I like the idea of lukas to use pragmas.
>
>     Why not use pragmas on accessors of the class side that would be
>     picked up by the preference browser? Then all state would be local to
>     the affected code.
>
>     Something along these lines:
>
>     MCMonticelloBrowser>>showAdvanceDiffTool: aBoolean
>         <preference: 'Show advanced diff tool' group: 'Monticello'
> type: #Boolean>
>
>         advancedDiffTool := aBoolean
>
>
>>>> Hi all,
>> Here is a changeset with a new version of the PreferencesBrowser.
>> It is for testing. I can improve it a little bit
>> (by including display depth, desktop color, gradient color and author
>> initials)
>> and provide a slice if it is ok.
>>
>> I've investigated how preferences are implemented and it seems to me
>> that
>> current situation is the result of succesives hacks.
>> I would like to clean out this part of the system.
>> I will provide a roadmap before any coding.
>> Can I start working on it ?
>>
>> Cheers
>> alain
>>>>
>>>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>>>
>>>>>
>>>>>> Hi all,
>>>>>> I would like to improve the PreferencesBrowser so that it includes
>>>>>> standard Fonts preferences (see joined snapshot).
>>>>>> It's almost done except that, if a preference font is set to Arial,
>>>>>> clicking on Save button leads to an infinite loop.
>>>>>>
>>>>>> To reproduce it, set button font to Arial-12 and
>>>>>> Preferences standardButtonFont deepCopy.
>>>>>>
>>>>>> Cheers
>>>>>> alain
>>>>>> <
>>>>>> FontsInPreferences
>>>>>> .png
>>>>>>
>>>>>>> <FTFdeepcopy.png>_______________________________________________
>>>>>>>
>>>>>> 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
>>>>
>>>>
>>>
>>>
>>
>> <PBFont.8.cs.gz>_______________________________________________
>> 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: Preferences refactoring

Stéphane Ducasse

On Feb 15, 2009, at 6:05 PM, Alain Plantec wrote:

> Stéphane Ducasse a écrit :
>> Alain
>>
>> It would be nice to redesign completely preferences.
> yes, it is the reason why I don't want to spend to much time on
> the improvement of actual PreferenceBrowser.
>> Did you read the thread
>>    Re: [Pharo-project] About Preference Flow
>>    of 4 of Feb ?
> yes, I had it in mind.
> Do someone know where I can find documentation on pragmas ?

Pragma class je pense.

Stef

>
> thanks
> alain
>>
>> Summary here
>>
>>    Instead of having the current situation ie
>>
>>    MyTool>>doSomething
>>
>>        ....
>>        Preferences useNewDiffTool
>>            ifTrue: [kjlhkjhjkh ]
>>            ifFalse: [nkjhkjkjhkj]
>>
>>
>>    and not been able to remove the preferences (or that the
>> preference is
>>    just a configuration layer).
>>
>>    I would like to have the preference made that way
>>
>>        MyTool class>>useNewDiff
>>
>>        MyTool class>> useOldDiff
>>
>>            **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>>
>>
>>        Preferences useNewDiffTool
>>            MyTool useNewDiff
>>
>> I like the idea of lukas to use pragmas.
>>
>>    Why not use pragmas on accessors of the class side that would be
>>    picked up by the preference browser? Then all state would be  
>> local to
>>    the affected code.
>>
>>    Something along these lines:
>>
>>    MCMonticelloBrowser>>showAdvanceDiffTool: aBoolean
>>        <preference: 'Show advanced diff tool' group: 'Monticello'
>> type: #Boolean>
>>
>>        advancedDiffTool := aBoolean
>>
>>
>>>>> Hi all,
>>> Here is a changeset with a new version of the PreferencesBrowser.
>>> It is for testing. I can improve it a little bit
>>> (by including display depth, desktop color, gradient color and  
>>> author
>>> initials)
>>> and provide a slice if it is ok.
>>>
>>> I've investigated how preferences are implemented and it seems to me
>>> that
>>> current situation is the result of succesives hacks.
>>> I would like to clean out this part of the system.
>>> I will provide a roadmap before any coding.
>>> Can I start working on it ?
>>>
>>> Cheers
>>> alain
>>>>>
>>>>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>>>>
>>>>>>
>>>>>>> Hi all,
>>>>>>> I would like to improve the PreferencesBrowser so that it  
>>>>>>> includes
>>>>>>> standard Fonts preferences (see joined snapshot).
>>>>>>> It's almost done except that, if a preference font is set to  
>>>>>>> Arial,
>>>>>>> clicking on Save button leads to an infinite loop.
>>>>>>>
>>>>>>> To reproduce it, set button font to Arial-12 and
>>>>>>> Preferences standardButtonFont deepCopy.
>>>>>>>
>>>>>>> Cheers
>>>>>>> alain
>>>>>>> <
>>>>>>> FontsInPreferences
>>>>>>> .png
>>>>>>>
>>>>>>>> <
>>>>>>>> FTFdeepcopy.png>_______________________________________________
>>>>>>>>
>>>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> <PBFont.8.cs.gz>_______________________________________________
>>> 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
|

Persistent Preferences

Tapple Gao
In reply to this post by Stéphane Ducasse
On Sun, Feb 15, 2009 at 03:47:27PM +0100, St?phane Ducasse wrote:

> Alain
>
> It would be nice to redesign completely preferences.
> Did you read the thread
> Re: [Pharo-project] About Preference Flow
> of 4 of Feb ?
>
> Summary here
>
> Instead of having the current situation ie
>
> MyTool>>doSomething
>
> ....
> Preferences useNewDiffTool
> ifTrue: [kjlhkjhjkh ]
> ifFalse: [nkjhkjkjhkj]
>
>
> and not been able to remove the preferences (or that the preference is
> just a configuration layer).
>
> I would like to have the preference made that way
>
> MyTool class>>useNewDiff
>
> MyTool class>> useOldDiff
>
> **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>
>
> Preferences useNewDiffTool
> MyTool useNewDiff

One issue with this is that, from what I can tell, it does not
permit you to save preferences outside the image. I think it
would be really great if my preferences for Polymorph theme and
fonts and browser look and feel would be read from a standard
place and applied whenever I loaded up the latest Pharo image. I
don't see a way to have that and also make Preferences optional.

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/

_______________________________________________
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: Persistent Preferences

Tapple Gao
On Sun, Feb 15, 2009 at 06:39:46PM -0500, Matthew Fulmer wrote:

> > I would like to have the preference made that way
> >
> > MyTool class>>useNewDiff
> >
> > MyTool class>> useOldDiff
> >
> > **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
> >
> >
> > Preferences useNewDiffTool
> > MyTool useNewDiff
>
> One issue with this is that, from what I can tell, it does not
> permit you to save preferences outside the image. I think it
> would be really great if my preferences for Polymorph theme and
> fonts and browser look and feel would be read from a standard
> place and applied whenever I loaded up the latest Pharo image. I
> don't see a way to have that and also make Preferences optional.

uh, nevermind. this could be done just as easily as it could be
using the current design of preferences. Sorry for the noise.

Take this as a feature request for the new and improved
Preferences system!

By the way, I love what you guys are doing with Pharo. I'm sorry
I can't spend my time helping you guys yet. I hope Pharo becomes
the default Squeak in the future.

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/

_______________________________________________
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: Persistent Preferences

Stéphane Ducasse
In reply to this post by Tapple Gao
Why you could not save the selector you should send to your  
components....
A layer on top does not imply that component should call you but after  
you can do what you want
to represent load and save data.
So your remark is wrong.

Stef

>> It would be nice to redesign completely preferences.
>> Did you read the thread
>> Re: [Pharo-project] About Preference Flow
>> of 4 of Feb ?
>>
>> Summary here
>>
>> Instead of having the current situation ie
>>
>> MyTool>>doSomething
>>
>> ....
>> Preferences useNewDiffTool
>> ifTrue: [kjlhkjhjkh ]
>> ifFalse: [nkjhkjkjhkj]
>>
>>
>> and not been able to remove the preferences (or that the  
>> preference is
>> just a configuration layer).
>>
>> I would like to have the preference made that way
>>
>> MyTool class>>useNewDiff
>>
>> MyTool class>> useOldDiff
>>
>> **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>>
>>
>> Preferences useNewDiffTool
>> MyTool useNewDiff
>
> One issue with this is that, from what I can tell, it does not
> permit you to save preferences outside the image. I think it
> would be really great if my preferences for Polymorph theme and
> fonts and browser look and feel would be read from a standard
> place and applied whenever I loaded up the latest Pharo image. I
> don't see a way to have that and also make Preferences optional.
>
> --
> Matthew Fulmer -- http://mtfulmer.wordpress.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
Reply | Threaded
Open this post in threaded view
|

Re: Persistent Preferences

Stéphane Ducasse
In reply to this post by Tapple Gao
>>>
>
> uh, nevermind. this could be done just as easily as it could be
> using the current design of preferences. Sorry for the noise.

ok no problem :)

>
>
> Take this as a feature request for the new and improved
> Preferences system!
>
> By the way, I love what you guys are doing with Pharo. I'm sorry
> I can't spend my time helping you guys yet. I hope Pharo becomes
> the default Squeak in the future.

make a great master and after apply to our INRIA PhD proposal :)

>
>
> --
> Matthew Fulmer -- http://mtfulmer.wordpress.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
Reply | Threaded
Open this post in threaded view
|

Re: Preferences refactoring

Alain Plantec-2
In reply to this post by Stéphane Ducasse
Here is a first proposition:

preference declaration: a class method with pragma.
In the image, a preference is stored as a Pragma instance (no Preference
class).
Actual preferences can be stored into a set of Pragma.
One can use a dictionary (a class variable somewhere)  in order to store
several named preference set.
Installing a preference set is done by the loading (code compilation)
of  all pragmas of the preference set.

Example:
AClassSomewhere>>loadPreferencesFrom: aSetOfPragma
     aSetOfPragma do: [:p | (p method methodReference
asMethodDefinition) load]

Preference method
two kinds: value preference object preference
- simple preference: a preference which type is a literal type

examples:
ChangeSet class>>checkForSlips
    <preferenceType: #Boolean defaultValue: true>
    ^ true
   
HTTPSocket class>>httpProxyPort
    <preferenceType: #Integer defaultValue: 80>
    ^ 80

- object preference: a preference which type is any class, such a
preference method return a "complex" object instance.
the value is stored in a class instance variable which name is the
preference name. the variable initialization is lazy.
the value as well as the default value are the result of a message send
to a particular class.
example with font:

AClassSomewhere class>>standardFont
    <preferenceType: #LogicalFont defaultGetter: #(#LogicalFont
#familyName: 'Arial' #fallbackFamilyNames: nil #pointSize: 12
#stretchValue: 5 #weightValue: 400 #slantValue: 0)>
    ^ standardFont
        ifNil: [standardFont := LogicalFont
                        familyName: 'Arial'
                        fallbackFamilyNames: nil
                        pointSize: 12
                        stretchValue: 5
                        weightValue: 400
                        slantValue: 0]

Interoperability with file system:
File in/out via standard code file, cool :)
All we need is present, mainly, we have MCStWriter and MCStReader

Tested example:
stream := RWBinaryOrTextStream on: String new.
writer := MCStWriter on: stream.
"collecting and writing"
PreferenceCollector allPreferencePragmas do: [ :p | (p method
methodReference asMethodDefinition) accept: writer].
"reading and loading"
reader := MCStReader on: stream readStream.
reader definitions do: [:d | d load].

Changing a preference value:
It can be simply done via code editing (no particular tool is mandatory)

Helpers
What we need: a cool tool to set preference values (actual
PreferenceBrowser replacement)
Let's call it PreferencesSetter (better name ?)
PreferenceSetter needs an helper builder for each individual preference
type.
For a particular preference (stored as a Pragma instance), The
PreferenceSetter tool ask the preference type class (found in the Pragma
instance)
to build the helper.
as an example, we need an helper in order to present and input a Boolean
preference.
In that case, the related helper is built by the sending of
preferenceHelper to Boolean.
Another example for font, the helper is built  by the sending of
preferenceHelper to LogicalFont.

A preference helper is responsible for the input a the preference and
for the building of the textual representation
of the value which is used to code the preference method.

alain

Stéphane Ducasse a écrit :

>
> On Feb 15, 2009, at 6:05 PM, Alain Plantec wrote:
>
>> Stéphane Ducasse a écrit :
>>> Alain
>>>
>>> It would be nice to redesign completely preferences.
>> yes, it is the reason why I don't want to spend to much time on
>> the improvement of actual PreferenceBrowser.
>>> Did you read the thread
>>>    Re: [Pharo-project] About Preference Flow
>>>    of 4 of Feb ?
>> yes, I had it in mind.
>> Do someone know where I can find documentation on pragmas ?
>
> Pragma class je pense.
>
> Stef
>
>>
>> thanks
>> alain
>>>
>>> Summary here
>>>
>>>    Instead of having the current situation ie
>>>
>>>    MyTool>>doSomething
>>>
>>>        ....
>>>        Preferences useNewDiffTool
>>>            ifTrue: [kjlhkjhjkh ]
>>>            ifFalse: [nkjhkjkjhkj]
>>>
>>>
>>>    and not been able to remove the preferences (or that the
>>> preference is
>>>    just a configuration layer).
>>>
>>>    I would like to have the preference made that way
>>>
>>>        MyTool class>>useNewDiff
>>>
>>>        MyTool class>> useOldDiff
>>>
>>>            **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>>>
>>>
>>>        Preferences useNewDiffTool
>>>            MyTool useNewDiff
>>>
>>> I like the idea of lukas to use pragmas.
>>>
>>>    Why not use pragmas on accessors of the class side that would be
>>>    picked up by the preference browser? Then all state would be
>>> local to
>>>    the affected code.
>>>
>>>    Something along these lines:
>>>
>>>    MCMonticelloBrowser>>showAdvanceDiffTool: aBoolean
>>>        <preference: 'Show advanced diff tool' group: 'Monticello'
>>> type: #Boolean>
>>>
>>>        advancedDiffTool := aBoolean
>>>
>>>
>>>>>> Hi all,
>>>> Here is a changeset with a new version of the PreferencesBrowser.
>>>> It is for testing. I can improve it a little bit
>>>> (by including display depth, desktop color, gradient color and author
>>>> initials)
>>>> and provide a slice if it is ok.
>>>>
>>>> I've investigated how preferences are implemented and it seems to me
>>>> that
>>>> current situation is the result of succesives hacks.
>>>> I would like to clean out this part of the system.
>>>> I will provide a roadmap before any coding.
>>>> Can I start working on it ?
>>>>
>>>> Cheers
>>>> alain
>>>>>>
>>>>>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>>>>>
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>> I would like to improve the PreferencesBrowser so that it includes
>>>>>>>> standard Fonts preferences (see joined snapshot).
>>>>>>>> It's almost done except that, if a preference font is set to
>>>>>>>> Arial,
>>>>>>>> clicking on Save button leads to an infinite loop.
>>>>>>>>
>>>>>>>> To reproduce it, set button font to Arial-12 and
>>>>>>>> Preferences standardButtonFont deepCopy.
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> alain
>>>>>>>> <
>>>>>>>> FontsInPreferences
>>>>>>>> .png
>>>>>>>>
>>>>>>>>> <FTFdeepcopy.png>_______________________________________________
>>>>>>>>>
>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> <PBFont.8.cs.gz>_______________________________________________
>>>> 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: Preferences refactoring

Gary Chambers-4
Not sure I like having the code changed all the time.
If the code is changed then the MC package will show changes...

The Pragma could instead specify how to set the preference (variable defined
by the class/instance that declares the pragma).

Regards, Gary

----- Original Message -----
From: "Alain Plantec" <[hidden email]>
To: <[hidden email]>
Sent: Monday, February 16, 2009 12:25 PM
Subject: Re: [Pharo-project] Preferences refactoring


Here is a first proposition:

preference declaration: a class method with pragma.
In the image, a preference is stored as a Pragma instance (no Preference
class).
Actual preferences can be stored into a set of Pragma.
One can use a dictionary (a class variable somewhere)  in order to store
several named preference set.
Installing a preference set is done by the loading (code compilation)
of  all pragmas of the preference set.

Example:
AClassSomewhere>>loadPreferencesFrom: aSetOfPragma
     aSetOfPragma do: [:p | (p method methodReference
asMethodDefinition) load]

Preference method
two kinds: value preference object preference
- simple preference: a preference which type is a literal type

examples:
ChangeSet class>>checkForSlips
    <preferenceType: #Boolean defaultValue: true>
    ^ true

HTTPSocket class>>httpProxyPort
    <preferenceType: #Integer defaultValue: 80>
    ^ 80

- object preference: a preference which type is any class, such a
preference method return a "complex" object instance.
the value is stored in a class instance variable which name is the
preference name. the variable initialization is lazy.
the value as well as the default value are the result of a message send
to a particular class.
example with font:

AClassSomewhere class>>standardFont
    <preferenceType: #LogicalFont defaultGetter: #(#LogicalFont
#familyName: 'Arial' #fallbackFamilyNames: nil #pointSize: 12
#stretchValue: 5 #weightValue: 400 #slantValue: 0)>
    ^ standardFont
        ifNil: [standardFont := LogicalFont
                        familyName: 'Arial'
                        fallbackFamilyNames: nil
                        pointSize: 12
                        stretchValue: 5
                        weightValue: 400
                        slantValue: 0]

Interoperability with file system:
File in/out via standard code file, cool :)
All we need is present, mainly, we have MCStWriter and MCStReader

Tested example:
stream := RWBinaryOrTextStream on: String new.
writer := MCStWriter on: stream.
"collecting and writing"
PreferenceCollector allPreferencePragmas do: [ :p | (p method
methodReference asMethodDefinition) accept: writer].
"reading and loading"
reader := MCStReader on: stream readStream.
reader definitions do: [:d | d load].

Changing a preference value:
It can be simply done via code editing (no particular tool is mandatory)

Helpers
What we need: a cool tool to set preference values (actual
PreferenceBrowser replacement)
Let's call it PreferencesSetter (better name ?)
PreferenceSetter needs an helper builder for each individual preference
type.
For a particular preference (stored as a Pragma instance), The
PreferenceSetter tool ask the preference type class (found in the Pragma
instance)
to build the helper.
as an example, we need an helper in order to present and input a Boolean
preference.
In that case, the related helper is built by the sending of
preferenceHelper to Boolean.
Another example for font, the helper is built  by the sending of
preferenceHelper to LogicalFont.

A preference helper is responsible for the input a the preference and
for the building of the textual representation
of the value which is used to code the preference method.

alain

Stéphane Ducasse a écrit :

>
> On Feb 15, 2009, at 6:05 PM, Alain Plantec wrote:
>
>> Stéphane Ducasse a écrit :
>>> Alain
>>>
>>> It would be nice to redesign completely preferences.
>> yes, it is the reason why I don't want to spend to much time on
>> the improvement of actual PreferenceBrowser.
>>> Did you read the thread
>>>    Re: [Pharo-project] About Preference Flow
>>>    of 4 of Feb ?
>> yes, I had it in mind.
>> Do someone know where I can find documentation on pragmas ?
>
> Pragma class je pense.
>
> Stef
>
>>
>> thanks
>> alain
>>>
>>> Summary here
>>>
>>>    Instead of having the current situation ie
>>>
>>>    MyTool>>doSomething
>>>
>>>        ....
>>>        Preferences useNewDiffTool
>>>            ifTrue: [kjlhkjhjkh ]
>>>            ifFalse: [nkjhkjkjhkj]
>>>
>>>
>>>    and not been able to remove the preferences (or that the
>>> preference is
>>>    just a configuration layer).
>>>
>>>    I would like to have the preference made that way
>>>
>>>        MyTool class>>useNewDiff
>>>
>>>        MyTool class>> useOldDiff
>>>
>>>            **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>>>
>>>
>>>        Preferences useNewDiffTool
>>>            MyTool useNewDiff
>>>
>>> I like the idea of lukas to use pragmas.
>>>
>>>    Why not use pragmas on accessors of the class side that would be
>>>    picked up by the preference browser? Then all state would be
>>> local to
>>>    the affected code.
>>>
>>>    Something along these lines:
>>>
>>>    MCMonticelloBrowser>>showAdvanceDiffTool: aBoolean
>>>        <preference: 'Show advanced diff tool' group: 'Monticello'
>>> type: #Boolean>
>>>
>>>        advancedDiffTool := aBoolean
>>>
>>>
>>>>>> Hi all,
>>>> Here is a changeset with a new version of the PreferencesBrowser.
>>>> It is for testing. I can improve it a little bit
>>>> (by including display depth, desktop color, gradient color and author
>>>> initials)
>>>> and provide a slice if it is ok.
>>>>
>>>> I've investigated how preferences are implemented and it seems to me
>>>> that
>>>> current situation is the result of succesives hacks.
>>>> I would like to clean out this part of the system.
>>>> I will provide a roadmap before any coding.
>>>> Can I start working on it ?
>>>>
>>>> Cheers
>>>> alain
>>>>>>
>>>>>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>>>>>
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>> I would like to improve the PreferencesBrowser so that it includes
>>>>>>>> standard Fonts preferences (see joined snapshot).
>>>>>>>> It's almost done except that, if a preference font is set to
>>>>>>>> Arial,
>>>>>>>> clicking on Save button leads to an infinite loop.
>>>>>>>>
>>>>>>>> To reproduce it, set button font to Arial-12 and
>>>>>>>> Preferences standardButtonFont deepCopy.
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> alain
>>>>>>>> <
>>>>>>>> FontsInPreferences
>>>>>>>> .png
>>>>>>>>
>>>>>>>>> <FTFdeepcopy.png>_______________________________________________
>>>>>>>>>
>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> <PBFont.8.cs.gz>_______________________________________________
>>>> 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: Preferences refactoring

Alain Plantec-2
Gary Chambers a écrit :
> Not sure I like having the code changed all the time.
> If the code is changed then the MC package will show changes...
ok, but I liked the idea of not to have variable for simple preferences.
a solution could be to use update notification. in the case of a
preference -> do not implies package change.
But I can agry with your solution easily. :)
>
> The Pragma could instead specify how to set the preference (variable
> defined by the class/instance that declares the pragma).
maybe no need for that by default:
for a preference named "myPreference" in class X, one can have, by
default, X class>>myPreference  and X class>>myPreference:

first case with implicit setter:

X class>>myPreference
    <preferenceType: T defaultValue: aTValue>
    ^ myPreference ifNil: [myPreference := aTValue]
Or
X class>>myPreference
    <preferenceType: T defaultGetter: #(how to get default)>
    ^ myPreference ifNil: [myPreference := ahow to get default]

And
X class>>myPreference: aTValue
    myPreference := aTValue


second case with explicit setter:

X class>>myPreference
    <preferenceType: T defaultValue: aTValue setter: #anothetSetter:>
    ^ myPreference ifNil: [myPreference := aTValue]
Or
X class>>myPreference
    <preferenceType: T defaultGetter: #(how to get default) setter:
#anothetSetter:>
    ^ myPreference ifNil: [myPreference := ahow to get default]

And
X class>>anothetSetter: aTValue
    myPreference := aTValue


Remark about implicit case:
Usually I don't like implicit things but, here it can be a way to
implement extensions (as helpers are)

Possible implicit methods :
X class>>myPreference: aTValue
    myPreference := aTValue

X class>>myPreferenceHelpText
    ^ 'help text the helper need'

X class>>myPreferenceGroups
    ^ #(#Morphic #Colors)

X class>>myPreference<Something>
    ^ "something used somewhere"

Cheers
alain

>
> Regards, Gary
>
> ----- Original Message ----- From: "Alain Plantec" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, February 16, 2009 12:25 PM
> Subject: Re: [Pharo-project] Preferences refactoring
>
>
> Here is a first proposition:
>
> preference declaration: a class method with pragma.
> In the image, a preference is stored as a Pragma instance (no Preference
> class).
> Actual preferences can be stored into a set of Pragma.
> One can use a dictionary (a class variable somewhere)  in order to store
> several named preference set.
> Installing a preference set is done by the loading (code compilation)
> of  all pragmas of the preference set.
>
> Example:
> AClassSomewhere>>loadPreferencesFrom: aSetOfPragma
>     aSetOfPragma do: [:p | (p method methodReference
> asMethodDefinition) load]
>
> Preference method
> two kinds: value preference object preference
> - simple preference: a preference which type is a literal type
>
> examples:
> ChangeSet class>>checkForSlips
>    <preferenceType: #Boolean defaultValue: true>
>    ^ true
>
> HTTPSocket class>>httpProxyPort
>    <preferenceType: #Integer defaultValue: 80>
>    ^ 80
>
> - object preference: a preference which type is any class, such a
> preference method return a "complex" object instance.
> the value is stored in a class instance variable which name is the
> preference name. the variable initialization is lazy.
> the value as well as the default value are the result of a message send
> to a particular class.
> example with font:
>
> AClassSomewhere class>>standardFont
>    <preferenceType: #LogicalFont defaultGetter: #(#LogicalFont
> #familyName: 'Arial' #fallbackFamilyNames: nil #pointSize: 12
> #stretchValue: 5 #weightValue: 400 #slantValue: 0)>
>    ^ standardFont
>        ifNil: [standardFont := LogicalFont
>                        familyName: 'Arial'
>                        fallbackFamilyNames: nil
>                        pointSize: 12
>                        stretchValue: 5
>                        weightValue: 400
>                        slantValue: 0]
>
> Interoperability with file system:
> File in/out via standard code file, cool :)
> All we need is present, mainly, we have MCStWriter and MCStReader
>
> Tested example:
> stream := RWBinaryOrTextStream on: String new.
> writer := MCStWriter on: stream.
> "collecting and writing"
> PreferenceCollector allPreferencePragmas do: [ :p | (p method
> methodReference asMethodDefinition) accept: writer].
> "reading and loading"
> reader := MCStReader on: stream readStream.
> reader definitions do: [:d | d load].
>
> Changing a preference value:
> It can be simply done via code editing (no particular tool is mandatory)
>
> Helpers
> What we need: a cool tool to set preference values (actual
> PreferenceBrowser replacement)
> Let's call it PreferencesSetter (better name ?)
> PreferenceSetter needs an helper builder for each individual preference
> type.
> For a particular preference (stored as a Pragma instance), The
> PreferenceSetter tool ask the preference type class (found in the Pragma
> instance)
> to build the helper.
> as an example, we need an helper in order to present and input a Boolean
> preference.
> In that case, the related helper is built by the sending of
> preferenceHelper to Boolean.
> Another example for font, the helper is built  by the sending of
> preferenceHelper to LogicalFont.
>
> A preference helper is responsible for the input a the preference and
> for the building of the textual representation
> of the value which is used to code the preference method.
>
> alain
>
> Stéphane Ducasse a écrit :
>>
>> On Feb 15, 2009, at 6:05 PM, Alain Plantec wrote:
>>
>>> Stéphane Ducasse a écrit :
>>>> Alain
>>>>
>>>> It would be nice to redesign completely preferences.
>>> yes, it is the reason why I don't want to spend to much time on
>>> the improvement of actual PreferenceBrowser.
>>>> Did you read the thread
>>>>    Re: [Pharo-project] About Preference Flow
>>>>    of 4 of Feb ?
>>> yes, I had it in mind.
>>> Do someone know where I can find documentation on pragmas ?
>>
>> Pragma class je pense.
>>
>> Stef
>>
>>>
>>> thanks
>>> alain
>>>>
>>>> Summary here
>>>>
>>>>    Instead of having the current situation ie
>>>>
>>>>    MyTool>>doSomething
>>>>
>>>>        ....
>>>>        Preferences useNewDiffTool
>>>>            ifTrue: [kjlhkjhjkh ]
>>>>            ifFalse: [nkjhkjkjhkj]
>>>>
>>>>
>>>>    and not been able to remove the preferences (or that the
>>>> preference is
>>>>    just a configuration layer).
>>>>
>>>>    I would like to have the preference made that way
>>>>
>>>>        MyTool class>>useNewDiff
>>>>
>>>>        MyTool class>> useOldDiff
>>>>
>>>>            **NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
>>>>
>>>>
>>>>        Preferences useNewDiffTool
>>>>            MyTool useNewDiff
>>>>
>>>> I like the idea of lukas to use pragmas.
>>>>
>>>>    Why not use pragmas on accessors of the class side that would be
>>>>    picked up by the preference browser? Then all state would be
>>>> local to
>>>>    the affected code.
>>>>
>>>>    Something along these lines:
>>>>
>>>>    MCMonticelloBrowser>>showAdvanceDiffTool: aBoolean
>>>>        <preference: 'Show advanced diff tool' group: 'Monticello'
>>>> type: #Boolean>
>>>>
>>>>        advancedDiffTool := aBoolean
>>>>
>>>>
>>>>>>> Hi all,
>>>>> Here is a changeset with a new version of the PreferencesBrowser.
>>>>> It is for testing. I can improve it a little bit
>>>>> (by including display depth, desktop color, gradient color and author
>>>>> initials)
>>>>> and provide a slice if it is ok.
>>>>>
>>>>> I've investigated how preferences are implemented and it seems to me
>>>>> that
>>>>> current situation is the result of succesives hacks.
>>>>> I would like to clean out this part of the system.
>>>>> I will provide a roadmap before any coding.
>>>>> Can I start working on it ?
>>>>>
>>>>> Cheers
>>>>> alain
>>>>>>>
>>>>>>>> On 11 Feb 2009, at 16:22, Alain Plantec wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>> I would like to improve the PreferencesBrowser so that it
>>>>>>>>> includes
>>>>>>>>> standard Fonts preferences (see joined snapshot).
>>>>>>>>> It's almost done except that, if a preference font is set to
>>>>>>>>> Arial,
>>>>>>>>> clicking on Save button leads to an infinite loop.
>>>>>>>>>
>>>>>>>>> To reproduce it, set button font to Arial-12 and
>>>>>>>>> Preferences standardButtonFont deepCopy.
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> alain
>>>>>>>>> <
>>>>>>>>> FontsInPreferences
>>>>>>>>> .png
>>>>>>>>>
>>>>>>>>>> <FTFdeepcopy.png>_______________________________________________
>>>>>>>>>>
>>>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> <PBFont.8.cs.gz>_______________________________________________
>>>>> 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: Preferences refactoring

Alain Plantec-2
Alain Plantec a écrit :
> Gary Chambers a écrit :
>  
>> Not sure I like having the code changed all the time.
>> If the code is changed then the MC package will show changes...
>>    
> ok, but I liked the idea of not to have variable for simple preferences.
>  
and not to be forced to use a particular tool or an inspector in order
to change a preference.
just use your favorite browser.
alain
> a solution could be to use update notification. in the case of a
> preference -> do not implies package change.
> But I can agry with your solution easily. :)
>  
.....

_______________________________________________
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: Preferences refactoring

Alain Plantec-2
Alain Plantec a écrit :

> Alain Plantec a écrit :
>  
>> Gary Chambers a écrit :
>>  
>>    
>>> Not sure I like having the code changed all the time.
>>> If the code is changed then the MC package will show changes...
>>>    
>>>      
>> ok, but I liked the idea of not to have variable for simple preferences.
>>  
>>    
> and not to be forced to use a particular tool or an inspector in order
> to change a preference.
> just use your favorite browser.
> alain
>  
ok one can have:
XX class>>myPreference: aValue
    "self myPreference: myValue"
    myPreference := aValue

and the user edits the comment of the setter and evaluates it without
saving the code.
Cheers
alain

>> a solution could be to use update notification. in the case of a
>> preference -> do not implies package change.
>> But I can agry with your solution easily. :)
>>  
>>    
> .....
>
> _______________________________________________
> 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
12