aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm-notify-dialog.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-03-06 20:21:49 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-03-06 20:21:49 +0800
commit245d1c200e2d09a77c540f1874d1c0eb31c2dbd3 (patch)
treede0d1813e3090ff2ee5a4753f685f5b6ae24b80c /calendar/gui/alarm-notify/alarm-notify-dialog.c
parent64c201dff22bb74066debb18826ab5b176750e22 (diff)
downloadgsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.tar
gsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.tar.gz
gsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.tar.bz2
gsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.tar.lz
gsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.tar.xz
gsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.tar.zst
gsoc2013-evolution-245d1c200e2d09a77c540f1874d1c0eb31c2dbd3.zip
new function. (alarm_notify_dialog): made it return a pointer to the
2003-03-06 Rodrigo Moya <rodrigo@ximian.com> * gui/alarm-notify/alarm-notify-dialog.[ch] (alarm_notify_dialog_disable_buttons): new function. (alarm_notify_dialog): made it return a pointer to the dialog structure. * gui/alarm-notify/alarm-queue.c (remove_alarms, remove_comp): splitted alarm removal out of remove_comp. (obj_updated_cb): remove the component only when needed. In normal updates, just update the internal structure. (edit_component): don't get a CompQueuedAlarms as argument, since it might be removed. (on_dialog_obj_updated_cb, on_dialog_obj_removed_cb): callbacks for modifications during dialog display. (notify_dialog_cb): disconnect from "obj_*ed" signals and call edit_component with the new set of arguments. (display_notification): added more data to the closure structure. svn path=/trunk/; revision=20185
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-notify-dialog.c')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify-dialog.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c
index 81034ceca5..2d013b4463 100644
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c
@@ -309,9 +309,9 @@ write_html_heading (GtkHTMLStream *stream, const char *message,
* Runs the alarm notification dialog. The specified @func will be used to
* notify the client about result of the actions in the dialog.
*
- * Return value: TRUE on success, FALSE if the dialog could not be created.
+ * Return value: a pointer to the dialog structure if successful or NULL if an error occurs.
**/
-gboolean
+gpointer
alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
CalComponentVType vtype, const char *message,
AlarmNotifyFunc func, gpointer func_data)
@@ -321,12 +321,12 @@ alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
icaltimezone *current_zone;
char *buf, *title;
- g_return_val_if_fail (trigger != -1, FALSE);
+ g_return_val_if_fail (trigger != -1, NULL);
/* Only VEVENTs or VTODOs can have alarms */
- g_return_val_if_fail (vtype == CAL_COMPONENT_EVENT || vtype == CAL_COMPONENT_TODO, FALSE);
- g_return_val_if_fail (message != NULL, FALSE);
- g_return_val_if_fail (func != NULL, FALSE);
+ g_return_val_if_fail (vtype == CAL_COMPONENT_EVENT || vtype == CAL_COMPONENT_TODO, NULL);
+ g_return_val_if_fail (message != NULL, NULL);
+ g_return_val_if_fail (func != NULL, NULL);
an = g_new0 (AlarmNotify, 1);
@@ -337,7 +337,7 @@ alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
if (!an->xml) {
g_message ("alarm_notify_dialog(): Could not load the Glade XML file!");
g_free (an);
- return FALSE;
+ return NULL;
}
an->dialog = glade_xml_get_widget (an->xml, "alarm-notify");
@@ -354,10 +354,10 @@ alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!");
g_object_unref (an->xml);
g_free (an);
- return FALSE;
+ return NULL;
}
- g_signal_connect (an->dialog, "destroy",
+ g_signal_connect (G_OBJECT (an->dialog), "destroy",
G_CALLBACK (dialog_destroy_cb),
an);
@@ -407,6 +407,14 @@ alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
#endif
gtk_widget_show (an->dialog);
- return TRUE;
+ return an;
}
+void
+alarm_notify_dialog_disable_buttons (gpointer dialog)
+{
+ AlarmNotify *an = dialog;
+
+ gtk_widget_set_sensitive (an->snooze, FALSE);
+ gtk_widget_set_sensitive (an->edit, FALSE);
+}