[evolution-patches] [calendar-alarm] fix 317808



hi

modified alarm-notify.glade
and alarm-notify-dialog.c to 
include hours in snooze time
option of alarm notification dialog.

patch is attached.

regards
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2833
diff -u -p -w -r1.2833 ChangeLog
--- ChangeLog	21 Oct 2005 10:02:34 -0000	1.2833
+++ ChangeLog	21 Oct 2005 14:15:01 -0000
@@ -1,3 +1,19 @@
+2005-10-21  P. S. Chakravarthi <pchakravarthi novell com>
+
+	Fixes #317808
+	* gui/alarm-notify/alarm-notify.glade : modified snooze-time property to 
+	cater to snooze-time in minutes and hours.
+	* gui/alarm-notify/alarm-notify-dialog.c  
+	AlarmNotify : structure modified to include hours and minutes in snooze 
+	time.
+	(an_modified_hrs_label_cb): added
+	(an_modified_minutes_label): code modified to reflect the naming in the 
+	glade file.
+	(notified_alarms_dialog_new): another signal connect added for hours 
+	change call back
+	(snooze_pressed_cb): code modified to calculate snooze time in minutes 
+	from two parameters.
+
 2005-10-21  Mubeen Jukaku  <jmubeen novell com>
 
 	Sankar Committting for Mubeen
Index: gui/alarm-notify/alarm-notify-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-notify-dialog.c,v
retrieving revision 1.36
diff -u -p -w -r1.36 alarm-notify-dialog.c
--- gui/alarm-notify/alarm-notify-dialog.c	30 Sep 2005 14:39:40 -0000	1.36
+++ gui/alarm-notify/alarm-notify-dialog.c	21 Oct 2005 14:15:01 -0000
@@ -45,7 +45,6 @@
 #include <e-util/e-icon-factory.h>
 
 
-	
 enum {
 	ALARM_DISPLAY_COLUMN,
 	ALARM_SUMMARY_COLUMN,
@@ -71,8 +70,10 @@ typedef struct {
 	GladeXML *xml;
 
 	GtkWidget *dialog;
-	GtkWidget *snooze_time;
+	GtkWidget *snooze_time_min;
+	GtkWidget *snooze_time_hrs;
 	GtkWidget *minutes_label;
+	GtkWidget *hrs_label;
 	GtkWidget *description;
 	GtkWidget *location;
 	GtkWidget *treeview;
@@ -83,7 +84,6 @@ typedef struct {
 } AlarmNotify;
 
 
-
 static void
 tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data);
 
@@ -96,28 +96,41 @@ edit_pressed_cb (GtkButton *button, gpoi
 static void
 snooze_pressed_cb (GtkButton *button, gpointer user_data);
 
-
 AlarmNotify *an = NULL;
 gboolean have_one = FALSE;
 
 
-
 static void
 an_update_minutes_label (GtkSpinButton *sb, gpointer data)
 {
 	AlarmNotify *an;
 	char *new_label;
-	int snooze_timeout;
+	int snooze_timeout_min;
 
 	an = (AlarmNotify *) data;
 
-	snooze_timeout = gtk_spin_button_get_value_as_int (sb);
-	new_label = g_strdup (ngettext ("minute", "minutes", snooze_timeout));
+	snooze_timeout_min  = gtk_spin_button_get_value_as_int (sb);
+	new_label = g_strdup (ngettext ("minute", "minutes", snooze_timeout_min));
 	gtk_label_set_text (GTK_LABEL (an->minutes_label), new_label);
 	g_free (new_label);
 }
 
 static void
+an_update_hrs_label (GtkSpinButton *sb, gpointer data)
+{
+	AlarmNotify *an;
+	char *new_label;
+	int snooze_timeout_hrs;
+
+	an = (AlarmNotify *) data;
+
+	snooze_timeout_hrs  = gtk_spin_button_get_value_as_int (sb);
+	new_label = g_strdup (ngettext ("hours", "hours", snooze_timeout_hrs));
+	gtk_label_set_text (GTK_LABEL (an->hrs_label), new_label);
+	g_free (new_label);
+}
+
+static void
 dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data)
 {
 	AlarmNotify *an = user_data;
@@ -173,7 +186,8 @@ snooze_pressed_cb (GtkButton *button, gp
 
 	g_return_if_fail (funcinfo);
 
-	snooze_timeout = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time));
+	snooze_timeout = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time_min));
+	snooze_timeout += 60 * (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time_hrs)));
 	(* funcinfo->func) (ALARM_NOTIFY_SNOOZE, snooze_timeout, funcinfo->func_data);
 
 }
