From 8bc396a7e0e0fce2e4b3537bed4c85fa14745f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 17 Jan 2011 23:01:59 +0100 Subject: [PATCH] Adjust for merging commit 24f1e87 Signed-off-by: David Zeuthen --- data/clock-preferences.ui | 50 +----------------------------------- js/prefs/clockPreferences.js | 13 ---------- js/ui/dateMenu.js | 26 ++++++++----------- 3 files changed, 11 insertions(+), 78 deletions(-) diff --git a/data/clock-preferences.ui b/data/clock-preferences.ui index 68e60cedc..2e22d9aa9 100644 --- a/data/clock-preferences.ui +++ b/data/clock-preferences.ui @@ -1,5 +1,5 @@ - + @@ -145,54 +145,6 @@ 1 - - - True - 0 - none - - - True - 6 - 12 - - - True - vertical - 6 - - - Show _week numbers - True - True - False - True - True - - - 0 - - - - - - - - - True - Calendar - - - - - - - - False - False - 2 - - 6 diff --git a/js/prefs/clockPreferences.js b/js/prefs/clockPreferences.js index 866fc3032..f35d8e250 100644 --- a/js/prefs/clockPreferences.js +++ b/js/prefs/clockPreferences.js @@ -13,7 +13,6 @@ const FORMAT_KEY = 'format'; const SHOW_DATE_KEY = 'show-date'; const SHOW_SECONDS_KEY = 'show-seconds'; -const SHOW_WEEKDATE_KEY = 'show-weekdate'; function ClockPreferences(uiFile) { this._init(uiFile); @@ -31,7 +30,6 @@ ClockPreferences.prototype = { this._24hrRadio = builder.get_object('24hr_radio'); this._dateCheck = builder.get_object('date_check'); this._secondsCheck = builder.get_object('seconds_check'); - this._weekCheck = builder.get_object('week_check'); delete builder; @@ -39,10 +37,6 @@ ClockPreferences.prototype = { this._notifyId = this._settings.connect('changed', Lang.bind(this, this._updateDialog)); - this._calendar_settings = new Gio.Settings({ schema: 'org.gnome.shell.calendar' }); - this._calendar_notifyId = this._calendar_settings.connect('changed', - Lang.bind(this, - this._updateDialog)); this._12hrRadio.connect('toggled', Lang.bind(this, function() { @@ -59,11 +53,6 @@ ClockPreferences.prototype = { this._settings.set_boolean(SHOW_SECONDS_KEY, this._secondsCheck.active); })); - this._weekCheck.connect('toggled', Lang.bind(this, - function() { - this._calendar_settings.set_boolean(SHOW_WEEKDATE_KEY, - this._weekCheck.active); - })); this._updateDialog(); }, @@ -79,13 +68,11 @@ ClockPreferences.prototype = { this._dateCheck.active = this._settings.get_boolean(SHOW_DATE_KEY); this._secondsCheck.active = this._settings.get_boolean(SHOW_SECONDS_KEY); - this._weekCheck.active = this._calendar_settings.get_boolean(SHOW_WEEKDATE_KEY); }, _onResponse: function() { this._dialog.destroy(); this._settings.disconnect(this._notifyId); - this._calendar_settings.disconnect(this._calendar_notifyId); this.emit('destroy'); } }; diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 23853b4d4..b11aa0c8d 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -16,8 +16,10 @@ const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const Calendar = imports.ui.calendar; -const CLOCK_FORMAT_KEY = 'format'; -const CLOCK_CUSTOM_FORMAT_KEY = 'custom-format'; +// in org.gnome.desktop.interface +const CLOCK_FORMAT_KEY = 'clock-format'; + +// in org.gnome.shell.clock const CLOCK_SHOW_DATE_KEY = 'show-date'; const CLOCK_SHOW_SECONDS_KEY = 'show-seconds'; @@ -120,7 +122,9 @@ DateMenuButton.prototype = { this.menu.addMenuItem(item); // Track changes to clock settings + this._desktopSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' }); this._clockSettings = new Gio.Settings({ schema: 'org.gnome.shell.clock' }); + this._desktopSettings.connect('changed', Lang.bind(this, this._clockSettingsChanged)); this._clockSettings.connect('changed', Lang.bind(this, this._clockSettingsChanged)); // Start the clock @@ -132,7 +136,7 @@ DateMenuButton.prototype = { }, _updateClockAndDate: function() { - let format = this._clockSettings.get_string(CLOCK_FORMAT_KEY); + let format = this._desktopSettings.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); @@ -140,17 +144,7 @@ DateMenuButton.prototype = { let dateFormat; switch (format) { - case 'unix': - // force updates every second - showSeconds = true; - clockFormat = '%s'; - break; - case 'custom': - // force updates every second - showSeconds = true; - clockFormat = this._clockSettings.get_string(CLOCK_CUSTOM_FORMAT_KEY); - break; - case '24-hour': + case '24h': if (showDate) /* Translators: This is the time format with date used in 24-hour mode. */ @@ -162,7 +156,7 @@ DateMenuButton.prototype = { clockFormat = showSeconds ? _("%a %R:%S") : _("%a %R"); break; - case '12-hour': + case '12h': default: if (showDate) /* Translators: This is a time format with date used @@ -206,7 +200,7 @@ DateMenuButton.prototype = { _onPreferencesActivate: function() { Main.overview.hide(); - this._spawn(['gnome-shell-clock-preferences']); + this._spawn(['gnome-control-center', 'datetime']); }, _spawn: function(args) {