Commit Graph

33 Commits

Author SHA1 Message Date
Ray Strode
eabad1923e Revert "gsettings-tool: warn if setting a value fails"
This reverts commit ea57feff96.

It makes the gsettings tool fail any time it tries to set a
key to a value, that the key already has.

https://bugzilla.gnome.org/show_bug.cgi?id=641768
2011-05-23 13:40:02 -04:00
Ryan Lortie
9793919d7b Whitespace fixes 2011-05-18 17:56:50 -04:00
Ryan Lortie
8148a3c396 Fix gsettings tool string handling
There are some bugs caused by the way that gsettings-tool currently
attempts to help the user when they leave the quotes off of a string
value that they are setting.

Simplify the code to make it more robust and add some comments about why
it should be done this way.

https://bugzilla.gnome.org/show_bug.cgi?id=649915
2011-05-17 11:58:46 -04:00
Colin Walters
bf087aabbf gsettings-tool fixes: Add missing _apply(), add unset-recursively to man page 2011-04-12 12:56:33 -04:00
Colin Walters
3fd9f2e8f9 gsettings: Implement reset-recursively
Motivation was the ability to:
$ gsettings reset-recursively org.gnome.gnome-panel

https://bugzilla.gnome.org/show_bug.cgi?id=647579
2011-04-12 12:13:43 -04:00
Dan Winship
ea57feff96 gsettings-tool: warn if setting a value fails
eg, if the dconf backend cannot connect to dbus

https://bugzilla.gnome.org/show_bug.cgi?id=641768
2011-04-09 12:45:16 -04:00
Matthias Clasen
766d70729b Allow to list keys in all schemas
Make the schema argument to gsettings list-recursively optional.
This allows to search for not exactly known keys by going

gsettings list-recursively | grep 'font'
2011-02-23 00:18:37 -05:00
Matthias Clasen
c3334490c7 Fix some problems with message handling
g_printerr() doesn't append a newline, so we have to consistently
do it everywhere. Also, we cannot call gettext on "", ever.
2011-02-12 12:45:25 -05:00
Matthias Clasen
51c87f6809 Update help and docs for gsettings cmdline tool
The man page had gotten quite out of sync.
2011-01-21 18:02:05 -05:00
Christian Persch
ce50df7e0e Better error reporting for g_variant_parse()
Add error codes, and use them when setting the GError.

Bug #634583.
2010-12-12 13:25:34 +01:00
Matthias Clasen
9574dbd228 Be more careful about overwriting errors
When trying to parse again, we don't want to overwrite the exiting
error.
2010-10-31 20:58:15 -04:00
Matthias Clasen
e24dfacd5b gsettings-tool: Support completion for enum values
https://bugzilla.gnome.org/show_bug.cgi?id=631264
2010-10-30 01:13:42 -04:00
Matthias Clasen
6298e88538 Add a command to list keys and values recursively
This is similar to gconftool-2 -R, which is very handy
for collecting information for bug reports, etc. It is now
possible to say gsettings list-recursively org.foo.bar, and
this will produce a list of schemas, keys and values for
org.foo.bar and all its child and grandchild schemata,
recursively.

https://bugzilla.gnome.org/show_bug.cgi?id=632571
2010-10-30 00:00:06 -04:00
Matthias Clasen
d619216686 Make gsettings-tool translatable again
This regression was caused by the recent rewrite.
2010-10-29 23:12:07 -04:00
Ryan Lortie
c4037230d4 gsettings-tool: Add 'range' subcommand
Provides access to the g_settings_get_range() functionality, converting
its return value to something that's reasonable for printing at the
console and potentially parseable.  The format may change.

Bug #631264.
2010-10-04 03:42:57 -04:00
Ryan Lortie
59bdba3cbb gsettings-tool: implement range-checking
Prevent assertion messages from spewing forth and also ensure that we
exit with an error status in the event that the value was out of range.

Bug #631264.
2010-10-04 03:42:43 -04:00
Ryan Lortie
2d6f8a8ea4 gsettings-tool: Rewrite
Rewrite the GSettings tool.

Improvements/changes:

 - simplify the code by performing common actions (like creating a
   schema) in only one place instead of one per-command

 - new features (list schemas, list keys, monitor multiple, etc)

 - factor-out bash completion and implement in shellscript

 - input validation: should never abort due to invalid inputs

Still to do:

 - proper error checking for ranges/choices

 - support for querying range/choice information

 - bash completion support for enums

Closes bug #629289, possibly among others.
2010-10-03 02:48:07 -04:00
Claude Paroz
86d3342f85 Add translator comments for command parameter translation 2010-09-22 10:42:55 +02:00
Ryan Lortie
77e3badcf3 split GSettings.list_items => list_{children,keys}
This is an incompatible public API/ABI change.
2010-09-09 16:42:55 -04:00
Ryan Lortie
d5bd531d96 Cleanup the GSettingsBackend API
This is a substantial ABI break.  Rebuild dconf.
2010-07-22 18:39:50 -04:00
Ryan Lortie
137ae2413c g_settings_list_keys() -> _list_items()
This function returns children as well.
2010-06-30 10:02:45 -04:00
Matthias Clasen
d20969e07b Filter out child schema entries when listing keys 2010-06-27 16:31:53 -04:00
Matthias Clasen
025435329a Implement bash completion for gsettings 2010-06-27 16:00:20 -04:00
Ryan Lortie
795d2bf8cf GSettings: Don't free value before using its type
Fix a bug where the type from g_variant_get_type() was used after
freeing the variant.  This works for base types (since they are cached
and live forever) but not for arrays (where the bug was first seen).
2010-06-27 10:12:59 -04:00
Milan Bouchet-Valat
a558e460a2 Fix gsettings tool crash, part 2
Same as previous commit, but for two other functions it missed.
2010-06-19 19:00:13 +02:00
Milan Bouchet-Valat
62939f5e45 Fix gsettings tool crash
When no path is provided for the schema, we have call
g_settings_new() instead of g_settings_new_with_path()
passing a NULL path.

This was crashing the tool on start since an assertion was
recently added to g_settings_new_with_path() to refuse NULL.
2010-06-19 18:33:26 +02:00
Ryan Lortie
0766981a1e Make g_settings_sync() a proper prototype. 2010-06-17 16:56:53 -04:00
Ryan Lortie
a8b5353b14 Add g_settings_sync() and use it 2010-06-10 22:30:44 -04:00
Ryan Lortie
3160bcad6a GDBusConnection.call(): add 'reply_type' argument
This allows the caller to specify the reply type that they are expecting
for this call.  If the reply comes back with the wrong type, GDBus will
generate an appropriate error internally.

  - add a GVariantType * argument to g_dbus_connection_call() and
    _call_sync().

  - move the internal API for computing message types from introspection
    data to be based on GVariantType instead of strings.  Update users
    of this code.

  - have GDBusProxy pass this calculated GVariantType into
    g_dbus_connection_call().  Remove the checks done in GDBusProxy.

  - Update other users of the code (test cases, gdbus-tool, GSettings
    tool, etc).  In some cases, remove redundant checks; in some other
    cases, we are fixing bugs because no checking was done where it
    should have been.

Closes bug #619391.
2010-05-24 17:00:04 -04:00
Ryan Lortie
849684e540 GSettings tool: work-around GDBus issue
There is currently no way (near as I can tell) to ensure that a message
has been sent when using GDBus.  If we exit() before we are sure, then
it is very possible that the message isn't sent at all.  This behaviour
was observed when using the GSettings commandline tool with dconf.

A quick and dirty workaround for now.
2010-05-17 07:16:37 -04:00
Matthias Clasen
f3e04973e7 Rename gsettings-tool to gsettings
And make it verb-based.
2010-04-22 01:17:02 -04:00
Matthias Clasen
bedf4c3259 Add documentation and translation for gsettings-tool 2010-04-20 22:55:15 -04:00
Matthias Clasen
1dbe06c30a Add a minimal commandline utility to poke GSettings 2010-04-20 22:55:15 -04:00