aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2004-06-09 00:44:46 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-06-09 00:44:46 +0800
commitbab3dc622a2cd10e861e1ffb762768e68079a81e (patch)
tree49f87315bdc07b6adaec78e5838cd0f5d89a05ab /calendar/gui
parent7601e9e71eb0f412b7671954c8724e1820e519cd (diff)
downloadgsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.tar
gsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.tar.gz
gsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.tar.bz2
gsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.tar.lz
gsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.tar.xz
gsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.tar.zst
gsoc2013-evolution-bab3dc622a2cd10e861e1ffb762768e68079a81e.zip
new function for notifying all pages of the client change.
2004-06-08 Rodrigo Moya <rodrigo@novell.com> * gui/dialogs/comp-editor.[ch] (comp_editor_notify_client_changed): new function for notifying all pages of the client change. (page_client_changed_cb): no need for this callback. (comp_editor_append_page): no need to connect to "client_changed" signal on the pages. * gui/dialogs/comp-editor-page.c (comp_editor_page_notify_client_changed): re-added the call to comp_editor_page_set_e_cal(), the client was not being set anywhere. * gui/dialogs/event-page.c (source_changed_cb): use comp_editor_notify_client_changed() so that all pages get informed of the client change. * gui/dialogs/task-page.c (source_changed_cb): ditto. svn path=/trunk/; revision=26255
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/comp-editor-page.c1
-rw-r--r--calendar/gui/dialogs/comp-editor.c40
-rw-r--r--calendar/gui/dialogs/comp-editor.h1
-rw-r--r--calendar/gui/dialogs/event-page.c5
-rw-r--r--calendar/gui/dialogs/task-page.c5
5 files changed, 35 insertions, 17 deletions
diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c
index 44e89a3b14..2d656060e7 100644
--- a/calendar/gui/dialogs/comp-editor-page.c
+++ b/calendar/gui/dialogs/comp-editor-page.c
@@ -433,6 +433,7 @@ comp_editor_page_notify_client_changed (CompEditorPage *page,
g_return_if_fail (page != NULL);
g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
+ comp_editor_page_set_e_cal (page, client);
gtk_signal_emit (GTK_OBJECT (page),
comp_editor_page_signals[CLIENT_CHANGED],
client);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 96f58a3025..ef3757cac7 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -105,7 +105,6 @@ static void page_changed_cb (GtkObject *obj, gpointer data);
static void needs_send_cb (GtkObject *obj, gpointer data);
static void page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data);
static void page_dates_changed_cb (GtkObject *obj, CompEditorPageDates *dates, gpointer data);
-static void page_client_changed_cb (GtkObject *obj, ECal *client, gpointer data);
static void obj_modified_cb (ECal *client, GList *objs, gpointer data);
static void obj_removed_cb (ECal *client, GList *uids, gpointer data);
@@ -769,8 +768,6 @@ comp_editor_append_page (CompEditor *editor,
G_CALLBACK (page_summary_changed_cb), editor);
g_signal_connect(page, "dates_changed",
G_CALLBACK (page_dates_changed_cb), editor);
- g_signal_connect(page, "client_changed",
- G_CALLBACK (page_client_changed_cb), editor);
/* Listen for when the page is mapped/unmapped so we can
install/uninstall the appropriate GtkAccelGroup. */
@@ -1341,6 +1338,31 @@ comp_editor_focus (CompEditor *editor)
raise_and_focus (GTK_WIDGET (editor));
}
+/**
+ * comp_editor_page_notify_client_changed:
+ * @page: An editor page.
+ *
+ * Makes an editor page emit the "client_changed" signal. This is meant to be
+ * used only by page implementations.
+ **/
+void
+comp_editor_notify_client_changed (CompEditor *editor, ECal *client)
+{
+ GList *l;
+ CompEditorPrivate *priv;
+
+ g_return_if_fail (editor != NULL);
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ priv = editor->priv;
+
+ priv->changed = TRUE;
+
+ comp_editor_set_e_cal (editor, client);
+ for (l = priv->pages; l != NULL; l = l->next)
+ comp_editor_page_notify_client_changed (COMP_EDITOR_PAGE (l->data), client);
+}
+
/* Menu Commands */
static void
save_close_cmd (GtkWidget *widget, gpointer data)
@@ -1543,18 +1565,6 @@ page_dates_changed_cb (GtkObject *obj,
}
static void
-page_client_changed_cb (GtkObject *obj, ECal *client, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- priv->changed = TRUE;
- comp_editor_set_e_cal (editor, client);
-}
-
-static void
obj_modified_cb (ECal *client, GList *objects, gpointer data)
{
CompEditor *editor = COMP_EDITOR (data);
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index 48b332ce4b..b0b9521868 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -101,6 +101,7 @@ void comp_editor_set_ui_prop (CompEditor *editor,
const char *val);
void comp_editor_focus (CompEditor *editor);
+void comp_editor_notify_client_changed (CompEditor *editor, ECal *client);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index abdc84aa34..d832cf4873 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -41,6 +41,7 @@
#include <libecal/e-cal-time-util.h>
#include "../calendar-config.h"
#include "../e-timezone-entry.h"
+#include "comp-editor.h"
#include "comp-editor-util.h"
#include "event-page.h"
@@ -1297,7 +1298,9 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
} else {
- comp_editor_page_notify_client_changed (COMP_EDITOR_PAGE (epage), client);
+ comp_editor_notify_client_changed (
+ COMP_EDITOR (gtk_widget_get_toplevel (priv->main)),
+ client);
sensitize_widgets (epage);
}
}
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 0979397245..de17834994 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -42,6 +42,7 @@
#include "e-util/e-categories-config.h"
#include "../e-timezone-entry.h"
#include "../calendar-config.h"
+#include "comp-editor.h"
#include "comp-editor-util.h"
#include "task-page.h"
@@ -827,7 +828,9 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
} else {
- comp_editor_page_notify_client_changed (COMP_EDITOR_PAGE (epage), client);
+ comp_editor_notify_client_changed (
+ COMP_EDITOR (gtk_widget_get_toplevel (priv->main)),
+ client);
}
}
}