Commit 3bdeb456 authored by John Stowers's avatar John Stowers

Add a --verbose option

parent e2b8f81f
3.1.0
* Mark many strings as translatable.
* Now appears as 'Advanced Settings' in GNOME shell search
* Add a -v,--verbose option that prints changed settings
3.0.5
* More autostart desktop file fixes. Try harder to autostart nautilus when
......
......@@ -57,6 +57,8 @@ if __name__ == '__main__':
help="Enable test and debug code")
parser.add_option("-p", "--prefix",
help="Installation prefix (for gsettings schema, themes, etc)", metavar="[/, /usr]")
parser.add_option("-v", "--verbose", action="store_true",
help="Print the names of settings modified")
options, args = parser.parse_args()
try:
......@@ -82,6 +84,7 @@ if __name__ == '__main__':
gtweak.PKG_DATA_DIR = PKG_DATA_DIR
gtweak.ENABLE_TEST = options.test
gtweak.APP_NAME = "gnome-tweak-tool"
gtweak.VERBOSE = options.verbose
logging.basicConfig(format="%(levelname)-8s: %(message)s", level=logging.INFO)
......
......@@ -18,6 +18,8 @@
import subprocess
import logging
import gtweak
from gi.repository import GConf
class GConfSetting:
......@@ -62,6 +64,9 @@ class GConfSetting:
assert(False)
def set_value(self, value):
if gtweak.VERBOSE:
print "Change: %s -> %s" % (self._key, value)
if self._type == bool:
self._client.set_bool(self._key, value)
elif self._type == str:
......
......@@ -68,6 +68,12 @@ class GSettingsSetting(Gio.Settings):
self._schema = _SCHEMA_CACHE[schema_name]
if gtweak.VERBOSE:
self.connect("changed", self._on_changed)
def _on_changed(self, settings, key_name):
print "Change: %s %s -> %s" % (self.props.schema, key_name, self[key_name])
def _setting_check_is_list(self, key):
variant = Gio.Settings.get_value(self, key)
return variant.get_type_string() == "as"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment