ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
121 stars 77 forks source link

numImages in config files #98

Closed pllim closed 9 years ago

pllim commented 9 years ago

I see numImages repeated in both my channel_Image.cfg and general.cfg. Are they the same thing? Can I just keep it in general.cfg and remove it from channel_Image.cfg? Thanks.

ejeschke commented 9 years ago

Hi @pllim. I've clarified the order of inheritance of this setting in commit f77a20154347af3bb51676d552726a74045d3453.

The channel_*.cfg files are saved whenever someone presses "Save Settings" in a Preferences plugin (which is a local plugin, meaning settings are saved on a per-channel basis). Since this particular preference will be inherited from general.cfg, I would leave your setting in that file. Even if you remove it from the channel_Image.cfg file, it will show up there the next time (if ever) you press "Save Settings".

pllim commented 9 years ago

So, if numImages is different in both, Ginga will use the value from general.cfg and ignore the one in channel_Image.cfg? I illustrate the scenario below:

~/username/.ginga/
    channel_Image.cfg (numImages = 10)
    general.cfg (numImages = 1)
ejeschke commented 9 years ago

No, sorry if I wasn't clear. If there is a value in channel_Image.cfg it will be used in before that in general.cfg. But if the value is already in general.cfg it will be inherited to channel_Image.cfg the first time the user does a "Save Settings" when editing the Preferences for the Image channel. Therefore to my thinking it's better to have the initial setting in general.cfg.

pllim commented 9 years ago

Ah, okay. Thank you for the clarification.