Adjust for merging commit 24f1e87

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
Florian Müllner 2011-01-17 23:01:59 +01:00 committed by David Zeuthen
parent 71851a58e5
commit 8bc396a7e0
3 changed files with 11 additions and 78 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface domain="gnome-shell">
<requires lib="gtk+" version="2.16"/> <requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="prefs-dialog"> <object class="GtkDialog" id="prefs-dialog">
@ -145,54 +145,6 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="week_check">
<property name="label" translatable="yes">Show _week numbers</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label_display1">
<property name="visible">True</property>
<property name="label" translatable="yes">Calendar</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="padding">6</property> <property name="padding">6</property>

View File

@ -13,7 +13,6 @@ const FORMAT_KEY = 'format';
const SHOW_DATE_KEY = 'show-date'; const SHOW_DATE_KEY = 'show-date';
const SHOW_SECONDS_KEY = 'show-seconds'; const SHOW_SECONDS_KEY = 'show-seconds';
const SHOW_WEEKDATE_KEY = 'show-weekdate';
function ClockPreferences(uiFile) { function ClockPreferences(uiFile) {
this._init(uiFile); this._init(uiFile);
@ -31,7 +30,6 @@ ClockPreferences.prototype = {
this._24hrRadio = builder.get_object('24hr_radio'); this._24hrRadio = builder.get_object('24hr_radio');
this._dateCheck = builder.get_object('date_check'); this._dateCheck = builder.get_object('date_check');
this._secondsCheck = builder.get_object('seconds_check'); this._secondsCheck = builder.get_object('seconds_check');
this._weekCheck = builder.get_object('week_check');
delete builder; delete builder;
@ -39,10 +37,6 @@ ClockPreferences.prototype = {
this._notifyId = this._settings.connect('changed', this._notifyId = this._settings.connect('changed',
Lang.bind(this, Lang.bind(this,
this._updateDialog)); 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, this._12hrRadio.connect('toggled', Lang.bind(this,
function() { function() {
@ -59,11 +53,6 @@ ClockPreferences.prototype = {
this._settings.set_boolean(SHOW_SECONDS_KEY, this._settings.set_boolean(SHOW_SECONDS_KEY,
this._secondsCheck.active); this._secondsCheck.active);
})); }));
this._weekCheck.connect('toggled', Lang.bind(this,
function() {
this._calendar_settings.set_boolean(SHOW_WEEKDATE_KEY,
this._weekCheck.active);
}));
this._updateDialog(); this._updateDialog();
}, },
@ -79,13 +68,11 @@ ClockPreferences.prototype = {
this._dateCheck.active = this._settings.get_boolean(SHOW_DATE_KEY); this._dateCheck.active = this._settings.get_boolean(SHOW_DATE_KEY);
this._secondsCheck.active = this._settings.get_boolean(SHOW_SECONDS_KEY); this._secondsCheck.active = this._settings.get_boolean(SHOW_SECONDS_KEY);
this._weekCheck.active = this._calendar_settings.get_boolean(SHOW_WEEKDATE_KEY);
}, },
_onResponse: function() { _onResponse: function() {
this._dialog.destroy(); this._dialog.destroy();
this._settings.disconnect(this._notifyId); this._settings.disconnect(this._notifyId);
this._calendar_settings.disconnect(this._calendar_notifyId);
this.emit('destroy'); this.emit('destroy');
} }
}; };

View File

@ -16,8 +16,10 @@ const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu; const PopupMenu = imports.ui.popupMenu;
const Calendar = imports.ui.calendar; const Calendar = imports.ui.calendar;
const CLOCK_FORMAT_KEY = 'format'; // in org.gnome.desktop.interface
const CLOCK_CUSTOM_FORMAT_KEY = 'custom-format'; const CLOCK_FORMAT_KEY = 'clock-format';
// in org.gnome.shell.clock
const CLOCK_SHOW_DATE_KEY = 'show-date'; const CLOCK_SHOW_DATE_KEY = 'show-date';
const CLOCK_SHOW_SECONDS_KEY = 'show-seconds'; const CLOCK_SHOW_SECONDS_KEY = 'show-seconds';
@ -120,7 +122,9 @@ DateMenuButton.prototype = {
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
// Track changes to clock settings // 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._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)); this._clockSettings.connect('changed', Lang.bind(this, this._clockSettingsChanged));
// Start the clock // Start the clock
@ -132,7 +136,7 @@ DateMenuButton.prototype = {
}, },
_updateClockAndDate: function() { _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 showDate = this._clockSettings.get_boolean(CLOCK_SHOW_DATE_KEY);
let showSeconds = this._clockSettings.get_boolean(CLOCK_SHOW_SECONDS_KEY); let showSeconds = this._clockSettings.get_boolean(CLOCK_SHOW_SECONDS_KEY);
@ -140,17 +144,7 @@ DateMenuButton.prototype = {
let dateFormat; let dateFormat;
switch (format) { switch (format) {
case 'unix': case '24h':
// 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':
if (showDate) if (showDate)
/* Translators: This is the time format with date used /* Translators: This is the time format with date used
in 24-hour mode. */ in 24-hour mode. */
@ -162,7 +156,7 @@ DateMenuButton.prototype = {
clockFormat = showSeconds ? _("%a %R:%S") clockFormat = showSeconds ? _("%a %R:%S")
: _("%a %R"); : _("%a %R");
break; break;
case '12-hour': case '12h':
default: default:
if (showDate) if (showDate)
/* Translators: This is a time format with date used /* Translators: This is a time format with date used
@ -206,7 +200,7 @@ DateMenuButton.prototype = {
_onPreferencesActivate: function() { _onPreferencesActivate: function() {
Main.overview.hide(); Main.overview.hide();
this._spawn(['gnome-shell-clock-preferences']); this._spawn(['gnome-control-center', 'datetime']);
}, },
_spawn: function(args) { _spawn: function(args) {