Unified Prefs Project
  • Just looking around
    aldur
    Posts: 5 from 2005/8/25
    Hi guys, I'm developing some projects at the moment and would like your input in a morphos Version

    Link to the AROS thread about this project
    http://aros-exec.org/modules/newbb/viewtopic.php?topic_id=1213&forum=2&post_id=9945#forumpost9945

    Link to the AmigaOS4 thread about this project
    http://amigaworld.net/modules/newbb/viewtopic.php?topic_id=16281&forum=15

    I was wondering if this would be something that your platform would be intrested in,

    basically I know nothing about the preference system in your OS but if anyone is intrested in discussing this idea I would appricate the discussion as I want to make sure that I cover as much as possible at the start.
  • »09.12.05 - 15:12
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Bladerunner
    Posts: 418 from 2004/2/19
    Well, I have to admit i don`t fully understand what your project means. Afaiu, You are thinking of a monolithic preferences programm where all system settings can be managed? Like in KDE for example?
    Well thats the way MorphOS allready works. You have an all in one Prefs programm. The only difference is afaik that no xml is used to generate prefs files and you still have single prefs files. But I don`t see whats wrong with that. But then, as I allready said, I am not sure whether I fully understood your aproach.
  • »09.12.05 - 19:05
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Idea is defining preferences in an XML file and UP creates a preferences editor out of it.

    But problem in this project is that MUI already provides these kind of services and writing a prefs editor is only matter of few lines at best... It is good idea and initiative but MUI coders probably wont adapt it....

    Anyway that is only my opinion.
    1 + 1 = 3 with very large values of 1
  • »09.12.05 - 20:23
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Aaah... didnt read AWN thread fully. It could allow sharing same preferences across applications (internet proxy settings for example).

    I dont still see much use for application specific preferences for reasons mentioned in above but for more global settings, why not.
    1 + 1 = 3 with very large values of 1
  • »09.12.05 - 20:28
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    pixie
    Posts: 147 from 2003/9/5
    From: Am*ga
    Framiel Feelins seems to be a good aproach for this... see his post on aros-exec
    pixie - writing from a paradise called Portugal
  • »10.12.05 - 02:30
    Profile
  • Butterfly
    Butterfly
    alfie
    Posts: 96 from 2005/3/25
    From: Italy
    I see advantages in your approch, but other unified preferences on Amiga didn't have wild usage (think of mime vapor preferences f.e.). It is very hard to image that programmers would stop using their preferred way to store prefs and "commons prefs" like in your example (proxy settings) are very rare.
  • »10.12.05 - 12:06
    Profile Visit Website
  • Just looking around
    aldur
    Posts: 5 from 2005/8/25
    @all

    Thanks for your points of View, I don't have Morphos so bare with me.

    Yes, my program would mean a single preference program managing multiple programs rather than a seperate preference programs for each preference file that exists.

    my reason for this is most of the software I tend to write would allow a user to define certain aspects of the program.

    For example UnifiedPrefs came out of my other project XGUIDE which is an XML representation of the AmigaGUIDE format that would allow authors to write XGUIDE documents that could be used in various different loactions and look completely different in each

    for example the idiots guide to samba for OS4 the xguide file could sit on the web server for downloading but a PHP script could convert the file into a website, and to update the site the author just uploads the new file to the web server replacing the old one. and it gets rendered.

    but when you download the document because its XML you could run a transformation on it (via a preference) to show it as Simple HTML or load it into a 3rd party program that would render it with a menu on the left and content on the right like a windows help file with search, index, etc... , or you could have a transformation that would load it into a PDF Viewer.

    as I want to create a Datatype for this format the control of the datatype would be via Unified preference that gives the user the ability to choose, in fact the preference could be set to prompt so that the datatype would ask what you want to view this document under.

    though the more I think about it the more I think that a datatype would not be right as it might need to be able to launch a different program than multiview possibly for viewing PDF's.


    I currently have a PHP script that will transform the XGUIDE I built that contains all of the information on the samba for idiots website that runs on my amiga of course the xslt template that I am using is ugly as sin ;-) but I'm not concerned about that at the minute. the XGUIDE format will actually be a compressed file that the php script will extract the information from, I just have to figure out how I want the web server to manage this as I don't want to be dearchiving each file in the compression (XML, images, ... whatever file you want)

    ado
  • »12.12.05 - 14:06
    Profile
  • Butterfly
    Butterfly
    alfie
    Posts: 96 from 2005/3/25
    From: Italy
    Why don't you simply write a fast, small, not stream oriented, not charsets supporting xml library parser? Your general xml configuration parser is not easy to implement and to use. Consider the server section of a simple amirc configuration file: what kind of structure would your library fill? In the very same situation, a simple xml configuration oriented parser, that calls some callback funtion, would be more useful.
  • »13.12.05 - 13:35
    Profile Visit Website
  • Just looking around
    aldur
    Posts: 5 from 2005/8/25
    Sorry could you go into more detail about this??

    when writting a program that would use my XML preference structure I would want to use the least amount of code to access the preference inside my code

    effectivly
    // initialise and load
    mylib = openlibrary("unifiedPrefs.library);
    myPrefPtr = mylib.load("prefs.demo.helloworld.xml");
    // get 4 settings
    myVar1 = mylib.get(myPrefPtr, "//preference[@name='myPref1']/Value");
    myVar2 = mylib.get(myPrefPtr, "//preference[@name='myPref2']/Value");
    myVar3 = mylib.get(myPrefPtr, "//preference[@name='myPref3']/Value");
    myVar4 = mylib.get(myPrefPtr, "//preference[@name='myPref4']/Value");

    or even
    // get 4 settings
    myVar1 = mylib.get(myPrefPtr, "myPref1");
    myVar2 = mylib.get(myPrefPtr, "myPref2");
    myVar3 = mylib.get(myPrefPtr, "myPref3");
    myVar4 = mylib.get(myPrefPtr, "myPref4");

    How is that not easy to use???

    Now a General Preference management tool that would allow the computer user to manage all the preferences that are on thier machine would be a little hard with the automatic generation of the actual preference editor window on the fly.


    [ Edited by aldur on 2005/12/14 23:25 ]
  • »14.12.05 - 16:22
    Profile
  • Butterfly
    Butterfly
    alfie
    Posts: 96 from 2005/3/25
    From: Italy
    LEt's suppose I have this file
    ---
    ...
    <serverlist>
    <server>
    <name>irc.freenode.net</name>
    <channelList>
    <channel autojoin="1">
    <name>#amigaita</name>
    </channel>
    <channel>
    <name>#morphos</name>
    </channel>
    <channel>
    <name>developers</name>
    <pass>CHGEISKKQE</pass>
    </channelList>
    </server>
    <server>
    <name>irc.tin.it</name>
    </server>
    </serverList>
    ...
    ---

    The above can be where ever in the xml file and can be also present in multiple instance. How do you read that?

    Ciao. Alfonso.
  • »14.12.05 - 16:48
    Profile Visit Website
  • Just looking around
    aldur
    Posts: 5 from 2005/8/25
    if we used the following format

    myVar1 = mylib.get(myPrefPtr, "//preference[@name='myPref1']/Value");

    then the follwoing line

    myVar = mylib.get(myPrefptr, "//serverList/server[channelList/channel[@autojoin='1']]/name");
    would retrieve "irc.freenode.net" while
    myVar = mylib.get(myPrefPtr, "//serverList/server/channelList/channel[@autojoin='1']/name");
    would retrieve "#amigaita"



    [ Edited by aldur on 2005/12/15 1:15 ]
  • »14.12.05 - 18:14
    Profile
  • Just looking around
    aldur
    Posts: 5 from 2005/8/25
    Just a note the unifiedPrefs.library will allow you to retrieve any value from any xml file

    but the management screen would require the XML file to be of a specific format.

    now it would be possible to store nearly any type of XML preference information if a preference type is defined and the Control panel program was updated to understand the new format.

    ado
  • »14.12.05 - 18:19
    Profile