aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-25 06:53:30 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-25 06:53:30 +0800
commit9515b98403f2f7ef77dc6c51f82505fccef08c2b (patch)
tree2557338a0ad82878b8b2d84ecc9df7e169d75bc8 /calendar/gui/dialogs
parent73c370019c4de89d4c901ee8c25cc0cbb55992fb (diff)
downloadgsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.tar
gsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.tar.gz
gsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.tar.bz2
gsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.tar.lz
gsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.tar.xz
gsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.tar.zst
gsoc2013-evolution-9515b98403f2f7ef77dc6c51f82505fccef08c2b.zip
Saving progress. Experimenting with directory layout.
Saving progress. Experimenting with directory layout. svn path=/branches/kill-bonobo/; revision=36446
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/comp-editor.c41
-rw-r--r--calendar/gui/dialogs/comp-editor.h3
2 files changed, 41 insertions, 3 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index ee5ad096d0..430b559948 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -214,7 +214,15 @@ enum {
LAST_SIGNAL
};
-static guint comp_editor_signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL];
+static GList *active_editors;
+
+static void
+comp_editor_weak_notify_cb (gpointer unused,
+ GObject *where_the_object_was)
+{
+ active_editors = g_list_remove (active_editors, where_the_object_was);
+}
static void
attach_message(CompEditor *editor, CamelMimeMessage *msg)
@@ -1704,7 +1712,7 @@ comp_editor_class_init (CompEditorClass *class)
NULL,
G_PARAM_READWRITE));
- comp_editor_signals[OBJECT_CREATED] =
+ signals[OBJECT_CREATED] =
g_signal_new ("object_created",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
@@ -1724,6 +1732,12 @@ comp_editor_init (CompEditor *editor)
editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor);
+ g_object_weak_ref (
+ G_OBJECT (editor), (GWeakNotify)
+ comp_editor_weak_notify_cb, NULL);
+
+ active_editors = g_list_prepend (active_editors, editor);
+
priv->pages = NULL;
priv->changed = FALSE;
priv->needs_send = FALSE;
@@ -2279,7 +2293,18 @@ close_dialog (CompEditor *editor)
gtk_widget_destroy (GTK_WIDGET (editor));
}
-
+gint
+comp_editor_compare (CompEditor *editor_a,
+ CompEditor *editor_b)
+{
+ const gchar *uid_a = NULL;
+ const gchar *uid_b = NULL;
+
+ e_cal_component_get_uid (editor_a->priv->comp, &uid_a);
+ e_cal_component_get_uid (editor_b->priv->comp, &uid_b);
+
+ return g_strcmp0 (uid_a, uid_b);
+}
void
comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org)
@@ -2547,6 +2572,16 @@ comp_editor_get_managed_widget (CompEditor *editor,
return widget;
}
+CompEditor *
+comp_editor_find_instance (const gchar *uid)
+{
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ return g_list_find_custom (
+ active_editors, uid,
+ (GCompareFunc) comp_editor_compare);
+}
+
/**
* comp_editor_set_needs_send:
* @editor: A component editor
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index 9289b9ced7..23a8d3acea 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -87,6 +87,8 @@ typedef enum {
} CompEditorFlags;
GType comp_editor_get_type (void);
+gint comp_editor_compare (CompEditor *editor_a,
+ CompEditor *editor_b);
void comp_editor_set_changed (CompEditor *editor,
gboolean changed);
gboolean comp_editor_get_changed (CompEditor *editor);
@@ -149,6 +151,7 @@ GtkActionGroup *
const gchar *group_name);
GtkWidget * comp_editor_get_managed_widget (CompEditor *editor,
const gchar *widget_path);
+CompEditor * comp_editor_find_instance (const gchar *uid);
G_END_DECLS