From 44b85ff8d08023f49be431f1a8514240b9b4b276 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 4 Sep 2012 16:57:10 +0200 Subject: migrate to gsettings --- configure.in | 19 +- doc/html/libmateweather-mateweather-mateconf.html | 405 ---------------------- doc/tmpl/mateweather-mateconf.sgml | 136 -------- libmateweather/Makefile.am | 29 +- libmateweather/mateweather-mateconf.c | 310 ----------------- libmateweather/mateweather-mateconf.h | 84 ----- libmateweather/mateweather-prefs.c | 370 ++------------------ libmateweather/mateweather-prefs.h | 32 +- libmateweather/mateweather-uninstalled.pc.in | 2 +- libmateweather/mateweather.pc.in | 2 +- libmateweather/mateweather.schemas.in | 173 --------- libmateweather/org.mate.weather.gschema.xml | 121 +++++++ po/POTFILES.in | 1 - 13 files changed, 172 insertions(+), 1512 deletions(-) delete mode 100644 doc/html/libmateweather-mateweather-mateconf.html delete mode 100644 doc/tmpl/mateweather-mateconf.sgml delete mode 100644 libmateweather/mateweather-mateconf.c delete mode 100644 libmateweather/mateweather-mateconf.h delete mode 100644 libmateweather/mateweather.schemas.in create mode 100644 libmateweather/org.mate.weather.gschema.xml diff --git a/configure.in b/configure.in index 57a50fb..d762ec0 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT([libmateweather], [1.4.0], [http://www.mate-desktop.org]) +AC_INIT([libmateweather], [1.5.0], [http://www.mate-desktop.org]) AC_PREREQ(2.59) AM_CONFIG_HEADER(config.h) @@ -34,7 +34,7 @@ GTK_REQUIRED=2.11.0 GLIB_REQUIRED=2.13.0 LIBSOUP_REQUIRED=2.4.0 LIBSOUP_GNOME_REQUIRED=1.1.0 -MATECONF_REQUIRED=1.1.0 +GIO_REQUIRED=2.25.0 LIBXML_REQUIRED=2.6.0 AM_MAINTAINER_MODE @@ -48,7 +48,8 @@ AM_PROG_CC_C_O AC_ISC_POSIX AC_STDC_HEADERS AM_PROG_LIBTOOL -AC_PATH_PROG(MATECONFTOOL, mateconftool-2) + +GLIB_GSETTINGS AC_ARG_ENABLE(all-translations-in-one-xml, [AC_HELP_STRING([--enable-all-translations-in-one-xml], @@ -134,13 +135,11 @@ PKG_CHECK_MODULES(LIBSOUP_GNOME, AC_SUBST(LIBSOUP_CFLAGS) AC_SUBST(LIBSOUP_LIBS) -dnl -- check for mateconf (required) ----------------------------------------- -PKG_CHECK_MODULES(MATECONF, - [mateconf-2.0]) -AC_SUBST(MATECONF_CFLAGS) -AC_SUBST(MATECONF_LIBS) - -AM_MATECONF_SOURCE_2 +dnl -- check for gio (required) ----------------------------------------- +PKG_CHECK_MODULES(GIO, + [gio-2.0 >= GIO_REQUIRED]) +AC_SUBST(GIO_CFLAGS) +AC_SUBST(GIO_LIBS) dnl -- check for glib; redundant at this point, but sets $GLIB_MKENUMS AM_PATH_GLIB_2_0($GLIB_REQUIRED) diff --git a/doc/html/libmateweather-mateweather-mateconf.html b/doc/html/libmateweather-mateweather-mateconf.html deleted file mode 100644 index d0becc8..0000000 --- a/doc/html/libmateweather-mateweather-mateconf.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - -mateweather-mateconf - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-

mateweather-mateconf

-

mateweather-mateconf

-
-
-

Synopsis

-
                    MateWeatherMateConf;
-MateWeatherMateConf *     mateweather_mateconf_new                  (const char *prefix);
-void                mateweather_mateconf_free                 (MateWeatherMateConf *ctx);
-MateConfClient *       mateweather_mateconf_get_client           (MateWeatherMateConf *ctx);
-WeatherLocation *   mateweather_mateconf_get_location         (MateWeatherMateConf *ctx);
-gchar *             mateweather_mateconf_get_full_key         (MateWeatherMateConf *ctx,
-                                                         const gchar *key);
-void                mateweather_mateconf_set_bool             (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         gboolean the_bool,
-                                                         GError **opt_error);
-void                mateweather_mateconf_set_int              (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         gint the_int,
-                                                         GError **opt_error);
-void                mateweather_mateconf_set_string           (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         const gchar *the_string,
-                                                         GError **opt_error);
-gboolean            mateweather_mateconf_get_bool             (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         GError **opt_error);
-gint                mateweather_mateconf_get_int              (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         GError **opt_error);
-gchar *             mateweather_mateconf_get_string           (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         GError **opt_error);
-
-
-
-

Description

-

-

-
-
-

Details

-
-

MateWeatherMateConf

-
typedef struct _MateWeatherMateConf MateWeatherMateConf;
-

-

-
-
-
-

mateweather_mateconf_new ()

-
MateWeatherMateConf *     mateweather_mateconf_new                  (const char *prefix);
-

-

-
-- - - - - - - - - - -

prefix :

-

Returns :

-
-
-
-
-

mateweather_mateconf_free ()

-
void                mateweather_mateconf_free                 (MateWeatherMateConf *ctx);
-

-

-
-- - - - -

ctx :

-
-
-
-
-

mateweather_mateconf_get_client ()

-
MateConfClient *       mateweather_mateconf_get_client           (MateWeatherMateConf *ctx);
-

-

-
-- - - - - - - - - - -

ctx :

-

Returns :

-
-
-
-
-

mateweather_mateconf_get_location ()

-
WeatherLocation *   mateweather_mateconf_get_location         (MateWeatherMateConf *ctx);
-

-

-
-- - - - - - - - - - -

ctx :

-

Returns :

-
-
-
-
-

mateweather_mateconf_get_full_key ()

-
gchar *             mateweather_mateconf_get_full_key         (MateWeatherMateConf *ctx,
-                                                         const gchar *key);
-

-

-
-- - - - - - - - - - - - - - -

ctx :

-

key :

-

Returns :

-
-
-
-
-

mateweather_mateconf_set_bool ()

-
void                mateweather_mateconf_set_bool             (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         gboolean the_bool,
-                                                         GError **opt_error);
-

-

-
-- - - - - - - - - - - - - - - - - - -

ctx :

-

key :

-

the_bool :

-

opt_error :

-
-
-
-
-

mateweather_mateconf_set_int ()

-
void                mateweather_mateconf_set_int              (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         gint the_int,
-                                                         GError **opt_error);
-

-

-
-- - - - - - - - - - - - - - - - - - -

ctx :

-

key :

-

the_int :

-

opt_error :

-
-
-
-
-

mateweather_mateconf_set_string ()

-
void                mateweather_mateconf_set_string           (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         const gchar *the_string,
-                                                         GError **opt_error);
-

-

-
-- - - - - - - - - - - - - - - - - - -

ctx :

-

key :

-

the_string :

-

opt_error :

-
-
-
-
-

mateweather_mateconf_get_bool ()

-
gboolean            mateweather_mateconf_get_bool             (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         GError **opt_error);
-

-

-
-- - - - - - - - - - - - - - - - - - -

ctx :

-

key :

-

opt_error :

-

Returns :

-
-
-
-
-

mateweather_mateconf_get_int ()

-
gint                mateweather_mateconf_get_int              (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         GError **opt_error);
-

-

-
-- - - - - - - - - - - - - - - - - - -

ctx :

-

key :

-

opt_error :

-

Returns :

-
-
-
-
-

mateweather_mateconf_get_string ()

-
gchar *             mateweather_mateconf_get_string           (MateWeatherMateConf *ctx,
-                                                         const gchar *key,
-                                                         GError **opt_error);
-

-

-
-- - - - - - - - - - - - - - - - - - -

ctx :

-

key :

-

opt_error :

-

Returns :

-
-
-
-
- - - \ No newline at end of file diff --git a/doc/tmpl/mateweather-mateconf.sgml b/doc/tmpl/mateweather-mateconf.sgml deleted file mode 100644 index 238ab34..0000000 --- a/doc/tmpl/mateweather-mateconf.sgml +++ /dev/null @@ -1,136 +0,0 @@ - -mateweather-mateconf - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@prefix: -@Returns: - - - - - - - -@ctx: - - - - - - - -@ctx: -@Returns: - - - - - - - -@ctx: -@Returns: - - - - - - - -@ctx: -@key: -@Returns: - - - - - - - -@ctx: -@key: -@the_bool: -@opt_error: - - - - - - - -@ctx: -@key: -@the_int: -@opt_error: - - - - - - - -@ctx: -@key: -@the_string: -@opt_error: - - - - - - - -@ctx: -@key: -@opt_error: -@Returns: - - - - - - - -@ctx: -@key: -@opt_error: -@Returns: - - - - - - - -@ctx: -@key: -@opt_error: -@Returns: - - diff --git a/libmateweather/Makefile.am b/libmateweather/Makefile.am index 8502708..41a35fe 100644 --- a/libmateweather/Makefile.am +++ b/libmateweather/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libmateweather.la libmateweatherincdir = $(includedir)/libmateweather mateweather_old_headers = \ - weather.h mateweather-mateconf.h mateweather-prefs.h mateweather-xml.h + weather.h mateweather-prefs.h mateweather-xml.h mateweather_new_headers = \ mateweather-location.h location-entry.h \ mateweather-timezone.h timezone-menu.h @@ -21,7 +21,6 @@ libmateweather_la_SOURCES = \ weather-sun.c weather-moon.c \ mateweather-enum-types.c \ mateweather-prefs.c mateweather-prefs.h \ - mateweather-mateconf.c mateweather-mateconf.h \ mateweather-xml.c mateweather-xml.h \ mateweather-location.c mateweather-location.h \ mateweather-timezone.c mateweather-timezone.h \ @@ -43,7 +42,7 @@ libmateweather_la_CFLAGS = \ $(GTK_CFLAGS) \ $(LIBXML_CFLAGS) \ $(LIBSOUP_CFLAGS) \ - $(MATECONF_CFLAGS) \ + $(GIO_CFLAGS) \ -DG_LOG_DOMAIN=\"MateWeather\" \ -DMATELOCALEDIR=\""$(datadir)/locale"\" \ -DMATEWEATHER_XML_LOCATION_DIR=\""$(pkgdatadir)"\" @@ -53,7 +52,7 @@ libmateweather_la_LIBADD = \ $(GTK_LIBS) \ $(LIBXML_LIBS) \ $(LIBSOUP_LIBS) \ - $(MATECONF_LIBS) \ + $(GIO_LIBS) \ $(REGEX_LIBS) libmateweather_la_LDFLAGS = \ @@ -123,26 +122,10 @@ test_sun_moon_LDADD = \ noinst_HEADERS = weather-priv.h mateweather-win32.h noinst_PROGRAMS = test_metar test_locations test_sun_moon -schemadir = @MATECONF_SCHEMA_FILE_DIR@ -schema_in_files = mateweather.schemas.in -schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -if MATECONF_SCHEMAS_INSTALL -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-install-rule $$p ; \ - done \ - fi -uninstall-local: - for p in $(schema_DATA) ; do \ - MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-uninstall-rule $$p ; \ - done -endif +gsettings_SCHEMAS = org.mate.weather.gschema.xml +@GSETTINGS_RULES@ -EXTRA_DIST = mateweather.pc.in mateweather-uninstalled.pc.in $(schema_in_files) +EXTRA_DIST = mateweather.pc.in mateweather-uninstalled.pc.in $(gsettings_SCHEMAS) EXTRA_PROGRAMS = test_metar test_sun_moon diff --git a/libmateweather/mateweather-mateconf.c b/libmateweather/mateweather-mateconf.c deleted file mode 100644 index f8f6f1b..0000000 --- a/libmateweather/mateweather-mateconf.c +++ /dev/null @@ -1,310 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * mateweather-mateconf.c: MateConf interaction methods for mateweather. - * - * Copyright (C) 2005 Philip Langdale, Papadimitriou Spiros - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, see - * . - * - * Authors: - * Philip Langdale - * Papadimitriou Spiros - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#define MATEWEATHER_I_KNOW_THIS_IS_UNSTABLE -#include "mateweather-mateconf.h" -#include "weather-priv.h" - -struct _MateWeatherMateConf -{ - MateConfClient *mateconf; - char *prefix; -}; - - -MateWeatherMateConf * -mateweather_mateconf_new (const char *prefix) -{ - MateWeatherMateConf *ctx = g_new0 (MateWeatherMateConf, 1); - ctx->mateconf = mateconf_client_get_default (); - ctx->prefix = g_strdup (prefix); - - return ctx; -} - - -void -mateweather_mateconf_free (MateWeatherMateConf *ctx) -{ - if (!ctx) - return; - - g_object_unref (ctx->mateconf); - g_free (ctx->prefix); - g_free (ctx); -} - - -MateConfClient * -mateweather_mateconf_get_client (MateWeatherMateConf *ctx) -{ - g_return_val_if_fail (ctx != NULL, NULL); - return ctx->mateconf; -} - - -gchar * -mateweather_mateconf_get_full_key (MateWeatherMateConf *ctx, - const gchar *key) -{ - g_return_val_if_fail (ctx != NULL, NULL); - g_return_val_if_fail (key != NULL, NULL); - - return g_strdup_printf ("%s/%s", ctx->prefix, key); -} - -void -mateweather_mateconf_set_bool (MateWeatherMateConf *ctx, - const gchar *key, - gboolean the_bool, - GError **opt_error) -{ - gchar *full_key; - - g_return_if_fail (ctx != NULL); - g_return_if_fail (key != NULL); - g_return_if_fail (opt_error == NULL || *opt_error == NULL); - - full_key = mateweather_mateconf_get_full_key (ctx, key); - mateconf_client_set_bool (ctx->mateconf, full_key, the_bool, opt_error); - g_free (full_key); -} - -void -mateweather_mateconf_set_int (MateWeatherMateConf *ctx, - const gchar *key, - gint the_int, - GError **opt_error) -{ - gchar *full_key; - - g_return_if_fail (ctx != NULL); - g_return_if_fail (key != NULL); - g_return_if_fail (opt_error == NULL || *opt_error == NULL); - - full_key = mateweather_mateconf_get_full_key (ctx, key); - mateconf_client_set_int (ctx->mateconf, full_key, the_int, opt_error); - g_free (full_key); -} - -void -mateweather_mateconf_set_string (MateWeatherMateConf *ctx, - const gchar *key, - const gchar *the_string, - GError **opt_error) -{ - gchar *full_key; - - g_return_if_fail (ctx != NULL); - g_return_if_fail (key != NULL); - g_return_if_fail (opt_error == NULL || *opt_error == NULL); - - full_key = mateweather_mateconf_get_full_key (ctx, key); - mateconf_client_set_string (ctx->mateconf, full_key, the_string, opt_error); - g_free (full_key); -} - -gboolean -mateweather_mateconf_get_bool (MateWeatherMateConf *ctx, - const gchar *key, - GError **opt_error) -{ - gchar *full_key; - gboolean ret; - - g_return_val_if_fail (ctx != NULL, FALSE); - g_return_val_if_fail (key != NULL, FALSE); - g_return_val_if_fail (opt_error == NULL || *opt_error == NULL, FALSE); - - full_key = mateweather_mateconf_get_full_key (ctx, key); - ret = mateconf_client_get_bool (ctx->mateconf, full_key, opt_error); - g_free (full_key); - return ret; -} - -gint -mateweather_mateconf_get_int (MateWeatherMateConf *ctx, - const gchar *key, - GError **opt_error) -{ - gchar *full_key; - gint ret; - - g_return_val_if_fail (ctx != NULL, 0); - g_return_val_if_fail (key != NULL, 0); - g_return_val_if_fail (opt_error == NULL || *opt_error == NULL, 0); - - full_key = mateweather_mateconf_get_full_key (ctx, key); - ret = mateconf_client_get_int (ctx->mateconf, full_key, opt_error); - g_free (full_key); - return ret; -} - -gchar * -mateweather_mateconf_get_string (MateWeatherMateConf *ctx, - const gchar *key, - GError **opt_error) -{ - gchar *full_key; - gchar *ret; - - g_return_val_if_fail (ctx != NULL, NULL); - g_return_val_if_fail (key != NULL, NULL); - g_return_val_if_fail (opt_error == NULL || *opt_error == NULL, NULL); - - full_key = mateweather_mateconf_get_full_key (ctx, key); - ret = mateconf_client_get_string (ctx->mateconf, full_key, opt_error); - g_free (full_key); - return ret; -} - - -WeatherLocation * -mateweather_mateconf_get_location (MateWeatherMateConf *ctx) -{ - WeatherLocation *location; - gchar *name, *code, *zone, *radar, *coordinates; - - g_return_val_if_fail (ctx != NULL, NULL); - - name = mateweather_mateconf_get_string (ctx, "location4", NULL); - if (!name) - { - /* TRANSLATOR: Change this to the default location name, - * used when you first start the Weather Applet. This is - * the common localised name that corresponds to - * the location code (DEFAULT_CODE) you will put on the next message - * For example, for the Greek locale, we set this to "Athens", the - * capital city and we write it in Greek. It's important to translate - * this name. - * - * If you do not require a DEFAULT_LOCATION, set this to - * "DEFAULT_LOCATION". - */ - if (strcmp ("DEFAULT_LOCATION", _("DEFAULT_LOCATION"))) - name = g_strdup (_("DEFAULT_LOCATION")); - else - name = g_strdup ("Pittsburgh"); - } - - code = mateweather_mateconf_get_string (ctx, "location1", NULL); - if (!code) - { - /* TRANSLATOR: Change this to the code of your default location that - * corresponds to the DEFAULT_LOCATION name you put above. This is - * normally a four-letter (ICAO) code and can be found in - * http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - * NB. The web page is over 1.7MB in size. - * Pick a default location like a capital city so that it would be ok - * for more of your users. For example, for Greek, we use "LGAV" for - * the capital city, Athens. - * - * If you do not require a DEFAULT_CODE, set this to "DEFAULT_CODE". - */ - if (strcmp ("DEFAULT_CODE", _("DEFAULT_CODE"))) - code = g_strdup (_("DEFAULT_CODE")); - else - code = g_strdup ("KPIT"); - } - - zone = mateweather_mateconf_get_string (ctx, "location2", NULL); - if (!zone) - { - /* TRANSLATOR: Change this to the zone of your default location that - * corresponds to the DEFAULT_LOCATION and DEFAULT_CODE you put above. - * Normally, US and Canada locations have zones while the rest do not. - * Check - * http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - * as any zone you put here must also be present in the Locations.xml - * file. - * - * If your default location does not have a zone, set this to - * "DEFAULT_ZONE". - */ - if (strcmp ("DEFAULT_ZONE", _("DEFAULT_ZONE"))) - zone = g_strdup (_("DEFAULT_ZONE" )); - else - zone = g_strdup ("PAZ021"); - } - - radar = mateweather_mateconf_get_string (ctx, "location3", NULL); - if (!radar) - { - /* TRANSLATOR: Change this to the radar of your default location that - * corresponds to the DEFAULT_LOCATION and DEFAULT_CODE you put above. - * Normally, US and Canada locations have radar names while the rest do - * not. Check - * http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - * as any radar you put here must also be present in the Locations.xml - * file. - * - * If your default location does not have a radar, set this to " " - * (or space). - * If you do not have a default location, set this to DEFAULT_RADAR. - */ - if (strcmp ("DEFAULT_RADAR", _("DEFAULT_RADAR"))) - radar = g_strdup (_("DEFAULT_RADAR")); - else - radar = g_strdup ("pit"); - } - - coordinates = mateweather_mateconf_get_string (ctx, "coordinates", NULL); - if (!coordinates) - { - /* TRANSLATOR: Change this to the coordinates of your default location - * that corresponds to the DEFAULT_LOCATION and DEFAULT_CODE you put - * above. Check - * http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - * as any coordinates you put here must also be present in the - * Locations.xml file. - * - * If your default location does not have known coordinates, set this - * to " " (or space). - * If you do not have a default location, set this to - * DEFAULT_COORDINATES. - */ - if (strcmp ("DEFAULT_COORDINATES", _("DEFAULT_COORDINATES"))) - coordinates = g_strdup (_("DEFAULT_COORDINATES")); - else - coordinates = g_strdup ("40-32N 080-13W"); - } - - location = weather_location_new (name, code, zone, radar, coordinates, - NULL, NULL); - - g_free (name); - g_free (code); - g_free (zone); - g_free (radar); - g_free (coordinates); - - return location; -} diff --git a/libmateweather/mateweather-mateconf.h b/libmateweather/mateweather-mateconf.h deleted file mode 100644 index 5132d81..0000000 --- a/libmateweather/mateweather-mateconf.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * mateweather-mateconf.h: MateConf interaction methods for mateweather. - * - * Copyright (C) 2005 Philip Langdale, Papadimitriou Spiros - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, see - * . - * - * Authors: - * Philip Langdale - * Papadimitriou Spiros - */ - -#ifndef __MATEWEATHER_MATECONF_WRAPPER_H__ -#define __MATEWEATHER_MATECONF_WRAPPER_H__ - - -#ifndef MATEWEATHER_I_KNOW_THIS_IS_UNSTABLE -#error "libmateweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform" -#endif - - -#include -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _MateWeatherMateConf MateWeatherMateConf; - -MateWeatherMateConf * mateweather_mateconf_new (const char *prefix); -void mateweather_mateconf_free (MateWeatherMateConf *ctx); - -MateConfClient * mateweather_mateconf_get_client (MateWeatherMateConf *ctx); - -WeatherLocation * mateweather_mateconf_get_location (MateWeatherMateConf *ctx); - -gchar * mateweather_mateconf_get_full_key (MateWeatherMateConf *ctx, - const gchar *key); - -void mateweather_mateconf_set_bool (MateWeatherMateConf *ctx, - const gchar *key, - gboolean the_bool, - GError **opt_error); -void mateweather_mateconf_set_int (MateWeatherMateConf *ctx, - const gchar *key, - gint the_int, - GError **opt_error); -void mateweather_mateconf_set_string (MateWeatherMateConf *ctx, - const gchar *key, - const gchar *the_string, - GError **opt_error); - -gboolean mateweather_mateconf_get_bool (MateWeatherMateConf *ctx, - const gchar *key, - GError **opt_error); -gint mateweather_mateconf_get_int (MateWeatherMateConf *ctx, - const gchar *key, - GError **opt_error); -gchar * mateweather_mateconf_get_string (MateWeatherMateConf *ctx, - const gchar *key, - GError **opt_error); - -#ifdef __cplusplus -} -#endif - -#endif /* __MATEWEATHER_MATECONF_WRAPPER_H__ */ diff --git a/libmateweather/mateweather-prefs.c b/libmateweather/mateweather-prefs.c index b533ca2..d964085 100644 --- a/libmateweather/mateweather-prefs.c +++ b/libmateweather/mateweather-prefs.c @@ -24,372 +24,56 @@ #include #endif -#include - #define MATEWEATHER_I_KNOW_THIS_IS_UNSTABLE #include "mateweather-prefs.h" #include "weather-priv.h" -static MateConfEnumStringPair temp_unit_enum_map [] = { - { TEMP_UNIT_DEFAULT, N_("Default") }, - /* translators: Kelvin */ - { TEMP_UNIT_KELVIN, N_("K") }, - /* translators: Celsius */ - { TEMP_UNIT_CENTIGRADE, N_("C") }, - /* translators: Fahrenheit */ - { TEMP_UNIT_FAHRENHEIT, N_("F") }, - { 0, NULL } -}; - -static MateConfEnumStringPair speed_unit_enum_map [] = { - { SPEED_UNIT_DEFAULT, N_("Default") }, - /* translators: meters per second */ - { SPEED_UNIT_MS, N_("m/s") }, - /* translators: kilometers per hour */ - { SPEED_UNIT_KPH, N_("km/h") }, - /* translators: miles per hour */ - { SPEED_UNIT_MPH, N_("mph") }, - /* translators: knots (speed unit) */ - { SPEED_UNIT_KNOTS, N_("knots") }, - /* translators: wind speed */ - { SPEED_UNIT_BFT, N_("Beaufort scale") }, - { 0, NULL } -}; - -static MateConfEnumStringPair pressure_unit_enum_map [] = { - { PRESSURE_UNIT_DEFAULT, N_("Default") }, - /* translators: kilopascals */ - { PRESSURE_UNIT_KPA, N_("kPa") }, - /* translators: hectopascals */ - { PRESSURE_UNIT_HPA, N_("hPa") }, - /* translators: millibars */ - { PRESSURE_UNIT_MB, N_("mb") }, - /* translators: millimeters of mercury */ - { PRESSURE_UNIT_MM_HG, N_("mmHg") }, - /* translators: inches of mercury */ - { PRESSURE_UNIT_INCH_HG, N_("inHg") }, - /* translators: atmosphere */ - { PRESSURE_UNIT_ATM, N_("atm") }, - { 0, NULL } -}; - -static MateConfEnumStringPair distance_unit_enum_map [] = { - { DISTANCE_UNIT_DEFAULT, N_("Default") }, - /* translators: meters */ - { DISTANCE_UNIT_METERS, N_("m") }, - /* translators: kilometers */ - { DISTANCE_UNIT_KM, N_("km") }, - /* translators: miles */ - { DISTANCE_UNIT_MILES, N_("mi") }, - { 0, NULL } -}; - - -static void -parse_temp_string (const gchar *mateconf_str, MateWeatherPrefs *prefs) -{ - gint value = 0; -#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT - char *imperial = NULL; -#endif - - prefs->temperature_unit = TEMP_UNIT_INVALID; - prefs->use_temperature_default = TRUE; - - if ( mateconf_str && mateconf_string_to_enum (temp_unit_enum_map, mateconf_str, &value) ) { - prefs->temperature_unit = value; - - if ((prefs->temperature_unit == TEMP_UNIT_DEFAULT) && - (mateconf_string_to_enum (temp_unit_enum_map, _("DEFAULT_TEMP_UNIT"), &value)) ) { - prefs->temperature_unit = value; - } else { - prefs->use_temperature_default = FALSE; - } - } else { - /* TRANSLATOR: This is the default unit to use for temperature measurements. */ - /* Valid values are: "K" (Kelvin), "C" (Celsius) and "F" (Fahrenheit) */ - if (mateconf_string_to_enum (temp_unit_enum_map, _("DEFAULT_TEMP_UNIT"), &value) ) { - prefs->temperature_unit = value; - } - } - if (!prefs->temperature_unit || prefs->temperature_unit == TEMP_UNIT_DEFAULT ) { -#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT - imperial = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT); - if ( imperial && imperial[0] == 2 ) { - /* imperial */ - prefs->temperature_unit = TEMP_UNIT_FAHRENHEIT; - } else -#endif - prefs->temperature_unit = TEMP_UNIT_CENTIGRADE; - } -} - -static void -parse_speed_string (const gchar *mateconf_str, MateWeatherPrefs *prefs) -{ - gint value = 0; -#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT - char *imperial = NULL; -#endif - - prefs->speed_unit = SPEED_UNIT_INVALID; - prefs->use_speed_default = TRUE; - - if (mateconf_str && mateconf_string_to_enum (speed_unit_enum_map, mateconf_str, &value) ) { - prefs->speed_unit = value; - if ((prefs->speed_unit == SPEED_UNIT_DEFAULT) && - (mateconf_string_to_enum (speed_unit_enum_map, _("DEFAULT_SPEED_UNIT"), &value)) ) { - prefs->speed_unit = value; - } else { - prefs->use_speed_default = FALSE; - } - } - else { - /* TRANSLATOR: This is the default unit to use for wind speed. */ - /* Valid values are: "m/s" (meters per second), "km/h" (kilometers per hour), */ - /* "mph" (miles per hour) and "knots" */ - if (mateconf_string_to_enum (speed_unit_enum_map, _("DEFAULT_SPEED_UNIT"), &value) ) { - prefs->speed_unit = value; - } - } - if ((!prefs->speed_unit) || prefs->speed_unit == SPEED_UNIT_DEFAULT) { -#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT - imperial = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT); - if (imperial && imperial[0] == 2) { - /* imperial */ - prefs->speed_unit = SPEED_UNIT_KNOTS; - } else -#endif - prefs->speed_unit = SPEED_UNIT_MS; - } -} - - -static void -parse_pressure_string (const gchar *mateconf_str, MateWeatherPrefs *prefs) -{ - gint value = 0; -#ifdef _NL_MEASUREMENT_MEASUREMENT - char *imperial = NULL; -#endif - - prefs->pressure_unit = PRESSURE_UNIT_INVALID; - prefs->use_pressure_default = TRUE; - - if ( mateconf_str && mateconf_string_to_enum (pressure_unit_enum_map, mateconf_str, &value) ) { - prefs->pressure_unit = value; - - if ((prefs->pressure_unit == PRESSURE_UNIT_DEFAULT) && - (mateconf_string_to_enum (pressure_unit_enum_map, _("DEFAULT_PRESSURE_UNIT"), &value)) ) { - prefs->pressure_unit = value; - } else { - prefs->use_pressure_default = FALSE; - } - } - else { - /* TRANSLATOR: This is the default unit to use for atmospheric pressure. */ - /* Valid values are: "kPa" (kiloPascals), "hPa" (hectoPascals), - "mb" (millibars), "mmHg" (millimeters of mercury), - "inHg" (inches of mercury) and "atm" (atmosphere) */ - if (mateconf_string_to_enum (pressure_unit_enum_map, _("DEFAULT_PRESSURE_UNIT"), &value) ) { - prefs->pressure_unit = value; - } - } - if ( (!prefs->pressure_unit) || prefs->pressure_unit == PRESSURE_UNIT_DEFAULT ) { -#ifdef _NL_MEASUREMENT_MEASUREMENT - imperial = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT); - if (imperial && imperial[0] == 2) { - /* imperial */ - prefs->pressure_unit = PRESSURE_UNIT_INCH_HG; - } else -#endif - prefs->pressure_unit = PRESSURE_UNIT_HPA; - } -} - -static void -parse_distance_string (const gchar *mateconf_str, MateWeatherPrefs *prefs) -{ - gint value = 0; -#ifdef _NL_MEASUREMENT_MEASUREMENT - char *imperial = NULL; -#endif - - prefs->distance_unit = DISTANCE_UNIT_INVALID; - prefs->use_distance_default = TRUE; - if (mateconf_str && mateconf_string_to_enum (distance_unit_enum_map, mateconf_str, &value)) { - prefs->distance_unit = value; - - if ((prefs->distance_unit == DISTANCE_UNIT_DEFAULT) && - (mateconf_string_to_enum (distance_unit_enum_map, _("DEFAULT_DISTANCE_UNIT"), &value)) ) { - prefs->distance_unit = value; - } else { - prefs->use_distance_default = FALSE; - } - } - else { - /* TRANSLATOR: This is the default unit to use for visibility distance. */ - /* Valid values are: "m" (meters), "km" (kilometers) and "mi" (miles) */ - if (mateconf_string_to_enum (distance_unit_enum_map, _("DEFAULT_DISTANCE_UNIT"), &value) ) { - prefs->distance_unit = value; - } - } - - if ((!prefs->distance_unit) || prefs->distance_unit == DISTANCE_UNIT_DEFAULT) { -#ifdef _NL_MEASUREMENT_MEASUREMENT - imperial = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT); - if (imperial && imperial[0] == 2) { - /* imperial */ - prefs->distance_unit = DISTANCE_UNIT_MILES; - } else -#endif - prefs->distance_unit = DISTANCE_UNIT_METERS; - } - - return; -} - -const char * -mateweather_prefs_temp_enum_to_string (TempUnit temp) -{ - return mateconf_enum_to_string (temp_unit_enum_map, temp); -} - -const char * -mateweather_prefs_speed_enum_to_string (SpeedUnit speed) -{ - return mateconf_enum_to_string (speed_unit_enum_map, speed); -} - -const char * -mateweather_prefs_pressure_enum_to_string (PressureUnit pressure) -{ - return mateconf_enum_to_string (pressure_unit_enum_map, pressure); -} - -const char * -mateweather_prefs_distance_enum_to_string (DistanceUnit distance) -{ - return mateconf_enum_to_string (distance_unit_enum_map, distance); -} - - void -mateweather_prefs_load (MateWeatherPrefs *prefs, MateWeatherMateConf *ctx) +mateweather_prefs_load (MateWeatherPrefs *prefs, GSettings *settings) { - GError *error = NULL; - gchar *mateconf_str = NULL; - g_return_if_fail (prefs != NULL); - g_return_if_fail (ctx != NULL); + g_return_if_fail (settings != NULL); if (prefs->location) { weather_location_free (prefs->location); } - prefs->location = mateweather_mateconf_get_location (ctx); - - /* Assume we use unit defaults */ - prefs->use_temperature_default = TRUE; - prefs->use_speed_default = TRUE; - prefs->use_pressure_default = TRUE; - prefs->use_distance_default = TRUE; + gchar *name, *code, *zone, *radar, *coordinates; + name = g_settings_get_string (settings, "location4"); + code = g_settings_get_string (settings, "location1"); + zone = g_settings_get_string (settings, "location2"); + radar = g_settings_get_string (settings, "location3"); + coordinates = g_settings_get_string (settings, "coordinates"); + prefs->location = weather_location_new (name, code, zone, radar, coordinates, + NULL, NULL); + + g_free (name); + g_free (code); + g_free (zone); + g_free (radar); + g_free (coordinates); prefs->update_interval = - mateweather_mateconf_get_int (ctx, "auto_update_interval", &error); - if (error) { - g_print ("%s \n", error->message); - g_error_free (error); - error = NULL; - } + g_settings_get_int (settings, "auto-update-interval"); prefs->update_interval = MAX (prefs->update_interval, 60); prefs->update_enabled = - mateweather_mateconf_get_bool (ctx, "auto_update", NULL); + g_settings_get_boolean (settings, "auto-update"); prefs->detailed = - mateweather_mateconf_get_bool (ctx, "enable_detailed_forecast", NULL); + g_settings_get_boolean (settings, "enable-detailed-forecast"); prefs->radar_enabled = - mateweather_mateconf_get_bool (ctx, "enable_radar_map", NULL); + g_settings_get_boolean (settings, "enable-radar-map"); prefs->use_custom_radar_url = - mateweather_mateconf_get_bool (ctx, "use_custom_radar_url", NULL); + g_settings_get_boolean (settings, "use-custom-radar-url"); if (prefs->radar) { g_free (prefs->radar); prefs->radar = NULL; } - prefs->radar = mateweather_mateconf_get_string (ctx, "radar", NULL); - - mateconf_str = mateweather_mateconf_get_string (ctx, MATECONF_TEMP_UNIT, NULL); - parse_temp_string (mateconf_str, prefs); - g_free (mateconf_str); - - mateconf_str = mateweather_mateconf_get_string (ctx, MATECONF_SPEED_UNIT, NULL); - parse_speed_string (mateconf_str, prefs); - g_free (mateconf_str); - - mateconf_str = mateweather_mateconf_get_string (ctx, MATECONF_PRESSURE_UNIT, NULL); - parse_pressure_string (mateconf_str, prefs); - g_free (mateconf_str); - - mateconf_str = mateweather_mateconf_get_string (ctx, MATECONF_DISTANCE_UNIT, NULL); - parse_distance_string (mateconf_str, prefs); - g_free (mateconf_str); + prefs->radar = g_settings_get_string (settings, "radar"); + + prefs->temperature_unit = g_settings_get_enum (settings, GSETTINGS_TEMP_UNIT); + prefs->speed_unit = g_settings_get_enum (settings, GSETTINGS_SPEED_UNIT); + prefs->pressure_unit = g_settings_get_enum (settings, GSETTINGS_PRESSURE_UNIT); + prefs->distance_unit = g_settings_get_enum (settings, GSETTINGS_DISTANCE_UNIT); return; } - -TempUnit -mateweather_prefs_parse_temperature (const char *str, gboolean *is_default) -{ - MateWeatherPrefs prefs; - - g_return_val_if_fail (str != NULL, TEMP_UNIT_INVALID); - g_return_val_if_fail (is_default != NULL, TEMP_UNIT_INVALID); - - parse_temp_string (str, &prefs); - *is_default = prefs.use_temperature_default; - return prefs.temperature_unit; -} - -SpeedUnit -mateweather_prefs_parse_speed (const char *str, gboolean *is_default) -{ - MateWeatherPrefs prefs; - - g_return_val_if_fail (str != NULL, SPEED_UNIT_INVALID); - g_return_val_if_fail (is_default != NULL, SPEED_UNIT_INVALID); - - parse_speed_string (str, &prefs); - *is_default = prefs.use_speed_default; - return prefs.speed_unit; -} - -static const char * -get_translated_unit (int unit, MateConfEnumStringPair *pairs, int min_value, int max_value) -{ - g_return_val_if_fail (unit >= min_value && unit <= max_value, NULL); - - return _(pairs[unit - 1].str); /* minus 1 because enum value 0 is for "invalid" (look at weather.h) */ -} - -const char * -mateweather_prefs_get_temp_display_name (TempUnit temp) -{ - return get_translated_unit (temp, temp_unit_enum_map, TEMP_UNIT_DEFAULT, TEMP_UNIT_FAHRENHEIT); -} - -const char * -mateweather_prefs_get_speed_display_name (SpeedUnit speed) -{ - return get_translated_unit (speed, speed_unit_enum_map, SPEED_UNIT_DEFAULT, SPEED_UNIT_BFT); -} - -const char * -mateweather_prefs_get_pressure_display_name (PressureUnit pressure) -{ - return get_translated_unit (pressure, pressure_unit_enum_map, PRESSURE_UNIT_DEFAULT, PRESSURE_UNIT_ATM); -} - -const char * -mateweather_prefs_get_distance_display_name (DistanceUnit distance) -{ - return get_translated_unit (distance, distance_unit_enum_map, DISTANCE_UNIT_DEFAULT, DISTANCE_UNIT_MILES); -} diff --git a/libmateweather/mateweather-prefs.h b/libmateweather/mateweather-prefs.h index 17cc65f..042170b 100644 --- a/libmateweather/mateweather-prefs.h +++ b/libmateweather/mateweather-prefs.h @@ -26,13 +26,13 @@ #include -#include +#include -/* mateconf keys */ -#define MATECONF_TEMP_UNIT "temperature_unit" -#define MATECONF_SPEED_UNIT "speed_unit" -#define MATECONF_PRESSURE_UNIT "pressure_unit" -#define MATECONF_DISTANCE_UNIT "distance_unit" +/* gsettings keys */ +#define GSETTINGS_TEMP_UNIT "temperature-unit" +#define GSETTINGS_SPEED_UNIT "speed-unit" +#define GSETTINGS_PRESSURE_UNIT "pressure-unit" +#define GSETTINGS_DISTANCE_UNIT "distance-unit" typedef struct _MateWeatherPrefs MateWeatherPrefs; @@ -46,31 +46,13 @@ struct _MateWeatherPrefs { gchar *radar; TempUnit temperature_unit; - gboolean use_temperature_default; SpeedUnit speed_unit; - gboolean use_speed_default; PressureUnit pressure_unit; - gboolean use_pressure_default; DistanceUnit distance_unit; - gboolean use_distance_default; }; void mateweather_prefs_load (MateWeatherPrefs *prefs, - MateWeatherMateConf *ctx); + GSettings *settings); -const char * mateweather_prefs_temp_enum_to_string (TempUnit temp); -const char * mateweather_prefs_speed_enum_to_string (SpeedUnit speed); -const char * mateweather_prefs_pressure_enum_to_string (PressureUnit pressure); -const char * mateweather_prefs_distance_enum_to_string (DistanceUnit distance); - -TempUnit mateweather_prefs_parse_temperature (const char *str, - gboolean *is_default); -SpeedUnit mateweather_prefs_parse_speed (const char *str, - gboolean *is_default); - -const char * mateweather_prefs_get_temp_display_name (TempUnit temp); -const char * mateweather_prefs_get_speed_display_name (SpeedUnit speed); -const char * mateweather_prefs_get_pressure_display_name (PressureUnit pressure); -const char * mateweather_prefs_get_distance_display_name (DistanceUnit distance); #endif /* __MATEWEATHER_PREFS_H_ */ diff --git a/libmateweather/mateweather-uninstalled.pc.in b/libmateweather/mateweather-uninstalled.pc.in index ac37302..08e42f7 100644 --- a/libmateweather/mateweather-uninstalled.pc.in +++ b/libmateweather/mateweather-uninstalled.pc.in @@ -7,7 +7,7 @@ includedir=@includedir@ Name: MateWeather Description: MateWeather shared library Version: @VERSION@ -Requires: glib-2.0 gobject-2.0 gdk-pixbuf-2.0 gtk+-2.0 mateconf-2.0 +Requires: glib-2.0 gobject-2.0 gdk-pixbuf-2.0 gtk+-2.0 gio-2.0 Requires.private: libxml-2.0 libsoup-2.4 Libs: ${pc_top_builddir}/${pcfiledir}/libmateweather.la Cflags: -I${pc_top_builddir}/${pcfiledir}/.. diff --git a/libmateweather/mateweather.pc.in b/libmateweather/mateweather.pc.in index d332631..e90dbae 100644 --- a/libmateweather/mateweather.pc.in +++ b/libmateweather/mateweather.pc.in @@ -7,7 +7,7 @@ includedir=@includedir@ Name: MateWeather Description: MateWeather shared library Version: @VERSION@ -Requires: glib-2.0 gobject-2.0 gdk-pixbuf-2.0 gtk+-2.0 mateconf-2.0 +Requires: glib-2.0 gobject-2.0 gdk-pixbuf-2.0 gtk+-2.0 gio-2.0 Requires.private: libxml-2.0 libsoup-2.4 Libs: -L${libdir} -lmateweather Libs.private: -lm diff --git a/libmateweather/mateweather.schemas.in b/libmateweather/mateweather.schemas.in deleted file mode 100644 index 3b81d35..0000000 --- a/libmateweather/mateweather.schemas.in +++ /dev/null @@ -1,173 +0,0 @@ - - - - - /schemas/apps/mateweather/prefs/auto_update - mateweather-applet-2 - bool - true - - Update the data automatically - Determines whether the applet automatically updates its weather statistics or not. - - - - /schemas/apps/mateweather/prefs/auto_update_interval - mateweather-applet-2 - int - 1800 - - Update interval - The interval, in seconds, between automatic updates. - - - - /schemas/apps/mateweather/prefs/enable_metric - mateweather-applet-2 - bool - false - - Use metric units - Use metric units instead of english units. - - - - /schemas/apps/mateweather/prefs/distance_unit - mateweather-applet-2 - string - Default - - Distance unit - The unit to use for visibility. - - - - /schemas/apps/mateweather/prefs/pressure_unit - mateweather-applet-2 - string - Default - - Pressure unit - The unit to use for pressure. - - - - /schemas/apps/mateweather/prefs/speed_unit - mateweather-applet-2 - string - Default - - Speed unit - The unit to use for wind speed. - - - - /schemas/apps/mateweather/prefs/temperature_unit - mateweather-applet-2 - string - Default - - Temperature unit - The unit to use for temperature. - - - - /schemas/apps/mateweather/prefs/enable_detailed_forecast - mateweather-applet-2 - bool - false - - Not used anymore - - - - /schemas/apps/mateweather/prefs/enable_radar_map - mateweather-applet-2 - bool - false - - Display radar map - Fetch a radar map on each update. - - - - /schemas/apps/mateweather/prefs/location0 - mateweather-applet-2 - string - - DEFAULT_LOCATION - Weather location information - Weather location information. - - - - /schemas/apps/mateweather/prefs/location1 - mateweather-applet-2 - string - - DEFAULT_CODE - Nearby city - Nearby major zone, such as a capital city, as found from http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - - - - /schemas/apps/mateweather/prefs/location2 - mateweather-applet-2 - string - - DEFAULT_ZONE - Zone location - A unique zone for the city, as found from http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - - - - /schemas/apps/mateweather/prefs/location3 - mateweather-applet-2 - string - - DEFAULT_RADAR - Radar location - A three-digit-long code for retrieving radar maps from weather.com, found from http://git.gnome.org/cgit/libmateweather/plain/data/Locations.xml.in - - - - /schemas/apps/mateweather/prefs/location4 - mateweather-applet-2 - string - - DEFAULT_LOCATION - Weather for a city - The city that mateweather displays information for. - - - - /schemas/apps/mateweather/prefs/coordinates - mateweather-applet-2 - string - - DEFAULT_COORDINATES - Location coordinates - Latitude and longitude of your location expressed in DD-MM-SS[NS] DD-MM-SS[EW]. - - - - /schemas/apps/mateweather/prefs/use_custom_radar_url - mateweather-applet-2 - bool - false - - Use custom url for the radar map - If true, then retrieve a radar map from a location specified by the "radar" key. - - - - /schemas/apps/mateweather/prefs/radar - mateweather-applet-2 - string - - Url for the radar map - The custom url from where to retrieve a radar map. - - - - diff --git a/libmateweather/org.mate.weather.gschema.xml b/libmateweather/org.mate.weather.gschema.xml new file mode 100644 index 0000000..4a62fb9 --- /dev/null +++ b/libmateweather/org.mate.weather.gschema.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + Update the data automatically + Determines whether the applet automatically updates its weather statistics or not. + + + 1800 + Update interval + The interval, in seconds, between automatic updates. + + + false + Use metric units + Use metric units instead of english units. + + + 'Default' + Distance unit + The unit to use for visibility. + + + 'Default' + Pressure unit + The unit to use for pressure. + + + 'Default' + Speed unit + The unit to use for wind speed. + + + 'Default' + Temperature unit + The unit to use for temperature. + + + false + Not used anymore + + + false + Display radar map + Fetch a radar map on each update. + + + 'DEFAULT_LOCATION' + Weather location information + Weather location information. + + + 'DEFAULT_CODE' + Nearby city + Nearby major zone, such as a capital city, as found from https://raw.github.com/mate-desktop/libmateweather/master/data/Locations.xml.in + + + 'DEFAULT_ZONE' + Zone location + A unique zone for the city, as found from https://raw.github.com/mate-desktop/libmateweather/master/data/Locations.xml.in + + + 'DEFAULT_RADAR' + Radar location + A three-digit-long code for retrieving radar maps from weather.com, found from https://raw.github.com/mate-desktop/libmateweather/master/data/Locations.xml.in + + + 'DEFAULT_LOCATION' + Weather for a city + The city that mateweather displays information for. + + + 'DEFAULT_COORDINATES' + Location coordinates + Latitude and longitude of your location expressed in DD-MM-SS[NS] DD-MM-SS[EW]. + + + false + Use custom url for the radar map + If true, then retrieve a radar map from a location specified by the "radar" key. + + + '' + Url for the radar map + The custom url from where to retrieve a radar map. + + + diff --git a/po/POTFILES.in b/po/POTFILES.in index b1a0d7d..4ef6edd 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -2,7 +2,6 @@ # Please keep this file sorted alphabetically. # [encoding: UTF-8] -libmateweather/mateweather-mateconf.c libmateweather/mateweather-prefs.c libmateweather/mateweather-timezone.c libmateweather/mateweather.schemas.in -- cgit v1.2.1