Results 1 to 3 of 3

Thread: Plugin configuration?

  1. #1
    Low Bitrate
    Join Date
    Mar 2007
    Posts
    70

    Plugin configuration?

    Hey Dave,

    I was wondering what your thoughts were on how you want to implement this... Should each plugin specify its own configuration screen UI or should CarFrontEnd provide some generic UI? How should the data be stored?

  2. #2
    CarFrontEnd Creator iamgnat's Avatar
    Join Date
    Jul 2004
    Location
    NoVA
    Posts
    867
    Each plugin should handle it's own UI for it's configuration. As far as the configuration data, while you are not restricted to it there are methods in CarFrontEndAPI/PluginManager.h that allow you to save and retrieve configuration information. Currently you can store anything in there that NSDictionary can write to the file system.

    Code:
    #pragma mark Plugin Preferences methods
    @protocol PluginPreferences
    
    // Returns the current preferences for the given plugin.
    //  This is based on the value returned by the -name method of the plugin, so
    //      it is critical not to share names with other plugins.
    - (NSDictionary *) preferencesForPlugin: (id <CarFrontEndProtocol>) plugin;
    
    // Stores the given preferences dictionary.
    //  The structure of the dictionary is completely arbitrary from CFE's point
    //      of view and completely in the Plugin's control.
    //  This is based on the value returned by the -name method of the plugin, so
    //      it is critical not to share names with other plugins.
    - (void) savePreferences: (NSDictionary *) pluginPreferences
                  forPlugin: (id <CarFrontEndProtocol>) plugin;
    
    @end
    Here is a rough example:
    Code:
    - (void) savePrefs: (id) sender {
        NSMutableDictionary    *prefs = [[pluginManager preferencesForPlugin:self] mutableCopyWithZone:NULL];
    
        ...
    
        [pluginManager savePreferences:prefs forPlugin:self];
    }
    Let me know if you need more details.

    -dave
    My pathetic worklog.
    CarFrontEnd (now it's own sub-forum!!!!)

  3. #3
    Low Bitrate
    Join Date
    Mar 2007
    Posts
    70
    Thanks, I'll take a closer look at it soon.

Similar Threads

  1. Velleman K8055 USB I/O Board Extension plugin
    By 307SW_NLD in forum RR Released Plugins
    Replies: 224
    Last Post: 02-24-2013, 06:59 AM
  2. Service Configuration Files
    By Phatsacks in forum WinNT Based
    Replies: 1
    Last Post: 08-29-2007, 11:03 PM
  3. IRMAN plugin
    By knyarko in forum StreetDeck
    Replies: 3
    Last Post: 01-05-2007, 08:26 PM
  4. How do I use the Base plugin sources ?
    By guino in forum RR FAQ
    Replies: 1
    Last Post: 04-24-2006, 03:43 PM
  5. Winamp LCD display plugin / IRMan plugin - together?
    By Jarrod in forum Software & Software Development
    Replies: 9
    Last Post: 06-03-2002, 05:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •