ThunarxPreferencesProvider: thunarx Reference Manual

## ThunarxPreferencesProvider ThunarxPreferencesProvider — The interface to extensions that provide preferences |

## Functions

GList * | thunarx_preferences_provider_get_menu_items ()

## Types and Values

struct | ThunarxPreferencesProviderIface
| ThunarxPreferencesProvider

## Object Hierarchy

        GInterface
        ╰── ThunarxPreferencesProvider

## Prerequisites

ThunarxPreferencesProvider requires GObject.

## Includes

    #include <thunarx/thunarx.h>

## Description

The ThunarxPreferencesProvider interface is implemented by extensions that want to register additional items in the preferences menu of the file manager. In general this should only be done by extensions that are closely tied to the file manager (for example, the `thunar-uca` is such an extension, while an extension that just adds Compress file and Uncompress file to the context menu of compressed files should not add their own preferences to the file manager menu, because it should use desktop-wide settings for archive managers instead).

The name of ThunarxMenuItems returned from the thunarx_preferences_provider_get_menu `items()` method must be namespaced with the model to avoid collision with internal file manager menu items and menu items provided by other extensions. For example, the preferences menu item provided by the `thunar-uca` extension is called `ThunarUca::manage-menu-items`.

## Functions

### thunarx_preferences_provider_get_menu_items ()

    GList *
    thunarx_preferences_provider_get_menu_items
                                   (ThunarxPreferencesProvider *provider,
                                    GtkWidget *window);

Returns the list of ThunarxMenuItems that `provider` has to offer as preferences within `window` . These menu items will usually be added to the builtin list of preferences in the "Edit" menu of the file manager's `window` .

Plugin writers that implement this interface should make sure to choose descriptive names and tooltips, and not to crowd the "Edit" menu too much. That said, think twice before implementing this interface, as too many preference menu items will render the file manager useless over time!

The caller is responsible to free the returned list of menu items using something like this when no longer needed:

    1
    g_list_free_full (list, g_object_unref);

[skip]

#### Parameters

provider | a ThunarxPreferencesProvider. |
window | the GtkWindow within which the menu items will be used. |

#### Returns

the list of ThunarxMenuItems that `provider` has to offer as preferences within `window` .

[transfer full][element-type ThunarxMenuItem]

## Types and Values

### struct ThunarxPreferencesProviderIface

    struct ThunarxPreferencesProviderIface {
      GList *(*get_menu_items) (ThunarxPreferencesProvider *provider,
                                GtkWidget                  *window);
    };

Interface with virtual methods implementation by extensions that want to install preferences items in the file managers menu. Providers don't need to implement all of the virtual methods listed in the interface.

#### Members

`get_menu_items` () | See `thunarx_preferences_provider_get_menu_items()`. |

### ThunarxPreferencesProvider

    typedef struct _ThunarxPreferencesProvider ThunarxPreferencesProvider;