From 81c3d4ca5ee8f43e3996bec3be02c566a5e33a4c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 17 Dec 2013 22:10:11 -0600 Subject: initial cut for syncing panel with c++ changes. this is broken. --- panel/CMakeLists.txt | 6 +++--- panel/datetime-prefs-locations.c | 22 +++++++++++----------- panel/datetime-prefs.c | 39 +++++++++++++++++++++------------------ 3 files changed, 35 insertions(+), 32 deletions(-) (limited to 'panel') diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt index b3fcc7b..4ac3289 100644 --- a/panel/CMakeLists.txt +++ b/panel/CMakeLists.txt @@ -6,9 +6,9 @@ add_library (${PANEL_LIB} SHARED datetime-prefs.c datetime-prefs-locations.c datetime-prefs-locations.h - ${CMAKE_SOURCE_DIR}/src/utils.c - ${CMAKE_SOURCE_DIR}/src/utils.h - ${CMAKE_SOURCE_DIR}/src/settings-shared.h) + ${CMAKE_SOURCE_DIR}/src/utils.cpp + ${CMAKE_SOURCE_DIR}/include/datetime/utils.h + ${CMAKE_SOURCE_DIR}/include/datetime/settings-shared.h) include_directories (${PANEL_DEPS_INCLUDE_DIRS}) diff --git a/panel/datetime-prefs-locations.c b/panel/datetime-prefs-locations.c index 54ab8f4..b79c014 100644 --- a/panel/datetime-prefs-locations.c +++ b/panel/datetime-prefs-locations.c @@ -24,15 +24,18 @@ with this program. If not, see . #include "config.h" #endif -#include -#include /* time_t */ +#include "datetime-prefs-locations.h" + +#include +#include + +#include + #include #include -#include -#include "datetime-prefs-locations.h" -#include "settings-shared.h" -#include "utils.h" +#include +#include /* time_t */ #define DATETIME_DIALOG_UI_FILE PKGDATADIR "/datetime-dialog.ui" @@ -310,7 +313,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); } } @@ -425,7 +428,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 (); @@ -437,7 +439,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); gchar * time_str = g_date_time_format (now_tz, format); gchar * old_time_str; @@ -456,8 +458,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 55456ac..90f9e79 100644 --- a/panel/datetime-prefs.c +++ b/panel/datetime-prefs.c @@ -25,22 +25,25 @@ with this program. If not, see . #include "config.h" #endif -#include -#include -#include -#include -#include -#include -#include +#include "datetime-prefs-locations.h" + +#include +#include +#include + #include #include #include #include -#include "dbus-shared.h" -#include "settings-shared.h" -#include "utils.h" -#include "datetime-prefs-locations.h" +#include +#include +#include + +#include +#include +#include +#include #define DATETIME_DIALOG_UI_FILE PKGDATADIR "/datetime-dialog.ui" @@ -221,8 +224,8 @@ sync_entry (IndicatorDatetimePanel * self, const gchar * location) 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 @@ -287,10 +290,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); @@ -637,8 +640,8 @@ entry_focus_out (GtkEntry * entry, 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); -- cgit v1.2.3