Migrate to GSettings
Use GSettings for all Shell configuration. GConf is kept to read configuration from external programs (Metacity, Nautilus and Magnifier), but ShellGConf is removed because it's mostly useless for the few calls we still have. Also get rid of unused GConf code in ShellAppSystem. A basic GConf schema is still used to override Metacity defaults and configure Magnifier in a system-wide fashion. GConf is also used as GSettings backend via the GSETTINGS_BACKEND environment variable. All of this will be removed when these programs have been ported to GSettings and able to use dconf. GLib 2.25.9 is required. Schemas are converted to the new XML format, and compiled at build time in data/ so that the Shell can be run from the source tree. This also requires setting the GSETTINGS_SCHEMA_DIR environment variable both when running installed or from source tree, in src/gnome-shell.in and src/gnome-shell-clock-preferences.in. https://bugzilla.gnome.org/show_bug.cgi?id=617917
This commit is contained in:
@ -1,18 +1,17 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const GConf = imports.gi.GConf;
|
||||
|
||||
const Lang = imports.lang;
|
||||
const Signals = imports.signals;
|
||||
|
||||
const Gettext = imports.gettext;
|
||||
|
||||
const GCONF_DIR = '/desktop/gnome/shell/clock';
|
||||
const FORMAT_KEY = GCONF_DIR + '/format';
|
||||
const SHOW_DATE_KEY = GCONF_DIR + '/show_date';
|
||||
const SHOW_SECONDS_KEY = GCONF_DIR + '/show_seconds';
|
||||
const FORMAT_KEY = 'format';
|
||||
const SHOW_DATE_KEY = 'show-date';
|
||||
const SHOW_SECONDS_KEY = 'show-seconds';
|
||||
|
||||
|
||||
function ClockPreferences(uiFile) {
|
||||
@ -34,25 +33,25 @@ ClockPreferences.prototype = {
|
||||
|
||||
delete builder;
|
||||
|
||||
this._gconf = GConf.Client.get_default();
|
||||
this._gconf.add_dir(GCONF_DIR, GConf.ClientPreloadType.PRELOAD_NONE);
|
||||
this._notifyId = this._gconf.notify_add(GCONF_DIR,
|
||||
this._settings = new Gio.Settings({ schema: 'org.gnome.shell.clock' });
|
||||
this._notifyId = this._settings.connect('changed',
|
||||
Lang.bind(this,
|
||||
this._updateDialog));
|
||||
|
||||
this._12hrRadio.connect('toggled', Lang.bind(this,
|
||||
function() {
|
||||
let format = this._12hrRadio.active ? '12-hour' : '24-hour';
|
||||
this._gconf.set_string(FORMAT_KEY, format);
|
||||
this._settings.set_string(FORMAT_KEY, format);
|
||||
}));
|
||||
this._dateCheck.connect('toggled', Lang.bind(this,
|
||||
function() {
|
||||
this._gconf.set_bool(SHOW_DATE_KEY, this._dateCheck.active);
|
||||
this._settings.set_boolean(SHOW_DATE_KEY,
|
||||
this._dateCheck.active);
|
||||
}));
|
||||
this._secondsCheck.connect('toggled', Lang.bind(this,
|
||||
function() {
|
||||
this._gconf.set_bool(SHOW_SECONDS_KEY,
|
||||
this._secondsCheck.active);
|
||||
this._settings.set_boolean(SHOW_SECONDS_KEY,
|
||||
this._secondsCheck.active);
|
||||
}));
|
||||
|
||||
this._updateDialog();
|
||||
@ -63,17 +62,17 @@ ClockPreferences.prototype = {
|
||||
},
|
||||
|
||||
_updateDialog: function() {
|
||||
let format = this._gconf.get_string(FORMAT_KEY);
|
||||
let format = this._settings.get_string(FORMAT_KEY);
|
||||
this._12hrRadio.active = (format == "12-hour");
|
||||
this._24hrRadio.active = (format == "24-hour");
|
||||
|
||||
this._dateCheck.active = this._gconf.get_bool(SHOW_DATE_KEY);
|
||||
this._secondsCheck.active = this._gconf.get_bool(SHOW_SECONDS_KEY);
|
||||
this._dateCheck.active = this._settings.get_boolean(SHOW_DATE_KEY);
|
||||
this._secondsCheck.active = this._settings.get_boolean(SHOW_SECONDS_KEY);
|
||||
},
|
||||
|
||||
_onResponse: function() {
|
||||
this._dialog.destroy();
|
||||
this._gconf.notify_remove(this._notifyId);
|
||||
this._settings.disconnect(this._notifyId);
|
||||
this.emit('destroy');
|
||||
}
|
||||
};
|
||||
|
@ -13,12 +13,11 @@ function AppFavorites() {
|
||||
}
|
||||
|
||||
AppFavorites.prototype = {
|
||||
FAVORITE_APPS_KEY: 'favorite_apps',
|
||||
FAVORITE_APPS_KEY: 'favorite-apps',
|
||||
|
||||
_init: function() {
|
||||
this._favorites = {};
|
||||
this._gconf = Shell.GConf.get_default();
|
||||
this._gconf.connect('changed::' + this.FAVORITE_APPS_KEY, Lang.bind(this, this._onFavsChanged));
|
||||
global.settings.connect('changed::' + this.FAVORITE_APPS_KEY, Lang.bind(this, this._onFavsChanged));
|
||||
this._reload();
|
||||
},
|
||||
|
||||
@ -28,7 +27,7 @@ AppFavorites.prototype = {
|
||||
},
|
||||
|
||||
_reload: function() {
|
||||
let ids = Shell.GConf.get_default().get_string_list('favorite_apps');
|
||||
let ids = global.settings.get_strv(this.FAVORITE_APPS_KEY);
|
||||
let appSys = Shell.AppSystem.get_default();
|
||||
let apps = ids.map(function (id) {
|
||||
return appSys.get_app(id);
|
||||
@ -75,7 +74,7 @@ AppFavorites.prototype = {
|
||||
|
||||
let ids = this._getIds();
|
||||
ids.push(appId);
|
||||
this._gconf.set_string_list(this.FAVORITE_APPS_KEY, ids);
|
||||
global.settings.set_strv(this.FAVORITE_APPS_KEY, ids);
|
||||
this._favorites[appId] = app;
|
||||
return true;
|
||||
},
|
||||
@ -96,7 +95,7 @@ AppFavorites.prototype = {
|
||||
return false;
|
||||
|
||||
let ids = this._getIds().filter(function (id) { return id != appId; });
|
||||
this._gconf.set_string_list(this.FAVORITE_APPS_KEY, ids);
|
||||
global.settings.set_strv(this.FAVORITE_APPS_KEY, ids);
|
||||
return true;
|
||||
},
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Lang = imports.lang;
|
||||
const St = imports.gi.St;
|
||||
const Pango = imports.gi.Pango;
|
||||
@ -10,7 +11,7 @@ const Gettext_gtk20 = imports.gettext.domain('gtk20');
|
||||
const MSECS_IN_DAY = 24 * 60 * 60 * 1000;
|
||||
const MSECS_IN_WEEK = MSECS_IN_DAY * 7;
|
||||
const WEEKDATE_HEADER_WIDTH_DIGITS = 3;
|
||||
const SHOW_WEEKDATE_KEY = 'calendar/show_weekdate';
|
||||
const SHOW_WEEKDATE_KEY = 'show-weekdate';
|
||||
|
||||
function _sameDay(dateA, dateB) {
|
||||
return (dateA.getDate() == dateB.getDate() &&
|
||||
@ -48,10 +49,10 @@ Calendar.prototype = {
|
||||
this._weekStart = NaN;
|
||||
this._weekdate = NaN;
|
||||
this._digitWidth = NaN;
|
||||
this._gconf = Shell.GConf.get_default();
|
||||
this._settings = new Gio.Settings({ schema: 'org.gnome.shell.calendar' });
|
||||
|
||||
this._gconf.connect('changed', Lang.bind(this, this._onSettingsChange));
|
||||
this._useWeekdate = this._gconf.get_boolean(SHOW_WEEKDATE_KEY);
|
||||
this._settings.connect('changed::' + SHOW_WEEKDATE_KEY, Lang.bind(this, this._onSettingsChange));
|
||||
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
|
||||
|
||||
let weekStartString = Gettext_gtk20.gettext('calendar:week_start:0');
|
||||
if (weekStartString.indexOf('calendar:week_start:') == 0) {
|
||||
@ -201,7 +202,7 @@ Calendar.prototype = {
|
||||
},
|
||||
|
||||
_onSettingsChange: function() {
|
||||
this._useWeekdate = this._gconf.get_boolean(SHOW_WEEKDATE_KEY);
|
||||
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
|
||||
this._buildHeader();
|
||||
this._update();
|
||||
},
|
||||
|
@ -127,7 +127,7 @@ function init() {
|
||||
global.logError('' + e);
|
||||
}
|
||||
|
||||
disabledExtensions = Shell.GConf.get_default().get_string_list('disabled_extensions');
|
||||
disabledExtensions = global.settings.get_strv('disabled-extensions', -1);
|
||||
}
|
||||
|
||||
function _loadExtensionsIn(dir, type) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GConf = imports.gi.GConf;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Pango = imports.gi.Pango;
|
||||
@ -582,10 +583,10 @@ LookingGlass.prototype = {
|
||||
vertical: true,
|
||||
visible: false });
|
||||
|
||||
let gconf = Shell.GConf.get_default();
|
||||
gconf.watch_directory('/desktop/gnome/interface');
|
||||
gconf.connect('changed::/desktop/gnome/interface/monospace_font_name',
|
||||
Lang.bind(this, this._updateFont));
|
||||
let gconf = GConf.Client.get_default();
|
||||
gconf.add_dir('/desktop/gnome/interface', GConf.ClientPreloadType.PRELOAD_NONE);
|
||||
gconf.notify_add('/desktop/gnome/interface/monospace_font_name',
|
||||
Lang.bind(this, this._updateFont));
|
||||
this._updateFont();
|
||||
|
||||
Main.uiGroup.add_actor(this.actor);
|
||||
@ -696,7 +697,7 @@ LookingGlass.prototype = {
|
||||
},
|
||||
|
||||
_updateFont: function() {
|
||||
let gconf = Shell.GConf.get_default();
|
||||
let gconf = GConf.Client.get_default();
|
||||
let fontName = gconf.get_string('/desktop/gnome/interface/monospace_font_name');
|
||||
// This is mishandled by the scanner - should by Pango.FontDescription_from_string(fontName);
|
||||
// https://bugzilla.gnome.org/show_bug.cgi?id=595889
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
const DBus = imports.dbus;
|
||||
const GConf = imports.gi.GConf;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
@ -461,7 +462,7 @@ Magnifier.prototype = {
|
||||
},
|
||||
|
||||
_gConfInit: function(zoomRegion) {
|
||||
let gConf = Shell.GConf.get_default();
|
||||
let gConf = GConf.Client.get_default();
|
||||
if (zoomRegion) {
|
||||
// Mag factor is accurate to two decimal places.
|
||||
let aPref = parseFloat(gConf.get_float(MAG_FACTOR_KEY).toFixed(2));
|
||||
@ -472,42 +473,42 @@ Magnifier.prototype = {
|
||||
if (aPref)
|
||||
zoomRegion.setScreenPosition(aPref);
|
||||
|
||||
zoomRegion.setLensMode(gConf.get_boolean(LENS_MODE_KEY));
|
||||
zoomRegion.setClampScrollingAtEdges(!gConf.get_boolean(CLAMP_MODE_KEY));
|
||||
zoomRegion.setLensMode(gConf.get_bool(LENS_MODE_KEY));
|
||||
zoomRegion.setClampScrollingAtEdges(!gConf.get_bool(CLAMP_MODE_KEY));
|
||||
|
||||
aPref = gConf.get_int(MOUSE_TRACKING_KEY);
|
||||
if (aPref)
|
||||
zoomRegion.setMouseTrackingMode(aPref);
|
||||
}
|
||||
let showCrosshairs = gConf.get_boolean(SHOW_CROSS_HAIRS_KEY);
|
||||
let showCrosshairs = gConf.get_bool(SHOW_CROSS_HAIRS_KEY);
|
||||
let thickness = gConf.get_int(CROSS_HAIRS_THICKNESS_KEY);
|
||||
let color = gConf.get_string(CROSS_HAIRS_COLOR_KEY);
|
||||
let opacity = gConf.get_int(CROSS_HAIRS_OPACITY_KEY);
|
||||
let length = gConf.get_int(CROSS_HAIRS_LENGTH_KEY);
|
||||
let clip = gConf.get_boolean(CROSS_HAIRS_CLIP_KEY);
|
||||
let clip = gConf.get_bool(CROSS_HAIRS_CLIP_KEY);
|
||||
this.addCrosshairs(thickness, color, opacity, length, clip);
|
||||
this.setCrosshairsVisible(showCrosshairs);
|
||||
|
||||
gConf.watch_directory(A11Y_MAG_PREFS_DIR);
|
||||
gConf.connect('changed::' + SHOW_KEY, Lang.bind(this, this._updateShowHide));
|
||||
gConf.connect('changed::' + SCREEN_POSITION_KEY, Lang.bind(this, this._updateScreenPosition));
|
||||
gConf.connect('changed::' + MAG_FACTOR_KEY, Lang.bind(this, this._updateMagFactor));
|
||||
gConf.connect('changed::' + LENS_MODE_KEY, Lang.bind(this, this._updateLensMode));
|
||||
gConf.connect('changed::' + CLAMP_MODE_KEY, Lang.bind(this, this._updateClampMode));
|
||||
gConf.connect('changed::' + MOUSE_TRACKING_KEY, Lang.bind(this, this._updateMouseTrackingMode));
|
||||
gConf.connect('changed::' + SHOW_CROSS_HAIRS_KEY, Lang.bind(this, this._updateShowCrosshairs));
|
||||
gConf.connect('changed::' + CROSS_HAIRS_THICKNESS_KEY, Lang.bind(this, this._updateCrosshairsThickness));
|
||||
gConf.connect('changed::' + CROSS_HAIRS_COLOR_KEY, Lang.bind(this, this._updateCrosshairsColor));
|
||||
gConf.connect('changed::' + CROSS_HAIRS_OPACITY_KEY, Lang.bind(this, this._updateCrosshairsOpacity));
|
||||
gConf.connect('changed::' + CROSS_HAIRS_LENGTH_KEY, Lang.bind(this, this._updateCrosshairsLength));
|
||||
gConf.connect('changed::' + CROSS_HAIRS_CLIP_KEY, Lang.bind(this, this._updateCrosshairsClip));
|
||||
gConf.add_dir(A11Y_MAG_PREFS_DIR, GConf.ClientPreloadType.PRELOAD_ONELEVEL);
|
||||
gConf.notify_add(SHOW_KEY, Lang.bind(this, this._updateShowHide));
|
||||
gConf.notify_add(SCREEN_POSITION_KEY, Lang.bind(this, this._updateScreenPosition));
|
||||
gConf.notify_add(MAG_FACTOR_KEY, Lang.bind(this, this._updateMagFactor));
|
||||
gConf.notify_add(LENS_MODE_KEY, Lang.bind(this, this._updateLensMode));
|
||||
gConf.notify_add(CLAMP_MODE_KEY, Lang.bind(this, this._updateClampMode));
|
||||
gConf.notify_add(MOUSE_TRACKING_KEY, Lang.bind(this, this._updateMouseTrackingMode));
|
||||
gConf.notify_add(SHOW_CROSS_HAIRS_KEY, Lang.bind(this, this._updateShowCrosshairs));
|
||||
gConf.notify_add(CROSS_HAIRS_THICKNESS_KEY, Lang.bind(this, this._updateCrosshairsThickness));
|
||||
gConf.notify_add(CROSS_HAIRS_COLOR_KEY, Lang.bind(this, this._updateCrosshairsColor));
|
||||
gConf.notify_add(CROSS_HAIRS_OPACITY_KEY, Lang.bind(this, this._updateCrosshairsOpacity));
|
||||
gConf.notify_add(CROSS_HAIRS_LENGTH_KEY, Lang.bind(this, this._updateCrosshairsLength));
|
||||
gConf.notify_add(CROSS_HAIRS_CLIP_KEY, Lang.bind(this, this._updateCrosshairsClip));
|
||||
|
||||
return gConf.get_boolean(SHOW_KEY);
|
||||
return gConf.get_bool(SHOW_KEY);
|
||||
},
|
||||
|
||||
_updateShowHide: function() {
|
||||
let gConf = Shell.GConf.get_default();
|
||||
this.setActive(gConf.get_boolean(SHOW_KEY));
|
||||
this.setActive(gConf.get_bool(SHOW_KEY));
|
||||
},
|
||||
|
||||
_updateScreenPosition: function() {
|
||||
@ -535,7 +536,7 @@ Magnifier.prototype = {
|
||||
// Applies only to the first zoom region.
|
||||
if (this._zoomRegions.length) {
|
||||
let gConf = Shell.GConf.get_default();
|
||||
this._zoomRegions[0].setLensMode(gConf.get_boolean(LENS_MODE_KEY));
|
||||
this._zoomRegions[0].setLensMode(gConf.get_bool(LENS_MODE_KEY));
|
||||
}
|
||||
},
|
||||
|
||||
@ -544,7 +545,7 @@ Magnifier.prototype = {
|
||||
if (this._zoomRegions.length) {
|
||||
let gConf = Shell.GConf.get_default();
|
||||
this._zoomRegions[0].setClampScrollingAtEdges(
|
||||
!gConf.get_boolean(CLAMP_MODE_KEY)
|
||||
!gConf.get_bool(CLAMP_MODE_KEY)
|
||||
);
|
||||
}
|
||||
},
|
||||
@ -561,7 +562,7 @@ Magnifier.prototype = {
|
||||
|
||||
_updateShowCrosshairs: function() {
|
||||
let gConf = Shell.GConf.get_default();
|
||||
this.setCrosshairsVisible(gConf.get_boolean(SHOW_CROSS_HAIRS_KEY));
|
||||
this.setCrosshairsVisible(gConf.get_bool(SHOW_CROSS_HAIRS_KEY));
|
||||
},
|
||||
|
||||
_updateCrosshairsThickness: function() {
|
||||
@ -586,7 +587,7 @@ Magnifier.prototype = {
|
||||
|
||||
_updateCrosshairsClip: function() {
|
||||
let gConf = Shell.GConf.get_default();
|
||||
this.setCrosshairsClip(gConf.get_boolean(CROSS_HAIRS_CLIP_KEY));
|
||||
this.setCrosshairsClip(gConf.get_bool(CROSS_HAIRS_CLIP_KEY));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -11,6 +11,7 @@ const DBus = imports.dbus;
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GConf = imports.gi.GConf;
|
||||
const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Meta = imports.gi.Meta;
|
||||
@ -133,7 +134,9 @@ function start() {
|
||||
|
||||
_startDate = new Date();
|
||||
|
||||
global.screen.connect('toggle-recording', function() {
|
||||
let recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
|
||||
|
||||
global.screen.connect('toggle-recording', function(recorderSettings) {
|
||||
if (recorder == null) {
|
||||
recorder = new Shell.Recorder({ stage: global.stage });
|
||||
}
|
||||
@ -141,11 +144,11 @@ function start() {
|
||||
if (recorder.is_recording()) {
|
||||
recorder.pause();
|
||||
} else {
|
||||
//read the parameters from GConf always in case they have changed
|
||||
let gconf = Shell.GConf.get_default();
|
||||
recorder.set_framerate(gconf.get_int('recorder/framerate'));
|
||||
recorder.set_filename('shell-%d%u-%c.' + gconf.get_string('recorder/file_extension'));
|
||||
let pipeline = gconf.get_string('recorder/pipeline');
|
||||
// read the parameters from GSettings always in case they have changed
|
||||
recorder.set_framerate(recorderSettings.get_int('framerate'));
|
||||
recorder.set_filename('shell-%d%u-%c.' + recorderSettings.get_string('file-extension'));
|
||||
let pipeline = recorderSettings.get_string('pipeline');
|
||||
|
||||
if (!pipeline.match(/^\s*$/))
|
||||
recorder.set_pipeline(pipeline);
|
||||
else
|
||||
@ -296,7 +299,7 @@ function _globalKeyPressHandler(actor, event) {
|
||||
let symbol = event.get_key_symbol();
|
||||
if (symbol == Clutter.Print) {
|
||||
// We want to be able to take screenshots of the shell at all times
|
||||
let gconf = Shell.GConf.get_default();
|
||||
let gconf = GConf.Client.get_default();
|
||||
let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot');
|
||||
if (command != null && command != '') {
|
||||
let [ok, len, args] = GLib.shell_parse_argv(command);
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
const Cairo = imports.cairo;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GConf = imports.gi.GConf;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
@ -40,10 +42,10 @@ const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
|
||||
'gnome-power-manager': 'battery'
|
||||
};
|
||||
|
||||
const CLOCK_FORMAT_KEY = 'clock/format';
|
||||
const CLOCK_CUSTOM_FORMAT_KEY = 'clock/custom_format';
|
||||
const CLOCK_SHOW_DATE_KEY = 'clock/show_date';
|
||||
const CLOCK_SHOW_SECONDS_KEY = 'clock/show_seconds';
|
||||
const CLOCK_FORMAT_KEY = 'format';
|
||||
const CLOCK_CUSTOM_FORMAT_KEY = 'custom-format';
|
||||
const CLOCK_SHOW_DATE_KEY = 'show-date';
|
||||
const CLOCK_SHOW_SECONDS_KEY = 'show-seconds';
|
||||
|
||||
function AnimatedIcon(name, size) {
|
||||
this._init(name, size);
|
||||
@ -521,8 +523,8 @@ ClockButton.prototype = {
|
||||
|
||||
this._calendarPopup = null;
|
||||
|
||||
let gconf = Shell.GConf.get_default();
|
||||
gconf.connect('changed', Lang.bind(this, this._updateClock));
|
||||
this._clockSettings = new Gio.Settings({ schema: 'org.gnome.shell.clock' });
|
||||
this._clockSettings.connect('changed', Lang.bind(this, this._updateClock));
|
||||
|
||||
// Start the clock
|
||||
this._updateClock();
|
||||
@ -580,10 +582,9 @@ ClockButton.prototype = {
|
||||
},
|
||||
|
||||
_updateClock: function() {
|
||||
let gconf = Shell.GConf.get_default();
|
||||
let format = gconf.get_string(CLOCK_FORMAT_KEY);
|
||||
let showDate = gconf.get_boolean(CLOCK_SHOW_DATE_KEY);
|
||||
let showSeconds = gconf.get_boolean(CLOCK_SHOW_SECONDS_KEY);
|
||||
let format = this._clockSettings.get_string(CLOCK_FORMAT_KEY);
|
||||
let showDate = this._clockSettings.get_boolean(CLOCK_SHOW_DATE_KEY);
|
||||
let showSeconds = this._clockSettings.get_boolean(CLOCK_SHOW_SECONDS_KEY);
|
||||
|
||||
let clockFormat;
|
||||
switch (format) {
|
||||
@ -595,7 +596,7 @@ ClockButton.prototype = {
|
||||
case 'custom':
|
||||
// force updates every second
|
||||
showSeconds = true;
|
||||
clockFormat = gconf.get_string(CLOCK_CUSTOM_FORMAT_KEY);
|
||||
clockFormat = this._clockSettings.get_string(CLOCK_CUSTOM_FORMAT_KEY);
|
||||
break;
|
||||
case '24-hour':
|
||||
if (showDate)
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Pango = imports.gi.Pango;
|
||||
const GConf = imports.gi.GConf;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Shell = imports.gi.Shell;
|
||||
@ -120,13 +121,13 @@ function PlacesManager() {
|
||||
|
||||
PlacesManager.prototype = {
|
||||
_init: function() {
|
||||
let gconf = Shell.GConf.get_default();
|
||||
gconf.watch_directory(NAUTILUS_PREFS_DIR);
|
||||
let gconf = GConf.Client.get_default();
|
||||
gconf.add_dir(NAUTILUS_PREFS_DIR, GConf.ClientPreloadType.PRELOAD_NONE);
|
||||
|
||||
this._defaultPlaces = [];
|
||||
this._mounts = [];
|
||||
this._bookmarks = [];
|
||||
this._isDesktopHome = gconf.get_boolean(DESKTOP_IS_HOME_KEY);
|
||||
this._isDesktopHome = gconf.get_bool(DESKTOP_IS_HOME_KEY);
|
||||
|
||||
let homeFile = Gio.file_new_for_path (GLib.get_home_dir());
|
||||
let homeUri = homeFile.get_uri();
|
||||
@ -225,7 +226,7 @@ PlacesManager.prototype = {
|
||||
|
||||
this._reloadBookmarks();
|
||||
|
||||
gconf.connect('changed::' + DESKTOP_IS_HOME_KEY, Lang.bind(this, this._updateDesktopMenuVisibility));
|
||||
gconf.notify_add(DESKTOP_IS_HOME_KEY, Lang.bind(this, this._updateDesktopMenuVisibility));
|
||||
|
||||
},
|
||||
|
||||
@ -336,7 +337,7 @@ PlacesManager.prototype = {
|
||||
},
|
||||
|
||||
_updateDesktopMenuVisibility: function() {
|
||||
let gconf = Shell.GConf.get_default();
|
||||
let gconf = GConf.Client.get_default();
|
||||
this._isDesktopHome = gconf.get_boolean(DESKTOP_IS_HOME_KEY);
|
||||
|
||||
if (this._isDesktopHome)
|
||||
|
@ -18,7 +18,7 @@ const Tweener = imports.ui.tweener;
|
||||
|
||||
const MAX_FILE_DELETED_BEFORE_INVALID = 10;
|
||||
|
||||
const HISTORY_KEY = 'run_dialog/history';
|
||||
const HISTORY_KEY = 'command-history';
|
||||
const HISTORY_LIMIT = 512;
|
||||
|
||||
const DIALOG_FADE_TIME = 0.1;
|
||||
@ -179,17 +179,16 @@ RunDialog.prototype = {
|
||||
_init : function() {
|
||||
this._isOpen = false;
|
||||
|
||||
this._gconf = Shell.GConf.get_default();
|
||||
this._gconf.connect('changed::development_tools', Lang.bind(this, function () {
|
||||
this._enableInternalCommands = this._gconf.get_boolean('development_tools');
|
||||
global.settings.connect('changed::development-tools', Lang.bind(this, function () {
|
||||
this._enableInternalCommands = global.settings.get_boolean('development-tools');
|
||||
}));
|
||||
this._enableInternalCommands = this._gconf.get_boolean('development_tools');
|
||||
this._enableInternalCommands = global.settings.get_boolean('development-tools');
|
||||
|
||||
this._history = this._gconf.get_string_list(HISTORY_KEY);
|
||||
this._history = global.settings.get_strv(HISTORY_KEY);
|
||||
this._historyIndex = -1;
|
||||
|
||||
this._gconf.connect('changed::' + HISTORY_KEY, Lang.bind(this, function() {
|
||||
this._history = this._gconf.get_string_list(HISTORY_KEY);
|
||||
global.settings.connect('changed::' + HISTORY_KEY, Lang.bind(this, function() {
|
||||
this._history = global.settings.get_strv(HISTORY_KEY);
|
||||
this._historyIndex = this._history.length;
|
||||
}));
|
||||
|
||||
@ -327,7 +326,7 @@ RunDialog.prototype = {
|
||||
if (this._history.length > HISTORY_LIMIT) {
|
||||
this._history.splice(0, this._history.length - HISTORY_LIMIT);
|
||||
}
|
||||
this._gconf.set_string_list(HISTORY_KEY, this._history);
|
||||
global.settings.set_strv(HISTORY_KEY, this._history);
|
||||
},
|
||||
|
||||
_run : function(input, inTerminal) {
|
||||
|
@ -26,13 +26,13 @@ const WORKSPACE_SWITCH_TIME = 0.25;
|
||||
// Note that mutter has a compile-time limit of 36
|
||||
const MAX_WORKSPACES = 16;
|
||||
|
||||
// The values here are also used for gconf, and the key and value
|
||||
// The values here are also used for GSettings, and the key and value
|
||||
// names must match
|
||||
const WorkspacesViewType = {
|
||||
SINGLE: 'single',
|
||||
GRID: 'grid'
|
||||
};
|
||||
const WORKSPACES_VIEW_KEY = 'overview/workspaces_view';
|
||||
const WORKSPACES_VIEW_KEY = 'workspaces-view';
|
||||
|
||||
const WORKSPACE_DRAGGING_SCALE = 0.85;
|
||||
const WORKSPACE_SHADOW_SCALE = (1 - WORKSPACE_DRAGGING_SCALE) / 2;
|
||||
@ -1429,9 +1429,7 @@ WorkspacesControls.prototype = {
|
||||
this.actor = new St.BoxLayout({ style_class: 'workspaces-bar' });
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
this._gconf = Shell.GConf.get_default();
|
||||
|
||||
let view = this._gconf.get_string(WORKSPACES_VIEW_KEY).toUpperCase();
|
||||
let view = global.settings.get_string(WORKSPACES_VIEW_KEY).toUpperCase();
|
||||
if (view in WorkspacesViewType)
|
||||
this._currentViewType = WorkspacesViewType[view];
|
||||
else
|
||||
@ -1528,7 +1526,7 @@ WorkspacesControls.prototype = {
|
||||
this._toggleViewButton.set_style_class_name('workspace-controls switch-single');
|
||||
|
||||
this._currentViewType = view;
|
||||
this._gconf.set_string(WORKSPACES_VIEW_KEY, view);
|
||||
global.settings.set_string(WORKSPACES_VIEW_KEY, view);
|
||||
},
|
||||
|
||||
_onDestroy: function() {
|
||||
@ -1590,8 +1588,8 @@ WorkspacesManager.prototype = {
|
||||
this.controlsBar.actor.connect('destroy',
|
||||
Lang.bind(this, this._onDestroy));
|
||||
this._viewChangedId =
|
||||
Shell.GConf.get_default().connect('changed::' + WORKSPACES_VIEW_KEY,
|
||||
Lang.bind(this, this._updateView));
|
||||
global.settings.connect('changed::' + WORKSPACES_VIEW_KEY,
|
||||
Lang.bind(this, this._updateView));
|
||||
this._nWorkspacesNotifyId =
|
||||
global.screen.connect('notify::n-workspaces',
|
||||
Lang.bind(this, this._workspacesChanged));
|
||||
@ -1600,7 +1598,7 @@ WorkspacesManager.prototype = {
|
||||
_updateView: function() {
|
||||
let viewType, newView;
|
||||
|
||||
let view = Shell.GConf.get_default().get_string(WORKSPACES_VIEW_KEY).toUpperCase();
|
||||
let view = global.settings.get_string(WORKSPACES_VIEW_KEY).toUpperCase();
|
||||
if (view in WorkspacesViewType)
|
||||
viewType = WorkspacesViewType[view];
|
||||
else
|
||||
@ -1678,7 +1676,7 @@ WorkspacesManager.prototype = {
|
||||
if (this._nWorkspacesNotifyId > 0)
|
||||
global.screen.disconnect(this._nWorkspacesNotifyId);
|
||||
if (this._viewChangedId > 0)
|
||||
Shell.GConf.get_default().disconnect(this._viewChangedId);
|
||||
global.settings.disconnect(this._viewChangedId);
|
||||
for (let w = 0; w < this._workspaces.length; w++) {
|
||||
this._workspaces[w].disconnectAll();
|
||||
this._workspaces[w].destroy();
|
||||
|
Reference in New Issue
Block a user