[Qgis-developer] Infrastructure for plugin settings
Denis Rouzaud
denis.rouzaud at gmail.com
Wed Sep 11 05:17:07 PDT 2013
On 09/11/2013 02:12 PM, Borys Jurgiel wrote:
> Dnia czwartek, 5 września 2013 15:00:31 Denis Rouzaud pisze:
>> I have made some publicity before for a library which handles plugin
>> settings.
>> http://3nids.github.io/qgissettingmanager/
>>
>> Basically, the idea is that it you create once the settings somewhere in
>> your plugin and then it handles type validation, defaut values, etc. The
>> most interesting part is that you have a SettingDialog class, which
>> automatically read/write widgets if you name them accordingly to the
>> settings (it handles several widgets for all the different types of
>> settings).
>>
>> This small lib is very time saving for the few plugins I have.
> It looks great! Especially with setValueOnWidgetUpdate=True, as I understand,
> I'm able to make interactive settings (reading values in the runtime, setting
> one widget depending on other widget value), without any need of direct access
> to widgets, I mean staying purely within this layer of abstraction. It's
> really nice.
>
> Of course, I understand graying out widgets and changing list of combobox'
> items still needs direct access.
>
>> Maybe an idea would be to translate this to a QgsPluginSetting class
>> which would then list all the settings to be edited in the main plugin
>> setting window.
> Similarly to Alex, I prefer interactive and aesthetically hand-polished gui ;)
> So for my plugins I only can imagine the common settings tree as something
> additional, an 'advanced' mode. Anyway, let's talk about it on the HF!
>
So do I. But you could use this library to create the settings, and it
would automatically add them to the infrastructure. Then, fell free to
set your own UI or not.
See you tomorrow!
More information about the Qgis-developer
mailing list