aboutsummaryrefslogtreecommitdiff
path: root/panel
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-31 11:46:08 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-01-31 11:46:08 +0000
commit089df7ae2d97966b789231e112709183483c64eb (patch)
tree0d8f4a2a9e99f61c5d7946653e7dd9eb3aac66d0 /panel
parentcbb15a8fefaf70b03434b055cf41185c4009fb10 (diff)
parent271b0fbf8b14a4f7a8f47de0e3a8751bd50676c3 (diff)
downloadayatana-indicator-datetime-089df7ae2d97966b789231e112709183483c64eb.tar.gz
ayatana-indicator-datetime-089df7ae2d97966b789231e112709183483c64eb.tar.bz2
ayatana-indicator-datetime-089df7ae2d97966b789231e112709183483c64eb.zip
Finally land this. Other, still open bugs will be fixed in subsequent commits. Fixes: 793450, 1271484, 1274046
Diffstat (limited to 'panel')
-rw-r--r--panel/datetime-prefs-locations.c26
-rw-r--r--panel/datetime-prefs.c50
2 files changed, 40 insertions, 36 deletions
diff --git a/panel/datetime-prefs-locations.c b/panel/datetime-prefs-locations.c
index 933adcf..8cd81fb 100644
--- a/panel/datetime-prefs-locations.c
+++ b/panel/datetime-prefs-locations.c
@@ -24,20 +24,23 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#endif
-#include <stdlib.h>
-#include <time.h> /* time_t */
+#include "datetime-prefs-locations.h"
+
+#include <datetime/settings-shared.h>
+#include <datetime/utils.h>
+
+#include <timezonemap/timezone-completion.h>
+
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
-#include <timezonemap/timezone-completion.h>
-#include "datetime-prefs-locations.h"
-#include "settings-shared.h"
-#include "utils.h"
+#include <stdlib.h>
+#include <time.h> /* time_t */
#if USE_UNITY
-#define DATETIME_DIALOG_UI_FILE PKGDATADIR "/unity-control-center/datetime-dialog.ui"
+ #define DATETIME_DIALOG_UI_FILE PKGDATADIR "/unity-control-center/datetime-dialog.ui"
#else
-#define DATETIME_DIALOG_UI_FILE PKGDATADIR "/gnome-control-center/datetime-dialog.ui"
+ #define DATETIME_DIALOG_UI_FILE PKGDATADIR "/gnome-control-center/datetime-dialog.ui"
#endif
#define COL_NAME 0
@@ -314,7 +317,7 @@ handle_edit (GtkCellRendererText * renderer G_GNUC_UNUSED,
gtk_list_store_set (store, &iter,
COL_VISIBLE_NAME, new_text,
- COL_ICON, correct ? NULL : GTK_STOCK_DIALOG_ERROR,
+ COL_ICON, correct ? NULL : "dialog-error",
-1);
}
}
@@ -429,7 +432,6 @@ update_times (GtkWidget * dlg)
g_signal_handlers_block_by_func (store, save_when_idle, dlg);
- GSettings * settings = g_settings_new (SETTINGS_INTERFACE);
GtkTreeIter iter;
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) {
GDateTime * now = g_date_time_new_now_local ();
@@ -441,7 +443,7 @@ update_times (GtkWidget * dlg)
if (strzone && *strzone) {
GTimeZone * tz = g_time_zone_new (strzone);
GDateTime * now_tz = g_date_time_to_timezone (now, tz);
- gchar * format = generate_full_format_string_at_time (now, now_tz, settings);
+ gchar * format = generate_full_format_string_at_time (now, now_tz, NULL);
gchar * time_str = g_date_time_format (now_tz, format);
gchar * old_time_str;
@@ -460,8 +462,6 @@ update_times (GtkWidget * dlg)
g_date_time_unref (now);
}
- g_object_unref (settings);
-
g_signal_handlers_unblock_by_func (store, save_when_idle, dlg);
return TRUE;
diff --git a/panel/datetime-prefs.c b/panel/datetime-prefs.c
index c1e70b1..02536c7 100644
--- a/panel/datetime-prefs.c
+++ b/panel/datetime-prefs.c
@@ -25,26 +25,30 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#endif
-#include <stdlib.h>
-#include <libintl.h>
-#include <locale.h>
-#include <langinfo.h>
+#include "datetime-prefs-locations.h"
+
+#include <datetime/dbus-shared.h>
+#include <datetime/settings-shared.h>
+#include <datetime/utils.h>
+
+#include <polkit/polkit.h>
+#include <timezonemap/cc-timezone-map.h>
+#include <timezonemap/timezone-completion.h>
+
#include <glib/gi18n-lib.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
-#include <polkit/polkit.h>
-#if USE_UNITY
-#include <libunity-control-center/cc-panel.h>
+
+#ifdef USE_UNITY
+ #include <libunity-control-center/cc-panel.h>
#else
-#include <libgnome-control-center/cc-panel.h>
+ #include <libgnome-control-center/cc-panel.h>
#endif
-#include <timezonemap/cc-timezone-map.h>
-#include <timezonemap/timezone-completion.h>
-#include "dbus-shared.h"
-#include "settings-shared.h"
-#include "utils.h"
-#include "datetime-prefs-locations.h"
+#include <stdlib.h>
+#include <libintl.h>
+#include <locale.h>
+#include <langinfo.h>
#if USE_UNITY
#define DATETIME_DIALOG_UI_FILE PKGDATADIR "/unity-control-center/datetime-dialog.ui"
@@ -225,12 +229,12 @@ toggle_ntp (GtkWidget * radio, GParamSpec * pspec G_GNUC_UNUSED, IndicatorDateti
static void
sync_entry (IndicatorDatetimePanel * self, const gchar * location)
{
- gchar * name = get_current_zone_name (location, self->priv->settings);
+ gchar * name = get_timezone_name (location, self->priv->settings);
gtk_entry_set_text (GTK_ENTRY (self->priv->tz_entry), name);
g_free (name);
- gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->tz_entry),
- GTK_ENTRY_ICON_SECONDARY, NULL);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (self->priv->tz_entry),
+ GTK_ENTRY_ICON_SECONDARY, NULL);
}
static void
@@ -295,10 +299,10 @@ proxy_ready (GObject *object G_GNUC_UNUSED,
{
if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
{
- const gchar *timezone = g_variant_get_string (value, NULL);
+ const gchar * str = g_variant_get_string (value, NULL);
- cc_timezone_map_set_timezone (priv->tzmap, timezone);
- sync_entry (self, timezone);
+ cc_timezone_map_set_timezone (priv->tzmap, str);
+ sync_entry (self, str);
g_signal_connect (priv->tzmap, "location-changed", G_CALLBACK (tz_changed), self);
}
g_variant_unref (value);
@@ -640,13 +644,13 @@ entry_focus_out (GtkEntry * entry,
gchar * zone;
g_object_get (location, "zone", &zone, NULL);
- gchar * name = get_current_zone_name (zone, self->priv->settings);
+ gchar * name = get_timezone_name (zone, self->priv->settings);
gboolean correct = (g_strcmp0 (gtk_entry_get_text (entry), name) == 0);
g_free (name);
g_free (zone);
- gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY,
- correct ? NULL : GTK_STOCK_DIALOG_ERROR);
+ gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY,
+ correct ? NULL : "dialog-error");
gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY,
_("You need to choose a location to change the time zone."));
gtk_entry_set_icon_activatable (entry, GTK_ENTRY_ICON_SECONDARY, FALSE);