[glideplan_swproj] Re: [glideplan_swproj] Re: Settings

  • From: Tomáš Zámečník <pulcik@xxxxxxxx>
  • To: glideplan_swproj@xxxxxxxxxxxxx
  • Date: Fri, 02 Dec 2011 12:21:41 +0100 (CET)

I think that it is easy. There are many ways.
One example:
We are saving to text file. So every setting should be translatable to 
string...plugin will manage the translation.
There will be a settings manager, which will have methods:

void setParameter(in string group, in string name, in string value)
bool getParameter(in string group, in string name, out string value) //returns 
true when parameter is found
void saveToFile(string filename) //Saves all set parameters
void loadFromFile(string filename) //Load parameters from file, so they can be 
read with get method

plugins will have access to it through core interface.

T.

> ------------ Původní zpráva ------------
> Od: Cestmir Houska <czestmyr@xxxxxxxxx>
> Předmět: [glideplan_swproj] Re: Settings
> Datum: 02.12.2011 11:56:23
> ----------------------------------------
> Agreed, Tom.
>
> That's the basic idea. But how to implement it? ;-)
>
> Cestmir
>
> 2011/12/2 Tomáš Zámečník <pulcik@xxxxxxxx>
>
> > My suggestion is to have one dialog for all settings and also one file on
> > disk.
> > Every setting should be triple: (type, name, value)
> > To avoid name conflicts, every plugin should have its own namespace.
> > Settins file might look like this:
> >
> > [Task Declaration]
> > int defaultTurnPointShape = 1
> > real defaultR1 = 0.5
> > real defaultR2 = 0.5
> > ...
> >
> > [Igc Viewing]
> > int coloring = 2
> > ...
> >
> > Tom
> >
> > > ------------ Původní zpráva ------------
> > > Od: Kuba Marek <blue.cube@xxxxxxxxx>
> > > Předmět: [glideplan_swproj] Settings
> > > Datum: 02.12.2011 02:42:39
> > > ----------------------------------------
> > > Hi,
> > > there's one thing we completely skipped in plugin API -- plugin
> > > settings. We were talking and thinking about this for the whole day on
> > > jabber and I've put something together.
> > >
> > >
> >
> https://github.com/updraft/updraft/commit/9621592837afd9f59e4348e62fc917578d5942d1
> > >
> > > What I was trying to achieve is to have both internal and usersettings.
> > > User settings should have GUI for different data types (int, string,
> > filename,
> > > list, color picker and number with units (maybe not all of those)).
> > >
> > > Comments, please
> > >
> > > K
> > >
> > >
> > >
> >
> > To visit archive or unsubscribe, follow:
> > http://www.freelists.org/list/glideplan_swproj
> >
>
>
>

To visit archive or unsubscribe, follow:
http://www.freelists.org/list/glideplan_swproj

Other related posts: