aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-attachment-bar.c')
-rw-r--r--widgets/misc/e-attachment-bar.c101
1 files changed, 0 insertions, 101 deletions
diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c
index 2da9d3541c..316aa85a0e 100644
--- a/widgets/misc/e-attachment-bar.c
+++ b/widgets/misc/e-attachment-bar.c
@@ -76,9 +76,6 @@ static GnomeIconListClass *parent_class = NULL;
struct _EAttachmentBarPrivate {
GtkWidget *attach; /* attachment file dialogue, if active */
- /* Recent documents. Use this widget directly when bonoboui is obsoleted */
- GtkWidget *recent;
-
gboolean batch_unref;
GPtrArray *attachments;
char *path;
@@ -791,9 +788,6 @@ destroy (GtkObject *object)
if (priv->attach)
gtk_widget_destroy (priv->attach);
- if (priv->recent)
- gtk_widget_destroy (priv->recent);
-
if (priv->path)
g_free (priv->path);
@@ -1065,14 +1059,6 @@ init (EAttachmentBar *bar)
priv->batch_unref = FALSE;
priv->attachments = g_ptr_array_new ();
- priv->recent = gtk_recent_chooser_menu_new ();
- gtk_recent_chooser_menu_set_show_numbers (GTK_RECENT_CHOOSER_MENU (priv->recent), TRUE);
- gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (priv->recent), GTK_RECENT_SORT_MRU);
- gtk_recent_chooser_set_show_not_found (GTK_RECENT_CHOOSER (priv->recent), FALSE);
- gtk_recent_chooser_set_show_private (GTK_RECENT_CHOOSER (priv->recent), FALSE);
- gtk_recent_chooser_set_show_icons (GTK_RECENT_CHOOSER (priv->recent), TRUE);
- gtk_recent_chooser_set_show_tips (GTK_RECENT_CHOOSER (priv->recent), TRUE);
-
priv->path = NULL;
bar->priv = priv;
@@ -1297,7 +1283,6 @@ void
e_attachment_bar_refresh (EAttachmentBar *bar)
{
update (bar);
-
}
int
@@ -1352,92 +1337,6 @@ e_attachment_bar_attach_mime_part (EAttachmentBar *bar, CamelMimePart *part)
add_from_mime_part (bar, part);
}
-/* FIXME: Remove this API if nobody uses it */
-void
-e_attachment_bar_bonobo_ui_populate_with_recent (BonoboUIComponent *uic, const char *path,
- EAttachmentBar *bar,
- BonoboUIVerbFn verb_cb, gpointer user_data)
-{
- struct _EAttachmentBarPrivate *priv;
- GList *items, *l;
- gint limit, i;
- GString *menuitems;
- char *encoded_label, *label;
-
- g_return_if_fail (E_IS_ATTACHMENT_BAR (bar));
-
- priv = bar->priv;
- limit = gtk_recent_chooser_get_limit (GTK_RECENT_CHOOSER (priv->recent));
- items = gtk_recent_chooser_get_items (GTK_RECENT_CHOOSER (priv->recent));
-
- menuitems = g_string_new ("<submenu");
- g_string_append (menuitems, " name=\"RecentDocsSubmenu\"");
- g_string_append_printf (menuitems, " sensitive=\"%s\"", items ? "1" : "0");
- g_string_append_printf (menuitems, " label=\"%s\"", _("Recent _Documents"));
- g_string_append (menuitems, ">\n");
-
- for (l = g_list_first (items), i = 1; l && i <= limit; l = l->next, ++i) {
- GtkRecentInfo *info = ((GtkRecentInfo *)(l->data));
- const gchar *info_dn = gtk_recent_info_get_display_name (info);
- char *display_name, *u;
-
- /* escape _'s in the display name so that it doesn't become an underline in a GtkLabel */
- if ((u = strchr (info_dn, '_'))) {
- int extra = 1;
- char *d;
- const char *s;
-
- while ((u = strchr (u + 1, '_')))
- extra++;
-
- d = display_name = g_alloca (strlen (info_dn) + extra + 1);
- s = info_dn;
- while (*s != '\0') {
- if (*s == '_')
- *d++ = '_';
- *d++ = *s++;
- }
- *d = '\0';
- } else
- display_name = (char *) info_dn;
-
- /* Add menu item */
- label = g_strdup (display_name);
- encoded_label = bonobo_ui_util_encode_str (label);
- g_string_append_printf (menuitems,
- " <menuitem name=\"Recent-%d\" verb=\"\" label=\"%s\"/>\n",
- i, encoded_label);
- g_free (encoded_label);
- g_free (label);
- }
-
- g_string_append (menuitems, "</submenu>\n");
-
- bonobo_ui_component_set (uic, path, menuitems->str, NULL);
-
- g_string_free (menuitems, TRUE);
-
- /* Add uri prop */
- for (l = g_list_first (items), i = 1; l && i <= limit; l = l->next, ++i) {
- GtkRecentInfo *info = ((GtkRecentInfo *)(l->data));
- const gchar *info_uri = gtk_recent_info_get_uri (info);
- label = g_strdup_printf ("/commands/Recent-%d", i);
- bonobo_ui_component_set_prop (uic, label, "uri", info_uri, NULL);
- g_free (label);
- }
-
- /* Add verb */
- for (l = g_list_first (items), i = 1; l && i <= limit; l = l->next, ++i) {
- label = g_strdup_printf ("Recent-%d", i);
- bonobo_ui_component_add_verb (uic, label, verb_cb, user_data);
- g_free (label);
- }
-
- for (l = g_list_first (items); l; l = l->next)
- gtk_recent_info_unref ((GtkRecentInfo *)(l->data));
- g_list_free (items);
-}
-
static void
action_recent_cb (GtkAction *action,
EAttachmentBar *attachment_bar)