@@ -226,8 +240,10 @@ notified_alarms_dialog_new (void)
 	}
 	
 	an->dialog = glade_xml_get_widget (an->xml, "alarm-notify");
-	an->snooze_time = glade_xml_get_widget (an->xml, "snooze-time");
+	an->snooze_time_min = glade_xml_get_widget (an->xml, "snooze-time-min");
 	an->minutes_label = glade_xml_get_widget (an->xml, "minutes-label");
+	an->snooze_time_hrs = glade_xml_get_widget (an->xml, "snooze-time-hrs");
+	an->hrs_label = glade_xml_get_widget (an->xml, "hrs-label");
 	an->description = glade_xml_get_widget (an->xml, "description-label");
 	an->location = glade_xml_get_widget (an->xml, "location-label");
 	an->treeview = glade_xml_get_widget (an->xml, "appointments-treeview");
@@ -235,7 +251,7 @@ notified_alarms_dialog_new (void)
 	snooze_btn = glade_xml_get_widget (an->xml, "snooze-button");
 	edit_btn = glade_xml_get_widget (an->xml, "edit-button");
 
-	if (!(an->dialog && an->scrolledwindow && an->treeview && an->snooze_time
+	if (!(an->dialog && an->scrolledwindow && an->treeview && an->snooze_time_min && an->snooze_time_hrs 
 	      && an->description && an->location && edit_btn && snooze_btn)) {
 		g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!");
 		g_object_unref (an->xml);
@@ -283,8 +299,12 @@ notified_alarms_dialog_new (void)
 	}
 	
 	/* Set callback for updating the snooze "minutes" label */
-	g_signal_connect (G_OBJECT (an->snooze_time), "value_changed",
+	g_signal_connect (G_OBJECT (an->snooze_time_min), "value_changed",
 	 		G_CALLBACK (an_update_minutes_label), an);
+	
+	/* Set callback for updating the snooze "hours" label */
+	g_signal_connect (G_OBJECT (an->snooze_time_hrs), "value_changed",
+	 		G_CALLBACK (an_update_hrs_label), an);
 	
 	
 	na = g_new0 (AlarmNotificationsDialog, 1);
Index: gui/alarm-notify/alarm-notify.glade
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-notify.glade,v
retrieving revision 1.12
diff -u -p -w -r1.12 alarm-notify.glade
--- gui/alarm-notify/alarm-notify.glade	12 Aug 2005 13:55:51 -0000	1.12
+++ gui/alarm-notify/alarm-notify.glade	21 Oct 2005 14:15:01 -0000
@@ -195,9 +195,52 @@
 			      <property name="visible">True</property>
 			      <property name="homogeneous">False</property>
 			      <property name="spacing">6</property>
+			      <child>
+				<widget class="GtkSpinButton" id="snooze-time-hrs">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">False</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">False</property>
+				  <property name="wrap">False</property>
+				  <property name="adjustment">0 0 12 1 1 1</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="hrs-label">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">hours</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
 
 			      <child>
-				<widget class="GtkSpinButton" id="snooze-time">
+				<widget class="GtkSpinButton" id="snooze-time-min">
 				  <property name="visible">True</property>
 				  <property name="can_focus">True</property>
 				  <property name="climb_rate">1</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]