[gnome-calendar] window: unmark disabled sources checkbox
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: unmark disabled sources checkbox
- Date: Mon, 22 Dec 2014 13:42:42 +0000 (UTC)
commit c4de15eeef2908318a3b2e3bdb6e26736c29fa4c
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sun Dec 21 13:55:43 2014 -0500
window: unmark disabled sources checkbox
Calendars selector menu needs to know which source is enable to properly
mark the checkbox
src/gcal-manager.c | 5 +++--
src/gcal-manager.h | 2 +-
src/gcal-window.c | 4 +++-
3 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index b9bd975..ea8b3fa 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -292,7 +292,6 @@ on_client_connected (GObject *source_object,
unit->client = g_object_ref (client);
g_hash_table_insert (priv->clients, source, unit);
- g_signal_emit (GCAL_MANAGER (user_data), signals[SOURCE_ADDED], 0, source);
g_debug ("Source %s (%s) connected",
e_source_get_display_name (source),
@@ -312,6 +311,8 @@ on_client_connected (GObject *source_object,
e_cal_data_model_add_client (priv->e_data_model, client);
e_cal_data_model_add_client (priv->search_data_model, client);
}
+ g_signal_emit (GCAL_MANAGER (user_data), signals[SOURCE_ADDED], 0, source, unit->enabled);
+
g_clear_object (&client);
}
else
@@ -492,7 +493,7 @@ gcal_manager_class_init (GcalManagerClass *klass)
signals[SOURCE_ADDED] = g_signal_new ("source-added", GCAL_TYPE_MANAGER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GcalManagerClass, source_added),
NULL, NULL, NULL,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
+ G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN);
signals[SOURCE_REMOVED] = g_signal_new ("source-removed", GCAL_TYPE_MANAGER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GcalManagerClass, source_removed),
diff --git a/src/gcal-manager.h b/src/gcal-manager.h
index 44edfcb..f0f13ac 100644
--- a/src/gcal-manager.h
+++ b/src/gcal-manager.h
@@ -47,7 +47,7 @@ struct _GcalManagerClass
/* signals */
void (*source_activated) (GcalManager *manager, ESource *source, gboolean active);
- void (*source_added) (GcalManager *manager, ESource *source);
+ void (*source_added) (GcalManager *manager, ESource *source, gboolean enabled);
void (*source_removed) (GcalManager *manager, ESource *source);
};
diff --git a/src/gcal-window.c b/src/gcal-window.c
index b23640e..f82b1b0 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -168,6 +168,7 @@ static void hide_notification (GtkWidget *b
/* calendar management */
static void add_source (GcalManager *manager,
ESource *source,
+ gboolean enabled,
gpointer user_data);
static void remove_source (GcalManager *manager,
@@ -678,6 +679,7 @@ hide_notification (GtkWidget *button,
static void
add_source (GcalManager *manager,
ESource *source,
+ gboolean enabled,
gpointer user_data)
{
GcalWindowPrivate *priv;
@@ -693,7 +695,7 @@ add_source (GcalManager *manager,
priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
/* create the action itself */
- action = g_simple_action_new_stateful (e_source_get_uid (source), NULL, g_variant_new_boolean (TRUE));
+ action = g_simple_action_new_stateful (e_source_get_uid (source), NULL, g_variant_new_boolean (enabled));
g_signal_connect (action, "change-state", G_CALLBACK (on_calendar_toggled), user_data);
g_action_map_add_action (G_ACTION_MAP (user_data), G_ACTION (action));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]