aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/alarm-dialog.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-06-26 01:35:55 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-06-26 01:35:55 +0800
commit6a4275e077299ac5e9ea8bed23787ae73c73043a (patch)
tree23f49ff3a63c45a38ae1f1b6aad6107e34798be9 /calendar/gui/dialogs/alarm-dialog.c
parent71bd5f404a73118c52c8c3a149b1984083a48c62 (diff)
downloadgsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.tar
gsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.tar.gz
gsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.tar.bz2
gsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.tar.lz
gsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.tar.xz
gsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.tar.zst
gsoc2013-evolution-6a4275e077299ac5e9ea8bed23787ae73c73043a.zip
use "Contacts..."
2004-06-25 JP Rosevear <jpr@novell.com> * gui/dialogs/e-delegate-dialog.glade: use "Contacts..." * gui/dialogs/alarm-dialog.glade: add custom message email toggle * gui/dialogs/alarm-dialog.c (get_widgets): get custom email message toggle (check_custom_email): check the custom message when setting sensitivity of OK button (malarm_message_toggled_cb): check custom email (malarm_description_changed_cb): ditto (action_selection_done_cb): ditto svn path=/trunk/; revision=26517
Diffstat (limited to 'calendar/gui/dialogs/alarm-dialog.c')
-rw-r--r--calendar/gui/dialogs/alarm-dialog.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c
index b243453d89..6365009e14 100644
--- a/calendar/gui/dialogs/alarm-dialog.c
+++ b/calendar/gui/dialogs/alarm-dialog.c
@@ -103,6 +103,7 @@ typedef struct {
GtkWidget *malarm_address_group;
GtkWidget *malarm_addresses;
GtkWidget *malarm_addressbook;
+ GtkWidget *malarm_message;
GtkWidget *malarm_description;
GNOME_Evolution_Addressbook_SelectNames corba_select_names;
@@ -190,6 +191,7 @@ clear_widgets (Dialog *dialog)
gtk_widget_set_sensitive (dialog->repeat_group, FALSE);
gtk_widget_set_sensitive (dialog->dalarm_group, FALSE);
gtk_widget_set_sensitive (dialog->aalarm_group, FALSE);
+ gtk_widget_set_sensitive (dialog->malarm_group, FALSE);
gtk_notebook_set_current_page (GTK_NOTEBOOK (dialog->option_notebook), 0);
}
@@ -370,6 +372,9 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
e_cal_component_free_attendee_list (attendee_list);
e_destination_freev (destv);
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->malarm_message)))
+ return;
+
/* Description */
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description));
gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
@@ -550,6 +555,7 @@ get_widgets (Dialog *dialog)
dialog->malarm_group = GW ("malarm-group");
dialog->malarm_address_group = GW ("malarm-address-group");
dialog->malarm_addressbook = GW ("malarm-addressbook");
+ dialog->malarm_message = GW ("malarm-message");
dialog->malarm_description = GW ("malarm-description");
dialog->palarm_group = GW ("palarm-group");
@@ -578,6 +584,7 @@ get_widgets (Dialog *dialog)
&& dialog->malarm_group
&& dialog->malarm_address_group
&& dialog->malarm_addressbook
+ && dialog->malarm_message
&& dialog->malarm_description
&& dialog->palarm_group
&& dialog->palarm_program
@@ -765,6 +772,8 @@ static void
check_custom_email (Dialog *dialog)
{
char *str;
+ GtkTextBuffer *text_buffer;
+ GtkTextIter text_iter_start, text_iter_end;
EDestination **destv;
gboolean sens;
@@ -773,7 +782,12 @@ check_custom_email (Dialog *dialog)
destv = e_destination_importv (str);
g_free (str);
- sens = destv != NULL;
+ text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description));
+ gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
+ gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
+ str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
+
+ sens = (destv != NULL) && (e_dialog_toggle_get (dialog->malarm_message) ? str && *str : TRUE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->toplevel), GTK_RESPONSE_OK, sens);
e_destination_freev (destv);
@@ -792,6 +806,26 @@ malarm_addresses_changed_cb (BonoboListener *listener,
}
static void
+malarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data)
+{
+ Dialog *dialog = data;
+ gboolean active;
+
+ active = gtk_toggle_button_get_active (toggle);
+
+ gtk_widget_set_sensitive (dialog->malarm_group, active);
+ check_custom_email (dialog);
+}
+
+static void
+malarm_description_changed_cb (GtkWidget *widget, gpointer data)
+{
+ Dialog *dialog = data;
+
+ check_custom_email (dialog);
+}
+
+static void
action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
{
Dialog *dialog = data;
@@ -865,6 +899,12 @@ init_widgets (Dialog *dialog)
G_CALLBACK (palarm_program_changed_cb), dialog);
/* Handle custom email */
+ g_signal_connect (G_OBJECT (dialog->malarm_message), "toggled",
+ G_CALLBACK (malarm_message_toggled_cb), dialog);
+ text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description));
+ g_signal_connect (G_OBJECT (text_buffer), "changed",
+ G_CALLBACK (malarm_description_changed_cb), dialog);
+
cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (dialog->malarm_addresses));
pb = bonobo_control_frame_get_control_property_bag (cf, NULL);