shell: Revert "Let panels have their own commandline flags"
This reverts commit 31a8a99440
.
This was meant for bgo#695885 which has stalled for a while, so this
feature has no in-tree user. This commit removes it for now, this can be
readded when users for it materialize.
https://bugzilla.gnome.org/show_bug.cgi?id=751597
This commit is contained in:
parent
7ce6ce6807
commit
c84722248e
9 changed files with 10 additions and 55 deletions
|
@ -90,19 +90,17 @@ cc_keyboard_panel_set_property (GObject *object,
|
||||||
page = section = NULL;
|
page = section = NULL;
|
||||||
switch (g_variant_n_children (parameters))
|
switch (g_variant_n_children (parameters))
|
||||||
{
|
{
|
||||||
case 3:
|
case 2:
|
||||||
g_variant_get_child (parameters, 2, "v", &v);
|
g_variant_get_child (parameters, 1, "v", &v);
|
||||||
section = g_variant_get_string (v, NULL);
|
section = g_variant_get_string (v, NULL);
|
||||||
g_variant_unref (v);
|
g_variant_unref (v);
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
case 2:
|
case 1:
|
||||||
g_variant_get_child (parameters, 1, "v", &v);
|
g_variant_get_child (parameters, 0, "v", &v);
|
||||||
page = g_variant_get_string (v, NULL);
|
page = g_variant_get_string (v, NULL);
|
||||||
g_variant_unref (v);
|
g_variant_unref (v);
|
||||||
cc_keyboard_panel_set_page (panel, page, section);
|
cc_keyboard_panel_set_page (panel, page, section);
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
case 1:
|
|
||||||
/* No flags expected, fall-through */
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -167,8 +167,7 @@ variant_av_to_string_array (GVariant *array)
|
||||||
count = g_variant_iter_init (&iter, array);
|
count = g_variant_iter_init (&iter, array);
|
||||||
strv = g_ptr_array_sized_new (count + 1);
|
strv = g_ptr_array_sized_new (count + 1);
|
||||||
while (g_variant_iter_next (&iter, "v", &v)) {
|
while (g_variant_iter_next (&iter, "v", &v)) {
|
||||||
if (g_variant_is_of_type (v, G_VARIANT_TYPE_STRING))
|
g_ptr_array_add (strv, (gpointer *)g_variant_get_string (v, NULL));
|
||||||
g_ptr_array_add (strv, (gpointer *)g_variant_get_string (v, NULL));
|
|
||||||
g_variant_unref (v);
|
g_variant_unref (v);
|
||||||
}
|
}
|
||||||
g_ptr_array_add (strv, NULL); /* NULL-terminate the strv data array */
|
g_ptr_array_add (strv, NULL); /* NULL-terminate the strv data array */
|
||||||
|
|
|
@ -159,12 +159,12 @@ cc_goa_panel_set_property (GObject *object,
|
||||||
const gchar *first_arg = NULL;
|
const gchar *first_arg = NULL;
|
||||||
|
|
||||||
parameters = g_value_get_variant (value);
|
parameters = g_value_get_variant (value);
|
||||||
if (parameters == NULL || g_variant_n_children (parameters) == 0)
|
if (parameters == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_variant_n_children (parameters) > 1)
|
if (g_variant_n_children (parameters) > 0)
|
||||||
{
|
{
|
||||||
g_variant_get_child (parameters, 1, "v", &v);
|
g_variant_get_child (parameters, 0, "v", &v);
|
||||||
if (g_variant_is_of_type (v, G_VARIANT_TYPE_STRING))
|
if (g_variant_is_of_type (v, G_VARIANT_TYPE_STRING))
|
||||||
first_arg = g_variant_get_string (v, NULL);
|
first_arg = g_variant_get_string (v, NULL);
|
||||||
else
|
else
|
||||||
|
|
|
@ -54,10 +54,9 @@ cc_sound_panel_set_property (GObject *object,
|
||||||
GVariant *parameters;
|
GVariant *parameters;
|
||||||
|
|
||||||
parameters = g_value_get_variant (value);
|
parameters = g_value_get_variant (value);
|
||||||
if (parameters && g_variant_n_children (parameters) > 1) {
|
if (parameters && g_variant_n_children (parameters) > 0) {
|
||||||
GVariant *v;
|
GVariant *v;
|
||||||
/* Skip the first child, we don't expect any flag */
|
g_variant_get_child (parameters, 0, "v", &v);
|
||||||
g_variant_get_child (parameters, 1, "v", &v);
|
|
||||||
gvc_mixer_dialog_set_page (self->dialog, g_variant_get_string (v, NULL));
|
gvc_mixer_dialog_set_page (self->dialog, g_variant_get_string (v, NULL));
|
||||||
g_variant_unref (v);
|
g_variant_unref (v);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,22 +131,18 @@ cc_application_command_line (GApplication *application,
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariantBuilder *flags_builder;
|
|
||||||
|
|
||||||
verbose = FALSE;
|
verbose = FALSE;
|
||||||
show_overview = FALSE;
|
show_overview = FALSE;
|
||||||
show_help = FALSE;
|
show_help = FALSE;
|
||||||
start_panels = NULL;
|
start_panels = NULL;
|
||||||
|
|
||||||
flags_builder = g_variant_builder_new (G_VARIANT_TYPE_VARDICT);
|
|
||||||
|
|
||||||
argv = g_application_command_line_get_arguments (command_line, &argc);
|
argv = g_application_command_line_get_arguments (command_line, &argc);
|
||||||
|
|
||||||
context = g_option_context_new (N_("- Settings"));
|
context = g_option_context_new (N_("- Settings"));
|
||||||
g_option_context_add_main_entries (context, all_options, GETTEXT_PACKAGE);
|
g_option_context_add_main_entries (context, all_options, GETTEXT_PACKAGE);
|
||||||
g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
|
g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
|
||||||
g_option_context_add_group (context, gtk_get_option_group (TRUE));
|
g_option_context_add_group (context, gtk_get_option_group (TRUE));
|
||||||
cc_panel_loader_add_option_groups (context, flags_builder);
|
|
||||||
g_option_context_set_help_enabled (context, FALSE);
|
g_option_context_set_help_enabled (context, FALSE);
|
||||||
|
|
||||||
start_panels = NULL;
|
start_panels = NULL;
|
||||||
|
@ -231,8 +227,6 @@ cc_application_command_line (GApplication *application,
|
||||||
g_debug ("No extra argument");
|
g_debug ("No extra argument");
|
||||||
|
|
||||||
builder = g_variant_builder_new (G_VARIANT_TYPE ("av"));
|
builder = g_variant_builder_new (G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (builder, "v", g_variant_builder_end (flags_builder));
|
|
||||||
|
|
||||||
for (i = 1; start_panels[i] != NULL; i++)
|
for (i = 1; start_panels[i] != NULL; i++)
|
||||||
g_variant_builder_add (builder, "v", g_variant_new_string (start_panels[i]));
|
g_variant_builder_add (builder, "v", g_variant_new_string (start_panels[i]));
|
||||||
parameters = g_variant_builder_end (builder);
|
parameters = g_variant_builder_end (builder);
|
||||||
|
|
|
@ -216,21 +216,4 @@ cc_panel_loader_load_by_name (CcShell *shell,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
cc_panel_loader_add_option_groups (GOptionContext *context,
|
|
||||||
GVariantBuilder *builder)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (all_panels); i++)
|
|
||||||
{
|
|
||||||
GType (*get_type) (void);
|
|
||||||
get_type = all_panels[i].get_type;
|
|
||||||
GOptionGroup *group = cc_panel_get_option_group (get_type(), builder);
|
|
||||||
if (group == NULL)
|
|
||||||
continue;
|
|
||||||
g_option_context_add_group (context, group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CC_PANEL_LOADER_NO_GTYPES */
|
#endif /* CC_PANEL_LOADER_NO_GTYPES */
|
||||||
|
|
|
@ -30,8 +30,6 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
void cc_panel_loader_fill_model (CcShellModel *model);
|
void cc_panel_loader_fill_model (CcShellModel *model);
|
||||||
GList *cc_panel_loader_get_panels (void);
|
GList *cc_panel_loader_get_panels (void);
|
||||||
void cc_panel_loader_add_option_groups (GOptionContext *context,
|
|
||||||
GVariantBuilder *builder);
|
|
||||||
CcPanel *cc_panel_loader_load_by_name (CcShell *shell,
|
CcPanel *cc_panel_loader_load_by_name (CcShell *shell,
|
||||||
const char *name,
|
const char *name,
|
||||||
GVariant *parameters);
|
GVariant *parameters);
|
||||||
|
|
|
@ -280,15 +280,3 @@ cc_panel_get_help_uri (CcPanel *panel)
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GOptionGroup *
|
|
||||||
cc_panel_get_option_group (GType panel_type,
|
|
||||||
GVariantBuilder *builder)
|
|
||||||
{
|
|
||||||
GOptionGroup *options = NULL;
|
|
||||||
CcPanelClass *class = CC_PANEL_CLASS (g_type_class_ref (panel_type));
|
|
||||||
if (class->get_option_group != NULL)
|
|
||||||
options = class->get_option_group (builder);
|
|
||||||
g_type_class_unref (class);
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
|
@ -74,16 +74,12 @@ struct _CcPanelClass
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GtkBinClass parent_class;
|
GtkBinClass parent_class;
|
||||||
|
|
||||||
GOptionGroup * (* get_option_group) (GVariantBuilder *builder);
|
|
||||||
GPermission * (* get_permission) (CcPanel *panel);
|
GPermission * (* get_permission) (CcPanel *panel);
|
||||||
const char * (* get_help_uri) (CcPanel *panel);
|
const char * (* get_help_uri) (CcPanel *panel);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType cc_panel_get_type (void);
|
GType cc_panel_get_type (void);
|
||||||
|
|
||||||
GOptionGroup *cc_panel_get_option_group (GType panel_type,
|
|
||||||
GVariantBuilder *builder);
|
|
||||||
|
|
||||||
CcShell* cc_panel_get_shell (CcPanel *panel);
|
CcShell* cc_panel_get_shell (CcPanel *panel);
|
||||||
|
|
||||||
GPermission *cc_panel_get_permission (CcPanel *panel);
|
GPermission *cc_panel_get_permission (CcPanel *panel);
|
||||||
|
|
Loading…
Add table
Reference in a new issue