discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add a defaults database to a theme ?


From: Bertrand Dekoninck
Subject: Re: How to add a defaults database to a theme ?
Date: Fri, 10 May 2019 18:15:37 +0200
User-agent: GNUMail (Version 1.3.0)

On 2019-05-10 13:35:28 +0200 Richard Frith-Macdonald <address@hidden> wrote:

> 
> 
>> On 10 May 2019, at 12:24, Bertrand Dekoninck <address@hidden> 
>> wrote:
> 
>> On 2019-05-10 13:06:02 +0200 Fred Kiefer <address@hidden> wrote:
> 
>>> Hi Bertrand,
> 
>>> I think you are misreading the compiler warning. This just complains that 
>>> the class that this method is on already has an instance variable with the 
>>> name „defaults“. You should just use a different name for your local 
>>> variable instead. Maybe something like „user_defaults“?
> 
>>> Hope this helps,
>>> Fred
>> Thanks,
> 
>> I can get rid of the warning in this way, but I think my problem is 
>> different. In the code hereafter, is standardUserDefaults the database of 
>> the theme, or the database of the app using the theme ? If it's the theme 
>> 's one, how could I write to it with the command line. Should I use the 
>> bundle identifier ?
> 
> NSUserDefaults has multiple databases (called 'domains') in a list which 
> defines their order of precedence, so when you ask for a default, and 
> multiple domains in the list contain the default name, you get the correct 
> value returned (the one from the first domain that contains a value for the 
> key).
> 
> The normal order of the important domains here is
> 
> Command line arguments,  Application, NSGlobalDomain, GSThemeDomain, 
> Registration (hard coded and set on application startup)
> 
> GSThemeDomain is set up by your theme (information in a property list in the 
> theme bundle) and changes whenever a new theme is made active in an app, so 
> to get the behavior you want, you need zero coding, you just have to put the 
> key/value pair into your GSThemeDomain and it will be used unless the user 
> overrides it by setting a value in a higher precedence domain (eg on the 
> cmmand line).
> 

Thanks, I got it ! I've added a "RikMenuBarTransparency" key in RikInfo.plist, 
and now I can override it when I write in NSGlobalDomain as you explained.  I 
also cleaned up a little this plist. I've still got an issue with it : the 
"GSBackendHandleWindowDecorations = NO" that it contains doesn't seem to work 
(I've looked in the other domains if it is overridden and it isn't). I still 
have to investigate, but I did understand a few more things today.

Bertrand




reply via email to

[Prev in Thread] Current Thread [Next in Thread]