2
* Create a test app for your plugin quickly.
4
* #define NEW gsd_media_keys_manager_new
5
* #define START gsd_media_keys_manager_start
6
* #define MANAGER GsdMediaKeysManager
7
* #include "gsd-media-keys-manager.h"
9
* #include "test-plugin.h"
16
#include <glib/gi18n.h>
18
#include <libnotify/notify.h>
21
#define SCHEMA_NAME PLUGIN_NAME
25
#error Include PLUGIN_CFLAGS in the test application s CFLAGS
26
#endif /* !PLUGIN_NAME */
28
static MANAGER *manager = NULL;
33
const gchar * const * list;
36
list = g_settings_list_schemas ();
37
for (i = 0; list[i] != NULL; i++) {
38
if (g_str_equal (list[i], "org.gnome.settings-daemon.plugins." SCHEMA_NAME))
45
print_enable_disable_help (void)
47
fprintf (stderr, "To deactivate:\n");
48
fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active false\n");
49
fprintf (stderr, "To reactivate:\n");
50
fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active true\n");
54
main (int argc, char **argv)
59
bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
60
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
61
textdomain (GETTEXT_PACKAGE);
62
notify_init ("gnome-settings-daemon");
64
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
67
if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) {
68
fprintf (stderr, "%s\n", error->message);
73
if (has_settings () == FALSE) {
74
fprintf (stderr, "The schemas for plugin '%s' isn't available, check your installation.\n", SCHEMA_NAME);
76
settings = g_settings_new ("org.gnome.settings-daemon.plugins." SCHEMA_NAME);
77
if (g_settings_get_boolean (settings, "active") != FALSE) {
78
fprintf (stderr, "Plugin '%s' is not disabled. You need to disable it before launching the test application.\n", SCHEMA_NAME);
79
print_enable_disable_help ();
82
print_enable_disable_help();
88
START (manager, &error);
93
g_object_unref (manager);