[evolution-patches] [addressbook]Patch to Fix 273921



Hi,

This patch fixes the Bug #273921 (Double-clicking on contact puts the
address in wrong field). 

Added 'section_index' and 'invoked_from_composer' to the structure
ENameSelectorDialog.
invoked_from_composer is for keeping track if the ENameSelectorDialog
was invoked from composer or not and section_index is for keeping
track of the button (To, Cc, Bcc) from which this dialog was invoked.
Earlier when a contact was double clicked it was added to the To field
irrespective of the button from which it was invoked, this was because
section index was hard coded as 0, now on double clicking contact gets
added to the appropriate field as we now have information that from
which button the dialog has been invoked.

Thanks,
Devashish  Sharma

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/ChangeLog,v
retrieving revision 1.57
diff -u -p -w -r1.57 ChangeLog
--- ChangeLog	25 Jul 2005 06:52:42 -0000	1.57
+++ ChangeLog	3 Aug 2005 10:39:32 -0000
@@ -1,3 +1,20 @@
+2005-08-03  Devashish Sharma <sdevashish novell com>
+
+	* e-name-selector-dialog.h:  Added 'section_index' and
+	'invoked_from_composer' to the structure ENameSelectorDialog.
+	invoked_from_composer is for keeping track if the ENameSelectorDialog
+	was invoked from composer or not and section_index is for keeping
+	track of the button (To, Cc, Bcc) from which this dialog was invoked.
+	Earlier when a contact was double clicked it was added to the To field
+	irrespective of the button from which it was invoked, this was because
+	section index was hard coded as 0, now on double clicking contact gets
+	added to the appropriate field as we now have information that from
+	which button the dialog has been invoked. 
+	* e-name-selector-dialog.c (contact_activated): Added check that if the dialog is invoked
+	from the composer double-clicking a contact adds it to the section
+	corresponding to the button from which it was invoked.
+	This solves the Bug #273921.
+		
 2005-07-24  Vivek Jain  <jvivek novell com>
 	
 	* e-name-selector-dialog.c: "Section" structure has two new members
Index: e-name-selector-dialog.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-name-selector-dialog.h,v
retrieving revision 1.1
diff -u -p -w -r1.1 e-name-selector-dialog.h
--- e-name-selector-dialog.h	17 Dec 2004 04:44:14 -0000	1.1
+++ e-name-selector-dialog.h	3 Aug 2005 10:19:48 -0000
@@ -70,6 +70,8 @@ struct ENameSelectorDialog {
 	GtkSizeGroup       *button_size_group;
 
 	GArray             *sections;
+	gint 		   section_index; 
+	gint 		   invoked_from_composer;	
 };
 
 GType                e_name_selector_dialog_get_type   (void);
Index: e-name-selector-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-name-selector-dialog.c,v
retrieving revision 1.18
diff -u -p -w -r1.18 e-name-selector-dialog.c
--- e-name-selector-dialog.c	25 Jul 2005 06:52:42 -0000	1.18
+++ e-name-selector-dialog.c	3 Aug 2005 10:39:12 -0000
@@ -721,6 +721,9 @@ contact_activated (ENameSelectorDialog *
 		return;
 	}
 
+	if(name_selector_dialog->invoked_from_composer == 1)
+		section = &g_array_index (name_selector_dialog->sections, Section, name_selector_dialog->section_index);
+	else
 		section = &g_array_index (name_selector_dialog->sections, Section, 0);
 	if (!e_name_selector_model_peek_section (name_selector_dialog->name_selector_model,
 						 section->name, NULL, &destination_store)) {
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.712
diff -u -p -w -r1.712 ChangeLog
--- ChangeLog	27 Jul 2005 10:55:23 -0000	1.712
+++ ChangeLog	3 Aug 2005 10:18:16 -0000
@@ -1,3 +1,9 @@
+2005-08-03 Devashish Sharma <sdevashish novell com>
+
+	* e-msg-composer-hdrs.c (address_button_clicked_cb): Assigning values
+	to section_index according to the button (To, Cc , Bcc) clicked .
+	Enhancement made to Fix #273921.
+	
 2005-07-27  Mengjie Yu  <meng-jie yu sun com>
 
 	* e-msg-composer-select-file.h:
Index: e-msg-composer-hdrs.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-hdrs.c,v
retrieving revision 1.142
diff -u -p -w -r1.142 e-msg-composer-hdrs.c
--- e-msg-composer-hdrs.c	21 Jul 2005 07:00:54 -0000	1.142
+++ e-msg-composer-hdrs.c	3 Aug 2005 10:09:51 -0000
@@ -190,12 +190,19 @@ address_button_clicked_cb (GtkButton *bu
 	hdrs = emchas->hdrs;
 	priv = hdrs->priv;
 	
-	if(button == (GtkButton *)hdrs->priv->to.label)
+	hdrs->priv->name_selector->dialog->invoked_from_composer=1 ;	
+	if(button == (GtkButton *)hdrs->priv->to.label) {
 		gtk_widget_grab_focus(hdrs->priv->to.entry);
-	else if(button == (GtkButton *)priv->cc.label)
+		hdrs->priv->name_selector->dialog->section_index = 0;
+	}
+	else if(button == (GtkButton *)priv->cc.label) {
 		gtk_widget_grab_focus(hdrs->priv->cc.entry);
-	else if(button == (GtkButton *)priv->bcc.label)
+		hdrs->priv->name_selector->dialog->section_index = 1;
+	}
+	else if(button == (GtkButton *)priv->bcc.label) {
 		gtk_widget_grab_focus(hdrs->priv->bcc.entry);
+		hdrs->priv->name_selector->dialog->section_index = 2;
+	}
 
 	name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector);
 	gtk_widget_show (GTK_WIDGET (name_selector_dialog));


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