diff options
Diffstat (limited to 'applets/clock')
-rw-r--r-- | applets/clock/Makefile.am | 3 | ||||
-rw-r--r-- | applets/clock/clock.c | 11 | ||||
-rw-r--r-- | applets/clock/org.mate.panel.applet.clock.gschema.xml.in | 88 | ||||
-rw-r--r-- | applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in | 88 |
4 files changed, 102 insertions, 88 deletions
diff --git a/applets/clock/Makefile.am b/applets/clock/Makefile.am index 17dc67e4..6744d122 100644 --- a/applets/clock/Makefile.am +++ b/applets/clock/Makefile.am @@ -159,6 +159,9 @@ gsettings_SCHEMAS = org.mate.panel.applet.clock.gschema.xml @INTLTOOL_XML_NOMERGE_RULE@ @GSETTINGS_RULES@ +%.gschema.xml.in: %.gschema.xml.in.in Makefile + $(AM_V_GEN) $(SED) -e 's^\@GETTEXT_PACKAGE\@^$(GETTEXT_PACKAGE)^g' < $< > $@ + EXTRA_DIST = \ org.mate.panel.ClockApplet.mate-panel-applet.in.in \ $(gsettings_SCHEMAS) \ diff --git a/applets/clock/clock.c b/applets/clock/clock.c index 44b844e8..bcbf847d 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -2264,6 +2264,17 @@ static void setup_gsettings (ClockData *cd) { cd->settings = mate_panel_applet_settings_new (MATE_PANEL_APPLET (cd->applet), CLOCK_SCHEMA); + + /* hack to allow users to set custom format in dconf-editor */ + gint format; + gchar *custom_format; + format = g_settings_get_enum (cd->settings, KEY_FORMAT); + custom_format = g_settings_get_string (cd->settings, KEY_CUSTOM_FORMAT); + g_settings_set_enum (cd->settings, KEY_FORMAT, format); + g_settings_set_string (cd->settings, KEY_CUSTOM_FORMAT, custom_format); + if (custom_format != NULL) + g_free (custom_format); + g_signal_connect (cd->settings, "changed::" KEY_FORMAT, G_CALLBACK (format_changed), cd); g_signal_connect (cd->settings, "changed::" KEY_SHOW_SECONDS, G_CALLBACK (show_seconds_changed), cd); g_signal_connect (cd->settings, "changed::" KEY_SHOW_DATE, G_CALLBACK (show_date_changed), cd); diff --git a/applets/clock/org.mate.panel.applet.clock.gschema.xml.in b/applets/clock/org.mate.panel.applet.clock.gschema.xml.in deleted file mode 100644 index d2f7daca..00000000 --- a/applets/clock/org.mate.panel.applet.clock.gschema.xml.in +++ /dev/null @@ -1,88 +0,0 @@ -<schemalist gettext-domain="@GETTEXT_PACKAGE@"> - <enum id="org.mate.panel.applet.clock.ClockFormat"> - <value nick="invalid" value="0"/> - <value nick="12-hour" value="1"/> - <value nick="24-hour" value="2"/> - <value nick="unix" value="3"/> - <value nick="internet" value="4"/> - <value nick="custom" value="5"/> - </enum> - <enum id="org.mate.panel.applet.clock.TemperatureUnit"> - <value nick="Invalid" value="0"/> - <value nick="Default" value="1"/> - <value nick="Kelvin" value="2"/> - <value nick="Centigrade" value="3"/> - <value nick="Fahrenheit" value="4"/> - </enum> - <enum id="org.mate.panel.applet.clock.SpeedUnit"> - <value nick="Invalid" value="0"/> - <value nick="Default" value="1"/> - <value nick="m/s" value="2"/> - <value nick="km/h" value="3"/> - <value nick="mph" value="4"/> - <value nick="knots" value="5"/> - <value nick="Beaufort scale" value="6"/> - </enum> - <schema id="org.mate.panel.applet.clock"> - <key name="format" enum="org.mate.panel.applet.clock.ClockFormat"> - <default>'24-hour'</default> - <summary>Hour format</summary> - <description>This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.</description> - </key> - <key name="custom-format" type="s"> - <default>''</default> - <summary>Custom format of the clock</summary> - <description>This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.</description> - </key> - <key name="show-seconds" type="b"> - <default>false</default> - <summary>Show time with seconds</summary> - <description>If true, display seconds in time.</description> - </key> - <key name="show-date" type="b"> - <default>true</default> - <summary>Show date in clock</summary> - <description>If true, display date in the clock, in addition to time.</description> - </key> - <key name="show-tooltip" type="b"> - <default>true</default> - <summary>Show date in tooltip</summary> - <description>If true, show date in a tooltip when the pointer is over the clock.</description> - </key> - <key name="show-weather" type="b"> - <default>true</default> - <summary>Show weather in clock</summary> - <description>If true, display a weather icon.</description> - </key> - <key name="show-temperature" type="b"> - <default>true</default> - <summary>Show temperature in clock</summary> - <description>If true, show the temperature next to the weather icon.</description> - </key> - <key name="show-week-numbers" type="b"> - <default>true</default> - <summary>Show week numbers in calendar</summary> - <description>If true, show week numbers in the calendar.</description> - </key> - <key name="expand-locations" type="b"> - <default>false</default> - <summary>Expand list of locations</summary> - <description>If true, expand the list of locations in the calendar window.</description> - </key> - <key name="cities" type="as"> - <default>[]</default> - <summary>List of locations</summary> - <description>A list of locations to display in the calendar window.</description> - </key> - <key name="temperature-unit" enum="org.mate.panel.applet.clock.TemperatureUnit"> - <default>'Default'</default> - <summary>Temperature unit</summary> - <description>The unit to use when showing temperatures.</description> - </key> - <key name="speed-unit" enum="org.mate.panel.applet.clock.SpeedUnit"> - <default>'Default'</default> - <summary>Speed unit</summary> - <description>The unit to use when showing wind speed.</description> - </key> - </schema> -</schemalist> diff --git a/applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in b/applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in new file mode 100644 index 00000000..c041c53c --- /dev/null +++ b/applets/clock/org.mate.panel.applet.clock.gschema.xml.in.in @@ -0,0 +1,88 @@ +<schemalist gettext-domain="@GETTEXT_PACKAGE@"> + <enum id="org.mate.panel.applet.clock.ClockFormat"> + <value nick="invalid" value="0"/> + <value nick="12-hour" value="1"/> + <value nick="24-hour" value="2"/> + <value nick="unix" value="3"/> + <value nick="internet" value="4"/> + <value nick="custom" value="5"/> + </enum> + <enum id="org.mate.panel.applet.clock.TemperatureUnit"> + <value nick="Invalid" value="0"/> + <value nick="Default" value="1"/> + <value nick="Kelvin" value="2"/> + <value nick="Centigrade" value="3"/> + <value nick="Fahrenheit" value="4"/> + </enum> + <enum id="org.mate.panel.applet.clock.SpeedUnit"> + <value nick="Invalid" value="0"/> + <value nick="Default" value="1"/> + <value nick="m/s" value="2"/> + <value nick="km/h" value="3"/> + <value nick="mph" value="4"/> + <value nick="knots" value="5"/> + <value nick="Beaufort scale" value="6"/> + </enum> + <schema id="org.mate.panel.applet.clock"> + <key name="format" enum="org.mate.panel.applet.clock.ClockFormat"> + <default>'24-hour'</default> + <_summary>Hour format</_summary> + <_description>This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.</_description> + </key> + <key name="custom-format" type="s"> + <default>''</default> + <_summary>Custom format of the clock</_summary> + <_description>This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.</_description> + </key> + <key name="show-seconds" type="b"> + <default>false</default> + <_summary>Show time with seconds</_summary> + <_description>If true, display seconds in time.</_description> + </key> + <key name="show-date" type="b"> + <default>true</default> + <_summary>Show date in clock</_summary> + <_description>If true, display date in the clock, in addition to time.</_description> + </key> + <key name="show-tooltip" type="b"> + <default>true</default> + <_summary>Show date in tooltip</_summary> + <_description>If true, show date in a tooltip when the pointer is over the clock.</_description> + </key> + <key name="show-weather" type="b"> + <default>true</default> + <_summary>Show weather in clock</_summary> + <_description>If true, display a weather icon.</_description> + </key> + <key name="show-temperature" type="b"> + <default>true</default> + <_summary>Show temperature in clock</_summary> + <_description>If true, show the temperature next to the weather icon.</_description> + </key> + <key name="show-week-numbers" type="b"> + <default>true</default> + <_summary>Show week numbers in calendar</_summary> + <_description>If true, show week numbers in the calendar.</_description> + </key> + <key name="expand-locations" type="b"> + <default>false</default> + <_summary>Expand list of locations</_summary> + <_description>If true, expand the list of locations in the calendar window.</_description> + </key> + <key name="cities" type="as"> + <default>[]</default> + <_summary>List of locations</_summary> + <_description>A list of locations to display in the calendar window.</_description> + </key> + <key name="temperature-unit" enum="org.mate.panel.applet.clock.TemperatureUnit"> + <default>'Default'</default> + <_summary>Temperature unit</_summary> + <_description>The unit to use when showing temperatures.</_description> + </key> + <key name="speed-unit" enum="org.mate.panel.applet.clock.SpeedUnit"> + <default>'Default'</default> + <_summary>Speed unit</_summary> + <_description>The unit to use when showing wind speed.</_description> + </key> + </schema> +</schemalist> |