-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide command line options for WebKitSettings properties #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a nitpick.
core/cog-utils.c
Outdated
const gboolean prop_value = !(value && | ||
g_ascii_strcasecmp (value, "true") && | ||
strcmp (value, "1")); | ||
g_printerr ("set %s=%s\n", option, prop_value ? "true" : "false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a stray debug statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, good catch! Let's remove this before merging 👍
This adds code to introspect properties of a given GObjectClass and obtain a set of GOptionEntry instances which, when added to a GOptionGroup, will set the values of the properties from the parsed command line options. Then, the above utility code is used to expose the properties from WebKitSettings in a generic way, instead of having to manually add a GOptionEntry and handling for each settings. The following CLI options are replaced by the new functionality, which covers the corresponding settings: --webgl becomes --enable-webgl=1 -D/--dev-tools becomes --enable-developer-extras=1 -v/--log-console becomes --enable-write-console-messages-to-stdout=1 Closes #27
Instead of directly using the type names provided by GType, use uppercase strings for the value placeholders in help texts, which makes the output from --help-websettings more easily readable and provide a few lines with explanations for the available input formats.
fbe6cc6
to
72b2818
Compare
I've added a small commit on top to provide a nicer formatting of the help output when using
|
This adds code to introspect properties of a given
GObjectClass
and obtain a set ofGOptionEntry
instances which, when added to aGOptionGroup
, will set the values of the properties from the parsed command line options.Then, the above utility code is used to expose the properties from
WebKitSettings
in a generic way, instead of having to manually add aGOptionEntry
and handling for each settings.The following CLI options are replaced by the new functionality, which covers the corresponding settings:
--webgl
--enable-webgl=1
-D
--dev-tools
--enable-developer-extras=1
-v
--log-console
--enable-write-console-messages-to-stdout=1
Closes #27