[evolution-patches] Contact Quick-add Workflow



Here is a patch that skips the ugly preview window, and goes straight in
to the quick-add dialog if a contact doesn't exist, or to the editor, if
the contact already exists. This patch also fixes the quick-add dialog
to be HIG compliant. There are still other things that need to be done
with the quick-add code, but this at least greatly improves what the
user gets to see with the current code, in the available timeframe.

-- dobey


Index: addressbook/gui/contact-editor/e-contact-quick-add.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-quick-add.c,v
retrieving revision 1.37
diff -u -p -r1.37 e-contact-quick-add.c
--- addressbook/gui/contact-editor/e-contact-quick-add.c	21 Jan 2005 08:37:52 -0000	1.37
+++ addressbook/gui/contact-editor/e-contact-quick-add.c	21 Jan 2005 18:52:28 -0000
@@ -268,19 +268,26 @@ static GtkWidget *
 build_quick_add_dialog (QuickAdd *qa)
 {
 	GtkWidget *dialog;
+	GtkWidget *label;
 	GtkTable *table;
-	const gint xpad=6, ypad=6;
+	const gint xpad=0, ypad=0;
 
 	g_return_val_if_fail (qa != NULL, NULL);
 
 	dialog = gtk_dialog_new_with_buttons (_("Contact Quick-Add"),
 					      NULL, /* XXX */
-					      (GtkDialogFlags) 0,
+					      GTK_DIALOG_NO_SEPARATOR,
 					      _("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL,
-					        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 					      GTK_STOCK_OK, GTK_RESPONSE_OK,
 					      NULL);
 
+	gtk_widget_ensure_style (dialog);
+	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 
+					0);
+	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 
+					12);
+
 	g_signal_connect (dialog, "response", G_CALLBACK (clicked_cb), qa);
 
 	qa->name_entry = gtk_entry_new ();
@@ -293,27 +300,34 @@ build_quick_add_dialog (QuickAdd *qa)
 		gtk_entry_set_text (GTK_ENTRY (qa->email_entry), qa->email);
 
 	table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
+	gtk_table_set_row_spacings (table, 6);
+	gtk_table_set_col_spacings (table, 12);
 
-	gtk_table_attach (table, gtk_label_new_with_mnemonic (_("_Full Name:")),
+	label = gtk_label_new_with_mnemonic (_("_Full name:"));
+	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+
+	gtk_table_attach (table, label,
 			  0, 1, 0, 1,
-			  0, 0, xpad, ypad);
+			  GTK_FILL, 0, xpad, ypad);
 	gtk_table_attach (table, qa->name_entry,
 			  1, 2, 0, 1,
-			  GTK_EXPAND | GTK_FILL, GTK_EXPAND, xpad, ypad);
-	gtk_table_attach (table, gtk_label_new_with_mnemonic (_("E-_mail:")),
+			  GTK_EXPAND | GTK_FILL, 0, xpad, ypad);
+
+	label = gtk_label_new_with_mnemonic (_("E-_mail:"));
+	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+
+	gtk_table_attach (table, label,
 			  0, 1, 1, 2,
-			  0, 0, xpad, ypad);
+			  GTK_FILL, 0, xpad, ypad);
 	gtk_table_attach (table, qa->email_entry,
 			  1, 2, 1, 2,
-			  GTK_EXPAND | GTK_FILL, GTK_EXPAND, xpad, ypad);
-	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 
-					6);
-
-	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox),6);
+			  GTK_EXPAND | GTK_FILL, 0, xpad, ypad);
 
+	gtk_container_set_border_width (GTK_CONTAINER (table), 
+					12);
 	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
 			    GTK_WIDGET (table),
-			    TRUE, TRUE, 6);
+			    FALSE, FALSE, 0);
 	gtk_widget_show_all (GTK_WIDGET (table));
 			  
 	
Index: addressbook/gui/widgets/eab-popup-control.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/eab-popup-control.c,v
retrieving revision 1.11
diff -u -p -r1.11 eab-popup-control.c
--- addressbook/gui/widgets/eab-popup-control.c	7 Oct 2004 01:33:10 -0000	1.11
+++ addressbook/gui/widgets/eab-popup-control.c	21 Jan 2005 18:52:28 -0000
@@ -924,14 +924,6 @@ contact_editor_cb (EBook *book, EBookSta
 }
 
 static void
-edit_contact_info_cb (GtkWidget *button, EABPopupControl *pop)
-{
-	emit_event (pop, "Hide");
-
-	addressbook_load_default_book (contact_editor_cb, pop);
-}
-
-static void
 eab_popup_control_display_contact (EABPopupControl *pop, EContact *contact)
 {
 	GtkWidget *b;
@@ -943,23 +935,11 @@ eab_popup_control_display_contact (EABPo
 	pop->contact = contact;
 	g_object_ref (pop->contact);
 
-	eab_contact_display_render (EAB_CONTACT_DISPLAY (pop->contact_display),
-				    contact,
-				    EAB_CONTACT_DISPLAY_RENDER_COMPACT);
-	gtk_widget_show (pop->contact_display);
-	gtk_widget_hide (pop->generic_view);
-
-	b = gtk_button_new_with_label (_("Edit Contact Info"));
-	gtk_box_pack_start (GTK_BOX (pop->main_vbox), b, TRUE, TRUE, 0);
-	g_signal_connect (b,
-			  "clicked",
-			  G_CALLBACK (edit_contact_info_cb),
-			  pop);
-	gtk_widget_show (b);
+	addressbook_load_default_book (contact_editor_cb, pop);
 }
 
 static void
-add_contacts_cb (GtkWidget *button, EABPopupControl *pop)
+eab_popup_control_no_matches (EABPopupControl *pop)
 {
 	if (pop->email && *pop->email) {
 		if (pop->name && *pop->name)
@@ -970,23 +950,6 @@ add_contacts_cb (GtkWidget *button, EABP
 	}
 	eab_popup_control_cleanup (pop);
 	emit_event (pop, "Destroy");
-}
-
-static void
-eab_popup_control_no_matches (EABPopupControl *pop)
-{
-	GtkWidget *b;
-
-	g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
-
-	b = e_button_new_with_stock_icon (_("Add to Contacts"), "gtk-add");
-
-	gtk_box_pack_start (GTK_BOX (pop->main_vbox), b, TRUE, TRUE, 0);
-	g_signal_connect (b,
-			  "clicked",
-			  G_CALLBACK (add_contacts_cb),
-			  pop);
-	gtk_widget_show (b);
 }
 
 static void


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