~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to libedataserverui/e-name-selector-entry.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
303
303
        if (n_addresses <= 0)
304
304
                /* Chain up to parent's drag_data_received() method. */
305
305
                GTK_WIDGET_CLASS (e_name_selector_entry_parent_class)->
306
 
                        drag_data_received (widget, context, x, y,
307
 
                        selection_data, info, time);
 
306
                        drag_data_received (
 
307
                                widget, context, x, y,
 
308
                                selection_data, info, time);
308
309
}
309
310
 
310
311
static void
767
768
        file_as_query_str   = name_style_query ("file_as",   cue_str);
768
769
        user_fields_str     = ens_util_populate_user_query_fields (priv->user_query_fields, cue_str, encoded_cue_str);
769
770
 
770
 
        query_str = g_strdup_printf ("(or "
771
 
                                     " (beginswith \"nickname\"  %s) "
772
 
                                     " (beginswith \"email\"     %s) "
773
 
                                     " %s "
774
 
                                     " %s "
775
 
                                     " %s "
776
 
                                     ")",
777
 
                                     encoded_cue_str, encoded_cue_str,
778
 
                                     full_name_query_str, file_as_query_str,
779
 
                                     user_fields_str ? user_fields_str : "");
 
771
        query_str = g_strdup_printf (
 
772
                "(or "
 
773
                " (beginswith \"nickname\"  %s) "
 
774
                " (beginswith \"email\"     %s) "
 
775
                " %s "
 
776
                " %s "
 
777
                " %s "
 
778
                ")",
 
779
                encoded_cue_str, encoded_cue_str,
 
780
                full_name_query_str, file_as_query_str,
 
781
                user_fields_str ? user_fields_str : "");
780
782
 
781
783
        g_free (user_fields_str);
782
784
        g_free (file_as_query_str);
1095
1097
        textrep_len = g_utf8_strlen (textrep, -1);
1096
1098
        pos         = range_start;
1097
1099
 
1098
 
        g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry);
1099
 
        g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry);
1100
 
        g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
1101
 
                                         destination_row_changed, name_selector_entry);
 
1100
        g_signal_handlers_block_by_func (
 
1101
                name_selector_entry,
 
1102
                user_insert_text, name_selector_entry);
 
1103
        g_signal_handlers_block_by_func (
 
1104
                name_selector_entry,
 
1105
                user_delete_text, name_selector_entry);
 
1106
        g_signal_handlers_block_by_func (
 
1107
                name_selector_entry->priv->destination_store,
 
1108
                destination_row_changed, name_selector_entry);
1102
1109
 
1103
1110
        if (textrep_len > range_len) {
1104
1111
                gint i;
1107
1114
                for (i = 0; textrep[i] && cue_str[i]; i++)
1108
1115
                        textrep[i] = cue_str[i];
1109
1116
 
1110
 
                gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end);
1111
 
                gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), textrep, -1, &pos);
1112
 
                gtk_editable_select_region (GTK_EDITABLE (name_selector_entry), range_end,
1113
 
                                            range_start + textrep_len);
 
1117
                gtk_editable_delete_text (
 
1118
                        GTK_EDITABLE (name_selector_entry),
 
1119
                        range_start, range_end);
 
1120
                gtk_editable_insert_text (
 
1121
                        GTK_EDITABLE (name_selector_entry),
 
1122
                        textrep, -1, &pos);
 
1123
                gtk_editable_select_region (
 
1124
                        GTK_EDITABLE (name_selector_entry),
 
1125
                        range_end, range_start + textrep_len);
1114
1126
                priv->is_completing = TRUE;
1115
1127
        }
1116
1128
        g_free (cue_str);
1127
1139
                generate_attribute_list (name_selector_entry);
1128
1140
        }
1129
1141
 
1130
 
        g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
1131
 
                                           destination_row_changed, name_selector_entry);
 
1142
        g_signal_handlers_unblock_by_func (
 
1143
                name_selector_entry->priv->destination_store,
 
1144
                destination_row_changed, name_selector_entry);
1132
1145
        g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry);
1133
1146
        g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry);
1134
1147
 
1205
1218
        destination = build_destination_at_position (text, pos);
1206
1219
        g_assert (destination);
1207
1220
 
1208
 
        g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
1209
 
                                         destination_row_inserted, name_selector_entry);
1210
 
        e_destination_store_insert_destination (name_selector_entry->priv->destination_store,
 
1221
        g_signal_handlers_block_by_func (
 
1222
                name_selector_entry->priv->destination_store,
 
1223
                destination_row_inserted, name_selector_entry);
 
1224
        e_destination_store_insert_destination (
 
1225
                name_selector_entry->priv->destination_store,
1211
1226
                                                index, destination);
1212
 
        g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
1213
 
                                           destination_row_inserted, name_selector_entry);
 
1227
        g_signal_handlers_unblock_by_func (
 
1228
                name_selector_entry->priv->destination_store,
 
1229
                destination_row_inserted, name_selector_entry);
1214
1230
        g_object_unref (destination);
1215
1231
}
1216
1232
 
1234
1250
        if (e_destination_get_contact (destination))
1235
1251
                rebuild_attributes = TRUE;
1236
1252
 
1237
 
        g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
1238
 
                                         destination_row_changed, name_selector_entry);
 
1253
        g_signal_handlers_block_by_func (
 
1254
                name_selector_entry->priv->destination_store,
 
1255
                destination_row_changed, name_selector_entry);
1239
1256
        e_destination_set_raw (destination, raw_address);
1240
 
        g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
1241
 
                                           destination_row_changed, name_selector_entry);
 
1257
        g_signal_handlers_unblock_by_func (
 
1258
                name_selector_entry->priv->destination_store,
 
1259
                destination_row_changed, name_selector_entry);
1242
1260
 
1243
1261
        g_free (raw_address);
1244
1262
 
1329
1347
 
1330
1348
        destination = find_destination_by_index (name_selector_entry, index);
1331
1349
        if (destination) {
1332
 
                g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
1333
 
                                         destination_row_deleted, name_selector_entry);
1334
 
                e_destination_store_remove_destination (name_selector_entry->priv->destination_store,
 
1350
                g_signal_handlers_block_by_func (
 
1351
                        name_selector_entry->priv->destination_store,
 
1352
                        destination_row_deleted, name_selector_entry);
 
1353
                e_destination_store_remove_destination (
 
1354
                        name_selector_entry->priv->destination_store,
1335
1355
                                                destination);
1336
 
                g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
1337
 
                                           destination_row_deleted, name_selector_entry);
 
1356
                g_signal_handlers_unblock_by_func (
 
1357
                        name_selector_entry->priv->destination_store,
 
1358
                        destination_row_deleted, name_selector_entry);
1338
1359
        }
1339
1360
}
1340
1361
 
1658
1679
                        }
1659
1680
                }
1660
1681
        }
1661
 
        gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry),
1662
 
                                  start_pos, end_pos);
 
1682
        gtk_editable_delete_text (
 
1683
                GTK_EDITABLE (name_selector_entry),
 
1684
                start_pos, end_pos);
1663
1685
 
1664
1686
        /*If the user is deleting a '"' new destinations have to be created for ',' between the quoted text
1665
1687
         Like "fd,ty,uy" is a one entity, but if you remove the quotes it has to be broken doan into 3 seperate
1719
1741
 
1720
1742
        g_return_val_if_fail (name_selector_entry->priv->email_generator == email_generator_model, FALSE);
1721
1743
 
1722
 
        e_tree_model_generator_convert_iter_to_child_iter (email_generator_model,
1723
 
                                                           &contact_iter, &email_n,
1724
 
                                                           generator_iter);
 
1744
        e_tree_model_generator_convert_iter_to_child_iter (
 
1745
                email_generator_model,
 
1746
                &contact_iter, &email_n,
 
1747
                generator_iter);
1725
1748
 
1726
1749
        contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_iter);
1727
1750
        book_client = e_contact_store_get_client (name_selector_entry->priv->contact_store, &contact_iter);
2004
2027
        if (!name_selector_entry->priv->contact_store)
2005
2028
                return;
2006
2029
 
2007
 
        gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model),
2008
 
                                                          &generator_iter, iter);
2009
 
        e_tree_model_generator_convert_iter_to_child_iter (name_selector_entry->priv->email_generator,
2010
 
                                                           &contact_store_iter, &email_n,
2011
 
                                                           &generator_iter);
 
2030
        gtk_tree_model_filter_convert_iter_to_child_iter (
 
2031
                GTK_TREE_MODEL_FILTER (model),
 
2032
                &generator_iter, iter);
 
2033
        e_tree_model_generator_convert_iter_to_child_iter (
 
2034
                name_selector_entry->priv->email_generator,
 
2035
                &contact_store_iter, &email_n,
 
2036
                &generator_iter);
2012
2037
 
2013
2038
        contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_store_iter);
2014
2039
        if (!contact) {
2080
2105
        if (!name_selector_entry->priv->contact_store)
2081
2106
                return;
2082
2107
 
2083
 
        gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model),
2084
 
                                                          &generator_iter, iter);
2085
 
        e_tree_model_generator_convert_iter_to_child_iter (name_selector_entry->priv->email_generator,
2086
 
                                                           &contact_store_iter, &email_n,
2087
 
                                                           &generator_iter);
 
2108
        gtk_tree_model_filter_convert_iter_to_child_iter (
 
2109
                GTK_TREE_MODEL_FILTER (model),
 
2110
                &generator_iter, iter);
 
2111
        e_tree_model_generator_convert_iter_to_child_iter (
 
2112
                name_selector_entry->priv->email_generator,
 
2113
                &contact_store_iter, &email_n,
 
2114
                &generator_iter);
2088
2115
 
2089
2116
        contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_store_iter);
2090
2117
        email_list = e_contact_get (contact, E_CONTACT_EMAIL);
2094
2121
        if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
2095
2122
                string = g_strdup_printf ("%s", file_as_str ? file_as_str : "?");
2096
2123
        } else {
2097
 
                string = g_strdup_printf ("%s%s<%s>", file_as_str ? file_as_str : "",
2098
 
                                          file_as_str ? " " : "",
2099
 
                                          email_str ? email_str : "");
 
2124
                string = g_strdup_printf (
 
2125
                        "%s%s<%s>", file_as_str ? file_as_str : "",
 
2126
                        file_as_str ? " " : "",
 
2127
                        email_str ? email_str : "");
2100
2128
        }
2101
2129
 
2102
2130
        g_free (file_as_str);
2136
2164
static void
2137
2165
ensure_type_ahead_complete_on_timeout (ENameSelectorEntry *name_selector_entry)
2138
2166
{
2139
 
        re_set_timeout (name_selector_entry->priv->type_ahead_complete_cb_id, type_ahead_complete_on_timeout_cb, name_selector_entry);
 
2167
        re_set_timeout (
 
2168
                name_selector_entry->priv->type_ahead_complete_cb_id,
 
2169
                type_ahead_complete_on_timeout_cb, name_selector_entry);
 
2170
}
 
2171
 
 
2172
static gboolean
 
2173
is_source_enabled_with_parents (ESourceRegistry *registry,
 
2174
                                ESource *source)
 
2175
{
 
2176
        ESource *parent;
 
2177
        const gchar *parent_uid;
 
2178
 
 
2179
        g_return_val_if_fail (registry != NULL, FALSE);
 
2180
        g_return_val_if_fail (source != NULL, FALSE);
 
2181
 
 
2182
        if (!e_source_get_enabled (source))
 
2183
                return FALSE;
 
2184
 
 
2185
        parent = g_object_ref (source);
 
2186
        while (parent_uid = e_source_get_parent (parent), parent_uid) {
 
2187
                ESource *next = e_source_registry_ref_source (registry, parent_uid);
 
2188
 
 
2189
                if (!next)
 
2190
                        break;
 
2191
 
 
2192
                g_object_unref (parent);
 
2193
 
 
2194
                if (!e_source_get_enabled (next)) {
 
2195
                        g_object_unref (next);
 
2196
                        return FALSE;
 
2197
                }
 
2198
 
 
2199
                parent = next;
 
2200
        }
 
2201
 
 
2202
        g_object_unref (parent);
 
2203
 
 
2204
        return TRUE;
2140
2205
}
2141
2206
 
2142
2207
static void
2149
2214
 
2150
2215
        if (name_selector_entry->priv->contact_store) {
2151
2216
                name_selector_entry->priv->email_generator =
2152
 
                        e_tree_model_generator_new (GTK_TREE_MODEL (name_selector_entry->priv->contact_store));
 
2217
                        e_tree_model_generator_new (
 
2218
                                GTK_TREE_MODEL (
 
2219
                                name_selector_entry->priv->contact_store));
2153
2220
 
2154
 
                e_tree_model_generator_set_generate_func (name_selector_entry->priv->email_generator,
2155
 
                                                          (ETreeModelGeneratorGenerateFunc) generate_contact_rows,
2156
 
                                                          name_selector_entry, NULL);
 
2221
                e_tree_model_generator_set_generate_func (
 
2222
                        name_selector_entry->priv->email_generator,
 
2223
                        (ETreeModelGeneratorGenerateFunc) generate_contact_rows,
 
2224
                        name_selector_entry, NULL);
2157
2225
 
2158
2226
                /* Assign the store to the entry completion */
2159
2227
 
2160
 
                gtk_entry_completion_set_model (name_selector_entry->priv->entry_completion,
2161
 
                                                GTK_TREE_MODEL (name_selector_entry->priv->email_generator));
 
2228
                gtk_entry_completion_set_model (
 
2229
                        name_selector_entry->priv->entry_completion,
 
2230
                        GTK_TREE_MODEL (
 
2231
                        name_selector_entry->priv->email_generator));
2162
2232
 
2163
2233
                /* Set up callback for incoming matches */
2164
 
                g_signal_connect_swapped (name_selector_entry->priv->contact_store, "row-inserted",
2165
 
                                          G_CALLBACK (ensure_type_ahead_complete_on_timeout), name_selector_entry);
 
2234
                g_signal_connect_swapped (
 
2235
                        name_selector_entry->priv->contact_store, "row-inserted",
 
2236
                        G_CALLBACK (ensure_type_ahead_complete_on_timeout), name_selector_entry);
2166
2237
        } else {
2167
2238
                /* Remove the store from the entry completion */
2168
2239
 
2239
2310
                extension = e_source_get_extension (source, extension_name);
2240
2311
 
2241
2312
                /* Skip disabled address books. */
2242
 
                if (!e_source_get_enabled (source))
 
2313
                if (!is_source_enabled_with_parents (registry, source))
2243
2314
                        continue;
2244
2315
 
2245
2316
                /* Skip non-completion address books. */
2433
2504
{
2434
2505
        GtkTreeIter  iter;
2435
2506
 
2436
 
        g_signal_connect_swapped (name_selector_entry->priv->destination_store, "row-changed",
2437
 
                                  G_CALLBACK (destination_row_changed), name_selector_entry);
2438
 
        g_signal_connect_swapped (name_selector_entry->priv->destination_store, "row-deleted",
2439
 
                                  G_CALLBACK (destination_row_deleted), name_selector_entry);
2440
 
        g_signal_connect_swapped (name_selector_entry->priv->destination_store, "row-inserted",
2441
 
                                  G_CALLBACK (destination_row_inserted), name_selector_entry);
 
2507
        g_signal_connect_swapped (
 
2508
                name_selector_entry->priv->destination_store, "row-changed",
 
2509
                G_CALLBACK (destination_row_changed), name_selector_entry);
 
2510
        g_signal_connect_swapped (
 
2511
                name_selector_entry->priv->destination_store, "row-deleted",
 
2512
                G_CALLBACK (destination_row_deleted), name_selector_entry);
 
2513
        g_signal_connect_swapped (
 
2514
                name_selector_entry->priv->destination_store, "row-inserted",
 
2515
                G_CALLBACK (destination_row_inserted), name_selector_entry);
2442
2516
 
2443
2517
        if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (name_selector_entry->priv->destination_store), &iter))
2444
2518
                return;
2475
2549
                name_selector_entry->priv->popup_destination = NULL;
2476
2550
        }
2477
2551
 
2478
 
        gtk_entry_get_layout_offsets (GTK_ENTRY (name_selector_entry),
2479
 
                                      &layout_offset_x, &layout_offset_y);
 
2552
        gtk_entry_get_layout_offsets (
 
2553
                GTK_ENTRY (name_selector_entry),
 
2554
                &layout_offset_x, &layout_offset_y);
2480
2555
        x = (event_button->x + 0.5) - layout_offset_x;
2481
2556
        y = (event_button->y + 0.5) - layout_offset_y;
2482
2557
 
2490
2565
        index = gtk_entry_layout_index_to_text_index (GTK_ENTRY (name_selector_entry), index);
2491
2566
        destination = find_destination_at_position (name_selector_entry, index);
2492
2567
        /* FIXME: Add this to a private variable, in ENameSelectorEntry Class*/
2493
 
        g_object_set_data ((GObject *)name_selector_entry, "index", GINT_TO_POINTER(index));
 
2568
        g_object_set_data ((GObject *) name_selector_entry, "index", GINT_TO_POINTER (index));
2494
2569
 
2495
2570
        if (!destination || !e_destination_get_contact (destination))
2496
2571
                return FALSE;
2600
2675
        struct _camel_header_address *address;
2601
2676
        gboolean res = FALSE;
2602
2677
 
2603
 
        address = camel_header_address_decode (string, "UTF-8");
 
2678
        address = camel_header_address_decode (string, "UTF-8");
2604
2679
 
2605
2680
        if (!address)
2606
2681
                return FALSE;
2627
2702
        gint position, start, end;
2628
2703
        const GList *dests;
2629
2704
 
2630
 
        position = GPOINTER_TO_INT(g_object_get_data ((GObject *)name_selector_entry, "index"));
 
2705
        position = GPOINTER_TO_INT (g_object_get_data ((GObject *) name_selector_entry, "index"));
2631
2706
 
2632
2707
        for (dests = e_destination_list_get_dests (destination); dests; dests = dests->next) {
2633
2708
                const EDestination *dest = dests->data;
2716
2791
 
2717
2792
                contact_list_editor = (*name_selector_entry->priv->contact_list_editor_func) (book_client, contact, FALSE, TRUE);
2718
2793
                g_object_ref (name_selector_entry);
2719
 
                g_signal_connect (contact_list_editor, "editor_closed",
2720
 
                                  G_CALLBACK (editor_closed_cb), name_selector_entry);
 
2794
                g_signal_connect (
 
2795
                        contact_list_editor, "editor_closed",
 
2796
                        G_CALLBACK (editor_closed_cb), name_selector_entry);
2721
2797
        } else {
2722
2798
                GtkWidget *contact_editor;
2723
2799
 
2726
2802
 
2727
2803
                contact_editor = (*name_selector_entry->priv->contact_editor_func) (book_client, contact, FALSE, TRUE);
2728
2804
                g_object_ref (name_selector_entry);
2729
 
                g_signal_connect (contact_editor, "editor_closed",
2730
 
                                  G_CALLBACK (editor_closed_cb), name_selector_entry);
 
2805
                g_signal_connect (
 
2806
                        contact_editor, "editor_closed",
 
2807
                        G_CALLBACK (editor_closed_cb), name_selector_entry);
2731
2808
        }
2732
2809
}
2733
2810
 
2898
2975
 
2899
2976
                        if (length > 1) {
2900
2977
                                menu_item = gtk_check_menu_item_new_with_label (email);
2901
 
                                g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);
 
2978
                                g_signal_connect (
 
2979
                                        menu_item, "toggled",
 
2980
                                        G_CALLBACK (destination_set_list), dest);
2902
2981
                        } else {
2903
2982
                                menu_item = gtk_menu_item_new_with_label (email);
2904
2983
                        }
2908
2987
                        show_menu = TRUE;
2909
2988
 
2910
2989
                        if (length > 1) {
2911
 
                                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), !e_destination_is_ignored (dest));
2912
 
                                g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_list),
