aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c14
2 files changed, 16 insertions, 4 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 42c2ec1432..79e9fae852 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-10 Sushma Rai <rsushma@novell.com>
+
+ * gui/contact-editor/e-contact-editor.c (fill_in_address_textview):
+ Not inserting new line at the end and also, placing the cursor at
+ the beginning of the widget. Fixes #300300.
+
2005-12-06 Veerapuram Varadhan <vvaradhan@novell.com>
* conduits/addressbook-conduit.c: (pre_sync):
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index b9757bbdfd..387111ed21 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -1714,7 +1714,7 @@ fill_in_address_textview (EContactEditor *editor, gint record, EContactAddress *
gchar *textview_name;
GtkWidget *textview;
GtkTextBuffer *text_buffer;
- GtkTextIter iter;
+ GtkTextIter iter_end, iter_start;
textview_name = g_strdup_printf ("textview-%s-address", address_name [record]);
textview = glade_xml_get_widget (editor->gui, textview_name);
@@ -1723,9 +1723,15 @@ fill_in_address_textview (EContactEditor *editor, gint record, EContactAddress *
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
gtk_text_buffer_set_text (text_buffer, address->street ? address->street : "", -1);
- gtk_text_buffer_get_end_iter (text_buffer, &iter);
- gtk_text_buffer_insert (text_buffer, &iter, "\n", -1);
- gtk_text_buffer_insert (text_buffer, &iter, address->ext ? address->ext : "", -1);
+ gtk_text_buffer_get_end_iter (text_buffer, &iter_end);
+ if (address->ext) {
+ gtk_text_buffer_insert (text_buffer, &iter_end, "\n", -1);
+ gtk_text_buffer_insert (text_buffer, &iter_end, address->ext, -1);
+ } else {
+ gtk_text_buffer_insert (text_buffer, &iter_end, "", -1);
+ }
+ gtk_text_buffer_get_iter_at_line (text_buffer, &iter_start, 0);
+ gtk_text_buffer_place_cursor (text_buffer, &iter_start);
}
static void