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,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();
|
||||
},
|
||||
|
Reference in New Issue
Block a user