shell: Let panels have their own commandline flags
Add a class method to CcPanel to get a GOptionGroup which will be added to the main commandline parser. This gives panels the chance to have commandline "--flags" in addition to the already available parameters. This changes changes the way parameters are passed to panels: the first entry in the GVariant array is always the a{sv} dictionary of commandline flags, followed by the remaining free-form arguments. https://bugzilla.gnome.org/show_bug.cgi?id=696054
This commit is contained in:
parent
9977bb200e
commit
31a8a99440
9 changed files with 55 additions and 10 deletions
|
@ -259,3 +259,15 @@ cc_panel_get_help_uri (CcPanel *panel)
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue