aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-list-editor/e-contact-list-editor.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-06 04:52:01 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-06 04:52:01 +0800
commit1c4fe770ac9faad5103a520598f1755186cf248c (patch)
tree282fa9cb42575ce4a6441e6aea9b61abe1ac9871 /addressbook/gui/contact-list-editor/e-contact-list-editor.c
parent7547460503d6d937f93406d01e1feb23e61f6872 (diff)
downloadgsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar
gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.gz
gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.bz2
gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.lz
gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.xz
gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.zst
gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.zip
Check to make sure our call to e_addressbook_model_get_card doesn't return
2001-10-05 Jon Trowbridge <trow@ximian.com> * gui/component/select-names/e-select-names.c (real_add_address_cb): Check to make sure our call to e_addressbook_model_get_card doesn't return NULL. * gui/widgets/e-addressbook-model.c (e_addressbook_model_get_card): Chek that we aren't requesting a negative row. * gui/contact-list-editor/e-contact-list-editor.c (add_email_cb): Move to the bottom of the scrolled window, so we can see the address we just added. (table_drag_data_received_cb): Move to the bottom of the scrolled window, so we can see the contact we just dropped. * gui/component/addressbook.c (addressbook_factory_new_control): We don't own the string returned by e_categories_master_list_nth, so terrible things will happen if we free it. (Bug 10916) svn path=/trunk/; revision=13469
Diffstat (limited to 'addressbook/gui/contact-list-editor/e-contact-list-editor.c')
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 92919c402e..041bf6d9d8 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -593,11 +593,17 @@ e_contact_list_editor_create_table(gchar *name,
static void
add_email_cb (GtkWidget *w, EContactListEditor *editor)
{
+ GtkAdjustment *adj = e_scroll_frame_get_vadjustment (E_SCROLL_FRAME (editor->table));
char *text = gtk_entry_get_text (GTK_ENTRY(editor->email_entry));
- if (text && *text)
+ if (text && *text) {
e_contact_list_model_add_email (E_CONTACT_LIST_MODEL(editor->model), text);
+ /* Skip to the end of the list */
+ if (adj->upper - adj->lower > adj->page_size)
+ gtk_adjustment_set_value (adj, adj->upper);
+ }
+
gtk_entry_set_text (GTK_ENTRY(editor->email_entry), "");
if (!editor->changed) {
@@ -720,12 +726,14 @@ table_drag_data_received_cb (ETable *table, int row, int col,
GtkSelectionData *selection_data,
guint info, guint time, EContactListEditor *editor)
{
+ GtkAdjustment *adj = e_scroll_frame_get_vadjustment (E_SCROLL_FRAME (editor->table));
char *target_type;
gboolean changed = FALSE;
target_type = gdk_atom_name (selection_data->target);
if (!strcmp (target_type, VCARD_TYPE)) {
+
GList *card_list = e_card_load_cards_from_string_with_default_charset (selection_data->data, "ISO-8859-1");
GList *c;
@@ -745,6 +753,10 @@ table_drag_data_received_cb (ETable *table, int row, int col,
}
g_list_foreach (card_list, (GFunc)gtk_object_unref, NULL);
g_list_free (card_list);
+
+ /* Skip to the end of the list */
+ if (adj->upper - adj->lower > adj->page_size)
+ gtk_adjustment_set_value (adj, adj->upper);
}
if (changed && !editor->changed) {