shell: Handle --list from the local instance

This is an help-like parameter, so we want its output to show up in the
terminal from which gnome-control-center was just started, not from the
terminal from which the main gnome-control-center instance was started.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
This commit is contained in:
Christophe Fergeau 2015-06-20 15:27:14 +02:00
parent b3138a4c0f
commit b484470e56

View file

@ -112,6 +112,21 @@ launch_panel_activated (GSimpleAction *action,
static gint
cc_application_handle_local_options (GApplication *application, GVariantDict *options)
{
if (g_variant_dict_contains (options, "list"))
{
GList *panels, *l;
panels = cc_panel_loader_get_panels ();
g_print ("%s\n", _("Available panels:"));
for (l = panels; l != NULL; l = l->next)
g_print ("\t%s\n", (char *) l->data);
g_list_free (panels);
return 0;
}
return -1;
}
@ -131,21 +146,6 @@ cc_application_command_line (GApplication *application,
argv = g_application_command_line_get_arguments (command_line, &argc);
options = g_application_command_line_get_options_dict (command_line);
if (g_variant_dict_contains (options, "list"))
{
GList *panels, *l;
panels = cc_panel_loader_get_panels ();
g_print ("%s\n", _("Available panels:"));
for (l = panels; l != NULL; l = l->next)
g_print ("\t%s\n", (char *) l->data);
g_list_free (panels);
return 0;
}
#ifdef HAVE_CHEESE
cheese_gtk_init (&argc, &argv);
#endif /* HAVE_CHEESE */