PeasUIConfigurable

PeasUIConfigurable — Interface for configurable plugins.

Synopsis

#define             PEAS_UI_CONFIGURABLE_IFACE          (obj)
                    PeasUIConfigurable;
                    PeasUIConfigurableInterface;
gboolean            peas_ui_configurable_is_configurable
                                                        (PeasUIConfigurable *configurable);
gboolean            peas_ui_configurable_create_configure_dialog
                                                        (PeasUIConfigurable *configurable,
                                                         GtkWidget **conf_dlg);

Object Hierarchy

  GInterface
   +----PeasUIConfigurable

Prerequisites

PeasUIConfigurable requires GObject.

Description

The PeasUIConfigurable interface will allow a PeasPlugin to provide a graphical interface for the user to configure the plugin through the PeasUIPluginManager: the PeasUIPluginManager will make the “Configure Plugin” button active when the selected plugin implements the PeasUIConfigurable interface and peas_ui_configurable_is_configurable() returns TRUE. See peas_ui_configurable_is_configurable().

To do so, the plugin writer will just need to implement the create_configure_dialog() method. You should not implement the is_configurable() method, unless create_configure_dialog() is overwritten but does not always return a valid GtkWindow.

Details

PEAS_UI_CONFIGURABLE_IFACE()

#define PEAS_UI_CONFIGURABLE_IFACE(obj)        (G_TYPE_CHECK_CLASS_CAST ((obj), PEAS_UI_TYPE_CONFIGURABLE, PeasUIConfigurableInterface))

PeasUIConfigurable

typedef struct _PeasUIConfigurable PeasUIConfigurable;

PeasUIConfigurableInterface

typedef struct {
  GTypeInterface g_iface;

  gboolean    (*create_configure_dialog)  (PeasUIConfigurable *configurable,
                                           GtkWidget         **conf_dlg);

  /* Plugins should usually not override this, it's handled automatically
   * by the PeasPluginClass */
  gboolean    (*is_configurable)          (PeasUIConfigurable *configurable);
} PeasUIConfigurableInterface;

peas_ui_configurable_is_configurable ()

gboolean            peas_ui_configurable_is_configurable
                                                        (PeasUIConfigurable *configurable);

Returns whether the plugin is configurable.

The default implementation of the is_configurable() method will return TRUE if the create_configure_dialog() method was overriden, hence you won't usually need to override this method.

configurable :

A PeasUIConfigurable

Returns :

TRUE if the plugin is configurable.

peas_ui_configurable_create_configure_dialog ()

gboolean            peas_ui_configurable_create_configure_dialog
                                                        (PeasUIConfigurable *configurable,
                                                         GtkWidget **conf_dlg);

Creates the configure dialog widget for the plugin.

The default implementation returns NULL.

configurable :

A PeasUIConfigurable

conf_dlg :

(out) A GtkWindow used for configuration

Returns :

TRUE on success.