aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/comp-editor.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-04-26 07:37:21 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-04-26 07:37:21 +0800
commitd261d0b2e46d4793c2d54540782552846535eb60 (patch)
tree5e37dd30639f8ae27c298ccdbbe4cb18d79b0830 /calendar/gui/dialogs/comp-editor.c
parentdc7efb1311d23c32a76a9a8092f734223ce3207e (diff)
downloadgsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.gz
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.bz2
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.lz
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.xz
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.zst
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.zip
Begin migrating calendar settings to EShellSettings.
Begin dismantling calendar-config.c and migrating calendar settings to EShellSettings. EShellSettings utilizes GObject properties instead of separate get/set/notify functions for each setting.
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r--calendar/gui/dialogs/comp-editor.c81
1 files changed, 62 insertions, 19 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 4cf74613cf..4db6c66b12 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -76,6 +76,9 @@
/* Private part of the CompEditor structure */
struct _CompEditorPrivate {
+
+ gpointer shell; /* weak pointer */
+
/* Client to use */
ECal *client;
@@ -125,6 +128,7 @@ enum {
PROP_CHANGED,
PROP_CLIENT,
PROP_FLAGS,
+ PROP_SHELL,
PROP_SUMMARY
};
@@ -1232,6 +1236,17 @@ comp_editor_setup_recent_menu (CompEditor *editor)
}
static void
+comp_editor_set_shell (CompEditor *editor,
+ EShell *shell)
+{
+ g_return_if_fail (editor->priv->shell == NULL);
+
+ editor->priv->shell = shell;
+
+ g_object_add_weak_pointer (G_OBJECT (shell), &editor->priv->shell);
+}
+
+static void
comp_editor_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -1256,6 +1271,12 @@ comp_editor_set_property (GObject *object,
g_value_get_int (value));
return;
+ case PROP_SHELL:
+ comp_editor_set_shell (
+ COMP_EDITOR (object),
+ g_value_get_object (value));
+ return;
+
case PROP_SUMMARY:
comp_editor_set_summary (
COMP_EDITOR (object),
@@ -1291,6 +1312,12 @@ comp_editor_get_property (GObject *object,
COMP_EDITOR (object)));
return;
+ case PROP_SHELL:
+ g_value_set_object (
+ value, comp_editor_get_shell (
+ COMP_EDITOR (object)));
+ return;
+
case PROP_SUMMARY:
g_value_set_string (
value, comp_editor_get_summary (
@@ -1366,42 +1393,39 @@ static void
comp_editor_map (GtkWidget *widget)
{
CompEditor *editor = COMP_EDITOR (widget);
- GConfBridge *bridge = gconf_bridge_get ();
+ GConfBridge *bridge;
GtkAction *action;
+ const gchar *key;
+
+ bridge = gconf_bridge_get ();
/* Give subclasses a chance to construct their pages before
* we fiddle with their widgets. That's why we don't do this
* until after object construction. */
+ key = "/apps/evolution/calendar/display/show_categories";
action = comp_editor_get_action (editor, "view-categories");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_CATEGORIES,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_role";
action = comp_editor_get_action (editor, "view-role");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_ROLE,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_rsvp";
action = comp_editor_get_action (editor, "view-rsvp");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_RSVP,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_status";
action = comp_editor_get_action (editor, "view-status");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_STATUS,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_timezone";
action = comp_editor_get_action (editor, "view-time-zone");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_TIMEZONE,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ key = "/apps/evolution/calendar/display/show_type";
action = comp_editor_get_action (editor, "view-type");
- gconf_bridge_bind_property (
- bridge, CALENDAR_CONFIG_SHOW_TYPE,
- G_OBJECT (action), "active");
+ gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
/* Chain up to parent's map() method. */
GTK_WIDGET_CLASS (comp_editor_parent_class)->map (widget);
@@ -1510,6 +1534,17 @@ comp_editor_class_init (CompEditorClass *class)
g_object_class_install_property (
object_class,
+ PROP_SHELL,
+ g_param_spec_object (
+ "shell",
+ NULL,
+ NULL,
+ E_TYPE_SHELL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (
+ object_class,
PROP_SUMMARY,
g_param_spec_string (
"summary",
@@ -1849,6 +1884,14 @@ comp_editor_get_classification (CompEditor *editor)
return gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
}
+EShell *
+comp_editor_get_shell (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
+
+ return editor->priv->shell;
+}
+
void
comp_editor_set_summary (CompEditor *editor,
const gchar *summary)