2913
 
                                                          dest);
 
2990
                                gtk_check_menu_item_set_active (
 
2991
                                        GTK_CHECK_MENU_ITEM (menu_item),
 
2992
                                        !e_destination_is_ignored (dest));
 
2993
                                g_signal_connect_swapped (
 
2994
                                        menu_item, "activate",
 
2995
                                        G_CALLBACK (popup_activate_list), dest);
2914
2996
                        }
2915
2997
                }
2916
2998
 
2939
3021
 
2940
3022
                        if (i == email_num && len > 1) {
2941
3023
                                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
2942
 
                                g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_email),
2943
 
                                                          name_selector_entry);
 
3024
                                g_signal_connect_swapped (
 
3025
                                        menu_item, "activate",
 
3026
                                        G_CALLBACK (popup_activate_email),
 
3027
                                        name_selector_entry);
2944
3028
                        }
2945
3029
                }
2946
3030
        }
2956
3040
        /* Expand a list inline */
2957
3041
        if (is_list) {
2958
3042
                /* To Translators: This would be similiar to "Expand MyList Inline" where MyList is a Contact List*/
2959
 
                edit_label = g_strdup_printf (_("E_xpand %s Inline"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 
3043
                edit_label = g_strdup_printf (_("E_xpand %s Inline"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
2960
3044
                menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
2961
3045
                g_free (edit_label);
2962
3046
                gtk_widget_show (menu_item);
2963
3047
                gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
2964
 
                g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_inline_expand),
2965
 
                                          name_selector_entry);
 
3048
                g_signal_connect_swapped (
 
3049
                        menu_item, "activate", G_CALLBACK (popup_activate_inline_expand),
 
3050
                        name_selector_entry);
2966
3051
 
2967
3052
                /* Separator */
2968
3053
                menu_item = gtk_separator_menu_item_new ();
2971
3056
        }
2972
3057
 
2973
3058
        /* Copy Contact Item */
2974
 
        copy_label = g_strdup_printf (_("Cop_y %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 
3059
        copy_label = g_strdup_printf (_("Cop_y %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
2975
3060
        menu_item = gtk_menu_item_new_with_mnemonic (copy_label);
2976
3061
        g_free (copy_label);
2977
3062
        gtk_widget_show (menu_item);
2978
3063
        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
2979
3064
 
2980
 
        g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_copy),
2981
 
                                  name_selector_entry);
 
3065
        g_signal_connect_swapped (
 
3066
                menu_item, "activate", G_CALLBACK (popup_activate_copy),
 
3067
                name_selector_entry);
2982
3068
 
2983
3069
        /* Cut Contact Item */
2984
 
        cut_label = g_strdup_printf (_("C_ut %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 
3070
        cut_label = g_strdup_printf (_("C_ut %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
2985
3071
        menu_item = gtk_menu_item_new_with_mnemonic (cut_label);
2986
3072
        g_free (cut_label);
2987
3073
        gtk_widget_show (menu_item);
2988
3074
        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
2989
3075
 
2990
 
        g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_cut),
2991
 
                                  name_selector_entry);
 
3076
        g_signal_connect_swapped (
 
3077
                menu_item, "activate", G_CALLBACK (popup_activate_cut),
 
3078
                name_selector_entry);
2992
3079
 
2993
3080
        if (show_menu) {
2994
3081
                menu_item = gtk_separator_menu_item_new ();
2998
3085
 
2999
3086
        /* Edit Contact item */
3000
3087
 
3001
 
        edit_label = g_strdup_printf (_("_Edit %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
 
3088
        edit_label = g_strdup_printf (_("_Edit %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
3002
3089
        menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
3003
3090
        g_free (edit_label);
3004
3091
        gtk_widget_show (menu_item);
3005
3092
        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
3006
3093
 
3007
 
        g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_contact),
3008
 
                                  name_selector_entry);
 
3094
        g_signal_connect_swapped (
 
3095
                menu_item, "activate", G_CALLBACK (popup_activate_contact),
 
3096
                name_selector_entry);
3009
3097
 
3010
3098
        deep_free_list (email_list);
3011
3099
}