Welcome, Guest. Please login or register.

Author Topic: Program preference standard ?  (Read 5283 times)

Description:

0 Members and 3 Guests are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Program preference standard ?
« on: June 19, 2011, 03:50:48 PM »
On a tid bit of my free time I'm working on a small network diagnostic utility and I'd like to know if there is any standard way/place whatever to save the preferences of the program ? i.e. like the default sana device to use, packet definitions the user might want to wait for, GUI preferences ....
I realize some stuff goes into preferences directory on sys: IRC, but I think that's more like for the system oriented programs...

José
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Program preference standard ?
« Reply #1 on: June 19, 2011, 03:53:52 PM »
BTW if anyone knows where to get the Style Guide (might have some info related to this too) let me know, it's ridiculous that's it doesn't seem to be available anywhere...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Program preference standard ?
« Reply #2 on: June 19, 2011, 04:08:23 PM »
The only place your program should save its own prefs is in its own dir that it was run from.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline Minuous

Re: Program preference standard ?
« Reply #3 on: June 19, 2011, 04:51:56 PM »
@Jose:

You haven't looked very hard I suspect.

http://amigan.1emu.net/aw/
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Program preference standard ?
« Reply #4 on: June 19, 2011, 05:18:55 PM »
Quote from: Jose;646203
if there is any standard way/place whatever to save the preferences of the program ? i.e. like the default sana device to use, packet definitions the user might want to wait for, GUI preferences ....
I realize some stuff goes into preferences directory on sys: IRC, but I think that's more like for the system oriented programs...

The standard location is ENVARC: for the saved configuration and ENV: for the currently used configuration. At boot the ENVARC: content is copied to ENV:. sys directory in this location is reserved for OS preferences.

If your application is a simple one with only need for a single file for preferences you're typically supposed to save them in a appname.prefs. If on the other hand you have several files you should use a subdir appname/file1.prefs appname/file2.prefs etc. As ENV: is stored in RAM: you should avoid storing excessive large files.

When editing settings user is presented with 3 options: Save, Use and Cancel. Save saves the settings to both ENVARC: and ENV:, and the application begins to use the selected configuration. Use saves the settings to ENV: only, and the application begins to use the selected configuration. Cancel discards any changes to the configuration and the application continues to use the old settings.
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Program preference standard ?
« Reply #5 on: June 20, 2011, 03:02:11 AM »
Quote from: Piru;646218
The standard location is ENVARC: for the saved configuration and ENV: for the currently used configuration. At boot the ENVARC: content is copied to ENV:. sys directory in this location is reserved for OS preferences.

If your application is a simple one with only need for a single file for preferences you're typically supposed to save them in a appname.prefs. If on the other hand you have several files you should use a subdir appname/file1.prefs appname/file2.prefs etc. As ENV: is stored in RAM: you should avoid storing excessive large files.

When editing settings user is presented with 3 options: Save, Use and Cancel. Save saves the settings to both ENVARC: and ENV:, and the application begins to use the selected configuration. Use saves the settings to ENV: only, and the application begins to use the selected configuration. Cancel discards any changes to the configuration and the application continues to use the old settings.
A very good explanation!

What is the defining characteristic that determines whether an app should save prefs into its own dir (Work:Apps/JoseMegaProggy/JoseMegaProggy.prefs)
vs. saving in ENVARC: and ENV:
?

I have seen some programs save prefs into S: which I really don't like.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: Program preference standard ?
« Reply #6 on: June 20, 2011, 04:01:05 AM »
Quote from: ChaosLord;646297
What is the defining characteristic that determines whether an app should save prefs into its own dir (Work:Apps/JoseMegaProggy/JoseMegaProggy.prefs)
vs. saving in ENVARC: and ENV:
?

Generally true if the settings are system wide, don't have their own directory, or are multi-user. The Amiga User Interface Style Guide recommends searching...

1) Tool types or command line specified options (e.g. SETTINGS=path)
2) Settings found in program directory (TCL's recommendation)
3) Piru's explanation for ENV: and ENVARC:

If none of these can be found then default settings should be used.

The AUIFSG is well written and still useful today. It can be found online and is worth a look...

http://amigan.1emu.net/aw/style.zip

Quote from: ChaosLord;646297
I have seen some programs save prefs into S: which I really don't like.

Not Amiga User Interface Style Guide compliant. I don't like it either.
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Program preference standard ?
« Reply #7 on: June 20, 2011, 09:54:42 AM »
Quote from: ChaosLord;646297
A very good explanation!

What is the defining characteristic that determines whether an app should save prefs into its own dir (Work:Apps/JoseMegaProggy/JoseMegaProggy.prefs)
vs. saving in ENVARC: and ENV:
?

I have seen some programs save prefs into S: which I really don't like.

If your application doesnt implement Save/Use/Cancel and it has got its own directory then saving preferences to PROGDIR: could be considered. Using PROGDIR: allows easy uninstall (just wipe program dir) without cluttering ENV. On the other hand supporting ENV/ENVARC user could easily switch profiles.
My Amigas: A500, Mac Mini and PowerBook
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Program preference standard ?
« Reply #8 on: June 20, 2011, 10:05:03 AM »
@Itix
Does MorphOS support multiuser profiles?

--------------------

I generally prefer progs to keep their stuff in their own PROGDIR: because having thousands of files in ENVARC: slows down the booting process.  Of course if a prog has a real need to store stuff in ENVARC: then I am not against it.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: Program preference standard ?
« Reply #9 on: June 21, 2011, 02:05:44 AM »
Quote from: ChaosLord;646325

I generally prefer progs to keep their stuff in their own PROGDIR: because having thousands of files in ENVARC: slows down the booting process.  Of course if a prog has a real need to store stuff in ENVARC: then I am not against it.


I generally prefer PROGDIR: for settings also but HappyENV is the answer to slow booting and wasted memory for settings.

http://aminet.net/util/sys/envhandler.lha
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Program preference standard ?
« Reply #10 on: June 24, 2011, 12:27:26 AM »
That's pretty much all the info I wanted, a beer to everyone...
\\"We made Amiga, they {bleep}ed it up\\"