aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/eventedit.c
diff options
context:
space:
mode:
authorRussell Steinthal <steintr@src.gnome.org>1999-11-03 10:36:31 +0800
committerRussell Steinthal <steintr@src.gnome.org>1999-11-03 10:36:31 +0800
commita6c4b535334a6da5c8d1622b11a0893d0c55abee (patch)
tree40922f9ada769d340c6fdbf9fd18b22eb5a1d1f2 /calendar/eventedit.c
parent510e8547bba307dc1e7dd72bd1484faa27db1a4f (diff)
downloadgsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.tar
gsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.tar.gz
gsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.tar.bz2
gsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.tar.lz
gsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.tar.xz
gsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.tar.zst
gsoc2013-evolution-a6c4b535334a6da5c8d1622b11a0893d0c55abee.zip
Add default alarm support, Beep on display alarms option
Since there are now some calls from prop.c into previously static functions in eventedit.c, the code in those files should probably be reorganized. Perhaps a new alarm-utils.c file? In any case, this commits working code to the repository before we reorganize. svn path=/trunk/; revision=1366
Diffstat (limited to 'calendar/eventedit.c')
-rw-r--r--calendar/eventedit.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/calendar/eventedit.c b/calendar/eventedit.c
index 926bb6f09c..2b93426b00 100644
--- a/calendar/eventedit.c
+++ b/calendar/eventedit.c
@@ -319,20 +319,30 @@ alarm_toggle (GtkToggleButton *toggle, CalendarAlarm *alarm)
#define FXS (GTK_FILL | GTK_EXPAND | GTK_SHRINK)
#define FS (GTK_FILL | GTK_SHRINK)
-static void
-ee_create_ae (GtkTable *table, char *str, CalendarAlarm *alarm, enum AlarmType type, int y)
+void
+ee_create_ae (GtkTable *table, char *str, CalendarAlarm *alarm, enum AlarmType type, int y, gboolean control_sens, GtkSignalFunc dirty_func)
{
GtkWidget *entry;
alarm->w_enabled = gtk_check_button_new_with_label (str);
- gtk_signal_connect (GTK_OBJECT (alarm->w_enabled), "toggled",
- GTK_SIGNAL_FUNC (alarm_toggle), alarm);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (alarm->w_enabled),
+ alarm->enabled);
+ if (control_sens)
+ gtk_signal_connect (GTK_OBJECT (alarm->w_enabled), "toggled",
+ GTK_SIGNAL_FUNC (alarm_toggle), alarm);
+ if (dirty_func)
+ gtk_signal_connect (GTK_OBJECT (alarm->w_enabled), "toggled",
+ GTK_SIGNAL_FUNC (dirty_func), NULL);
gtk_table_attach (table, alarm->w_enabled, 0, 1, y, y+1, FS, FS, 0, 0);
alarm->w_count = make_spin_button (alarm->count, 0, 10000);
+ if (dirty_func)
+ gtk_signal_connect (GTK_OBJECT (alarm->w_count), "changed",
+ GTK_SIGNAL_FUNC (dirty_func), NULL);
gtk_table_attach (table, alarm->w_count, 1, 2, y, y+1, FS, FS, 0, 0);
alarm->w_timesel = timesel_new ();
+ /* is there a "changed" signal which we can connect to? */
gtk_option_menu_set_history (GTK_OPTION_MENU (alarm->w_timesel), alarm->units);
gtk_table_attach (table, alarm->w_timesel, 2, 3, y, y+1, FS, FS, 0, 0);
@@ -344,6 +354,11 @@ ee_create_ae (GtkTable *table, char *str, CalendarAlarm *alarm, enum AlarmType t
alarm->w_entry = gtk_entry_new ();
gtk_table_attach (table, alarm->w_entry, 4, 5, y, y+1, FXS, FS, 0, 0);
gtk_entry_set_text (GTK_ENTRY (alarm->w_entry), alarm->data ? alarm->data : "");
+ if (dirty_func)
+ gtk_signal_connect (GTK_OBJECT (alarm->w_entry),
+ "changed",
+ GTK_SIGNAL_FUNC (dirty_func),
+ NULL);
break;
case ALARM_PROGRAM:
@@ -354,12 +369,17 @@ ee_create_ae (GtkTable *table, char *str, CalendarAlarm *alarm, enum AlarmType t
entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (alarm->w_entry));
gtk_entry_set_text (GTK_ENTRY (entry), alarm->data ? alarm->data : "");
gtk_table_attach (table, alarm->w_entry, 4, 5, y, y+1, FXS, FS, 0, 0);
+ if (dirty_func)
+ gtk_signal_connect (GTK_OBJECT (entry),
+ "changed",
+ GTK_SIGNAL_FUNC (dirty_func),
+ NULL);
break;
default:
break;
}
- gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (alarm->w_enabled), alarm->enabled);
+
ee_alarm_setting (alarm, alarm->enabled);
}
@@ -379,10 +399,10 @@ ee_alarm_widgets (EventEditor *ee)
mailto = gtk_label_new (_("Mail to:"));
mailte = gtk_entry_new ();
- ee_create_ae (GTK_TABLE (table), _("Display"), &ee->ical->dalarm, ALARM_DISPLAY, 1);
- ee_create_ae (GTK_TABLE (table), _("Audio"), &ee->ical->aalarm, ALARM_AUDIO, 2);
- ee_create_ae (GTK_TABLE (table), _("Program"), &ee->ical->palarm, ALARM_PROGRAM, 3);
- ee_create_ae (GTK_TABLE (table), _("Mail"), &ee->ical->malarm, ALARM_MAIL, 4);
+ ee_create_ae (GTK_TABLE (table), _("Display"), &ee->ical->dalarm, ALARM_DISPLAY, 1, TRUE, NULL);
+ ee_create_ae (GTK_TABLE (table), _("Audio"), &ee->ical->aalarm, ALARM_AUDIO, 2, TRUE, NULL);
+ ee_create_ae (GTK_TABLE (table), _("Program"), &ee->ical->palarm, ALARM_PROGRAM, 3, TRUE, NULL);
+ ee_create_ae (GTK_TABLE (table), _("Mail"), &ee->ical->malarm, ALARM_MAIL, 4, TRUE, NULL);
return l;
}
@@ -423,7 +443,7 @@ ee_classification_widgets (EventEditor *ee)
* Retrieves the information from the CalendarAlarm widgets and stores them
* on the CalendarAlarm generic values
*/
-static void
+void
ee_store_alarm (CalendarAlarm *alarm, enum AlarmType type)
{
GtkWidget *item;