DEVImageCreator >> setDefaultPreferences (alain?)

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

DEVImageCreator >> setDefaultPreferences (alain?)

Mariano Martinez Peck
Hi Alain. DEVImageCreator  has to be updated to use the new preferences. I can do it but it will require much more than for me than for you ;)
 
For preferences it is  DEVImageCreator >> setDefaultPreferences
it is using Preferences class for the moment. It should be updated to use Settings, isn't it ?

BTW, Preferences is still present in Pharo 1.1 and thus, setDefaultPreferences is still working but I guess it should be updated.

Do you know when Preferences class will be completely removed?  Pharo 1.2?

Thanks!

Mariano

_______________________________________________
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: DEVImageCreator >> setDefaultPreferences (alain?)

Mariano Martinez Peck


On Tue, May 11, 2010 at 1:55 PM, Alain Plantec <[hidden email]> wrote:
Hi Mariano, all
Le 11/05/2010 11:43, Mariano Martinez Peck a écrit :

Hi Alain. DEVImageCreator  has to be updated to use the new preferences. I can do it but it will require much more than for me than for you ;)

For preferences it is  DEVImageCreator >> setDefaultPreferences
it is using Preferences class for the moment. It should be updated to use Settings, isn't it ?
I don't think so. There is no need for such a initialization anymore since package are defining their own preferences.
If a default value is desired then it should be set by an initialization method or lazily by the getter.
I find the lazy initialization better because then, the SettingBrowser can reset the preference to the default by setting it to nil.


But maybe the default value in the "PharoCore" is not the same as PharoDev?  I mean, suppose these are the default prefrences we used in the pharo dev images:


setDefaultPreferences.
    Preferences
    disable: #annotationPanes;
    disable: #allwaysShowVScrollBar;
    enable: #alternativeButtonsInScrollBars;
    disable: #fadedBackgroundWindows;
    enable: #fastDragWindowForMorphic;
    disable: #fullScreenLeavesDeskMargins;
    enable: #generalizedYellowButtonMenu;
    enable: #mouseClickForKeyboardFocus;   
    enable: #noWindowAnimationForClosing;
    disable: #scrollBarsNarrow;
    disable: #scrollBarsWithoutMenuButton;
    disable: #showSplitterHandles;
    disable: #syntaxHighlightingAsYouTypeAnsiAssignment;
    enable: #showTextEditingState;
    disable: #windowAnimation;
    setPreference: #GlyphContrast toValue: 55;
    disable: #roundedWindowCorners;
    disable: #roundedMenuCorners;
    enable: #infiniteUndo;
    enable: #useUndo;
    enable: #mercuryPanel;
    disable: #showUpdateOptionInWorldMenu.


If we used to do this, I guess it was becuase most of the default preferences of the core image was different. Otherwise, this method doesn't have sense.
If I now do what you say, I am changing the default value of the pharo core image also. Is this correct ?   or this should be only one flavor (PharoDev) ?

Anyway, suppose I want to do the same as above, I should do something like:

Preferences infiniteUndoSetting:  true; etc....


Similar happens with external packages. Suppose OB developers (Lukas?) doesn't want to have mercury bar enable by default, but us (in PharoDev) we DO want it. Then I need to set such preference. Maybe the name default looks bad for you.  It should be "preferences for PharoDev image"

 
BTW, Preferences is still present in Pharo 1.1 and thus, setDefaultPreferences is still working but I guess it should be updated.
why ? there is no need for setDefaultPreferences anymore.


Do you know when Preferences class will be completely removed?  Pharo 1.2?
I don't know. Maybe we can let it in the 1.1 in order
to let maintainers the possibility to port their packages and
definitively remove it in 1.2.


I agree, 1.2.
 
The same for TheWorldMenu I guess.

ok

Cheers

Mariano
 
Cheers
Alain


Thanks!

Mariano



_______________________________________________
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: DEVImageCreator >> setDefaultPreferences (alain?)

Alain Plantec-4
Le 11/05/2010 14:13, Mariano Martinez Peck a écrit :

>
>
> On Tue, May 11, 2010 at 1:55 PM, Alain Plantec <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Mariano, all
>     Le 11/05/2010 11:43, Mariano Martinez Peck a écrit :
>
>         Hi Alain. DEVImageCreator  has to be updated to use the new
>         preferences. I can do it but it will require much more than
>         for me than for you ;)
>
>         For preferences it is  DEVImageCreator >> setDefaultPreferences
>         it is using Preferences class for the moment. It should be
>         updated to use Settings, isn't it ?
>
>     I don't think so. There is no need for such a initialization
>     anymore since package are defining their own preferences.
>     If a default value is desired then it should be set by an
>     initialization method or lazily by the getter.
>     I find the lazy initialization better because then, the
>     SettingBrowser can reset the preference to the default by setting
>     it to nil.
>
>
> But maybe the default value in the "PharoCore" is not the same as
> PharoDev?  I mean, suppose these are the default prefrences we used in
> the pharo dev image
ok, there is only one default.
For this need, you should have to create a setting style for pharodev
and load it.
as an example:

PharoDevSettingStyle class >>styleName
     "notice the pragma which allow the setting
     browser to recognize the class as a style"
<settingstyle>
     ^ 'PharoDev'

PharoDevSettingStyle>>load
     "set your default 1.1 preferences here"
     CodeHolder showAnnotationPane: false.
     UITheme currentSettings fastDragging: true.
     SystemWindow fullScreenMargin: 25.
     MorphicModel keyboardFocusOnMouseDown: true.
     UITheme currentAnimationSettings useAnimation: false.
     "etc ... "

PharoDevSettingStyle>>loadStyle
     self load

Then, in order to load the style, evaluate
PharoDevSettingStyle new load.


Or, if you don't want to search for where are the preferences and how to
set them, simply,
open a SettingBrowser then set the settings then create a Style named
'PharoDev'.
The PharoDevSettingStyle class will be created for you.

>
> If we used to do this, I guess it was becuase most of the default
> preferences of the core image was different. Otherwise, this method
> doesn't have sense.
of course yes :)

Alain
>


_______________________________________________
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: DEVImageCreator >> setDefaultPreferences (alain?)

Alain Plantec-4
Le 11/05/2010 15:22, Alain Plantec a écrit :

> Le 11/05/2010 14:13, Mariano Martinez Peck a écrit :
>>
>>
>>
>>
>> But maybe the default value in the "PharoCore" is not the same as
>> PharoDev?  I mean, suppose these are the default prefrences we used
>> in the pharo dev image
> ok, there is only one default.
> For this need, you should have to create a setting style for pharodev
> and load it.
I've re-thougth about this and maybe building a style class and let it
in the dev image  is a bad solution
because then, the style class depends on all other packages. This is
exactly what we wanted to avoid by
introducing the settings.
So, maybe the default state for the preferences in the dev should be the
one of the core
plus the state decided by maintainers for additional packages.

Alain

_______________________________________________
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: DEVImageCreator >> setDefaultPreferences (alain?)

Stéphane Ducasse
In reply to this post by Alain Plantec-4
this is cool!
We should add that to the chapter.

>> But maybe the default value in the "PharoCore" is not the same as PharoDev?  I mean, suppose these are the default prefrences we used in the pharo dev image
> ok, there is only one default.
> For this need, you should have to create a setting style for pharodev and load it.
> as an example:
>
> PharoDevSettingStyle class >>styleName
>    "notice the pragma which allow the setting
>    browser to recognize the class as a style"
> <settingstyle>
>    ^ 'PharoDev'
>
> PharoDevSettingStyle>>load
>    "set your default 1.1 preferences here"
>    CodeHolder showAnnotationPane: false.
>    UITheme currentSettings fastDragging: true.
>    SystemWindow fullScreenMargin: 25.
>    MorphicModel keyboardFocusOnMouseDown: true.
>    UITheme currentAnimationSettings useAnimation: false.
>    "etc ... "
>
> PharoDevSettingStyle>>loadStyle
>    self load
>
> Then, in order to load the style, evaluate
> PharoDevSettingStyle new load.
>
>
> Or, if you don't want to search for where are the preferences and how to set them, simply,
> open a SettingBrowser then set the settings then create a Style named 'PharoDev'.
> The PharoDevSettingStyle class will be created for you.
>
>>
>> If we used to do this, I guess it was becuase most of the default preferences of the core image was different. Otherwise, this method doesn't have sense.
> of course yes :)
>
> 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: DEVImageCreator >> setDefaultPreferences (alain?)

Mariano Martinez Peck
In reply to this post by Alain Plantec-4


On Tue, May 11, 2010 at 3:44 PM, Alain Plantec <[hidden email]> wrote:
Le 11/05/2010 15:22, Alain Plantec a écrit :
Le 11/05/2010 14:13, Mariano Martinez Peck a écrit :




But maybe the default value in the "PharoCore" is not the same as PharoDev?  I mean, suppose these are the default prefrences we used in the pharo dev image
ok, there is only one default.
For this need, you should have to create a setting style for pharodev and load it.
I've re-thougth about this and maybe building a style class and let it in the dev image  is a bad solution
because then, the style class depends on all other packages. This is exactly what we wanted to avoid by
introducing the settings.
So, maybe the default state for the preferences in the dev should be the one of the core
plus the state decided by maintainers for additional packages.

