summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-05-17 12:07:33 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-10-21 02:29:06 -0400
commite6519d5e9398a6acaf9a761cb962ebc0d706bc05 (patch)
treec377f0d9fbdef476f3dc9e5ed6792511bad50919
parent0a274f874af12ec4de5ed8e0f9012f52392e24b6 (diff)
downloadgdm-e6519d5e9398a6acaf9a761cb962ebc0d706bc05.tar.gz
Prototype of a initial-setup application
This code was previously in the setup branch of gnome-control-center. We're moving it to gdm, since that is where it will be used.
-rw-r--r--configure.ac14
-rw-r--r--gui/Makefile.am2
-rw-r--r--gui/initial-setup/Makefile.am34
-rw-r--r--gui/initial-setup/cc-timezone-map.c613
-rw-r--r--gui/initial-setup/cc-timezone-map.h79
-rw-r--r--gui/initial-setup/dtm.c3085
-rw-r--r--gui/initial-setup/dtm.h473
-rw-r--r--gui/initial-setup/gdm-initial-setup.c1486
-rw-r--r--gui/initial-setup/gsd-datetime-mechanism.xml63
-rw-r--r--gui/initial-setup/panel-cell-renderer-mode.c145
-rw-r--r--gui/initial-setup/panel-cell-renderer-mode.h58
-rw-r--r--gui/initial-setup/panel-cell-renderer-security.c155
-rw-r--r--gui/initial-setup/panel-cell-renderer-security.h66
-rw-r--r--gui/initial-setup/panel-cell-renderer-signal.c161
-rw-r--r--gui/initial-setup/panel-cell-renderer-signal.h58
-rw-r--r--gui/initial-setup/setup.ui636
-rw-r--r--gui/initial-setup/tz.c475
-rw-r--r--gui/initial-setup/tz.h89
-rw-r--r--gui/initial-setup/welcome-image.jpgbin0 -> 55997 bytes
19 files changed, 7692 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 718eb38c..70d6bf6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,6 +183,19 @@ AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_XTRA
+NETWORK_MANAGER_REQUIRED_VERSION=0.8.992
+
+PKG_CHECK_MODULES(INITIAL_SETUP,
+ NetworkManager >= $NETWORK_MANAGER_REQUIRED_VERSION
+ libnm-glib >= $NETWORK_MANAGER_REQUIRED_VERSION
+ libnm-util >= $NETWORK_MANAGER_REQUIRED_VERSION
+ accountsservice
+ gweather-3.0
+ gtk+-3.0
+ glib-2.0
+ gio-2.0
+ gio-unix-2.0)
+
# Unit testing framework
PKG_CHECK_MODULES(CHECK,
[check >= 0.9.4],
@@ -1446,6 +1459,7 @@ gui/simple-greeter/extensions/smartcard/icons/Makefile
gui/simple-greeter/extensions/smartcard/icons/16x16/Makefile
gui/simple-greeter/extensions/smartcard/icons/48x48/Makefile
gui/simple-chooser/Makefile
+gui/initial-setup/Makefile
utils/Makefile
data/gdm.conf
data/Makefile
diff --git a/gui/Makefile.am b/gui/Makefile.am
index ff8a039d..f84fc19d 100644
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@ -3,6 +3,7 @@ NULL =
SUBDIRS = \
libgdmgreeter \
simple-greeter \
+ initial-setup \
$(NULL)
if XDMCP_SUPPORT
@@ -13,4 +14,5 @@ DIST_SUBDIRS = \
libgdmgreeter \
simple-chooser \
simple-greeter \
+ initial-setup \
$(NULL)
diff --git a/gui/initial-setup/Makefile.am b/gui/initial-setup/Makefile.am
new file mode 100644
index 00000000..e6b3dcc3
--- /dev/null
+++ b/gui/initial-setup/Makefile.am
@@ -0,0 +1,34 @@
+uidir = $(datadir)/gdm/initial-setup
+
+# GNOMECC_DATA_DIR is used in tz.c
+# DATADIR is used in cc-timezone-map.c
+# these two files are copied from gnome-control-center,
+# which explains the slightly odd locations
+AM_CPPFLAGS = \
+ $(INITIAL_SETUP_CFLAGS) \
+ -DUIDIR="\"$(uidir)\"" \
+ -DGNOMECC_DATA_DIR="\"$(datadir)/gnome-control-center\"" \
+ -DDATADIR="\"$(datadir)/gnome-control-center/ui/datetime\""
+
+LIBS = $(INITIAL_SETUP_LIBS) -lm
+
+libexec_PROGRAMS = gdm-initial-setup
+
+gdm_initial_setup_SOURCES = \
+ gdm-initial-setup.c \
+ panel-cell-renderer-signal.c panel-cell-renderer-signal.h \
+ panel-cell-renderer-mode.c panel-cell-renderer-mode.h \
+ panel-cell-renderer-security.c panel-cell-renderer-security.h \
+ cc-timezone-map.c cc-timezone-map.h \
+ tz.c tz.h \
+ dtm.c dtm.h
+
+ui_DATA = \
+ setup.ui \
+ welcome-image.jpg
+
+EXTRA_DIST = \
+ $(ui_DATA) \
+ $(sys_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/gui/initial-setup/cc-timezone-map.c b/gui/initial-setup/cc-timezone-map.c
new file mode 100644
index 00000000..ba7ba40f
--- /dev/null
+++ b/gui/initial-setup/cc-timezone-map.c
@@ -0,0 +1,613 @@
+/*
+ * Copyright (C) 2010 Intel, Inc
+ *
+ * Portions from Ubiquity, Copyright (C) 2009 Canonical Ltd.
+ * Written by Evan Dandrea <evand@ubuntu.com>
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Thomas Wood <thomas.wood@intel.com>
+ *
+ */
+
+#include "cc-timezone-map.h"
+#include <math.h>
+#include <string.h>
+#include "tz.h"
+
+G_DEFINE_TYPE (CcTimezoneMap, cc_timezone_map, GTK_TYPE_WIDGET)
+
+#define TIMEZONE_MAP_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_TIMEZONE_MAP, CcTimezoneMapPrivate))
+
+
+typedef struct
+{
+ gdouble offset;
+ guchar red;
+ guchar green;
+ guchar blue;
+ guchar alpha;
+} CcTimezoneMapOffset;
+
+struct _CcTimezoneMapPrivate
+{
+ GdkPixbuf *orig_background;
+ GdkPixbuf *orig_color_map;
+
+ GdkPixbuf *background;
+ GdkPixbuf *color_map;
+
+ guchar *visible_map_pixels;
+ gint visible_map_rowstride;
+
+ gdouble selected_offset;
+
+ TzDB *tzdb;
+ TzLocation *location;
+};
+
+enum
+{
+ LOCATION_CHANGED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
+
+static CcTimezoneMapOffset color_codes[] =
+{
+ {-11.0, 43, 0, 0, 255 },
+ {-10.0, 85, 0, 0, 255 },
+ {-9.5, 102, 255, 0, 255 },
+ {-9.0, 128, 0, 0, 255 },
+ {-8.0, 170, 0, 0, 255 },
+ {-7.0, 212, 0, 0, 255 },
+ {-6.0, 255, 0, 1, 255 }, // north
+ {-6.0, 255, 0, 0, 255 }, // south
+ {-5.0, 255, 42, 42, 255 },
+ {-4.5, 192, 255, 0, 255 },
+ {-4.0, 255, 85, 85, 255 },
+ {-3.5, 0, 255, 0, 255 },
+ {-3.0, 255, 128, 128, 255 },
+ {-2.0, 255, 170, 170, 255 },
+ {-1.0, 255, 213, 213, 255 },
+ {0.0, 43, 17, 0, 255 },
+ {1.0, 85, 34, 0, 255 },
+ {2.0, 128, 51, 0, 255 },
+ {3.0, 170, 68, 0, 255 },
+ {3.5, 0, 255, 102, 255 },
+ {4.0, 212, 85, 0, 255 },
+ {4.5, 0, 204, 255, 255 },
+ {5.0, 255, 102, 0, 255 },
+ {5.5, 0, 102, 255, 255 },
+ {5.75, 0, 238, 207, 247 },
+ {6.0, 255, 127, 42, 255 },
+ {6.5, 204, 0, 254, 254 },
+ {7.0, 255, 153, 85, 255 },
+ {8.0, 255, 179, 128, 255 },
+ {9.0, 255, 204, 170, 255 },
+ {9.5, 170, 0, 68, 250 },
+ {10.0, 255, 230, 213, 255 },
+ {10.5, 212, 124, 21, 250 },
+ {11.0, 212, 170, 0, 255 },
+ {11.5, 249, 25, 87, 253 },
+ {12.0, 255, 204, 0, 255 },
+ {12.75, 254, 74, 100, 248 },
+ {13.0, 255, 85, 153, 250 },
+ {-100, 0, 0, 0, 0 }
+};
+
+
+static void
+cc_timezone_map_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_timezone_map_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+cc_timezone_map_dispose (GObject *object)
+{
+ CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (object)->priv;
+
+ if (priv->orig_background)
+ {
+ g_object_unref (priv->orig_background);
+ priv->orig_background = NULL;
+ }
+
+ if (priv->orig_color_map)
+ {
+ g_object_unref (priv->orig_color_map);
+ priv->orig_color_map = NULL;
+ }
+
+ if (priv->background)
+ {
+ g_object_unref (priv->background);
+ priv->background = NULL;
+ }
+
+ if (priv->color_map)
+ {
+ g_object_unref (priv->color_map);
+ priv->color_map = NULL;
+
+ priv->visible_map_pixels = NULL;
+ priv->visible_map_rowstride = 0;
+ }
+
+ G_OBJECT_CLASS (cc_timezone_map_parent_class)->dispose (object);
+}
+
+static void
+cc_timezone_map_finalize (GObject *object)
+{
+ CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (object)->priv;
+
+ if (priv->tzdb)
+ {
+ tz_db_free (priv->tzdb);
+ priv->tzdb = NULL;
+ }
+
+
+ G_OBJECT_CLASS (cc_timezone_map_parent_class)->finalize (object);
+}
+
+/* GtkWidget functions */
+static void
+cc_timezone_map_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ /* choose a minimum size small enough to prevent the window
+ * from growing horizontally
+ */
+ if (minimum != NULL)
+ *minimum = 300;
+ if (natural != NULL)
+ *natural = 300;
+}
+
+static void
+cc_timezone_map_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
+ gint size;
+
+ /* The + 20 here is a slight tweak to make the map fill the
+ * panel better without causing horizontal growing
+ */
+ size = 300 * gdk_pixbuf_get_height (priv->orig_background) / gdk_pixbuf_get_width (priv->orig_background) + 20;
+ if (minimum != NULL)
+ *minimum = size;
+ if (natural != NULL)
+ *natural = size;
+}
+
+static void
+cc_timezone_map_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
+
+ if (priv->background)
+ g_object_unref (priv->background);
+
+ priv->background = gdk_pixbuf_scale_simple (priv->orig_background,
+ allocation->width,
+ allocation->height,
+ GDK_INTERP_BILINEAR);
+
+ if (priv->color_map)
+ g_object_unref (priv->color_map);
+
+ priv->color_map = gdk_pixbuf_scale_simple (priv->orig_color_map,
+ allocation->width,
+ allocation->height,
+ GDK_INTERP_BILINEAR);
+
+ priv->visible_map_pixels = gdk_pixbuf_get_pixels (priv->color_map);
+ priv->visible_map_rowstride = gdk_pixbuf_get_rowstride (priv->color_map);
+
+ GTK_WIDGET_CLASS (cc_timezone_map_parent_class)->size_allocate (widget,
+ allocation);
+}
+
+static void
+cc_timezone_map_realize (GtkWidget *widget)
+{
+ GdkWindowAttr attr = { 0, };
+ GtkAllocation allocation;
+ GdkCursor *cursor;
+ GdkWindow *window;
+
+ gtk_widget_get_allocation (widget, &allocation);
+
+ gtk_widget_set_realized (widget, TRUE);
+
+ attr.window_type = GDK_WINDOW_CHILD;
+ attr.wclass = GDK_INPUT_OUTPUT;
+ attr.width = allocation.width;
+ attr.height = allocation.height;
+ attr.x = allocation.x;
+ attr.y = allocation.y;
+ attr.event_mask = gtk_widget_get_events (widget)
+ | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
+
+ window = gdk_window_new (gtk_widget_get_parent_window (widget), &attr,
+ GDK_WA_X | GDK_WA_Y);
+
+ cursor = gdk_cursor_new (GDK_HAND2);
+ gdk_window_set_cursor (window, cursor);
+
+ gdk_window_set_user_data (window, widget);
+ gtk_widget_set_window (widget, window);
+}
+
+
+static gdouble
+convert_longtitude_to_x (gdouble longitude, gint map_width)
+{
+ const gdouble xdeg_offset = -6;
+ gdouble x;
+
+ x = (map_width * (180.0 + longitude) / 360.0)
+ + (map_width * xdeg_offset / 180.0);
+
+ return x;
+}
+
+static gdouble
+radians (gdouble degrees)
+{
+ return (degrees / 360.0) * G_PI * 2;
+}
+
+static gdouble
+convert_latitude_to_y (gdouble latitude, gdouble map_height)
+{
+ gdouble bottom_lat = -59;
+ gdouble top_lat = 81;
+ gdouble top_per, y, full_range, top_offset, map_range;
+
+ top_per = top_lat / 180.0;
+ y = 1.25 * log (tan (G_PI_4 + 0.4 * radians (latitude)));
+ full_range = 4.6068250867599998;
+ top_offset = full_range * top_per;
+ map_range = fabs (1.25 * log (tan (G_PI_4 + 0.4 * radians (bottom_lat))) - top_offset);
+ y = fabs (y - top_offset);
+ y = y / map_range;
+ y = y * map_height;
+ return y;
+}
+
+
+static gboolean
+cc_timezone_map_draw (GtkWidget *widget,
+ cairo_t *cr)
+{
+ CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
+ GdkPixbuf *hilight, *orig_hilight, *pin;
+ GtkAllocation alloc;
+ gchar *file;
+ GError *err = NULL;
+ gdouble pointx, pointy;
+ char buf[16];
+
+ gtk_widget_get_allocation (widget, &alloc);
+
+ /* paint background */
+ gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0);
+ cairo_paint (cr);
+
+ /* paint hilight */
+ file = g_strdup_printf (DATADIR "/timezone_%s.png",
+ g_ascii_formatd (buf, sizeof (buf),
+ "%g", priv->selected_offset));
+ orig_hilight = gdk_pixbuf_new_from_file (file, &err);
+ g_free (file);
+ file = NULL;
+
+ if (!orig_hilight)
+ {
+ g_warning ("Could not load hilight: %s",
+ (err) ? err->message : "Unknown Error");
+ if (err)
+ g_clear_error (&err);
+ }
+ else
+ {
+
+ hilight = gdk_pixbuf_scale_simple (orig_hilight, alloc.width,
+ alloc.height, GDK_INTERP_BILINEAR);
+ gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0);
+
+ cairo_paint (cr);
+ g_object_unref (hilight);
+ g_object_unref (orig_hilight);
+ }
+
+ /* load pin icon */
+ pin = gdk_pixbuf_new_from_file (DATADIR "/pin.png", &err);
+
+ if (err)
+ {
+ g_warning ("Could not load pin icon: %s", err->message);
+ g_clear_error (&err);
+ }
+
+ if (priv->location)
+ {
+ pointx = convert_longtitude_to_x (priv->location->longitude, alloc.width);
+ pointy = convert_latitude_to_y (priv->location->latitude, alloc.height);
+
+ if (pointy > alloc.height)
+ pointy = alloc.height;
+
+ if (pin)
+ {
+ gdk_cairo_set_source_pixbuf (cr, pin, pointx - 8, pointy - 14);
+ cairo_paint (cr);
+ }
+ }
+
+ if (pin)
+ {
+ g_object_unref (pin);
+ }
+
+ return TRUE;
+}
+
+
+static void
+cc_timezone_map_class_init (CcTimezoneMapClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (CcTimezoneMapPrivate));
+
+ object_class->get_property = cc_timezone_map_get_property;
+ object_class->set_property = cc_timezone_map_set_property;
+ object_class->dispose = cc_timezone_map_dispose;
+ object_class->finalize = cc_timezone_map_finalize;
+
+ widget_class->get_preferred_width = cc_timezone_map_get_preferred_width;
+ widget_class->get_preferred_height = cc_timezone_map_get_preferred_height;
+ widget_class->size_allocate = cc_timezone_map_size_allocate;
+ widget_class->realize = cc_timezone_map_realize;
+ widget_class->draw = cc_timezone_map_draw;
+
+ signals[LOCATION_CHANGED] = g_signal_new ("location-changed",
+ CC_TYPE_TIMEZONE_MAP,
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+}
+
+
+static gint
+sort_locations (TzLocation *a,
+ TzLocation *b)
+{
+ if (a->dist > b->dist)
+ return 1;
+
+ if (a->dist < b->dist)
+ return -1;
+
+ return 0;
+}
+
+static void
+set_location (CcTimezoneMap *map,
+ TzLocation *location)
+{
+ CcTimezoneMapPrivate *priv = map->priv;
+ TzInfo *info;
+
+ priv->location = location;
+
+ info = tz_info_from_location (priv->location);
+
+ priv->selected_offset = tz_location_get_utc_offset (priv->location)
+ / (60.0*60.0) + ((info->daylight) ? -1.0 : 0.0);
+
+ g_signal_emit (map, signals[LOCATION_CHANGED], 0, priv->location);
+
+ tz_info_free (info);
+}
+
+static gboolean
+button_press_event (GtkWidget *widget,
+ GdkEventButton *event)
+{
+ CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
+ gint x, y;
+ guchar r, g, b, a;
+ guchar *pixels;
+ gint rowstride;
+ gint i;
+
+ const GPtrArray *array;
+ gint width, height;
+ GList *distances = NULL;
+ GtkAllocation alloc;
+
+ x = event->x;
+ y = event->y;
+
+
+ rowstride = priv->visible_map_rowstride;
+ pixels = priv->visible_map_pixels;
+
+ r = pixels[(rowstride * y + x * 4)];
+ g = pixels[(rowstride * y + x * 4) + 1];
+ b = pixels[(rowstride * y + x * 4) + 2];
+ a = pixels[(rowstride * y + x * 4) + 3];
+
+
+ for (i = 0; color_codes[i].offset != -100; i++)
+ {
+ if (color_codes[i].red == r && color_codes[i].green == g
+ && color_codes[i].blue == b && color_codes[i].alpha == a)
+ {
+ priv->selected_offset = color_codes[i].offset;
+ }
+ }
+
+ gtk_widget_queue_draw (widget);
+
+ /* work out the co-ordinates */
+
+ array = tz_get_locations (priv->tzdb);
+
+ gtk_widget_get_allocation (widget, &alloc);
+ width = alloc.width;
+ height = alloc.height;
+
+ for (i = 0; i < array->len; i++)
+ {
+ gdouble pointx, pointy, dx, dy;
+ TzLocation *loc = array->pdata[i];
+
+ pointx = convert_longtitude_to_x (loc->longitude, width);
+ pointy = convert_latitude_to_y (loc->latitude, height);
+
+ dx = pointx - x;
+ dy = pointy - y;
+
+ loc->dist = dx * dx + dy * dy;
+ distances = g_list_prepend (distances, loc);
+
+ }
+ distances = g_list_sort (distances, (GCompareFunc) sort_locations);
+
+
+ set_location (CC_TIMEZONE_MAP (widget), (TzLocation*) distances->data);
+
+ g_list_free (distances);
+
+ return TRUE;
+}
+
+static void
+cc_timezone_map_init (CcTimezoneMap *self)
+{
+ CcTimezoneMapPrivate *priv;
+ GError *err = NULL;
+
+ priv = self->priv = TIMEZONE_MAP_PRIVATE (self);
+
+ priv->orig_background = gdk_pixbuf_new_from_file (DATADIR "/bg.png",
+ &err);
+
+ if (!priv->orig_background)
+ {
+ g_warning ("Could not load background image: %s",
+ (err) ? err->message : "Unknown error");
+ g_clear_error (&err);
+ }
+
+ priv->orig_color_map = gdk_pixbuf_new_from_file (DATADIR "/cc.png",
+ &err);
+ if (!priv->orig_color_map)
+ {
+ g_warning ("Could not load background image: %s",
+ (err) ? err->message : "Unknown error");
+ g_clear_error (&err);
+ }
+
+ priv->tzdb = tz_load_db ();
+
+ g_signal_connect (self, "button-press-event", G_CALLBACK (button_press_event),
+ NULL);
+}
+
+CcTimezoneMap *
+cc_timezone_map_new (void)
+{
+ return g_object_new (CC_TYPE_TIMEZONE_MAP, NULL);
+}
+
+gboolean
+cc_timezone_map_set_timezone (CcTimezoneMap *map,
+ const gchar *timezone)
+{
+ GPtrArray *locations;
+ guint i;
+ char *real_tz;
+ gboolean ret;
+
+ real_tz = tz_info_get_clean_name (map->priv->tzdb, timezone);
+
+ locations = tz_get_locations (map->priv->tzdb);
+ ret = FALSE;
+
+ for (i = 0; i < locations->len; i++)
+ {
+ TzLocation *loc = locations->pdata[i];
+
+ if (!g_strcmp0 (loc->zone, real_tz ? real_tz : timezone))
+ {
+ set_location (map, loc);
+ ret = TRUE;
+ break;
+ }
+ }
+
+ if (ret)
+ gtk_widget_queue_draw (GTK_WIDGET (map));
+
+ g_free (real_tz);
+
+ return ret;
+}
+
+TzLocation *
+cc_timezone_map_get_location (CcTimezoneMap *map)
+{
+ return map->priv->location;
+}
diff --git a/gui/initial-setup/cc-timezone-map.h b/gui/initial-setup/cc-timezone-map.h
new file mode 100644
index 00000000..bb15def1
--- /dev/null
+++ b/gui/initial-setup/cc-timezone-map.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Intel, Inc
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Thomas Wood <thomas.wood@intel.com>
+ *
+ */
+
+
+#ifndef _CC_TIMEZONE_MAP_H
+#define _CC_TIMEZONE_MAP_H
+
+#include <gtk/gtk.h>
+#include "tz.h"
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_TIMEZONE_MAP cc_timezone_map_get_type()
+
+#define CC_TIMEZONE_MAP(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ CC_TYPE_TIMEZONE_MAP, CcTimezoneMap))
+
+#define CC_TIMEZONE_MAP_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ CC_TYPE_TIMEZONE_MAP, CcTimezoneMapClass))
+
+#define CC_IS_TIMEZONE_MAP(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ CC_TYPE_TIMEZONE_MAP))
+
+#define CC_IS_TIMEZONE_MAP_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ CC_TYPE_TIMEZONE_MAP))
+
+#define CC_TIMEZONE_MAP_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ CC_TYPE_TIMEZONE_MAP, CcTimezoneMapClass))
+
+typedef struct _CcTimezoneMap CcTimezoneMap;
+typedef struct _CcTimezoneMapClass CcTimezoneMapClass;
+typedef struct _CcTimezoneMapPrivate CcTimezoneMapPrivate;
+
+struct _CcTimezoneMap
+{
+ GtkWidget parent;
+
+ CcTimezoneMapPrivate *priv;
+};
+
+struct _CcTimezoneMapClass
+{
+ GtkWidgetClass parent_class;
+};
+
+GType cc_timezone_map_get_type (void) G_GNUC_CONST;
+
+CcTimezoneMap *cc_timezone_map_new (void);
+
+gboolean cc_timezone_map_set_timezone (CcTimezoneMap *map,
+ const gchar *timezone);
+TzLocation * cc_timezone_map_get_location (CcTimezoneMap *map);
+
+G_END_DECLS
+
+#endif /* _CC_TIMEZONE_MAP_H */
diff --git a/gui/initial-setup/dtm.c b/gui/initial-setup/dtm.c
new file mode 100644
index 00000000..f51b3db5
--- /dev/null
+++ b/gui/initial-setup/dtm.c
@@ -0,0 +1,3085 @@
+/*
+ * Generated by gdbus-codegen 2.29.5. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "dtm.h"
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ ret = (g_value_get_double (a) == g_value_get_double (b));
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.gnome.SettingsDaemon.DateTimeMechanism
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:DateTimeMechanism
+ * @title: DateTimeMechanism
+ * @short_description: Generated C code for the org.gnome.SettingsDaemon.DateTimeMechanism D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.gnome.SettingsDaemon.DateTimeMechanism ---- */
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_timezone_IN_ARG_tz =
+{
+ {
+ -1,
+ "tz",
+ "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_set_timezone_IN_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_set_timezone_IN_ARG_tz,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_set_timezone_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_set_timezone_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_set_timezone_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_set_timezone =
+{
+ {
+ -1,
+ "SetTimezone",
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_set_timezone_IN_ARG_pointers,
+ NULL,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_set_timezone_annotation_info_pointers
+ },
+ "handle-set-timezone"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_get_timezone_OUT_ARG_timezone =
+{
+ {
+ -1,
+ "timezone",
+ "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_get_timezone_OUT_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_get_timezone_OUT_ARG_timezone,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_get_timezone_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_get_timezone_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_get_timezone_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_get_timezone =
+{
+ {
+ -1,
+ "GetTimezone",
+ NULL,
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_get_timezone_OUT_ARG_pointers,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_get_timezone_annotation_info_pointers
+ },
+ "handle-get-timezone"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_can_set_timezone_OUT_ARG_value =
+{
+ {
+ -1,
+ "value",
+ "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_can_set_timezone_OUT_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_can_set_timezone_OUT_ARG_value,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_can_set_timezone_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_can_set_timezone_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_can_set_timezone_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_can_set_timezone =
+{
+ {
+ -1,
+ "CanSetTimezone",
+ NULL,
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_can_set_timezone_OUT_ARG_pointers,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_can_set_timezone_annotation_info_pointers
+ },
+ "handle-can-set-timezone"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_date_IN_ARG_day =
+{
+ {
+ -1,
+ "day",
+ "u",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_date_IN_ARG_month =
+{
+ {
+ -1,
+ "month",
+ "u",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_date_IN_ARG_year =
+{
+ {
+ -1,
+ "year",
+ "u",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_set_date_IN_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_set_date_IN_ARG_day,
+ &_date_time_mechanism_method_info_set_date_IN_ARG_month,
+ &_date_time_mechanism_method_info_set_date_IN_ARG_year,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_set_date_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_set_date_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_set_date_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_set_date =
+{
+ {
+ -1,
+ "SetDate",
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_set_date_IN_ARG_pointers,
+ NULL,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_set_date_annotation_info_pointers
+ },
+ "handle-set-date"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_time_IN_ARG_seconds_since_epoch =
+{
+ {
+ -1,
+ "seconds_since_epoch",
+ "x",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_set_time_IN_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_set_time_IN_ARG_seconds_since_epoch,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_set_time_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_set_time_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_set_time_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_set_time =
+{
+ {
+ -1,
+ "SetTime",
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_set_time_IN_ARG_pointers,
+ NULL,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_set_time_annotation_info_pointers
+ },
+ "handle-set-time"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_can_set_time_OUT_ARG_value =
+{
+ {
+ -1,
+ "value",
+ "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_can_set_time_OUT_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_can_set_time_OUT_ARG_value,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_can_set_time_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_can_set_time_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_can_set_time_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_can_set_time =
+{
+ {
+ -1,
+ "CanSetTime",
+ NULL,
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_can_set_time_OUT_ARG_pointers,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_can_set_time_annotation_info_pointers
+ },
+ "handle-can-set-time"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_adjust_time_IN_ARG_seconds_to_add =
+{
+ {
+ -1,
+ "seconds_to_add",
+ "x",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_adjust_time_IN_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_adjust_time_IN_ARG_seconds_to_add,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_adjust_time_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_adjust_time_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_adjust_time_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_adjust_time =
+{
+ {
+ -1,
+ "AdjustTime",
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_adjust_time_IN_ARG_pointers,
+ NULL,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_adjust_time_annotation_info_pointers
+ },
+ "handle-adjust-time"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_get_hardware_clock_using_utc_OUT_ARG_is_using_utc =
+{
+ {
+ -1,
+ "is_using_utc",
+ "b",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_get_hardware_clock_using_utc_OUT_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_get_hardware_clock_using_utc_OUT_ARG_is_using_utc,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_get_hardware_clock_using_utc_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_get_hardware_clock_using_utc_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_get_hardware_clock_using_utc_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_get_hardware_clock_using_utc =
+{
+ {
+ -1,
+ "GetHardwareClockUsingUtc",
+ NULL,
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_get_hardware_clock_using_utc_OUT_ARG_pointers,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_get_hardware_clock_using_utc_annotation_info_pointers
+ },
+ "handle-get-hardware-clock-using-utc"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_hardware_clock_using_utc_IN_ARG_is_using_utc =
+{
+ {
+ -1,
+ "is_using_utc",
+ "b",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_set_hardware_clock_using_utc_IN_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_set_hardware_clock_using_utc_IN_ARG_is_using_utc,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_set_hardware_clock_using_utc_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_set_hardware_clock_using_utc_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_set_hardware_clock_using_utc_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_set_hardware_clock_using_utc =
+{
+ {
+ -1,
+ "SetHardwareClockUsingUtc",
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_set_hardware_clock_using_utc_IN_ARG_pointers,
+ NULL,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_set_hardware_clock_using_utc_annotation_info_pointers
+ },
+ "handle-set-hardware-clock-using-utc"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_get_using_ntp_OUT_ARG_can_use_ntp =
+{
+ {
+ -1,
+ "can_use_ntp",
+ "b",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_get_using_ntp_OUT_ARG_is_using_ntp =
+{
+ {
+ -1,
+ "is_using_ntp",
+ "b",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_get_using_ntp_OUT_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_get_using_ntp_OUT_ARG_can_use_ntp,
+ &_date_time_mechanism_method_info_get_using_ntp_OUT_ARG_is_using_ntp,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_get_using_ntp_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_get_using_ntp_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_get_using_ntp_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_get_using_ntp =
+{
+ {
+ -1,
+ "GetUsingNtp",
+ NULL,
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_get_using_ntp_OUT_ARG_pointers,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_get_using_ntp_annotation_info_pointers
+ },
+ "handle-get-using-ntp"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_set_using_ntp_IN_ARG_is_using_ntp =
+{
+ {
+ -1,
+ "is_using_ntp",
+ "b",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_set_using_ntp_IN_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_set_using_ntp_IN_ARG_is_using_ntp,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_set_using_ntp_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_set_using_ntp_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_set_using_ntp_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_set_using_ntp =
+{
+ {
+ -1,
+ "SetUsingNtp",
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_set_using_ntp_IN_ARG_pointers,
+ NULL,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_set_using_ntp_annotation_info_pointers
+ },
+ "handle-set-using-ntp"
+};
+
+static const _ExtendedGDBusArgInfo _date_time_mechanism_method_info_can_set_using_ntp_OUT_ARG_value =
+{
+ {
+ -1,
+ "value",
+ "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _date_time_mechanism_method_info_can_set_using_ntp_OUT_ARG_pointers[] =
+{
+ &_date_time_mechanism_method_info_can_set_using_ntp_OUT_ARG_value,
+ NULL
+};
+
+static const GDBusAnnotationInfo _date_time_mechanism_method_can_set_using_ntp_annotation_info_0 =
+{
+ -1,
+ "org.freedesktop.DBus.GLib.Async",
+ "",
+ NULL
+};
+
+static const GDBusAnnotationInfo * const _date_time_mechanism_method_can_set_using_ntp_annotation_info_pointers[] =
+{
+ &_date_time_mechanism_method_can_set_using_ntp_annotation_info_0,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _date_time_mechanism_method_info_can_set_using_ntp =
+{
+ {
+ -1,
+ "CanSetUsingNtp",
+ NULL,
+ (GDBusArgInfo **) &_date_time_mechanism_method_info_can_set_using_ntp_OUT_ARG_pointers,
+ (GDBusAnnotationInfo **) &_date_time_mechanism_method_can_set_using_ntp_annotation_info_pointers
+ },
+ "handle-can-set-using-ntp"
+};
+
+static const _ExtendedGDBusMethodInfo * const _date_time_mechanism_method_info_pointers[] =
+{
+ &_date_time_mechanism_method_info_set_timezone,
+ &_date_time_mechanism_method_info_get_timezone,
+ &_date_time_mechanism_method_info_can_set_timezone,
+ &_date_time_mechanism_method_info_set_date,
+ &_date_time_mechanism_method_info_set_time,
+ &_date_time_mechanism_method_info_can_set_time,
+ &_date_time_mechanism_method_info_adjust_time,
+ &_date_time_mechanism_method_info_get_hardware_clock_using_utc,
+ &_date_time_mechanism_method_info_set_hardware_clock_using_utc,
+ &_date_time_mechanism_method_info_get_using_ntp,
+ &_date_time_mechanism_method_info_set_using_ntp,
+ &_date_time_mechanism_method_info_can_set_using_ntp,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _date_time_mechanism_interface_info =
+{
+ {
+ -1,
+ "org.gnome.SettingsDaemon.DateTimeMechanism",
+ (GDBusMethodInfo **) &_date_time_mechanism_method_info_pointers,
+ NULL,
+ NULL,
+ NULL
+ },
+ "date-time-mechanism",
+};
+
+
+/**
+ * date_time_mechanism_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+date_time_mechanism_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_date_time_mechanism_interface_info;
+}
+
+
+
+/**
+ * DateTimeMechanism:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link>.
+ */
+
+/**
+ * DateTimeMechanismIface:
+ * @parent_iface: The parent interface.
+ * @handle_adjust_time: Handler for the #DateTimeMechanism::handle-adjust-time signal.
+ * @handle_can_set_time: Handler for the #DateTimeMechanism::handle-can-set-time signal.
+ * @handle_can_set_timezone: Handler for the #DateTimeMechanism::handle-can-set-timezone signal.
+ * @handle_can_set_using_ntp: Handler for the #DateTimeMechanism::handle-can-set-using-ntp signal.
+ * @handle_get_hardware_clock_using_utc: Handler for the #DateTimeMechanism::handle-get-hardware-clock-using-utc signal.
+ * @handle_get_timezone: Handler for the #DateTimeMechanism::handle-get-timezone signal.
+ * @handle_get_using_ntp: Handler for the #DateTimeMechanism::handle-get-using-ntp signal.
+ * @handle_set_date: Handler for the #DateTimeMechanism::handle-set-date signal.
+ * @handle_set_hardware_clock_using_utc: Handler for the #DateTimeMechanism::handle-set-hardware-clock-using-utc signal.
+ * @handle_set_time: Handler for the #DateTimeMechanism::handle-set-time signal.
+ * @handle_set_timezone: Handler for the #DateTimeMechanism::handle-set-timezone signal.
+ * @handle_set_using_ntp: Handler for the #DateTimeMechanism::handle-set-using-ntp signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link>.
+ */
+
+static void
+date_time_mechanism_default_init (DateTimeMechanismIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * DateTimeMechanism::handle-set-timezone:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ * @tz: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTimezone">SetTimezone()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_set_timezone() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-timezone",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_set_timezone),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
+
+ /**
+ * DateTimeMechanism::handle-get-timezone:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetTimezone">GetTimezone()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_get_timezone() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-timezone",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_get_timezone),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * DateTimeMechanism::handle-can-set-timezone:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTimezone">CanSetTimezone()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_can_set_timezone() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-can-set-timezone",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_can_set_timezone),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * DateTimeMechanism::handle-set-date:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ * @day: Argument passed by remote caller.
+ * @month: Argument passed by remote caller.
+ * @year: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetDate">SetDate()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_set_date() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-date",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_set_date),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
+
+ /**
+ * DateTimeMechanism::handle-set-time:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ * @seconds_since_epoch: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTime">SetTime()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_set_time() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-time",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_set_time),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT64);
+
+ /**
+ * DateTimeMechanism::handle-can-set-time:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTime">CanSetTime()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_can_set_time() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-can-set-time",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_can_set_time),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * DateTimeMechanism::handle-adjust-time:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ * @seconds_to_add: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.AdjustTime">AdjustTime()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_adjust_time() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-adjust-time",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_adjust_time),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT64);
+
+ /**
+ * DateTimeMechanism::handle-get-hardware-clock-using-utc:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetHardwareClockUsingUtc">GetHardwareClockUsingUtc()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_get_hardware_clock_using_utc() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-hardware-clock-using-utc",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_get_hardware_clock_using_utc),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * DateTimeMechanism::handle-set-hardware-clock-using-utc:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ * @is_using_utc: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetHardwareClockUsingUtc">SetHardwareClockUsingUtc()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_set_hardware_clock_using_utc() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-hardware-clock-using-utc",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_set_hardware_clock_using_utc),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN);
+
+ /**
+ * DateTimeMechanism::handle-get-using-ntp:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetUsingNtp">GetUsingNtp()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_get_using_ntp() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-using-ntp",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_get_using_ntp),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * DateTimeMechanism::handle-set-using-ntp:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ * @is_using_ntp: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetUsingNtp">SetUsingNtp()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_set_using_ntp() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-using-ntp",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_set_using_ntp),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN);
+
+ /**
+ * DateTimeMechanism::handle-can-set-using-ntp:
+ * @object: A #DateTimeMechanism.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetUsingNtp">CanSetUsingNtp()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call date_time_mechanism_complete_can_set_using_ntp() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-can-set-using-ntp",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DateTimeMechanismIface, handle_can_set_using_ntp),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+}
+
+typedef DateTimeMechanismIface DateTimeMechanismInterface;
+G_DEFINE_INTERFACE (DateTimeMechanism, date_time_mechanism, G_TYPE_OBJECT);
+
+/**
+ * date_time_mechanism_call_set_timezone:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @tz: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTimezone">SetTimezone()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_set_timezone_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_set_timezone_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_set_timezone (
+ DateTimeMechanism *proxy,
+ const gchar *tz,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "SetTimezone",
+ g_variant_new ("(s)",
+ tz),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_set_timezone_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_set_timezone().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_set_timezone().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_timezone_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_timezone_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @tz: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTimezone">SetTimezone()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_set_timezone() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_timezone_sync (
+ DateTimeMechanism *proxy,
+ const gchar *tz,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "SetTimezone",
+ g_variant_new ("(s)",
+ tz),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_get_timezone:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetTimezone">GetTimezone()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_get_timezone_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_get_timezone_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_get_timezone (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "GetTimezone",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_get_timezone_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_timezone: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_get_timezone().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_get_timezone().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_get_timezone_finish (
+ DateTimeMechanism *proxy,
+ gchar **out_timezone,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_timezone);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_get_timezone_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_timezone: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetTimezone">GetTimezone()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_get_timezone() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_get_timezone_sync (
+ DateTimeMechanism *proxy,
+ gchar **out_timezone,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "GetTimezone",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_timezone);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_can_set_timezone:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTimezone">CanSetTimezone()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_can_set_timezone_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_can_set_timezone_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_can_set_timezone (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "CanSetTimezone",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_can_set_timezone_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_can_set_timezone().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_can_set_timezone().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_can_set_timezone_finish (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_can_set_timezone_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTimezone">CanSetTimezone()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_can_set_timezone() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_can_set_timezone_sync (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "CanSetTimezone",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_date:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @day: Argument to pass with the method invocation.
+ * @month: Argument to pass with the method invocation.
+ * @year: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetDate">SetDate()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_set_date_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_set_date_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_set_date (
+ DateTimeMechanism *proxy,
+ guint day,
+ guint month,
+ guint year,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "SetDate",
+ g_variant_new ("(uuu)",
+ day,
+ month,
+ year),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_set_date_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_set_date().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_set_date().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_date_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_date_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @day: Argument to pass with the method invocation.
+ * @month: Argument to pass with the method invocation.
+ * @year: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetDate">SetDate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_set_date() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_date_sync (
+ DateTimeMechanism *proxy,
+ guint day,
+ guint month,
+ guint year,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "SetDate",
+ g_variant_new ("(uuu)",
+ day,
+ month,
+ year),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_time:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @seconds_since_epoch: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTime">SetTime()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_set_time_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_set_time_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_set_time (
+ DateTimeMechanism *proxy,
+ gint64 seconds_since_epoch,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "SetTime",
+ g_variant_new ("(x)",
+ seconds_since_epoch),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_set_time_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_set_time().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_set_time().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_time_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_time_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @seconds_since_epoch: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTime">SetTime()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_set_time() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_time_sync (
+ DateTimeMechanism *proxy,
+ gint64 seconds_since_epoch,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "SetTime",
+ g_variant_new ("(x)",
+ seconds_since_epoch),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_can_set_time:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTime">CanSetTime()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_can_set_time_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_can_set_time_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_can_set_time (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "CanSetTime",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_can_set_time_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_can_set_time().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_can_set_time().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_can_set_time_finish (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_can_set_time_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTime">CanSetTime()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_can_set_time() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_can_set_time_sync (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "CanSetTime",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_adjust_time:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @seconds_to_add: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.AdjustTime">AdjustTime()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_adjust_time_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_adjust_time_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_adjust_time (
+ DateTimeMechanism *proxy,
+ gint64 seconds_to_add,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "AdjustTime",
+ g_variant_new ("(x)",
+ seconds_to_add),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_adjust_time_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_adjust_time().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_adjust_time().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_adjust_time_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_adjust_time_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @seconds_to_add: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.AdjustTime">AdjustTime()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_adjust_time() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_adjust_time_sync (
+ DateTimeMechanism *proxy,
+ gint64 seconds_to_add,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "AdjustTime",
+ g_variant_new ("(x)",
+ seconds_to_add),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_get_hardware_clock_using_utc:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetHardwareClockUsingUtc">GetHardwareClockUsingUtc()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_get_hardware_clock_using_utc_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_get_hardware_clock_using_utc_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_get_hardware_clock_using_utc (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "GetHardwareClockUsingUtc",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_get_hardware_clock_using_utc_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_is_using_utc: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_get_hardware_clock_using_utc().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_get_hardware_clock_using_utc().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_get_hardware_clock_using_utc_finish (
+ DateTimeMechanism *proxy,
+ gboolean *out_is_using_utc,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(b)",
+ out_is_using_utc);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_get_hardware_clock_using_utc_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_is_using_utc: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetHardwareClockUsingUtc">GetHardwareClockUsingUtc()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_get_hardware_clock_using_utc() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_get_hardware_clock_using_utc_sync (
+ DateTimeMechanism *proxy,
+ gboolean *out_is_using_utc,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "GetHardwareClockUsingUtc",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(b)",
+ out_is_using_utc);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_hardware_clock_using_utc:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @is_using_utc: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetHardwareClockUsingUtc">SetHardwareClockUsingUtc()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_set_hardware_clock_using_utc_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_set_hardware_clock_using_utc_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_set_hardware_clock_using_utc (
+ DateTimeMechanism *proxy,
+ gboolean is_using_utc,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "SetHardwareClockUsingUtc",
+ g_variant_new ("(b)",
+ is_using_utc),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_set_hardware_clock_using_utc_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_set_hardware_clock_using_utc().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_set_hardware_clock_using_utc().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_hardware_clock_using_utc_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_hardware_clock_using_utc_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @is_using_utc: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetHardwareClockUsingUtc">SetHardwareClockUsingUtc()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_set_hardware_clock_using_utc() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_hardware_clock_using_utc_sync (
+ DateTimeMechanism *proxy,
+ gboolean is_using_utc,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "SetHardwareClockUsingUtc",
+ g_variant_new ("(b)",
+ is_using_utc),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_get_using_ntp:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetUsingNtp">GetUsingNtp()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_get_using_ntp_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_get_using_ntp_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_get_using_ntp (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "GetUsingNtp",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_get_using_ntp_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_can_use_ntp: (out): Return location for return parameter or %NULL to ignore.
+ * @out_is_using_ntp: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_get_using_ntp().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_get_using_ntp().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_get_using_ntp_finish (
+ DateTimeMechanism *proxy,
+ gboolean *out_can_use_ntp,
+ gboolean *out_is_using_ntp,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(bb)",
+ out_can_use_ntp,
+ out_is_using_ntp);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_get_using_ntp_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_can_use_ntp: (out): Return location for return parameter or %NULL to ignore.
+ * @out_is_using_ntp: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetUsingNtp">GetUsingNtp()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_get_using_ntp() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_get_using_ntp_sync (
+ DateTimeMechanism *proxy,
+ gboolean *out_can_use_ntp,
+ gboolean *out_is_using_ntp,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "GetUsingNtp",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(bb)",
+ out_can_use_ntp,
+ out_is_using_ntp);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_using_ntp:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @is_using_ntp: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetUsingNtp">SetUsingNtp()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_set_using_ntp_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_set_using_ntp_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_set_using_ntp (
+ DateTimeMechanism *proxy,
+ gboolean is_using_ntp,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "SetUsingNtp",
+ g_variant_new ("(b)",
+ is_using_ntp),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_set_using_ntp_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_set_using_ntp().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_set_using_ntp().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_using_ntp_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_set_using_ntp_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @is_using_ntp: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetUsingNtp">SetUsingNtp()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_set_using_ntp() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_set_using_ntp_sync (
+ DateTimeMechanism *proxy,
+ gboolean is_using_ntp,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "SetUsingNtp",
+ g_variant_new ("(b)",
+ is_using_ntp),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_can_set_using_ntp:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetUsingNtp">CanSetUsingNtp()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_call_can_set_using_ntp_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_call_can_set_using_ntp_sync() for the synchronous, blocking version of this method.
+ */
+void
+date_time_mechanism_call_can_set_using_ntp (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "CanSetUsingNtp",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * date_time_mechanism_call_can_set_using_ntp_finish:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_call_can_set_using_ntp().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with date_time_mechanism_call_can_set_using_ntp().
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_can_set_using_ntp_finish (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_call_can_set_using_ntp_sync:
+ * @proxy: A #DateTimeMechanismProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetUsingNtp">CanSetUsingNtp()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_call_can_set_using_ntp() for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+date_time_mechanism_call_can_set_using_ntp_sync (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "CanSetUsingNtp",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * date_time_mechanism_complete_set_timezone:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTimezone">SetTimezone()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_set_timezone (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * date_time_mechanism_complete_get_timezone:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @timezone: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetTimezone">GetTimezone()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_get_timezone (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *timezone)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(s)",
+ timezone));
+}
+
+/**
+ * date_time_mechanism_complete_can_set_timezone:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @value: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTimezone">CanSetTimezone()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_can_set_timezone (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint value)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ value));
+}
+
+/**
+ * date_time_mechanism_complete_set_date:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetDate">SetDate()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_set_date (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * date_time_mechanism_complete_set_time:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetTime">SetTime()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_set_time (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * date_time_mechanism_complete_can_set_time:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @value: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetTime">CanSetTime()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_can_set_time (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint value)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ value));
+}
+
+/**
+ * date_time_mechanism_complete_adjust_time:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.AdjustTime">AdjustTime()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_adjust_time (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * date_time_mechanism_complete_get_hardware_clock_using_utc:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @is_using_utc: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetHardwareClockUsingUtc">GetHardwareClockUsingUtc()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_get_hardware_clock_using_utc (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gboolean is_using_utc)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(b)",
+ is_using_utc));
+}
+
+/**
+ * date_time_mechanism_complete_set_hardware_clock_using_utc:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetHardwareClockUsingUtc">SetHardwareClockUsingUtc()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_set_hardware_clock_using_utc (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * date_time_mechanism_complete_get_using_ntp:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @can_use_ntp: Parameter to return.
+ * @is_using_ntp: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.GetUsingNtp">GetUsingNtp()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_get_using_ntp (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gboolean can_use_ntp,
+ gboolean is_using_ntp)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(bb)",
+ can_use_ntp,
+ is_using_ntp));
+}
+
+/**
+ * date_time_mechanism_complete_set_using_ntp:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.SetUsingNtp">SetUsingNtp()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_set_using_ntp (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * date_time_mechanism_complete_can_set_using_ntp:
+ * @object: A #DateTimeMechanism.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @value: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-DateTimeMechanism.CanSetUsingNtp">CanSetUsingNtp()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+date_time_mechanism_complete_can_set_using_ntp (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint value)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ value));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * DateTimeMechanismProxy:
+ *
+ * The #DateTimeMechanismProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * DateTimeMechanismProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #DateTimeMechanismProxy.
+ */
+
+static void
+date_time_mechanism_proxy_iface_init (DateTimeMechanismIface *iface)
+{
+}
+
+#define date_time_mechanism_proxy_get_type date_time_mechanism_proxy_get_type
+G_DEFINE_TYPE_WITH_CODE (DateTimeMechanismProxy, date_time_mechanism_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_DATE_TIME_MECHANISM, date_time_mechanism_proxy_iface_init));
+#undef date_time_mechanism_proxy_get_type
+
+static void
+date_time_mechanism_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+}
+
+static void
+date_time_mechanism_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+}
+
+static void
+date_time_mechanism_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_date_time_mechanism_interface_info, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (&paramv[0], TYPE_DATE_TIME_MECHANISM);
+ g_value_set_object (&paramv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (&paramv[n], G_TYPE_VARIANT);
+ g_value_set_variant (&paramv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_DATE_TIME_MECHANISM);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (&paramv[n]);
+ g_free (paramv);
+}
+
+static void
+date_time_mechanism_proxy_g_properties_changed (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_date_time_mechanism_interface_info, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_date_time_mechanism_interface_info, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static void
+date_time_mechanism_proxy_init (DateTimeMechanismProxy *proxy)
+{
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), date_time_mechanism_interface_info ());
+}
+
+static void
+date_time_mechanism_proxy_class_init (DateTimeMechanismProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->get_property = date_time_mechanism_proxy_get_property;
+ gobject_class->set_property = date_time_mechanism_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = date_time_mechanism_proxy_g_signal;
+ proxy_class->g_properties_changed = date_time_mechanism_proxy_g_properties_changed;
+
+}
+
+/**
+ * date_time_mechanism_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_proxy_new_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+date_time_mechanism_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_DATE_TIME_MECHANISM_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.DateTimeMechanism", NULL);
+}
+
+/**
+ * date_time_mechanism_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with date_time_mechanism_proxy_new().
+ *
+ * Returns: (transfer full) (type DateTimeMechanismProxy): The constructed proxy object or %NULL if @error is set.
+ */
+DateTimeMechanism *
+date_time_mechanism_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return DATE_TIME_MECHANISM (ret);
+ else
+ return NULL;
+}
+
+/**
+ * date_time_mechanism_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type DateTimeMechanismProxy): The constructed proxy object or %NULL if @error is set.
+ */
+DateTimeMechanism *
+date_time_mechanism_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_DATE_TIME_MECHANISM_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.DateTimeMechanism", NULL);
+ if (ret != NULL)
+ return DATE_TIME_MECHANISM (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * date_time_mechanism_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like date_time_mechanism_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call date_time_mechanism_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See date_time_mechanism_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+date_time_mechanism_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_DATE_TIME_MECHANISM_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.DateTimeMechanism", NULL);
+}
+
+/**
+ * date_time_mechanism_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to date_time_mechanism_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with date_time_mechanism_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type DateTimeMechanismProxy): The constructed proxy object or %NULL if @error is set.
+ */
+DateTimeMechanism *
+date_time_mechanism_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return DATE_TIME_MECHANISM (ret);
+ else
+ return NULL;
+}
+
+/**
+ * date_time_mechanism_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like date_time_mechanism_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See date_time_mechanism_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type DateTimeMechanismProxy): The constructed proxy object or %NULL if @error is set.
+ */
+DateTimeMechanism *
+date_time_mechanism_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_DATE_TIME_MECHANISM_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.DateTimeMechanism", NULL);
+ if (ret != NULL)
+ return DATE_TIME_MECHANISM (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * DateTimeMechanismSkeleton:
+ *
+ * The #DateTimeMechanismSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * DateTimeMechanismSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #DateTimeMechanismSkeleton.
+ */
+
+struct _DateTimeMechanismSkeletonPrivate
+{
+ GValueArray *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+};
+
+static void
+_date_time_mechanism_skeleton_handle_method_call (
+ GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ DateTimeMechanismSkeleton *skeleton = DATE_TIME_MECHANISM_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ GValue return_value = {0};
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 2);
+ g_value_init (&paramv[0], TYPE_DATE_TIME_MECHANISM);
+ g_value_set_object (&paramv[0], skeleton);
+ g_value_init (&paramv[1], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (&paramv[1], invocation);
+ g_variant_iter_init (&iter, parameters);
+ n = 2;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - 2];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (&paramv[n], G_TYPE_VARIANT);
+ g_value_set_variant (&paramv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_DATE_TIME_MECHANISM);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + 2; n++)
+ g_value_unset (&paramv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_date_time_mechanism_skeleton_handle_get_property (
+ GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ DateTimeMechanismSkeleton *skeleton = DATE_TIME_MECHANISM_SKELETON (user_data);
+ GValue value = {0};
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_date_time_mechanism_interface_info, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_date_time_mechanism_skeleton_handle_set_property (
+ GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ DateTimeMechanismSkeleton *skeleton = DATE_TIME_MECHANISM_SKELETON (user_data);
+ GValue value = {0};
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_date_time_mechanism_interface_info, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _date_time_mechanism_skeleton_vtable =
+{
+ _date_time_mechanism_skeleton_handle_method_call,
+ _date_time_mechanism_skeleton_handle_get_property,
+ _date_time_mechanism_skeleton_handle_set_property
+};
+
+static GDBusInterfaceInfo *
+date_time_mechanism_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
+{
+ return date_time_mechanism_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+date_time_mechanism_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
+{
+ return (GDBusInterfaceVTable *) &_date_time_mechanism_skeleton_vtable;
+}
+
+static GVariant *
+date_time_mechanism_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ DateTimeMechanismSkeleton *skeleton = DATE_TIME_MECHANISM_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_date_time_mechanism_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _date_time_mechanism_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _date_time_mechanism_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _date_time_mechanism_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.SettingsDaemon.DateTimeMechanism", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ if (g_variant_is_floating (value))
+ g_variant_ref_sink (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static void
+date_time_mechanism_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+}
+
+static void
+date_time_mechanism_skeleton_iface_init (DateTimeMechanismIface *iface)
+{
+}
+
+#define date_time_mechanism_skeleton_get_type date_time_mechanism_skeleton_get_type
+G_DEFINE_TYPE_WITH_CODE (DateTimeMechanismSkeleton, date_time_mechanism_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_DATE_TIME_MECHANISM, date_time_mechanism_skeleton_iface_init));
+#undef date_time_mechanism_skeleton_get_type
+
+static void
+date_time_mechanism_skeleton_finalize (GObject *object)
+{
+ DateTimeMechanismSkeleton *skeleton = DATE_TIME_MECHANISM_SKELETON (object);
+ g_list_foreach (skeleton->priv->changed_properties, (GFunc) _changed_property_free, NULL);
+ g_list_free (skeleton->priv->changed_properties);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ if (skeleton->priv->context != NULL)
+ g_main_context_unref (skeleton->priv->context);
+ G_OBJECT_CLASS (date_time_mechanism_skeleton_parent_class)->finalize (object);
+}
+
+static void
+date_time_mechanism_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ DateTimeMechanismSkeleton *skeleton = DATE_TIME_MECHANISM_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 0);
+ g_value_copy (&skeleton->priv->properties->values[prop_id - 1], value);
+}
+
+static void
+date_time_mechanism_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+}
+
+static void
+date_time_mechanism_skeleton_init (DateTimeMechanismSkeleton *skeleton)
+{
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_DATE_TIME_MECHANISM_SKELETON, DateTimeMechanismSkeletonPrivate);
+ skeleton->priv->context = g_main_context_get_thread_default ();
+ if (skeleton->priv->context != NULL)
+ g_main_context_ref (skeleton->priv->context);
+}
+
+static void
+date_time_mechanism_skeleton_class_init (DateTimeMechanismSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ g_type_class_add_private (klass, sizeof (DateTimeMechanismSkeletonPrivate));
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = date_time_mechanism_skeleton_finalize;
+ gobject_class->get_property = date_time_mechanism_skeleton_get_property;
+ gobject_class->set_property = date_time_mechanism_skeleton_set_property;
+
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = date_time_mechanism_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = date_time_mechanism_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = date_time_mechanism_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = date_time_mechanism_skeleton_dbus_interface_get_vtable;
+}
+
+/**
+ * date_time_mechanism_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-DateTimeMechanism.top_of_page">org.gnome.SettingsDaemon.DateTimeMechanism</link>.
+ *
+ * Returns: (transfer full) (type DateTimeMechanismSkeleton): The skeleton object.
+ */
+DateTimeMechanism *
+date_time_mechanism_skeleton_new (void)
+{
+ return DATE_TIME_MECHANISM (g_object_new (TYPE_DATE_TIME_MECHANISM_SKELETON, NULL));
+}
+
diff --git a/gui/initial-setup/dtm.h b/gui/initial-setup/dtm.h
new file mode 100644
index 00000000..2ce03ffd
--- /dev/null
+++ b/gui/initial-setup/dtm.h
@@ -0,0 +1,473 @@
+/*
+ * Generated by gdbus-codegen 2.29.5. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __DTM_H__
+#define __DTM_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.gnome.SettingsDaemon.DateTimeMechanism */
+
+#define TYPE_DATE_TIME_MECHANISM (date_time_mechanism_get_type ())
+#define DATE_TIME_MECHANISM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_DATE_TIME_MECHANISM, DateTimeMechanism))
+#define IS_DATE_TIME_MECHANISM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_DATE_TIME_MECHANISM))
+#define DATE_TIME_MECHANISM_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_DATE_TIME_MECHANISM, DateTimeMechanism))
+
+struct _DateTimeMechanism;
+typedef struct _DateTimeMechanism DateTimeMechanism;
+typedef struct _DateTimeMechanismIface DateTimeMechanismIface;
+
+struct _DateTimeMechanismIface
+{
+ GTypeInterface parent_iface;
+
+ gboolean (*handle_adjust_time) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint64 seconds_to_add);
+
+ gboolean (*handle_can_set_time) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_can_set_timezone) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_can_set_using_ntp) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_hardware_clock_using_utc) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_timezone) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_using_ntp) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_set_date) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ guint day,
+ guint month,
+ guint year);
+
+ gboolean (*handle_set_hardware_clock_using_utc) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gboolean is_using_utc);
+
+ gboolean (*handle_set_time) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint64 seconds_since_epoch);
+
+ gboolean (*handle_set_timezone) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *tz);
+
+ gboolean (*handle_set_using_ntp) (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gboolean is_using_ntp);
+
+};
+
+GType date_time_mechanism_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *date_time_mechanism_interface_info (void);
+
+
+/* D-Bus method call completion functions: */
+void date_time_mechanism_complete_set_timezone (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+void date_time_mechanism_complete_get_timezone (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *timezone);
+
+void date_time_mechanism_complete_can_set_timezone (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint value);
+
+void date_time_mechanism_complete_set_date (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+void date_time_mechanism_complete_set_time (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+void date_time_mechanism_complete_can_set_time (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint value);
+
+void date_time_mechanism_complete_adjust_time (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+void date_time_mechanism_complete_get_hardware_clock_using_utc (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gboolean is_using_utc);
+
+void date_time_mechanism_complete_set_hardware_clock_using_utc (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+void date_time_mechanism_complete_get_using_ntp (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gboolean can_use_ntp,
+ gboolean is_using_ntp);
+
+void date_time_mechanism_complete_set_using_ntp (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation);
+
+void date_time_mechanism_complete_can_set_using_ntp (
+ DateTimeMechanism *object,
+ GDBusMethodInvocation *invocation,
+ gint value);
+
+
+
+/* D-Bus method calls: */
+void date_time_mechanism_call_set_timezone (
+ DateTimeMechanism *proxy,
+ const gchar *tz,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_set_timezone_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_set_timezone_sync (
+ DateTimeMechanism *proxy,
+ const gchar *tz,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_get_timezone (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_get_timezone_finish (
+ DateTimeMechanism *proxy,
+ gchar **out_timezone,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_get_timezone_sync (
+ DateTimeMechanism *proxy,
+ gchar **out_timezone,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_can_set_timezone (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_can_set_timezone_finish (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_can_set_timezone_sync (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_set_date (
+ DateTimeMechanism *proxy,
+ guint day,
+ guint month,
+ guint year,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_set_date_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_set_date_sync (
+ DateTimeMechanism *proxy,
+ guint day,
+ guint month,
+ guint year,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_set_time (
+ DateTimeMechanism *proxy,
+ gint64 seconds_since_epoch,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_set_time_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_set_time_sync (
+ DateTimeMechanism *proxy,
+ gint64 seconds_since_epoch,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_can_set_time (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_can_set_time_finish (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_can_set_time_sync (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_adjust_time (
+ DateTimeMechanism *proxy,
+ gint64 seconds_to_add,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_adjust_time_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_adjust_time_sync (
+ DateTimeMechanism *proxy,
+ gint64 seconds_to_add,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_get_hardware_clock_using_utc (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_get_hardware_clock_using_utc_finish (
+ DateTimeMechanism *proxy,
+ gboolean *out_is_using_utc,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_get_hardware_clock_using_utc_sync (
+ DateTimeMechanism *proxy,
+ gboolean *out_is_using_utc,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_set_hardware_clock_using_utc (
+ DateTimeMechanism *proxy,
+ gboolean is_using_utc,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_set_hardware_clock_using_utc_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_set_hardware_clock_using_utc_sync (
+ DateTimeMechanism *proxy,
+ gboolean is_using_utc,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_get_using_ntp (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_get_using_ntp_finish (
+ DateTimeMechanism *proxy,
+ gboolean *out_can_use_ntp,
+ gboolean *out_is_using_ntp,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_get_using_ntp_sync (
+ DateTimeMechanism *proxy,
+ gboolean *out_can_use_ntp,
+ gboolean *out_is_using_ntp,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_set_using_ntp (
+ DateTimeMechanism *proxy,
+ gboolean is_using_ntp,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_set_using_ntp_finish (
+ DateTimeMechanism *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_set_using_ntp_sync (
+ DateTimeMechanism *proxy,
+ gboolean is_using_ntp,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_call_can_set_using_ntp (
+ DateTimeMechanism *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean date_time_mechanism_call_can_set_using_ntp_finish (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean date_time_mechanism_call_can_set_using_ntp_sync (
+ DateTimeMechanism *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* ---- */
+
+#define TYPE_DATE_TIME_MECHANISM_PROXY (date_time_mechanism_proxy_get_type ())
+#define DATE_TIME_MECHANISM_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_DATE_TIME_MECHANISM_PROXY, DateTimeMechanismProxy))
+#define DATE_TIME_MECHANISM_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_DATE_TIME_MECHANISM_PROXY, DateTimeMechanismProxyClass))
+#define DATE_TIME_MECHANISM_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_DATE_TIME_MECHANISM_PROXY, DateTimeMechanismProxyClass))
+#define IS_DATE_TIME_MECHANISM_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_DATE_TIME_MECHANISM_PROXY))
+#define IS_DATE_TIME_MECHANISM_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_DATE_TIME_MECHANISM_PROXY))
+
+typedef struct _DateTimeMechanismProxy DateTimeMechanismProxy;
+typedef struct _DateTimeMechanismProxyClass DateTimeMechanismProxyClass;
+typedef struct _DateTimeMechanismProxyPrivate DateTimeMechanismProxyPrivate;
+
+struct _DateTimeMechanismProxy
+{
+ GDBusProxy parent_instance;
+ DateTimeMechanismProxyPrivate *priv;
+};
+
+struct _DateTimeMechanismProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType date_time_mechanism_proxy_get_type (void) G_GNUC_CONST;
+
+void date_time_mechanism_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+DateTimeMechanism *date_time_mechanism_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+DateTimeMechanism *date_time_mechanism_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void date_time_mechanism_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+DateTimeMechanism *date_time_mechanism_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+DateTimeMechanism *date_time_mechanism_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_DATE_TIME_MECHANISM_SKELETON (date_time_mechanism_skeleton_get_type ())
+#define DATE_TIME_MECHANISM_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_DATE_TIME_MECHANISM_SKELETON, DateTimeMechanismSkeleton))
+#define DATE_TIME_MECHANISM_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_DATE_TIME_MECHANISM_SKELETON, DateTimeMechanismSkeletonClass))
+#define DATE_TIME_MECHANISM_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_DATE_TIME_MECHANISM_SKELETON, DateTimeMechanismSkeletonClass))
+#define IS_DATE_TIME_MECHANISM_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_DATE_TIME_MECHANISM_SKELETON))
+#define IS_DATE_TIME_MECHANISM_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_DATE_TIME_MECHANISM_SKELETON))
+
+typedef struct _DateTimeMechanismSkeleton DateTimeMechanismSkeleton;
+typedef struct _DateTimeMechanismSkeletonClass DateTimeMechanismSkeletonClass;
+typedef struct _DateTimeMechanismSkeletonPrivate DateTimeMechanismSkeletonPrivate;
+
+struct _DateTimeMechanismSkeleton
+{
+ GDBusInterfaceSkeleton parent_instance;
+ DateTimeMechanismSkeletonPrivate *priv;
+};
+
+struct _DateTimeMechanismSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType date_time_mechanism_skeleton_get_type (void) G_GNUC_CONST;
+
+DateTimeMechanism *date_time_mechanism_skeleton_new (void);
+
+
+G_END_DECLS
+
+#endif /* __DTM_H__ */
diff --git a/gui/initial-setup/gdm-initial-setup.c b/gui/initial-setup/gdm-initial-setup.c
new file mode 100644
index 00000000..b9a09dab
--- /dev/null
+++ b/gui/initial-setup/gdm-initial-setup.c
@@ -0,0 +1,1486 @@
+#include <config.h>
+#include <glib/gi18n.h>
+
+#include <stdlib.h>
+#include <gtk/gtk.h>
+
+#include <nm-client.h>
+#include <nm-device-wifi.h>
+#include <nm-access-point.h>
+#include <nm-utils.h>
+#include <nm-remote-settings.h>
+
+#include "panel-cell-renderer-signal.h"
+#include "panel-cell-renderer-mode.h"
+#include "panel-cell-renderer-security.h"
+
+#include <act/act-user-manager.h>
+
+#include "cc-timezone-map.h"
+#include "dtm.h"
+
+#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
+#include <libgweather/location-entry.h>
+
+#define DEFAULT_TZ "Europe/London"
+
+typedef struct {
+ GtkBuilder *builder;
+ GtkAssistant *assistant;
+
+ /* network data */
+ NMClient *nm_client;
+ NMRemoteSettings *nm_settings;
+ NMDevice *nm_device;
+ GtkListStore *ap_list;
+ gboolean refreshing;
+
+ GtkTreeRowReference *row;
+ guint pulse;
+
+ /* account data */
+ ActUserManager *act_client;
+ ActUser *act_user;
+
+ gboolean valid_name;
+ gboolean valid_username;
+ gboolean valid_password;
+ ActUserPasswordMode password_mode;
+ ActUserAccountType account_type;
+
+ gboolean user_data_unsaved;
+
+ /* location data */
+ CcTimezoneMap *map;
+ TzLocation *current_location;
+ DateTimeMechanism *dtm;
+} SetupData;
+
+#define OBJ(type,name) ((type)gtk_builder_get_object(setup->builder,(name)))
+#define WID(name) OBJ(GtkWidget*,name)
+
+/* --- Welcome page --- */
+
+static void
+prepare_welcome_page (SetupData *setup)
+{
+ GtkWidget *widget;
+ const gchar *filename;
+
+ widget = WID("welcome-image");
+ filename = UIDIR "/welcome-image.jpg";
+ if (!g_file_test (filename, G_FILE_TEST_EXISTS))
+ filename = "welcome-image.jpg";
+ gtk_image_set_from_file (GTK_IMAGE (widget), filename);
+}
+
+/* --- Network page --- */
+
+enum {
+ PANEL_WIRELESS_COLUMN_ID,
+ PANEL_WIRELESS_COLUMN_TITLE,
+ PANEL_WIRELESS_COLUMN_SORT,
+ PANEL_WIRELESS_COLUMN_STRENGTH,
+ PANEL_WIRELESS_COLUMN_MODE,
+ PANEL_WIRELESS_COLUMN_SECURITY,
+ PANEL_WIRELESS_COLUMN_ACTIVATING,
+ PANEL_WIRELESS_COLUMN_ACTIVE,
+ PANEL_WIRELESS_COLUMN_PULSE
+};
+
+static gint
+wireless_sort_cb (GtkTreeModel *model,
+ GtkTreeIter *a,
+ GtkTreeIter *b,
+ gpointer user_data)
+{
+ gchar *str_a;
+ gchar *str_b;
+ gint retval;
+
+ gtk_tree_model_get (model, a, PANEL_WIRELESS_COLUMN_SORT, &str_a, -1);
+ gtk_tree_model_get (model, b, PANEL_WIRELESS_COLUMN_SORT, &str_b, -1);
+
+ /* special case blank entries to the bottom */
+ if (g_strcmp0 (str_a, "") == 0) {
+ retval = 1;
+ goto out;
+ }
+ if (g_strcmp0 (str_b, "") == 0) {
+ retval = -1;
+ goto out;
+ }
+
+ retval = g_strcmp0 (str_a, str_b);
+out:
+ g_free (str_a);
+ g_free (str_b);
+
+ return retval;
+}
+
+static GPtrArray *
+get_strongest_unique_aps (const GPtrArray *aps)
+{
+ const GByteArray *ssid;
+ const GByteArray *ssid_tmp;
+ GPtrArray *unique = NULL;
+ gboolean add_ap;
+ guint i;
+ guint j;
+ NMAccessPoint *ap;
+ NMAccessPoint *ap_tmp;
+
+ /* we will have multiple entries for typical hotspots,
+ * just keep the one with the strongest signal
+ */
+ unique = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ if (aps == NULL)
+ goto out;
+
+ for (i = 0; i < aps->len; i++) {
+ ap = NM_ACCESS_POINT (g_ptr_array_index (aps, i));
+ ssid = nm_access_point_get_ssid (ap);
+ add_ap = TRUE;
+
+ /* get already added list */
+ for (j = 0; j < unique->len; j++) {
+ ap_tmp = NM_ACCESS_POINT (g_ptr_array_index (unique, j));
+ ssid_tmp = nm_access_point_get_ssid (ap_tmp);
+
+ /* is this the same type and data? */
+ if (nm_utils_same_ssid (ssid, ssid_tmp, TRUE)) {
+ /* the new access point is stronger */
+ if (nm_access_point_get_strength (ap) >
+ nm_access_point_get_strength (ap_tmp)) {
+ g_ptr_array_remove (unique, ap_tmp);
+ add_ap = TRUE;
+ } else {
+ add_ap = FALSE;
+ }
+ break;
+ }
+ }
+ if (add_ap) {
+ g_ptr_array_add (unique, g_object_ref (ap));
+ }
+ }
+
+out:
+ return unique;
+}
+
+static guint
+get_access_point_security (NMAccessPoint *ap)
+{
+ NM80211ApFlags flags;
+ NM80211ApSecurityFlags wpa_flags;
+ NM80211ApSecurityFlags rsn_flags;
+ guint type;
+
+ flags = nm_access_point_get_flags (ap);
+ wpa_flags = nm_access_point_get_wpa_flags (ap);
+ rsn_flags = nm_access_point_get_rsn_flags (ap);
+
+ if (!(flags & NM_802_11_AP_FLAGS_PRIVACY) &&
+ wpa_flags == NM_802_11_AP_SEC_NONE &&
+ rsn_flags == NM_802_11_AP_SEC_NONE)
+ type = NM_AP_SEC_NONE;
+ else if ((flags & NM_802_11_AP_FLAGS_PRIVACY) &&
+ wpa_flags == NM_802_11_AP_SEC_NONE &&
+ rsn_flags == NM_802_11_AP_SEC_NONE)
+ type = NM_AP_SEC_WEP;
+ else if (!(flags & NM_802_11_AP_FLAGS_PRIVACY) &&
+ wpa_flags != NM_802_11_AP_SEC_NONE &&
+ rsn_flags != NM_802_11_AP_SEC_NONE)
+ type = NM_AP_SEC_WPA;
+ else
+ type = NM_AP_SEC_WPA2;
+
+ return type;
+}
+
+static void
+add_access_point (SetupData *setup, NMAccessPoint *ap, NMAccessPoint *active)
+{
+ const GByteArray *ssid;
+ const gchar *ssid_text;
+ const gchar *object_path;
+ GtkTreeIter iter;
+ gboolean activated, activating;
+
+ ssid = nm_access_point_get_ssid (ap);
+ object_path = nm_object_get_path (NM_OBJECT (ap));
+
+ if (ssid == NULL)
+ return;
+ ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
+
+ if (active &&
+ nm_utils_same_ssid (ssid, nm_access_point_get_ssid (active), TRUE)) {
+ switch (nm_device_get_state (setup->nm_device))
+ {
+ case NM_DEVICE_STATE_PREPARE:
+ case NM_DEVICE_STATE_CONFIG:
+ case NM_DEVICE_STATE_NEED_AUTH:
+ case NM_DEVICE_STATE_IP_CONFIG:
+ case NM_DEVICE_STATE_SECONDARIES:
+ activated = FALSE;
+ activating = TRUE;
+ break;
+ case NM_DEVICE_STATE_ACTIVATED:
+ activated = TRUE;
+ activating = FALSE;
+ break;
+ default:
+ activated = FALSE;
+ activating = FALSE;
+ break;
+ }
+ } else {
+ activated = FALSE;
+ activating = FALSE;
+ }
+
+ gtk_list_store_append (setup->ap_list, &iter);
+ gtk_list_store_set (setup->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_ID, object_path,
+ PANEL_WIRELESS_COLUMN_TITLE, ssid_text,
+ PANEL_WIRELESS_COLUMN_SORT, ssid_text,
+ PANEL_WIRELESS_COLUMN_STRENGTH, nm_access_point_get_strength (ap),
+ PANEL_WIRELESS_COLUMN_MODE, nm_access_point_get_mode (ap),
+ PANEL_WIRELESS_COLUMN_SECURITY, get_access_point_security (ap),
+ PANEL_WIRELESS_COLUMN_ACTIVATING, activating,
+ PANEL_WIRELESS_COLUMN_ACTIVE, activated,
+ PANEL_WIRELESS_COLUMN_PULSE, setup->pulse,
+ -1);
+ if (activating) {
+ GtkTreePath *path;
+ GtkTreeModel *model;
+
+ model = (GtkTreeModel*)setup->ap_list;
+ path = gtk_tree_model_get_path (model, &iter);
+ setup->row = gtk_tree_row_reference_new (model, path);
+ gtk_tree_path_free (path);
+ }
+
+}
+
+static void
+add_access_point_other (SetupData *setup)
+{
+ GtkTreeIter iter;
+
+ gtk_list_store_append (setup->ap_list, &iter);
+ gtk_list_store_set (setup->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_ID, "ap-other...",
+ /* TRANSLATORS: this is when the access point is not listed
+ * * in the dropdown (or hidden) and the user has to select
+ * * another entry manually */
+
+ PANEL_WIRELESS_COLUMN_TITLE, C_("Wireless access point", "Other..."),
+ /* always last */
+ PANEL_WIRELESS_COLUMN_SORT, "",
+ PANEL_WIRELESS_COLUMN_STRENGTH, 0,
+ PANEL_WIRELESS_COLUMN_MODE, NM_802_11_MODE_UNKNOWN,
+ PANEL_WIRELESS_COLUMN_SECURITY, NM_AP_SEC_UNKNOWN,
+ PANEL_WIRELESS_COLUMN_ACTIVATING, FALSE,
+ PANEL_WIRELESS_COLUMN_ACTIVE, FALSE,
+ PANEL_WIRELESS_COLUMN_PULSE, setup->pulse,
+ -1);
+}
+
+static void
+select_and_scroll_to_ap (SetupData *setup, NMAccessPoint *ap)
+{
+ GtkTreeModel *model;
+ GtkTreeView *tv;
+ GtkTreeViewColumn *col;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ gchar *ssid_target;
+ const GByteArray *ssid;
+ const gchar *ssid_text;
+
+ model = (GtkTreeModel *)setup->ap_list;
+
+ if (!gtk_tree_model_get_iter_first (model, &iter))
+ return;
+
+ tv = OBJ(GtkTreeView*, "network-list");
+ col = OBJ(GtkTreeViewColumn*, "network-list-column");
+ selection = OBJ(GtkTreeSelection*, "network-list-selection");
+
+ ssid = nm_access_point_get_ssid (ap);
+ ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
+
+ do {
+ gtk_tree_model_get (model, &iter,
+ PANEL_WIRELESS_COLUMN_TITLE, &ssid_target,
+ -1);
+ if (g_strcmp0 (ssid_target, ssid_text) == 0) {
+ g_free (ssid_target);
+ gtk_tree_selection_select_iter (selection, &iter);
+ path = gtk_tree_model_get_path (model, &iter);
+ gtk_tree_view_scroll_to_cell (tv, path, col, FALSE, 0, 0);
+ gtk_tree_path_free (path);
+ break;
+ }
+ g_free (ssid_target);
+
+ } while (gtk_tree_model_iter_next (model, &iter));
+}
+
+static void refresh_wireless_list (SetupData *setup);
+
+static gboolean
+refresh_again (gpointer data)
+{
+ SetupData *setup = data;
+
+ refresh_wireless_list (setup);
+
+ return FALSE;
+}
+
+static void
+refresh_wireless_list (SetupData *setup)
+{
+ NMDeviceState state;
+ NMAccessPoint *active_ap;
+ NMAccessPoint *ap;
+ const GPtrArray *aps;
+ GPtrArray *unique_aps;
+ gint i;
+ GtkWidget *label;
+ GtkWidget *spinner;
+ GtkWidget *swin;
+
+ setup->refreshing = TRUE;
+
+ state = nm_device_get_state (setup->nm_device);
+
+ active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (setup->nm_device));
+
+ g_object_ref (setup->ap_list);
+ gtk_tree_view_set_model (OBJ(GtkTreeView*, "network-list"), NULL);
+ gtk_list_store_clear (setup->ap_list);
+ if (setup->row) {
+ gtk_tree_row_reference_free (setup->row);
+ setup->row = NULL;
+ }
+
+ aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (setup->nm_device));
+
+ swin = WID("network-scrolledwindow");
+ label = WID("no-network-label");
+ spinner = WID("no-network-spinner");
+
+ if (state == NM_DEVICE_STATE_UNMANAGED ||
+ state == NM_DEVICE_STATE_UNAVAILABLE) {
+ if (nm_client_get_state (setup->nm_client) == NM_STATE_CONNECTED_GLOBAL)
+ gtk_label_set_text (GTK_LABEL (label), _("Wireless network is not available, but we are connected anyway."));
+ else
+ gtk_label_set_text (GTK_LABEL (label), _("Network is not available, make sure to turn airplane mode off."));
+ gtk_widget_hide (swin);
+ gtk_widget_hide (spinner);
+ gtk_widget_show (label);
+ goto out;
+ }
+ else if (aps == NULL || aps->len == 0) {
+ gtk_label_set_text (GTK_LABEL (label), _("Checking for available wireless networks"));
+ gtk_widget_hide (swin);
+ gtk_widget_show (spinner);
+ gtk_widget_show (label);
+ g_timeout_add_seconds (1, refresh_again, setup);
+
+ goto out;
+ }
+ else {
+ gtk_widget_show (swin);
+ gtk_widget_hide (spinner);
+ gtk_widget_hide (label);
+ }
+
+ unique_aps = get_strongest_unique_aps (aps);
+ for (i = 0; i < unique_aps->len; i++) {
+ ap = NM_ACCESS_POINT (g_ptr_array_index (unique_aps, i));
+ add_access_point (setup, ap, active_ap);
+ }
+ g_ptr_array_unref (unique_aps);
+ add_access_point_other (setup);
+
+out:
+ gtk_tree_view_set_model (OBJ(GtkTreeView*, "network-list"), (GtkTreeModel*)setup->ap_list);
+ g_object_unref (setup->ap_list);
+
+ if (active_ap)
+ select_and_scroll_to_ap (setup, active_ap);
+
+ setup->refreshing = FALSE;
+}
+
+static void
+device_state_changed (NMDevice *device, GParamSpec *pspec, SetupData *setup)
+{
+ refresh_wireless_list (setup);
+}
+
+static void
+connection_activate_cb (NMClient *client,
+ NMActiveConnection *connection,
+ GError *error,
+ gpointer user_data)
+{
+ SetupData *setup = user_data;
+
+ if (connection == NULL) {
+ /* failed to activate */
+ refresh_wireless_list (setup);
+ }
+}
+
+static void
+connection_add_activate_cb (NMClient *client,
+ NMActiveConnection *connection,
+ const char *path,
+ GError *error,
+ gpointer user_data)
+{
+ connection_activate_cb (client, connection, error, user_data);
+}
+
+static void
+connect_to_hidden_network_cb (GObject *source_object, GAsyncResult *res, gpointer data)
+{
+ SetupData *setup = data;
+ GError *error = NULL;
+ GVariant *result = NULL;
+
+ result = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
+ if (result == NULL) {
+ g_warning ("failed to connect to hidden network: %s",
+ error->message);
+ g_error_free (error);
+ }
+
+ refresh_wireless_list (setup);
+}
+
+static void
+connect_to_hidden_network (SetupData *setup)
+{
+ GDBusProxy *proxy;
+ GVariant *res = NULL;
+ GError *error = NULL;
+
+ /* connect to NM applet */
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
+ NULL,
+ "org.gnome.network_manager_applet",
+ "/org/gnome/network_manager_applet",
+ "org.gnome.network_manager_applet",
+ NULL,
+ &error);
+ if (proxy == NULL) {
+ g_warning ("failed to connect to NM applet: %s",
+ error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ /* try to show the hidden network UI */
+ g_dbus_proxy_call (proxy,
+ "ConnectToHiddenNetwork",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ 5000, /* don't wait forever */
+ NULL,
+ connect_to_hidden_network_cb,
+ setup);
+
+out:
+ if (proxy != NULL)
+ g_object_unref (proxy);
+ if (res != NULL)
+ g_variant_unref (res);
+}
+
+static void
+wireless_selection_changed (GtkTreeSelection *selection, SetupData *setup)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gchar *object_path;
+ gchar *ssid_target;
+ GSList *list, *filtered, *l;
+ NMConnection *connection;
+ NMConnection *connection_to_activate;
+ NMSettingWireless *setting;
+ const GByteArray *ssid;
+ const gchar *ssid_tmp;
+
+ if (setup->refreshing)
+ return;
+
+ if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter,
+ PANEL_WIRELESS_COLUMN_ID, &object_path,
+ PANEL_WIRELESS_COLUMN_TITLE, &ssid_target,
+ -1);
+
+ gtk_list_store_set (setup->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_ACTIVATING, TRUE,
+ -1);
+
+ if (g_strcmp0 (object_path, "ap-other...") == 0) {
+ connect_to_hidden_network (setup);
+ goto out;
+ }
+
+ list = nm_remote_settings_list_connections (setup->nm_settings);
+ filtered = nm_device_filter_connections (setup->nm_device, list);
+
+ connection_to_activate = NULL;
+
+ for (l = filtered; l; l = l->next) {
+ connection = NM_CONNECTION (l->data);
+ setting = nm_connection_get_setting_wireless (connection);
+ if (!NM_IS_SETTING_WIRELESS (setting))
+ continue;
+
+ ssid = nm_setting_wireless_get_ssid (setting);
+ if (ssid == NULL)
+ continue;
+ ssid_tmp = nm_utils_escape_ssid (ssid->data, ssid->len);
+ if (g_strcmp0 (ssid_target, ssid_tmp) == 0) {
+ connection_to_activate = connection;
+ break;
+ }
+ }
+ g_slist_free (list);
+ g_slist_free (filtered);
+
+ if (connection_to_activate != NULL) {
+ nm_client_activate_connection (setup->nm_client,
+ connection_to_activate,
+ setup->nm_device, NULL,
+ connection_activate_cb, setup);
+ goto out;
+ }
+
+ nm_client_add_and_activate_connection (setup->nm_client,
+ NULL,
+ setup->nm_device, object_path,
+ connection_add_activate_cb, setup);
+
+out:
+ g_free (object_path);
+ g_free (ssid_target);
+
+ refresh_wireless_list (setup);
+}
+
+static void
+connection_state_changed (NMActiveConnection *c, GParamSpec *pspec, SetupData *setup)
+{
+ refresh_wireless_list (setup);
+}
+
+static void
+active_connections_changed (NMClient *client, GParamSpec *pspec, SetupData *setup)
+{
+ const GPtrArray *connections;
+ int i;
+
+ connections = nm_client_get_active_connections (client);
+ for (i = 0; connections && (i < connections->len); i++) {
+ NMActiveConnection *connection;
+
+ connection = g_ptr_array_index (connections, i);
+ if (!g_object_get_data (G_OBJECT (connection), "has-state-changed-handler")) {
+ g_signal_connect (connection, "notify::state",
+ G_CALLBACK (connection_state_changed), setup);
+ g_object_set_data (G_OBJECT (connection), "has-state-changed-handler", GINT_TO_POINTER (1));
+ }
+ }
+
+ refresh_wireless_list (setup);
+}
+
+static gboolean
+bump_pulse (gpointer data)
+{
+ SetupData *setup = data;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ GtkTreeModel *model;
+
+ setup->pulse++;
+
+ if (!setup->refreshing &&
+ gtk_tree_row_reference_valid (setup->row)) {
+ model = (GtkTreeModel *)setup->ap_list;
+ path = gtk_tree_row_reference_get_path (setup->row);
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_path_free (path);
+ gtk_list_store_set (setup->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_PULSE, setup->pulse,
+ -1);
+ }
+
+ return TRUE;
+}
+
+static void
+prepare_network_page (SetupData *setup)
+{
+ GtkTreeViewColumn *col;
+ GtkCellRenderer *cell;
+ GtkTreeSortable *sortable;
+ GtkTreeSelection *selection;
+ const GPtrArray *devices;
+ NMDevice *device;
+ gint i;
+ DBusGConnection *bus;
+ GError *error;
+
+ col = OBJ(GtkTreeViewColumn*, "network-list-column");
+
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ /* black small diamond */
+ g_object_set (cell, "text", "\342\254\251", NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "visible", PANEL_WIRELESS_COLUMN_ACTIVE,
+ NULL);
+ cell = gtk_cell_renderer_spinner_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_area_cell_set (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)), cell, "align", FALSE, NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "active", PANEL_WIRELESS_COLUMN_ACTIVATING,
+ "visible", PANEL_WIRELESS_COLUMN_ACTIVATING,
+ "pulse", PANEL_WIRELESS_COLUMN_PULSE,
+ NULL);
+ g_timeout_add (80, bump_pulse, setup);
+
+ cell = gtk_cell_renderer_text_new ();
+ g_object_set (cell, "width-chars", 45, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, TRUE);
+ gtk_cell_area_cell_set (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)), cell, "align", TRUE, NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "text", PANEL_WIRELESS_COLUMN_TITLE,
+ NULL);
+
+ cell = panel_cell_renderer_mode_new ();
+ gtk_cell_renderer_set_padding (cell, 4, 0);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "mode", PANEL_WIRELESS_COLUMN_MODE,
+ NULL);
+
+ cell = panel_cell_renderer_security_new ();
+ gtk_cell_renderer_set_padding (cell, 4, 0);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "security", PANEL_WIRELESS_COLUMN_SECURITY,
+ NULL);
+
+ cell = panel_cell_renderer_signal_new ();
+ gtk_cell_renderer_set_padding (cell, 4, 0);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "signal", PANEL_WIRELESS_COLUMN_STRENGTH,
+ NULL);
+
+ setup->ap_list = OBJ(GtkListStore *, "liststore-wireless");
+ sortable = GTK_TREE_SORTABLE (setup->ap_list);
+ gtk_tree_sortable_set_sort_column_id (sortable,
+ PANEL_WIRELESS_COLUMN_SORT,
+ GTK_SORT_ASCENDING);
+ gtk_tree_sortable_set_sort_func (sortable,
+ PANEL_WIRELESS_COLUMN_SORT,
+ wireless_sort_cb,
+ sortable,
+ NULL);
+
+ setup->nm_client = nm_client_new ();
+
+ g_signal_connect (setup->nm_client, "notify::active-connections",
+ G_CALLBACK (active_connections_changed), setup);
+
+ devices = nm_client_get_devices (setup->nm_client);
+ if (devices) {
+ for (i = 0; i < devices->len; i++) {
+ device = g_ptr_array_index (devices, i);
+
+ if (!nm_device_get_managed (device))
+ continue;
+
+ if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_WIFI) {
+ /* FIXME deal with multiple, dynamic devices */
+ setup->nm_device = device;
+ g_signal_connect (G_OBJECT (device), "notify::state",
+ G_CALLBACK (device_state_changed), setup);
+ break;
+ }
+ }
+ }
+
+ if (setup->nm_device == NULL) {
+ GtkWidget *swin;
+ GtkWidget *label;
+ GtkWidget *spinner;
+
+ swin = WID("network-scrolledwindow");
+ label = WID("no-network-label");
+ spinner = WID("no-network-spinner");
+
+ gtk_widget_hide (swin);
+ gtk_widget_hide (spinner);
+
+ gtk_label_set_text (GTK_LABEL (label), _("No network devices found"));
+ gtk_widget_show (label);
+
+ goto out;
+ }
+
+ error = NULL;
+ bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
+ if (!bus) {
+ g_warning ("Error connecting to system D-Bus: %s",
+ error->message);
+ g_error_free (error);
+ }
+ setup->nm_settings = nm_remote_settings_new (bus);
+
+ selection = OBJ(GtkTreeSelection*, "network-list-selection");
+
+ g_signal_connect (selection, "changed",
+ G_CALLBACK (wireless_selection_changed), setup);
+
+ refresh_wireless_list (setup);
+
+out: ;
+}
+
+/* --- Account page --- */
+
+static void
+update_account_page_status (SetupData *setup)
+{
+ gtk_assistant_set_page_complete (setup->assistant, WID("account-page"),
+ setup->valid_name &&
+ setup->valid_username &&
+ (setup->valid_password ||
+ setup->password_mode == ACT_USER_PASSWORD_MODE_NONE));
+}
+
+static void
+fullname_changed (GtkWidget *w, GParamSpec *pspec, SetupData *setup)
+{
+ setup->valid_name = strlen (gtk_entry_get_text (GTK_ENTRY (w))) > 0;
+ setup->user_data_unsaved = TRUE;
+
+ update_account_page_status (setup);
+}
+
+static void
+username_changed (GtkWidget *w, GParamSpec *pspec, SetupData *setup)
+{
+ setup->valid_username = strlen (gtk_entry_get_text (GTK_ENTRY (w))) > 0;
+ setup->user_data_unsaved = TRUE;
+
+ update_account_page_status (setup);
+}
+
+static void
+password_check_changed (GtkWidget *w, GParamSpec *pspec, SetupData *setup)
+{
+ GtkWidget *password_entry;
+ GtkWidget *confirm_entry;
+ gboolean need_password;
+
+ need_password = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+
+ if (need_password) {
+ setup->password_mode = ACT_USER_PASSWORD_MODE_REGULAR;
+ setup->valid_password = FALSE;
+ }
+ else {
+ setup->password_mode = ACT_USER_PASSWORD_MODE_NONE;
+ setup->valid_password = TRUE;
+ }
+
+ password_entry = WID("account-password-entry");
+ confirm_entry = WID("account-confirm-entry");
+
+ gtk_entry_set_text (GTK_ENTRY (password_entry), "");
+ gtk_entry_set_text (GTK_ENTRY (confirm_entry), "");
+ gtk_widget_set_sensitive (password_entry, need_password);
+ gtk_widget_set_sensitive (confirm_entry, need_password);
+
+ setup->user_data_unsaved = TRUE;
+ update_account_page_status (setup);
+}
+
+static void
+admin_check_changed (GtkWidget *w, GParamSpec *pspec, SetupData *setup)
+{
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))) {
+ setup->account_type = ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR;
+ }
+ else {
+ setup->account_type = ACT_USER_ACCOUNT_TYPE_STANDARD;
+ }
+
+ setup->user_data_unsaved = TRUE;
+ update_account_page_status (setup);
+}
+
+static gboolean
+query_tooltip (GtkWidget *widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ gpointer user_data)
+{
+ gchar *tip;
+
+ if (GTK_ENTRY_ICON_SECONDARY == gtk_entry_get_icon_at_pos (GTK_ENTRY (widget), x, y)) {
+ tip = gtk_entry_get_icon_tooltip_text (GTK_ENTRY (widget),
+ GTK_ENTRY_ICON_SECONDARY);
+ gtk_tooltip_set_text (tooltip, tip);
+ g_free (tip);
+
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+static void
+icon_released (GtkEntry *entry,
+ GtkEntryIconPosition pos,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ GtkSettings *settings;
+ gint timeout;
+
+ settings = gtk_widget_get_settings (GTK_WIDGET (entry));
+
+ g_object_get (settings, "gtk-tooltip-timeout", &timeout, NULL);
+ g_object_set (settings, "gtk-tooltip-timeout", 1, NULL);
+ gtk_tooltip_trigger_tooltip_query (gtk_widget_get_display (GTK_WIDGET (entry)));
+ g_object_set (settings, "gtk-tooltip-timeout", timeout, NULL);
+}
+
+static void
+set_entry_validation_error (GtkEntry *entry,
+ const gchar *text)
+{
+ g_object_set (entry, "caps-lock-warning", FALSE, NULL);
+ gtk_entry_set_icon_from_stock (entry,
+ GTK_ENTRY_ICON_SECONDARY,
+ GTK_STOCK_DIALOG_ERROR);
+ gtk_entry_set_icon_activatable (entry,
+ GTK_ENTRY_ICON_SECONDARY,
+ TRUE);
+ g_signal_connect (entry, "icon-release",
+ G_CALLBACK (icon_released), FALSE);
+ g_signal_connect (entry, "query-tooltip",
+ G_CALLBACK (query_tooltip), NULL);
+ g_object_set (entry, "has-tooltip", TRUE, NULL);
+ gtk_entry_set_icon_tooltip_text (entry,
+ GTK_ENTRY_ICON_SECONDARY,
+ text);
+}
+
+static void
+clear_entry_validation_error (GtkEntry *entry)
+{
+ gboolean warning;
+
+ g_object_get (entry, "caps-lock-warning", &warning, NULL);
+
+ if (warning)
+ return;
+
+ g_object_set (entry, "has-tooltip", FALSE, NULL);
+ gtk_entry_set_icon_from_pixbuf (entry,
+ GTK_ENTRY_ICON_SECONDARY,
+ NULL);
+ g_object_set (entry, "caps-lock-warning", TRUE, NULL);
+}
+
+#define MIN_PASSWORD_LEN 6
+
+static void
+update_password_entries (SetupData *setup)
+{
+ const gchar *password;
+ const gchar *verify;
+ GtkWidget *password_entry;
+ GtkWidget *confirm_entry;
+
+ password_entry = WID("account-password-entry");
+ confirm_entry = WID("account-confirm-entry");
+ password = gtk_entry_get_text (GTK_ENTRY (password_entry));
+ verify = gtk_entry_get_text (GTK_ENTRY (confirm_entry));
+
+ /* TODO: configurable policies for acceptable passwords */
+ if (strlen (password) < MIN_PASSWORD_LEN) {
+ setup->valid_password = FALSE;
+ }
+ else if (strcmp (password, verify) != 0) {
+ setup->valid_password = FALSE;
+ }
+ else {
+ setup->valid_password = TRUE;
+ }
+}
+
+static void
+password_changed (GtkWidget *w, GParamSpec *pspec, SetupData *setup)
+{
+ update_password_entries (setup);
+
+ setup->user_data_unsaved = TRUE;
+ update_account_page_status (setup);
+}
+
+static void
+confirm_changed (GtkWidget *w, GParamSpec *pspec, SetupData *setup)
+{
+ clear_entry_validation_error (GTK_ENTRY (w));
+ update_password_entries (setup);
+
+ setup->user_data_unsaved = TRUE;
+ update_account_page_status (setup);
+}
+
+static gboolean
+confirm_entry_focus_out (GtkWidget *entry,
+ GdkEventFocus *event,
+ SetupData *setup)
+{
+ const gchar *password;
+ const gchar *verify;
+ GtkEntry *password_entry;
+ GtkEntry *confirm_entry;
+
+ password_entry = OBJ(GtkEntry*, "account-password-entry");
+ confirm_entry = OBJ(GtkEntry*, "account-confirm-entry");
+ password = gtk_entry_get_text (password_entry);
+ verify = gtk_entry_get_text (confirm_entry);
+
+ if (strlen (password) > 0 && strlen (verify) > 0) {
+ if (strlen (password) < MIN_PASSWORD_LEN) {
+ set_entry_validation_error (confirm_entry,
+ _("The new password is too short"));
+ }
+ else if (strcmp (password, verify) != 0) {
+ set_entry_validation_error (confirm_entry,
+ _("Passwords do not match"));
+ }
+ else {
+ clear_entry_validation_error (confirm_entry);
+ }
+ }
+
+ return FALSE;
+}
+
+/* FIXME: ActUserManager should have this */
+static void
+create_user (SetupData *setup)
+{
+ GDBusConnection *connection;
+ GVariant *result;
+ const gchar *username;
+ const gchar *fullname;
+ GError *error;
+
+ username = gtk_entry_get_text (OBJ(GtkEntry*, "account-username-entry"));
+ fullname = gtk_entry_get_text (OBJ(GtkEntry*, "account-fullname-entry"));
+ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
+
+ error = NULL;
+ result = g_dbus_connection_call_sync (connection,
+ "org.freedesktop.Accounts",
+ "/org/freedesktop/Accounts",
+ "org.freedesktop.Accounts",
+ "CreateUser",
+ g_variant_new ("(ssi)",
+ username,
+ fullname,
+ setup->account_type),
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+ if (result == NULL) {
+ g_warning ("Failed to create user: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ g_variant_unref (result);
+
+ setup->act_user = act_user_manager_get_user (setup->act_client, username);
+
+out:
+ g_object_unref (connection);
+}
+
+static void save_account_data (SetupData *setup);
+
+gulong when_loaded;
+
+static void
+save_when_loaded (ActUser *user, GParamSpec *pspec, SetupData *setup)
+{
+ g_signal_handler_disconnect (user, when_loaded);
+ when_loaded = 0;
+
+ save_account_data (setup);
+}
+
+static void
+save_account_data (SetupData *setup)
+{
+ if (!setup->user_data_unsaved) {
+ return;
+ }
+
+ /* this can happen when going back */
+ if (!setup->valid_name ||
+ !setup->valid_username ||
+ !setup->valid_password) {
+ return;
+ }
+
+ if (setup->act_user == NULL) {
+ create_user (setup);
+ }
+
+ g_assert (setup->act_user);
+
+ if (!act_user_is_loaded (setup->act_user)) {
+ if (when_loaded == 0)
+ when_loaded = g_signal_connect (setup->act_user, "notify::is-loaded",
+ G_CALLBACK (save_when_loaded), setup);
+ return;
+ }
+
+ act_user_set_real_name (setup->act_user,
+ gtk_entry_get_text (OBJ (GtkEntry*, "account-fullname-entry")));
+ act_user_set_user_name (setup->act_user,
+ gtk_entry_get_text (OBJ (GtkEntry*, "account-username-entry")));
+ act_user_set_account_type (setup->act_user, setup->account_type);
+ if (setup->password_mode == ACT_USER_PASSWORD_MODE_REGULAR) {
+ act_user_set_password (setup->act_user,
+ gtk_entry_get_text (OBJ (GtkEntry*, "account-password-entry")),
+ NULL);
+ }
+ else {
+ act_user_set_password_mode (setup->act_user, setup->password_mode);
+ }
+
+ setup->user_data_unsaved = FALSE;
+}
+
+static void
+prepare_account_page (SetupData *setup)
+{
+ GtkWidget *fullname_entry;
+ GtkWidget *username_entry;
+ GtkWidget *password_check;
+ GtkWidget *admin_check;
+ GtkWidget *password_entry;
+ GtkWidget *confirm_entry;
+ gboolean need_password;
+
+ fullname_entry = WID("account-fullname-entry");
+ username_entry = WID("account-username-entry");
+ password_check = WID("account-password-check");
+ admin_check = WID("account-admin-check");
+ password_entry = WID("account-password-entry");
+ confirm_entry = WID("account-confirm-entry");
+
+ setup->act_client = act_user_manager_get_default ();
+
+ setup->valid_name = FALSE;
+ setup->valid_username = FALSE;
+ setup->valid_password = TRUE;
+ setup->password_mode = ACT_USER_PASSWORD_MODE_NONE;
+ setup->account_type = ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR;
+ setup->user_data_unsaved = FALSE;
+
+ need_password = setup->password_mode != ACT_USER_PASSWORD_MODE_NONE;
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (password_check), need_password);
+ gtk_widget_set_sensitive (password_entry, need_password);
+ gtk_widget_set_sensitive (confirm_entry, need_password);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (admin_check), setup->account_type == ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR);
+
+ g_signal_connect (fullname_entry, "notify::text",
+ G_CALLBACK (fullname_changed), setup);
+ g_signal_connect (username_entry, "notify::text",
+ G_CALLBACK (username_changed), setup);
+ g_signal_connect (password_check, "notify::active",
+ G_CALLBACK (password_check_changed), setup);
+ g_signal_connect (admin_check, "notify::active",
+ G_CALLBACK (admin_check_changed), setup);
+ g_signal_connect (password_entry, "notify::text",
+ G_CALLBACK (password_changed), setup);
+ g_signal_connect (confirm_entry, "notify::text",
+ G_CALLBACK (confirm_changed), setup);
+ g_signal_connect_after (confirm_entry, "focus-out-event",
+ G_CALLBACK (confirm_entry_focus_out), setup);
+
+ update_account_page_status (setup);
+}
+
+/* --- Location page --- */
+
+
+static void
+set_timezone_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ SetupData *setup = user_data;
+ GError *error;
+
+ error = NULL;
+ if (!date_time_mechanism_call_set_timezone_finish (setup->dtm,
+ res,
+ &error)) {
+ /* TODO: display any error in a user friendly way */
+ g_warning ("Could not set system timezone: %s", error->message);
+ g_error_free (error);
+ }
+}
+
+static void
+queue_set_timezone (SetupData *setup)
+{
+ /* for now just do it */
+ if (setup->current_location) {
+ date_time_mechanism_call_set_timezone (setup->dtm,
+ setup->current_location->zone,
+ NULL,
+ set_timezone_cb,
+ setup);
+ }
+}
+
+static void
+update_timezone (SetupData *setup)
+{
+ GString *str;
+ gchar *location;
+ gchar *timezone;
+ gchar *c;
+
+ str = g_string_new ("");
+ for (c = setup->current_location->zone; *c; c++) {
+ switch (*c) {
+ case '_':
+ g_string_append_c (str, ' ');
+ break;
+ case '/':
+ g_string_append (str, " / ");
+ break;
+ default:
+ g_string_append_c (str, *c);
+ }
+ }
+
+ c = strstr (str->str, " / ");
+ location = g_strdup (c + 3);
+ timezone = g_strdup (str->str);
+
+ gtk_label_set_label (OBJ(GtkLabel*,"current-location-label"), location);
+ gtk_label_set_label (OBJ(GtkLabel*,"current-timezone-label"), timezone);
+
+ g_free (location);
+ g_free (timezone);
+
+ g_string_free (str, TRUE);
+}
+
+static void
+location_changed_cb (CcTimezoneMap *map,
+ TzLocation *location,
+ SetupData *setup)
+{
+ g_debug ("location changed to %s/%s", location->country, location->zone);
+
+ setup->current_location = location;
+
+ update_timezone (setup);
+
+ queue_set_timezone (setup);
+}
+
+static void
+get_timezone_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ SetupData *setup = user_data;
+ gchar *timezone;
+ GError *error;
+
+ error = NULL;
+ if (!date_time_mechanism_call_get_timezone_finish (setup->dtm, &timezone, res, &error)) {
+ g_warning ("Could not get current timezone: %s", error->message);
+ g_error_free (error);
+ }
+ else {
+ if (!cc_timezone_map_set_timezone (setup->map, timezone)) {
+ g_warning ("Timezone '%s' is unhandled, setting %s as default", timezone, DEFAULT_TZ);
+ cc_timezone_map_set_timezone (setup->map, DEFAULT_TZ);
+ }
+ else {
+ g_debug ("System timezone is '%s'", timezone);
+ }
+
+ setup->current_location = cc_timezone_map_get_location (setup->map);
+ update_timezone (setup);
+ }
+
+ g_signal_connect (setup->map, "location-changed",
+ G_CALLBACK (location_changed_cb), setup);
+}
+
+static void
+location_changed (GObject *object, GParamSpec *param, SetupData *setup)
+{
+ GWeatherLocationEntry *entry = GWEATHER_LOCATION_ENTRY (object);
+ GWeatherLocation *gloc;
+ GWeatherTimezone *zone;
+ gchar *city;
+
+ gloc = gweather_location_entry_get_location (entry);
+ if (gloc == NULL)
+ return;
+
+ zone = gweather_location_get_timezone (gloc);
+ city = gweather_location_get_city_name (gloc);
+
+ if (zone != NULL) {
+ const gchar *name;
+ const gchar *id;
+ GtkLabel *label;
+
+ label = OBJ(GtkLabel*, "current-timezone-label");
+
+ name = gweather_timezone_get_name (zone);
+ id = gweather_timezone_get_tzid (zone);
+ if (name == NULL) {
+ /* Why does this happen ? */
+ name = id;
+ }
+ gtk_label_set_label (label, name);
+ cc_timezone_map_set_timezone (setup->map, id);
+ }
+
+ if (city != NULL) {
+ GtkLabel *label;
+
+ label = OBJ(GtkLabel*, "current-location-label");
+ gtk_label_set_label (label, city);
+ }
+
+ g_free (city);
+ gweather_location_unref (gloc);
+}
+
+static void
+prepare_location_page (SetupData *setup)
+{
+ GtkWidget *frame, *map, *entry;
+ GWeatherLocation *world;
+ GError *error;
+
+ frame = WID("location-map-frame");
+
+ error = NULL;
+ setup->dtm = date_time_mechanism_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ "org.gnome.SettingsDaemon.DateTimeMechanism",
+ "/",
+ NULL,
+ &error);
+ if (setup->dtm == NULL) {
+ g_error ("Failed to create proxy for datetime mechanism: %s", error->message);
+ exit (1);
+ }
+
+ setup->map = cc_timezone_map_new ();
+ map = (GtkWidget *)setup->map;
+ gtk_widget_set_hexpand (map, TRUE);
+ gtk_widget_set_vexpand (map, TRUE);
+ gtk_widget_set_halign (map, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (map, GTK_ALIGN_FILL);
+ gtk_widget_show (map);
+
+ gtk_container_add (GTK_CONTAINER (frame), map);
+
+ date_time_mechanism_call_get_timezone (setup->dtm, NULL, get_timezone_cb, setup);
+
+ world = gweather_location_new_world (FALSE);
+ entry = gweather_location_entry_new (world);
+ gtk_entry_set_placeholder_text (GTK_ENTRY (entry), _("Search for a location"));
+ gtk_widget_set_halign (entry, GTK_ALIGN_END);
+ gtk_widget_show (entry);
+
+ frame = WID("location-page");
+ gtk_grid_attach (GTK_GRID (frame), entry, 1, 1, 1, 1);
+
+ g_signal_connect (G_OBJECT (entry), "notify::location",
+ G_CALLBACK (location_changed), setup);
+}
+
+/* --- Other setup --- */
+
+static void
+close_cb (GtkAssistant *assi, gpointer data)
+{
+ gtk_main_quit ();
+}
+
+static void
+prepare_cb (GtkAssistant *assi, GtkWidget *page, SetupData *setup)
+{
+ if (page != WID("account-page"))
+ gtk_assistant_set_page_complete (assi, page, TRUE);
+ save_account_data (setup);
+}
+
+static void
+prepare_assistant (SetupData *setup)
+{
+ setup->assistant = OBJ(GtkAssistant*, "gnome-setup-assistant");
+
+ /* small hack to get rid of cancel button */
+ gtk_assistant_commit (setup->assistant);
+
+ g_signal_connect (G_OBJECT (setup->assistant), "prepare",
+ G_CALLBACK (prepare_cb), setup);
+ g_signal_connect (G_OBJECT (setup->assistant), "close",
+ G_CALLBACK (close_cb), NULL);
+
+ prepare_welcome_page (setup);
+ prepare_network_page (setup);
+ prepare_account_page (setup);
+ prepare_location_page (setup);
+}
+
+static void
+copy_account_data (SetupData *setup)
+{
+ /* FIXME: here is where we copy all the things we just
+ * configured, from the current users home dir to the
+ * account that was created in the first step
+ */
+}
+
+static void
+begin_autologin (SetupData *setup)
+{
+ const gchar *address;
+ GDBusConnection *connection;
+ GError *error;
+ const gchar *username;
+ GVariant *ret;
+
+ address = g_getenv ("GDM_GREETER_DBUS_ADDRESS");
+ if (address == NULL) {
+ g_warning ("GDM_GREETER_DBUS_ADDRESS not set; not initiating autologin");
+ return;
+ }
+
+ error = NULL;
+ connection = g_dbus_connection_new_for_address_sync (address,
+ G_DBUS_CONNECTION_FLAGS_NONE,
+ NULL,
+ NULL,
+ &error);
+ if (connection == NULL) {
+ g_warning ("Failed to create D-Bus connection for address '%s' (%s); not initiating autologin", address, error->message);
+ g_error_free (error);
+ return;
+ }
+
+ username = act_user_get_user_name (setup->act_user);
+
+ ret = g_dbus_connection_call_sync (connection,
+ "/org/gnome/DisplayManager/GreeterServer",
+ "/",
+ "org.gnome.DisplayManager.GreeterServer",
+ "BeginAutoLogin",
+ g_variant_new ("(s)", username),
+ NULL, /* no reply checking */
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+ if (ret == NULL) {
+ g_warning ("Calling org.gnome.DisplayManager.GreeterServer.BeginAutoLogin failed: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ g_variant_unref (ret);
+}
+
+int
+main (int argc, char *argv[])
+{
+ SetupData *setup;
+ GError *error;
+ const gchar *filename;
+
+ setup = g_new0 (SetupData, 1);
+
+ gtk_init (&argc, &argv);
+
+ filename = UIDIR "/setup.ui";
+ if (!g_file_test (filename, G_FILE_TEST_EXISTS))
+ filename = "setup.ui";
+
+ setup->builder = gtk_builder_new ();
+ error = NULL;
+ if (!gtk_builder_add_from_file (setup->builder, filename, &error)) {
+ g_error ("%s", error->message);
+ g_error_free (error);
+ exit (1);
+ }
+
+ prepare_assistant (setup);
+
+ gtk_window_present (GTK_WINDOW (setup->assistant));
+
+ gtk_main ();
+
+ g_settings_sync ();
+
+ copy_account_data (setup);
+
+ begin_autologin (setup);
+
+ return 0;
+}
diff --git a/gui/initial-setup/gsd-datetime-mechanism.xml b/gui/initial-setup/gsd-datetime-mechanism.xml
new file mode 100644
index 00000000..aeed2c28
--- /dev/null
+++ b/gui/initial-setup/gsd-datetime-mechanism.xml
@@ -0,0 +1,63 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/">
+ <interface name="org.gnome.SettingsDaemon.DateTimeMechanism">
+ <method name="SetTimezone">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="tz" direction="in" type="s"/>
+ </method>
+
+ <method name="GetTimezone">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="timezone" direction="out" type="s"/>
+ </method>
+
+ <method name="CanSetTimezone">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="value" direction="out" type="i">
+ </arg>
+ </method>
+ <method name="SetDate">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="day" direction="in" type="u"/>
+ <arg name="month" direction="in" type="u"/>
+ <arg name="year" direction="in" type="u"/>
+ </method>
+ <method name="SetTime">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="seconds_since_epoch" direction="in" type="x"/>
+ </method>
+ <method name="CanSetTime">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="value" direction="out" type="i">
+ </arg>
+ </method>
+ <method name="AdjustTime">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="seconds_to_add" direction="in" type="x"/>
+ </method>
+
+ <method name="GetHardwareClockUsingUtc">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="is_using_utc" direction="out" type="b"/>
+ </method>
+ <method name="SetHardwareClockUsingUtc">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="is_using_utc" direction="in" type="b"/>
+ </method>
+
+ <method name="GetUsingNtp">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="can_use_ntp" direction="out" type="b"/>
+ <arg name="is_using_ntp" direction="out" type="b"/>
+ </method>
+ <method name="SetUsingNtp">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="is_using_ntp" direction="in" type="b"/>
+ </method>
+ <method name="CanSetUsingNtp">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="value" direction="out" type="i">
+ </arg>
+ </method>
+ </interface>
+</node>
diff --git a/gui/initial-setup/panel-cell-renderer-mode.c b/gui/initial-setup/panel-cell-renderer-mode.c
new file mode 100644
index 00000000..9707c702
--- /dev/null
+++ b/gui/initial-setup/panel-cell-renderer-mode.c
@@ -0,0 +1,145 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include "nm-device.h"
+#include "panel-cell-renderer-mode.h"
+
+enum {
+ PROP_0,
+ PROP_MODE,
+ PROP_LAST
+};
+
+G_DEFINE_TYPE (PanelCellRendererMode, panel_cell_renderer_mode, GTK_TYPE_CELL_RENDERER_PIXBUF)
+
+static gpointer parent_class = NULL;
+
+/**
+ * panel_cell_renderer_mode_get_property:
+ **/
+static void
+panel_cell_renderer_mode_get_property (GObject *object, guint param_id,
+ GValue *value, GParamSpec *pspec)
+{
+ PanelCellRendererMode *renderer = PANEL_CELL_RENDERER_MODE (object);
+
+ switch (param_id) {
+ case PROP_MODE:
+ g_value_set_uint (value, renderer->mode);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+/**
+ * panel_cell_renderer_set_name:
+ **/
+static void
+panel_cell_renderer_set_name (PanelCellRendererMode *renderer)
+{
+ const gchar *icon_name = NULL;
+
+ if (renderer->mode == NM_802_11_MODE_ADHOC)
+ icon_name = "network-workgroup-symbolic";
+
+ g_object_set (renderer, "icon-name", icon_name, NULL);
+}
+
+/**
+ * panel_cell_renderer_mode_set_property:
+ **/
+static void
+panel_cell_renderer_mode_set_property (GObject *object, guint param_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ PanelCellRendererMode *renderer = PANEL_CELL_RENDERER_MODE (object);
+
+ switch (param_id) {
+ case PROP_MODE:
+ renderer->mode = g_value_get_uint (value);
+ panel_cell_renderer_set_name (renderer);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+/**
+ * panel_cell_renderer_finalize:
+ **/
+static void
+panel_cell_renderer_finalize (GObject *object)
+{
+ PanelCellRendererMode *renderer;
+ renderer = PANEL_CELL_RENDERER_MODE (object);
+ g_free (renderer->icon_name);
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/**
+ * panel_cell_renderer_mode_class_init:
+ **/
+static void
+panel_cell_renderer_mode_class_init (PanelCellRendererModeClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = panel_cell_renderer_finalize;
+
+ parent_class = g_type_class_peek_parent (class);
+
+ object_class->get_property = panel_cell_renderer_mode_get_property;
+ object_class->set_property = panel_cell_renderer_mode_set_property;
+
+ g_object_class_install_property (object_class, PROP_MODE,
+ g_param_spec_uint ("mode", NULL,
+ NULL,
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE));
+}
+
+/**
+ * panel_cell_renderer_mode_init:
+ **/
+static void
+panel_cell_renderer_mode_init (PanelCellRendererMode *renderer)
+{
+ renderer->mode = 0;
+ renderer->icon_name = NULL;
+}
+
+/**
+ * panel_cell_renderer_mode_new:
+ **/
+GtkCellRenderer *
+panel_cell_renderer_mode_new (void)
+{
+ return g_object_new (PANEL_TYPE_CELL_RENDERER_MODE, NULL);
+}
+
diff --git a/gui/initial-setup/panel-cell-renderer-mode.h b/gui/initial-setup/panel-cell-renderer-mode.h
new file mode 100644
index 00000000..3dedea5a
--- /dev/null
+++ b/gui/initial-setup/panel-cell-renderer-mode.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PANEL_CELL_RENDERER_MODE_H
+#define PANEL_CELL_RENDERER_MODE_H
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+#define PANEL_TYPE_CELL_RENDERER_MODE (panel_cell_renderer_mode_get_type())
+#define PANEL_CELL_RENDERER_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PANEL_TYPE_CELL_RENDERER_MODE, PanelCellRendererMode))
+#define PANEL_CELL_RENDERER_MODE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST((cls), PANEL_TYPE_CELL_RENDERER_MODE, PanelCellRendererModeClass))
+#define PANEL_IS_CELL_RENDERER_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PANEL_TYPE_CELL_RENDERER_MODE))
+#define PANEL_IS_CELL_RENDERER_MODE_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), PANEL_TYPE_CELL_RENDERER_MODE))
+#define PANEL_CELL_RENDERER_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PANEL_TYPE_CELL_RENDERER_MODE, PanelCellRendererModeClass))
+
+G_BEGIN_DECLS
+
+typedef struct _PanelCellRendererMode PanelCellRendererMode;
+typedef struct _PanelCellRendererModeClass PanelCellRendererModeClass;
+
+struct _PanelCellRendererMode
+{
+ GtkCellRendererPixbuf parent;
+ guint mode;
+ gchar *icon_name;
+};
+
+struct _PanelCellRendererModeClass
+{
+ GtkCellRendererPixbufClass parent_class;
+};
+
+GType panel_cell_renderer_mode_get_type (void);
+GtkCellRenderer *panel_cell_renderer_mode_new (void);
+
+G_END_DECLS
+
+#endif /* PANEL_CELL_RENDERER_MODE_H */
+
diff --git a/gui/initial-setup/panel-cell-renderer-security.c b/gui/initial-setup/panel-cell-renderer-security.c
new file mode 100644
index 00000000..debce367
--- /dev/null
+++ b/gui/initial-setup/panel-cell-renderer-security.c
@@ -0,0 +1,155 @@
+/* -*- Security: C; tab-width: 8; indent-tabs-security: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Red Hat, Inc
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include "panel-cell-renderer-security.h"
+
+enum {
+ PROP_0,
+ PROP_SECURITY,
+ PROP_LAST
+};
+
+G_DEFINE_TYPE (PanelCellRendererSecurity, panel_cell_renderer_security, GTK_TYPE_CELL_RENDERER_PIXBUF)
+
+static gpointer parent_class = NULL;
+
+/**
+ * panel_cell_renderer_security_get_property:
+ **/
+static void
+panel_cell_renderer_security_get_property (GObject *object, guint param_id,
+ GValue *value, GParamSpec *pspec)
+{
+ PanelCellRendererSecurity *renderer = PANEL_CELL_RENDERER_SECURITY (object);
+
+ switch (param_id) {
+ case PROP_SECURITY:
+ g_value_set_uint (value, renderer->security);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+/**
+ * panel_cell_renderer_set_name:
+ **/
+static void
+panel_cell_renderer_set_name (PanelCellRendererSecurity *renderer)
+{
+ const gchar *icon_name = NULL;
+
+ if (renderer->security != NM_AP_SEC_UNKNOWN &&
+ renderer->security != NM_AP_SEC_NONE)
+ icon_name = "network-wireless-encrypted-symbolic";
+
+ if (icon_name != NULL) {
+ g_object_set (renderer,
+ "icon-name", icon_name,
+ "visible", TRUE,
+ NULL);
+ } else {
+ g_object_set (renderer,
+ "icon-name", NULL,
+ "visible", FALSE,
+ NULL);
+ }
+}
+
+/**
+ * panel_cell_renderer_security_set_property:
+ **/
+static void
+panel_cell_renderer_security_set_property (GObject *object, guint param_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ PanelCellRendererSecurity *renderer = PANEL_CELL_RENDERER_SECURITY (object);
+
+ switch (param_id) {
+ case PROP_SECURITY:
+ renderer->security = g_value_get_uint (value);
+ panel_cell_renderer_set_name (renderer);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+/**
+ * panel_cell_renderer_finalize:
+ **/
+static void
+panel_cell_renderer_finalize (GObject *object)
+{
+ PanelCellRendererSecurity *renderer;
+ renderer = PANEL_CELL_RENDERER_SECURITY (object);
+ g_free (renderer->icon_name);
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/**
+ * panel_cell_renderer_security_class_init:
+ **/
+static void
+panel_cell_renderer_security_class_init (PanelCellRendererSecurityClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = panel_cell_renderer_finalize;
+
+ parent_class = g_type_class_peek_parent (class);
+
+ object_class->get_property = panel_cell_renderer_security_get_property;
+ object_class->set_property = panel_cell_renderer_security_set_property;
+
+ g_object_class_install_property (object_class, PROP_SECURITY,
+ g_param_spec_uint ("security", NULL,
+ NULL,
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE));
+}
+
+/**
+ * panel_cell_renderer_security_init:
+ **/
+static void
+panel_cell_renderer_security_init (PanelCellRendererSecurity *renderer)
+{
+ renderer->security = 0;
+ renderer->icon_name = NULL;
+}
+
+/**
+ * panel_cell_renderer_security_new:
+ **/
+GtkCellRenderer *
+panel_cell_renderer_security_new (void)
+{
+ return g_object_new (PANEL_TYPE_CELL_RENDERER_SECURITY, NULL);
+}
+
diff --git a/gui/initial-setup/panel-cell-renderer-security.h b/gui/initial-setup/panel-cell-renderer-security.h
new file mode 100644
index 00000000..3630a021
--- /dev/null
+++ b/gui/initial-setup/panel-cell-renderer-security.h
@@ -0,0 +1,66 @@
+/* -*- Security: C; tab-width: 8; indent-tabs-security: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Red Hat, Inc
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PANEL_CELL_RENDERER_SECURITY_H
+#define PANEL_CELL_RENDERER_SECURITY_H
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+#define PANEL_TYPE_CELL_RENDERER_SECURITY (panel_cell_renderer_security_get_type())
+#define PANEL_CELL_RENDERER_SECURITY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PANEL_TYPE_CELL_RENDERER_SECURITY, PanelCellRendererSecurity))
+#define PANEL_CELL_RENDERER_SECURITY_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST((cls), PANEL_TYPE_CELL_RENDERER_SECURITY, PanelCellRendererSecurityClass))
+#define PANEL_IS_CELL_RENDERER_SECURITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PANEL_TYPE_CELL_RENDERER_SECURITY))
+#define PANEL_IS_CELL_RENDERER_SECURITY_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), PANEL_TYPE_CELL_RENDERER_SECURITY))
+#define PANEL_CELL_RENDERER_SECURITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PANEL_TYPE_CELL_RENDERER_SECURITY, PanelCellRendererSecurityClass))
+
+G_BEGIN_DECLS
+
+typedef struct _PanelCellRendererSecurity PanelCellRendererSecurity;
+typedef struct _PanelCellRendererSecurityClass PanelCellRendererSecurityClass;
+
+typedef enum {
+ NM_AP_SEC_UNKNOWN,
+ NM_AP_SEC_NONE,
+ NM_AP_SEC_WEP,
+ NM_AP_SEC_WPA,
+ NM_AP_SEC_WPA2
+} NMAccessPointSecurity;
+
+struct _PanelCellRendererSecurity
+{
+ GtkCellRendererPixbuf parent;
+ guint security;
+ gchar *icon_name;
+};
+
+struct _PanelCellRendererSecurityClass
+{
+ GtkCellRendererPixbufClass parent_class;
+};
+
+GType panel_cell_renderer_security_get_type (void);
+GtkCellRenderer *panel_cell_renderer_security_new (void);
+
+G_END_DECLS
+
+#endif /* PANEL_CELL_RENDERER_SECURITY_H */
+
diff --git a/gui/initial-setup/panel-cell-renderer-signal.c b/gui/initial-setup/panel-cell-renderer-signal.c
new file mode 100644
index 00000000..782526eb
--- /dev/null
+++ b/gui/initial-setup/panel-cell-renderer-signal.c
@@ -0,0 +1,161 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-signal: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include "panel-cell-renderer-signal.h"
+
+enum {
+ PROP_0,
+ PROP_SIGNAL,
+ PROP_LAST
+};
+
+G_DEFINE_TYPE (PanelCellRendererSignal, panel_cell_renderer_signal, GTK_TYPE_CELL_RENDERER_PIXBUF)
+
+static gpointer parent_class = NULL;
+
+/**
+ * panel_cell_renderer_signal_get_property:
+ **/
+static void
+panel_cell_renderer_signal_get_property (GObject *object, guint param_id,
+ GValue *value, GParamSpec *pspec)
+{
+ PanelCellRendererSignal *renderer = PANEL_CELL_RENDERER_SIGNAL (object);
+
+ switch (param_id) {
+ case PROP_SIGNAL:
+ g_value_set_uint (value, renderer->signal);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+/**
+ * panel_cell_renderer_set_name:
+ **/
+static void
+panel_cell_renderer_set_name (PanelCellRendererSignal *renderer)
+{
+ const gchar *icon_name = NULL;
+ GIcon *icon;
+
+ /* the 'Other...' entry */
+ if (renderer->signal == 0) {
+ g_object_set (renderer, "gicon", NULL, NULL);
+ return;
+ }
+
+ if (renderer->signal < 20)
+ icon_name = "network-wireless-signal-none-symbolic";
+ else if (renderer->signal < 40)
+ icon_name = "network-wireless-signal-weak-symbolic";
+ else if (renderer->signal < 50)
+ icon_name = "network-wireless-signal-ok-symbolic";
+ else if (renderer->signal < 80)
+ icon_name = "network-wireless-signal-good-symbolic";
+ else
+ icon_name = "network-wireless-signal-excellent-symbolic";
+
+ icon = g_themed_icon_new_with_default_fallbacks (icon_name);
+ g_object_set (renderer, "gicon", icon, NULL);
+ g_object_unref (icon);
+}
+
+/**
+ * panel_cell_renderer_signal_set_property:
+ **/
+static void
+panel_cell_renderer_signal_set_property (GObject *object, guint param_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ PanelCellRendererSignal *renderer = PANEL_CELL_RENDERER_SIGNAL (object);
+
+ switch (param_id) {
+ case PROP_SIGNAL:
+ renderer->signal = g_value_get_uint (value);
+ panel_cell_renderer_set_name (renderer);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+/**
+ * panel_cell_renderer_finalize:
+ **/
+static void
+panel_cell_renderer_finalize (GObject *object)
+{
+ PanelCellRendererSignal *renderer;
+ renderer = PANEL_CELL_RENDERER_SIGNAL (object);
+ g_free (renderer->icon_name);
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/**
+ * panel_cell_renderer_signal_class_init:
+ **/
+static void
+panel_cell_renderer_signal_class_init (PanelCellRendererSignalClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = panel_cell_renderer_finalize;
+
+ parent_class = g_type_class_peek_parent (class);
+
+ object_class->get_property = panel_cell_renderer_signal_get_property;
+ object_class->set_property = panel_cell_renderer_signal_set_property;
+
+ g_object_class_install_property (object_class, PROP_SIGNAL,
+ g_param_spec_uint ("signal", NULL,
+ NULL,
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE));
+}
+
+/**
+ * panel_cell_renderer_signal_init:
+ **/
+static void
+panel_cell_renderer_signal_init (PanelCellRendererSignal *renderer)
+{
+ renderer->signal = 0;
+ renderer->icon_name = NULL;
+}
+
+/**
+ * panel_cell_renderer_signal_new:
+ **/
+GtkCellRenderer *
+panel_cell_renderer_signal_new (void)
+{
+ return g_object_new (PANEL_TYPE_CELL_RENDERER_SIGNAL, NULL);
+}
+
diff --git a/gui/initial-setup/panel-cell-renderer-signal.h b/gui/initial-setup/panel-cell-renderer-signal.h
new file mode 100644
index 00000000..b2d54dbc
--- /dev/null
+++ b/gui/initial-setup/panel-cell-renderer-signal.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-signal: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PANEL_CELL_RENDERER_SIGNAL_H
+#define PANEL_CELL_RENDERER_SIGNAL_H
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+#define PANEL_TYPE_CELL_RENDERER_SIGNAL (panel_cell_renderer_signal_get_type())
+#define PANEL_CELL_RENDERER_SIGNAL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PANEL_TYPE_CELL_RENDERER_SIGNAL, PanelCellRendererSignal))
+#define PANEL_CELL_RENDERER_SIGNAL_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST((cls), PANEL_TYPE_CELL_RENDERER_SIGNAL, PanelCellRendererSignalClass))
+#define PANEL_IS_CELL_RENDERER_SIGNAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PANEL_TYPE_CELL_RENDERER_SIGNAL))
+#define PANEL_IS_CELL_RENDERER_SIGNAL_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), PANEL_TYPE_CELL_RENDERER_SIGNAL))
+#define PANEL_CELL_RENDERER_SIGNAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PANEL_TYPE_CELL_RENDERER_SIGNAL, PanelCellRendererSignalClass))
+
+G_BEGIN_DECLS
+
+typedef struct _PanelCellRendererSignal PanelCellRendererSignal;
+typedef struct _PanelCellRendererSignalClass PanelCellRendererSignalClass;
+
+struct _PanelCellRendererSignal
+{
+ GtkCellRendererPixbuf parent;
+ guint signal;
+ gchar *icon_name;
+};
+
+struct _PanelCellRendererSignalClass
+{
+ GtkCellRendererPixbufClass parent_class;
+};
+
+GType panel_cell_renderer_signal_get_type (void);
+GtkCellRenderer *panel_cell_renderer_signal_new (void);
+
+G_END_DECLS
+
+#endif /* PANEL_CELL_RENDERER_SIGNAL_H */
+
diff --git a/gui/initial-setup/setup.ui b/gui/initial-setup/setup.ui
new file mode 100644
index 00000000..3611230b
--- /dev/null
+++ b/gui/initial-setup/setup.ui
@@ -0,0 +1,636 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkListStore" id="liststore-wireless">
+ <columns>
+ <column type="gchararray"/> <!-- column-name id -->
+ <column type="gchararray"/> <!-- column-name title -->
+ <column type="gchararray"/> <!-- column-name sortable -->
+ <column type="guint"/> <!-- column-name strength -->
+ <column type="guint"/> <!-- column-name mode -->
+ <column type="guint"/> <!-- column-name security -->
+ <column type="gboolean"/> <!-- column-name activating -->
+ <column type="gboolean"/> <!-- column-name active -->
+ <column type="guint"/> <!-- column-name pulse -->
+ </columns>
+ </object>
+ <object class="GtkAssistant" id="gnome-setup-assistant">
+ <!-- interface-naming-policy toplevel-contextual -->
+ <property name="border-width">12</property>
+ <property name="title"></property>
+ <property name="icon_name">preferences-system</property>
+ <property name="visible">False</property>
+ <property name="deletable">False</property>
+ <property name="resizable">False</property>
+ <property name="window-position">center</property>
+ <child>
+ <object class="GtkGrid" id="welcome-page">
+ <property name="name">welcome-page</property>
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="welcome-title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Welcome to GNOME</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">18</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="welcome-image">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="file">welcome-image.jpg</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="welcome-subtitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Now let's set up some essentials for your account.</property>
+ <property name="halign">start</property>
+ <property name="xalign">0.0</property>
+ <property name="margin-top">18</property>
+ <property name="margin-bottom">18</property>
+ <property name="wrap">True</property>
+ <property name="width-chars">50</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="title" translatable="yes">Introduction</property>
+ <property name="page-type">intro</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="account-page">
+ <property name="name">account-page</property>
+ <property name="visible">True</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="account-title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Create an Account</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">12</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="account-fullname-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Fullname</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">account-fullname-entry</property>
+ <property name="halign">end</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="account-fullname-entry">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkLabel" id="account-username-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Username</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">account-username-entry</property>
+ <property name="halign">end</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="account-username-entry">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkCheckButton" id="account-password-check">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Require a password to use this account</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkLabel" id="account-password-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Password</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">account-password-entry</property>
+ <property name="halign">end</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="account-password-entry">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="visibility">False</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkLabel" id="account-confirm-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Confirm Password</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">account-confirm-entry</property>
+ <property name="halign">end</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="account-confirm-entry">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="visibility">False</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkCheckButton" id="account-admin-check">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Act as administrator of this computer</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">6</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="title" translatable="yes">Account</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="network-page">
+ <property name="name">network-page</property>
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="network-title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Connect to the Network</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">18</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="network-subtitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Select a wireless network</property>
+ <property name="margin-bottom">12</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="network-scrolledwindow">
+ <property name="visible">True</property>
+ <property name="halign">fill</property>
+ <property name="valign">fill</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="margin-top">0</property>
+ <property name="margin-bottom">32</property>
+ <property name="margin-right">64</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkTreeView" id="network-list">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="halign">fill</property>
+ <property name="valign">fill</property>
+ <property name="model">liststore-wireless</property>
+ <property name="headers-visible">False</property>
+ <property name="search-column">2</property>
+ <property name="show-expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="network-list-selection">
+ <property name="mode">single</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="network-list-column"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="no-network-grid">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <child>
+ <object class="GtkSpinner" id="no-network-spinner">
+ <property name="visible">True</property>
+ <property name="active">True</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ <property name="margin-left">6</property>
+ <property name="margin-right">6</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="no-network-label">
+ <property name="visible">True</property>
+ <property name="label">No text</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="title" translatable="yes">Network</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="location-page">
+ <property name="name">location-page</property>
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="location-title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Select your Location</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">18</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="location-auto-check">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Determine your location automatically</property>
+ <property name="use_underline">True</property>
+ <property name="halign">start</property>
+ <property name="margin-right">24</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAspectFrame" id="location-map-frame">
+ <property name="visible">True</property>
+ <property name="halign">fill</property>
+ <property name="valign">fill</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="location-info-grid">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="row-spacing">12</property>
+ <property name="column-spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="location-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Location</property>
+ <property name="halign">end</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="current-location-label">
+ <property name="visible">True</property>
+ <property name="label">Boston, MA</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="timezone-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Timezone</property>
+ <property name="halign">end</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="current-timezone-label">
+ <property name="visible">True</property>
+ <property name="label">America / New York</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="title" translatable="yes">Location</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="online-page">
+ <property name="name">online-page</property>
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="online-title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Web Accounts</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">18</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="online-subtitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Associate your new account with your existing online accounts</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">18</property>
+ <property name="xalign">0.0</property>
+ <property name="wrap">True</property>
+ <property name="width-chars">50</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="online-add-button">
+ <property name="visible">True</property>
+ <property name="label">_Add Account</property>
+ <property name="use_underline">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-top">24</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="title" translatable="yes">Web Accounts</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="summary-page">
+ <property name="name">summary-page</property>
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="summary-title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Enjoy GNOME !</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="margin-bottom">18</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="summary-details">
+ <property name="visible">True</property>
+ <property name="xalign">0.0</property>
+ <property name="label" translatable="yes">Your new account is ready to use. You may change any of these options at any time in the System Settings.</property>
+ <property name="wrap">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="title" translatable="yes">Summary</property>
+ <property name="page-type">summary</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/gui/initial-setup/tz.c b/gui/initial-setup/tz.c
new file mode 100644
index 00000000..776418bc
--- /dev/null
+++ b/gui/initial-setup/tz.c
@@ -0,0 +1,475 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* Generic timezone utilities.
+ *
+ * Copyright (C) 2000-2001 Ximian, Inc.
+ *
+ * Authors: Hans Petter Jansson <hpj@ximian.com>
+ *
+ * Largely based on Michael Fulbright's work on Anaconda.
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <math.h>
+#include <string.h>
+#include "tz.h"
+
+
+/* Forward declarations for private functions */
+
+static float convert_pos (gchar *pos, int digits);
+static int compare_country_names (const void *a, const void *b);
+static void sort_locations_by_country (GPtrArray *locations);
+static gchar * tz_data_file_get (void);
+static void load_backward_tz (TzDB *tz_db);
+
+/* ---------------- *
+ * Public interface *
+ * ---------------- */
+TzDB *
+tz_load_db (void)
+{
+ gchar *tz_data_file;
+ TzDB *tz_db;
+ FILE *tzfile;
+ char buf[4096];
+
+ tz_data_file = tz_data_file_get ();
+ if (!tz_data_file) {
+ g_warning ("Could not get the TimeZone data file name");
+ return NULL;
+ }
+ tzfile = fopen (tz_data_file, "r");
+ if (!tzfile) {
+ g_warning ("Could not open *%s*\n", tz_data_file);
+ g_free (tz_data_file);
+ return NULL;
+ }
+
+ tz_db = g_new0 (TzDB, 1);
+ tz_db->locations = g_ptr_array_new ();
+
+ while (fgets (buf, sizeof(buf), tzfile))
+ {
+ gchar **tmpstrarr;
+ gchar *latstr, *lngstr, *p;
+ TzLocation *loc;
+
+ if (*buf == '#') continue;
+
+ g_strchomp(buf);
+ tmpstrarr = g_strsplit(buf,"\t", 6);
+
+ latstr = g_strdup (tmpstrarr[1]);
+ p = latstr + 1;
+ while (*p != '-' && *p != '+') p++;
+ lngstr = g_strdup (p);
+ *p = '\0';
+
+ loc = g_new0 (TzLocation, 1);
+ loc->country = g_strdup (tmpstrarr[0]);
+ loc->zone = g_strdup (tmpstrarr[2]);
+ loc->latitude = convert_pos (latstr, 2);
+ loc->longitude = convert_pos (lngstr, 3);
+
+#ifdef __sun
+ if (tmpstrarr[3] && *tmpstrarr[3] == '-' && tmpstrarr[4])
+ loc->comment = g_strdup (tmpstrarr[4]);
+
+ if (tmpstrarr[3] && *tmpstrarr[3] != '-' && !islower(loc->zone)) {
+ TzLocation *locgrp;
+
+ /* duplicate entry */
+ locgrp = g_new0 (TzLocation, 1);
+ locgrp->country = g_strdup (tmpstrarr[0]);
+ locgrp->zone = g_strdup (tmpstrarr[3]);
+ locgrp->latitude = convert_pos (latstr, 2);
+ locgrp->longitude = convert_pos (lngstr, 3);
+ locgrp->comment = (tmpstrarr[4]) ? g_strdup (tmpstrarr[4]) : NULL;
+
+ g_ptr_array_add (tz_db->locations, (gpointer) locgrp);
+ }
+#else
+ loc->comment = (tmpstrarr[3]) ? g_strdup(tmpstrarr[3]) : NULL;
+#endif
+
+ g_ptr_array_add (tz_db->locations, (gpointer) loc);
+
+ g_free (latstr);
+ g_free (lngstr);
+ g_strfreev (tmpstrarr);
+ }
+
+ fclose (tzfile);
+
+ /* now sort by country */
+ sort_locations_by_country (tz_db->locations);
+
+ g_free (tz_data_file);
+
+ /* Load up the hashtable of backward links */
+ load_backward_tz (tz_db);
+
+ return tz_db;
+}
+
+static void
+tz_location_free (TzLocation *loc)
+{
+ g_free (loc->country);
+ g_free (loc->zone);
+ g_free (loc->comment);
+
+ g_free (loc);
+}
+
+void
+tz_db_free (TzDB *db)
+{
+ g_ptr_array_foreach (db->locations, (GFunc) tz_location_free, NULL);
+ g_ptr_array_free (db->locations, TRUE);
+ g_hash_table_destroy (db->backward);
+ g_free (db);
+}
+
+GPtrArray *
+tz_get_locations (TzDB *db)
+{
+ return db->locations;
+}
+
+
+gchar *
+tz_location_get_country (TzLocation *loc)
+{
+ return loc->country;
+}
+
+
+gchar *
+tz_location_get_zone (TzLocation *loc)
+{
+ return loc->zone;
+}
+
+
+gchar *
+tz_location_get_comment (TzLocation *loc)
+{
+ return loc->comment;
+}
+
+
+void
+tz_location_get_position (TzLocation *loc, double *longitude, double *latitude)
+{
+ *longitude = loc->longitude;
+ *latitude = loc->latitude;
+}
+
+glong
+tz_location_get_utc_offset (TzLocation *loc)
+{
+ TzInfo *tz_info;
+ glong offset;
+
+ tz_info = tz_info_from_location (loc);
+ offset = tz_info->utc_offset;
+ tz_info_free (tz_info);
+ return offset;
+}
+
+TzInfo *
+tz_info_from_location (TzLocation *loc)
+{
+ TzInfo *tzinfo;
+ time_t curtime;
+ struct tm *curzone;
+
+ g_return_val_if_fail (loc != NULL, NULL);
+ g_return_val_if_fail (loc->zone != NULL, NULL);
+
+ setenv ("TZ", loc->zone, 1);
+
+#if 0
+ tzset ();
+#endif
+ tzinfo = g_new0 (TzInfo, 1);
+
+ curtime = time (NULL);
+ curzone = localtime (&curtime);
+
+#ifndef __sun
+ /* Currently this solution doesnt seem to work - I get that */
+ /* America/Phoenix uses daylight savings, which is wrong */
+ tzinfo->tzname_normal = g_strdup (curzone->tm_zone);
+ if (curzone->tm_isdst)
+ tzinfo->tzname_daylight =
+ g_strdup (&curzone->tm_zone[curzone->tm_isdst]);
+ else
+ tzinfo->tzname_daylight = NULL;
+
+ tzinfo->utc_offset = curzone->tm_gmtoff;
+#else
+ tzinfo->tzname_normal = NULL;
+ tzinfo->tzname_daylight = NULL;
+ tzinfo->utc_offset = 0;
+#endif
+
+ tzinfo->daylight = curzone->tm_isdst;
+
+ setenv ("TZ", "", 1);
+
+ return tzinfo;
+}
+
+
+void
+tz_info_free (TzInfo *tzinfo)
+{
+ g_return_if_fail (tzinfo != NULL);
+
+ if (tzinfo->tzname_normal) g_free (tzinfo->tzname_normal);
+ if (tzinfo->tzname_daylight) g_free (tzinfo->tzname_daylight);
+ g_free (tzinfo);
+}
+
+struct {
+ const char *orig;
+ const char *dest;
+} aliases[] = {
+ { "Asia/Istanbul", "Europe/Istanbul" }, /* Istanbul is in both Europe and Asia */
+ { "Europe/Nicosia", "Asia/Nicosia" }, /* Ditto */
+ { "EET", "Europe/Istanbul" }, /* Same tz as the 2 above */
+ { "HST", "Pacific/Honolulu" },
+ { "WET", "Europe/Brussels" }, /* Other name for the mainland Europe tz */
+ { "CET", "Europe/Brussels" }, /* ditto */
+ { "MET", "Europe/Brussels" },
+ { "Etc/Zulu", "Etc/GMT" },
+ { "Etc/UTC", "Etc/GMT" },
+ { "GMT", "Etc/GMT" },
+ { "Greenwich", "Etc/GMT" },
+ { "Etc/UCT", "Etc/GMT" },
+ { "Etc/GMT0", "Etc/GMT" },
+ { "Etc/GMT+0", "Etc/GMT" },
+ { "Etc/GMT-0", "Etc/GMT" },
+ { "Etc/Universal", "Etc/GMT" },
+ { "PST8PDT", "America/Los_Angeles" }, /* Other name for the Atlantic tz */
+ { "EST", "America/New_York" }, /* Other name for the Eastern tz */
+ { "EST5EDT", "America/New_York" }, /* ditto */
+ { "CST6CDT", "America/Chicago" }, /* Other name for the Central tz */
+ { "MST", "America/Denver" }, /* Other name for the mountain tz */
+ { "MST7MDT", "America/Denver" }, /* ditto */
+};
+
+static gboolean
+compare_timezones (const char *a,
+ const char *b)
+{
+ if (g_str_equal (a, b))
+ return TRUE;
+ if (strchr (b, '/') == NULL) {
+ char *prefixed;
+
+ prefixed = g_strdup_printf ("/%s", b);
+ if (g_str_has_suffix (a, prefixed)) {
+ g_free (prefixed);
+ return TRUE;
+ }
+ g_free (prefixed);
+ }
+
+ return FALSE;
+}
+
+char *
+tz_info_get_clean_name (TzDB *tz_db,
+ const char *tz)
+{
+ char *ret;
+ const char *timezone;
+ guint i;
+ gboolean replaced;
+
+ /* Remove useless prefixes */
+ if (g_str_has_prefix (tz, "right/"))
+ tz = tz + strlen ("right/");
+ else if (g_str_has_prefix (tz, "posix/"))
+ tz = tz + strlen ("posix/");
+
+ /* Here start the crazies */
+ replaced = FALSE;
+
+ for (i = 0; i < G_N_ELEMENTS (aliases); i++) {
+ if (compare_timezones (tz, aliases[i].orig)) {
+ replaced = TRUE;
+ timezone = aliases[i].dest;
+ break;
+ }
+ }
+
+ /* Try again! */
+ if (!replaced) {
+ /* Ignore crazy solar times from the '80s */
+ if (g_str_has_prefix (tz, "Asia/Riyadh") ||
+ g_str_has_prefix (tz, "Mideast/Riyadh")) {
+ timezone = "Asia/Riyadh";
+ replaced = TRUE;
+ }
+ }
+
+ if (!replaced)
+ timezone = tz;
+
+ ret = g_hash_table_lookup (tz_db->backward, timezone);
+ if (ret == NULL)
+ return g_strdup (timezone);
+ return g_strdup (ret);
+}
+
+/* ----------------- *
+ * Private functions *
+ * ----------------- */
+
+static gchar *
+tz_data_file_get (void)
+{
+ gchar *file;
+
+ file = g_strdup (TZ_DATA_FILE);
+
+ return file;
+}
+
+static float
+convert_pos (gchar *pos, int digits)
+{
+ gchar whole[10];
+ gchar *fraction;
+ gint i;
+ float t1, t2;
+
+ if (!pos || strlen(pos) < 4 || digits > 9) return 0.0;
+
+ for (i = 0; i < digits + 1; i++) whole[i] = pos[i];
+ whole[i] = '\0';
+ fraction = pos + digits + 1;
+
+ t1 = g_strtod (whole, NULL);
+ t2 = g_strtod (fraction, NULL);
+
+ if (t1 >= 0.0) return t1 + t2/pow (10.0, strlen(fraction));
+ else return t1 - t2/pow (10.0, strlen(fraction));
+}
+
+
+#if 0
+
+/* Currently not working */
+static void
+free_tzdata (TzLocation *tz)
+{
+
+ if (tz->country)
+ g_free(tz->country);
+ if (tz->zone)
+ g_free(tz->zone);
+ if (tz->comment)
+ g_free(tz->comment);
+
+ g_free(tz);
+}
+#endif
+
+
+static int
+compare_country_names (const void *a, const void *b)
+{
+ const TzLocation *tza = * (TzLocation **) a;
+ const TzLocation *tzb = * (TzLocation **) b;
+
+ return strcmp (tza->zone, tzb->zone);
+}
+
+
+static void
+sort_locations_by_country (GPtrArray *locations)
+{
+ qsort (locations->pdata, locations->len, sizeof (gpointer),
+ compare_country_names);
+}
+
+static void
+load_backward_tz (TzDB *tz_db)
+{
+ GError *error = NULL;
+ char **lines, *contents;
+ guint i;
+
+ tz_db->backward = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+ if (g_file_get_contents (GNOMECC_DATA_DIR "/datetime/backward", &contents, NULL, &error) == FALSE)
+ {
+ g_warning ("Failed to load 'backward' file: %s", error->message);
+ return;
+ }
+ lines = g_strsplit (contents, "\n", -1);
+ g_free (contents);
+ for (i = 0; lines[i] != NULL; i++)
+ {
+ char **items;
+ guint j;
+ char *real, *alias;
+
+ if (g_ascii_strncasecmp (lines[i], "Link\t", 5) != 0)
+ continue;
+
+ items = g_strsplit (lines[i], "\t", -1);
+ real = NULL;
+ alias = NULL;
+ /* Skip the "Link<tab>" part */
+ for (j = 1; items[j] != NULL; j++)
+ {
+ if (items[j][0] == '\0')
+ continue;
+ if (real == NULL)
+ {
+ real = items[j];
+ continue;
+ }
+ alias = items[j];
+ break;
+ }
+
+ if (real == NULL || alias == NULL)
+ g_warning ("Could not parse line: %s", lines[i]);
+
+ /* We don't need more than one name for it */
+ if (g_str_equal (real, "Etc/UTC") ||
+ g_str_equal (real, "Etc/UCT"))
+ real = "Etc/GMT";
+
+ g_hash_table_insert (tz_db->backward, g_strdup (alias), g_strdup (real));
+ g_strfreev (items);
+ }
+ g_strfreev (lines);
+}
+
diff --git a/gui/initial-setup/tz.h b/gui/initial-setup/tz.h
new file mode 100644
index 00000000..71c1c231
--- /dev/null
+++ b/gui/initial-setup/tz.h
@@ -0,0 +1,89 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* Generic timezone utilities.
+ *
+ * Copyright (C) 2000-2001 Ximian, Inc.
+ *
+ * Authors: Hans Petter Jansson <hpj@ximian.com>
+ *
+ * Largely based on Michael Fulbright's work on Anaconda.
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+#ifndef _E_TZ_H
+#define _E_TZ_H
+
+#include <glib.h>
+
+#ifndef __sun
+# define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"
+#else
+# define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab"
+#endif
+
+typedef struct _TzDB TzDB;
+typedef struct _TzLocation TzLocation;
+typedef struct _TzInfo TzInfo;
+
+
+struct _TzDB
+{
+ GPtrArray *locations;
+ GHashTable *backward;
+};
+
+struct _TzLocation
+{
+ gchar *country;
+ gdouble latitude;
+ gdouble longitude;
+ gchar *zone;
+ gchar *comment;
+
+ gdouble dist; /* distance to clicked point for comparison */
+};
+
+/* see the glibc info page information on time zone information */
+/* tzname_normal is the default name for the timezone */
+/* tzname_daylight is the name of the zone when in daylight savings */
+/* utc_offset is offset in seconds from utc */
+/* daylight if non-zero then location obeys daylight savings */
+
+struct _TzInfo
+{
+ gchar *tzname_normal;
+ gchar *tzname_daylight;
+ glong utc_offset;
+ gint daylight;
+};
+
+
+TzDB *tz_load_db (void);
+void tz_db_free (TzDB *db);
+char * tz_info_get_clean_name (TzDB *tz_db,
+ const char *tz);
+GPtrArray *tz_get_locations (TzDB *db);
+void tz_location_get_position (TzLocation *loc,
+ double *longitude, double *latitude);
+char *tz_location_get_country (TzLocation *loc);
+gchar *tz_location_get_zone (TzLocation *loc);
+gchar *tz_location_get_comment (TzLocation *loc);
+glong tz_location_get_utc_offset (TzLocation *loc);
+gint tz_location_set_locally (TzLocation *loc);
+TzInfo *tz_info_from_location (TzLocation *loc);
+void tz_info_free (TzInfo *tz_info);
+
+#endif
diff --git a/gui/initial-setup/welcome-image.jpg b/gui/initial-setup/welcome-image.jpg
new file mode 100644
index 00000000..35ff65ae
--- /dev/null
+++ b/gui/initial-setup/welcome-image.jpg
Binary files differ