Re: [evolution-patches] [addressbook] : Patch for Bug #241219



Hi,

Sending the revised patch with changes done.

thanks
Devashish

On Thu, 2005-08-18 at 09:26 +0530, Srinivasa Ragavan wrote:
> Looks fine except a few.
> On Tue, 2005-08-16 at 17:21 +0530, Devashish Sharma wrote:
> >  }
> >  
> > +response (GtkDialog *dialog, int response, EContactEditor *editor)
> It should be a static function with void return type.
> > +{
> > +       char *categories = NULL;
> > +       GtkWidget *entry = glade_xml_get_widget(editor->gui,
> > "entry-categories");
> > +       
> > +       if (response == GTK_RESPONSE_OK) {
> > +               categories = e_categories_dialog_get_categories
> > (E_CATEGORIES_DIALOG (dialog));
> > +               if (entry && GTK_IS_ENTRY(entry))
> > +                       gtk_entry_set_text (GTK_ENTRY (entry),
> > categories);
> > +               else
> > +                       e_contact_set (editor->contact,
> > E_CONTACT_CATEGORIES, categories);
> > +       }
> > +       gtk_widget_destroy(GTK_WIDGET(dialog));
> > +}
> > + 
> 
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1982
diff -u -p -r1.1982 ChangeLog
--- addressbook/ChangeLog	17 Aug 2005 11:12:03 -0000	1.1982
+++ addressbook/ChangeLog	19 Aug 2005 09:43:25 -0000
@@ -1,3 +1,9 @@
+2005-08-19  Devashish Sharma <sdevashish novell com>
+	
+	* gui/contact-editor/e-contact-editor.c (categories_clicked): Makes Edit
+	categories dialog non-modal.
+	Fixes Bug #241219
+
 2005-08-17  Devashish Sharma <sdevashish novell com>
 
 	*  gui/merging/eab-contact-compare.c (use_common_book_cb): When
Index: addressbook/gui/contact-editor/e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.240
diff -u -p -r1.240 e-contact-editor.c
--- addressbook/gui/contact-editor/e-contact-editor.c	10 Aug 2005 11:47:39 -0000	1.240
+++ addressbook/gui/contact-editor/e-contact-editor.c	19 Aug 2005 09:40:33 -0000
@@ -2544,11 +2544,26 @@ full_name_clicked (GtkWidget *button, EC
 }
 
 static void
+response (GtkDialog *dialog, int response, EContactEditor *editor)
+{
+	char *categories = NULL;
+	GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories");
+	
+	if (response == GTK_RESPONSE_OK) {
+		categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog));
+		if (entry && GTK_IS_ENTRY(entry))
+			gtk_entry_set_text (GTK_ENTRY (entry), categories);
+		else
+			e_contact_set (editor->contact, E_CONTACT_CATEGORIES, categories);
+	}
+	gtk_widget_destroy(GTK_WIDGET(dialog));
+}
+
+static void
 categories_clicked (GtkWidget *button, EContactEditor *editor)
 {
 	char *categories = NULL;
 	GtkDialog *dialog;
-	int result;
 	GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories");
 
 	if (entry && GTK_IS_ENTRY(entry))
@@ -2561,18 +2576,12 @@ categories_clicked (GtkWidget *button, E
 		g_free (categories);
 		return;
 	}
+
+	g_signal_connect(dialog, "response",
+			G_CALLBACK (response), editor);	
 	
 	gtk_widget_show(GTK_WIDGET(dialog));
-	result = gtk_dialog_run (dialog);
 	g_free (categories);
-	if (result == GTK_RESPONSE_OK) {
-		categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog));
-		if (entry && GTK_IS_ENTRY(entry))
-			gtk_entry_set_text (GTK_ENTRY (entry), categories);
-		else
-			e_contact_set (editor->contact, E_CONTACT_CATEGORIES, categories);
-	}
-	gtk_widget_destroy(GTK_WIDGET(dialog));
 }
 
 static void


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