Ok...but how can I do the following: there is a setting that in Core has XXX value and I want to change it for the Dev image. Creating whole Style doesn't make sense as I only want to change one setting. In addition, happens what you told me in this mail, and finally it is difficult to manage I think: imagine today I create a Style and tomorrow you create ore settings...do I need to update my style to contemplate such setting ?

Actually, I want to change two things: FastDragging (to true) and "Show update option in World menu" (to false).

So, how can I do that ?

Thanks

Mariano

 


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: DEVImageCreator >> setDefaultPreferences (alain?)

Alain Plantec-4
Le 11/05/2010 21:00, Mariano Martinez Peck a écrit :
>
>
>
> Actually, I want to change two things: FastDragging (to true) and
> "Show update option in World menu" (to false).
>
> So, how can I do that ?
----------------
UITheme currentSettings fastDragging: true.
WorldState showUpdateOptionInWorldMenu: false
----------------
Cheers
Alain

> Thanks
>
> Mariano
>
>
>
>     Alain
>
>     _______________________________________________
>     Pharo-project mailing list
>     [hidden email]
>     <mailto:[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: DEVImageCreator >> setDefaultPreferences (alain?)

Alain Plantec-4
In reply to this post by Mariano Martinez Peck
Le 11/05/2010 21:00, Mariano Martinez Peck a écrit :
>
>
>
> Ok...but how can I do the following: there is a setting that in Core
> has XXX value and I want to change it for the Dev image.
yes, this is the case of #showUpdateOptionInWorldMenu, the values are
different
> Creating whole Style doesn't make sense as I only want to change one
> setting.
the advantage is that you have the UI to switch from one Style to
another through the setting browser.
The load method of your style class (as show in my previous mail) can
contains few
setting updates, only those that make sense for the dev.

PharoDevSettingStyle>>load
     "set your default 1.1 preferences here"
     UITheme currentSettings fastDragging: true.
     WorldState showUpdateOptionInWorldMenu: false.

> In addition, happens what you told me in this mail, and finally it is
> difficult to manage I think: imagine today I create a Style and
> tomorrow you create ore settings...do I need to update my style to
> contemplate such setting ?
if the desired value for the dev is the default one then no.

Cheers
Alain


_______________________________________________
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: DEVImageCreator >> setDefaultPreferences (alain?)

Mariano Martinez Peck


On Tue, May 11, 2010 at 9:47 PM, Alain Plantec <[hidden email]> wrote:
Le 11/05/2010 21:00, Mariano Martinez Peck a écrit :




Ok...but how can I do the following: there is a setting that in Core has XXX value and I want to change it for the Dev image.
yes, this is the case of #showUpdateOptionInWorldMenu, the values are different

Creating whole Style doesn't make sense as I only want to change one setting.
the advantage is that you have the UI to switch from one Style to another through the setting browser.
The load method of your style class (as show in my previous mail) can contains few
setting updates, only those that make sense for the dev.
 

PharoDevSettingStyle>>load
   "set your default 1.1 preferences here"
   UITheme currentSettings fastDragging: true.
   WorldState showUpdateOptionInWorldMenu: false.




Ok....but...(follow above)

 
In addition, happens what you told me in this mail, and finally it is difficult to manage I think: imagine today I create a Style and tomorrow you create ore settings...do I need to update my style to contemplate such setting ?
if the desired value for the dev is the default one then no.


If I don't define certain settings, where you get them ?  DefaultSettingStyle ? why ? because of

styleName
    <settingstyle>
    ^ 'Default'

?

I am trying to understand how it works ;)

Thanks Alain!

Mariano

 
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: DEVImageCreator >> setDefaultPreferences (alain?)

Alain Plantec-4
Le 12/05/2010 17:07, Mariano Martinez Peck a écrit :

>
>
> On Tue, May 11, 2010 at 9:47 PM, Alain Plantec <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>
>     PharoDevSettingStyle>>load
>        "set your default 1.1 preferences here"
>        UITheme currentSettings fastDragging: true.
>        WorldState showUpdateOptionInWorldMenu: false.
>
>
>
>
> If I don't define certain settings, where you get them ?  
> DefaultSettingStyle ? why ? because of
>
> styleName
> <settingstyle>
>     ^ 'Default'
>
This is for the SettingBrowser, so, normally you don't have to take care
of it.
For other settings, don't do anything. they should be automatically
initialized
with their default value; lazily at least in the core as follow:

UserInterruptHandler class>>#cmdDotEnabled
     ^ CmdDotEnabled ifNil: [CmdDotEnabled := true]

Cheers
Alain

> ?
>
> I am trying to understand how it works ;)
>
> Thanks Alain!
>
> Mariano
>
>     Cheers
>
>     Alain
>
>
>     _______________________________________________
>     Pharo-project mailing list
>     [hidden email]
>     <mailto:[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