aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-04-11 08:14:51 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-04-11 08:14:51 +0800
commit942cdf2df9091e347e09c25d62015e77775f38b6 (patch)
tree6800b693776d993e8514fcd0c7fe95510fded7c6 /widgets
parent1509a85170184895f6c91f9c57167a74af5cd2db (diff)
downloadgsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.tar
gsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.tar.gz
gsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.tar.bz2
gsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.tar.lz
gsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.tar.xz
gsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.tar.zst
gsoc2013-evolution-942cdf2df9091e347e09c25d62015e77775f38b6.zip
Bug fixes and formerly unfinished bits of the attachment rewrite.
svn path=/branches/kill-bonobo/; revision=37513
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-attachment-handler-image.c9
-rw-r--r--widgets/misc/e-attachment-store.c2
-rw-r--r--widgets/misc/e-attachment-store.h2
-rw-r--r--widgets/misc/e-attachment-tree-view.c4
-rw-r--r--widgets/misc/e-attachment-view.c22
-rw-r--r--widgets/misc/e-attachment-view.h3
-rw-r--r--widgets/misc/e-attachment.c10
7 files changed, 38 insertions, 14 deletions
diff --git a/widgets/misc/e-attachment-handler-image.c b/widgets/misc/e-attachment-handler-image.c
index 02357facc9..ba5f8d759c 100644
--- a/widgets/misc/e-attachment-handler-image.c
+++ b/widgets/misc/e-attachment-handler-image.c
@@ -21,7 +21,6 @@
#include "e-attachment-handler-image.h"
-#include <config.h>
#include <glib/gi18n.h>
#include <gconf/gconf-client.h>
@@ -205,7 +204,6 @@ attachment_handler_image_constructed (GObject *object)
EAttachmentView *view;
GtkActionGroup *action_group;
GtkUIManager *ui_manager;
- const gchar *domain = GETTEXT_PACKAGE;
GError *error = NULL;
handler = E_ATTACHMENT_HANDLER (object);
@@ -215,16 +213,13 @@ attachment_handler_image_constructed (GObject *object)
G_OBJECT_CLASS (parent_class)->constructed (object);
view = e_attachment_handler_get_view (handler);
- ui_manager = e_attachment_view_get_ui_manager (view);
- action_group = gtk_action_group_new ("image");
- gtk_action_group_set_translation_domain (action_group, domain);
+ action_group = e_attachment_view_add_action_group (view, "image");
gtk_action_group_add_actions (
action_group, standard_entries,
G_N_ELEMENTS (standard_entries), object);
- gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
- g_object_unref (action_group);
+ ui_manager = e_attachment_view_get_ui_manager (view);
gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
if (error != NULL) {
diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c
index 24cc89b366..4a74bab915 100644
--- a/widgets/misc/e-attachment-store.c
+++ b/widgets/misc/e-attachment-store.c
@@ -213,7 +213,7 @@ attachment_store_init (EAttachmentStore *store)
types[column++] = E_TYPE_ATTACHMENT; /* COLUMN_ATTACHMENT */
types[column++] = G_TYPE_STRING; /* COLUMN_CAPTION */
types[column++] = G_TYPE_STRING; /* COLUMN_CONTENT_TYPE */
- types[column++] = G_TYPE_STRING; /* COLUMN_DISPLAY_NAME */
+ types[column++] = G_TYPE_STRING; /* COLUMN_DESCRIPTION */
types[column++] = G_TYPE_ICON; /* COLUMN_ICON */
types[column++] = G_TYPE_BOOLEAN; /* COLUMN_LOADING */
types[column++] = G_TYPE_INT; /* COLUMN_PERCENT */
diff --git a/widgets/misc/e-attachment-store.h b/widgets/misc/e-attachment-store.h
index a6dd702b97..5d2271cba0 100644
--- a/widgets/misc/e-attachment-store.h
+++ b/widgets/misc/e-attachment-store.h
@@ -63,7 +63,7 @@ enum {
E_ATTACHMENT_STORE_COLUMN_ATTACHMENT, /* E_TYPE_ATTACHMENT */
E_ATTACHMENT_STORE_COLUMN_CAPTION, /* G_TYPE_STRING */
E_ATTACHMENT_STORE_COLUMN_CONTENT_TYPE, /* G_TYPE_STRING */
- E_ATTACHMENT_STORE_COLUMN_DISPLAY_NAME, /* G_TYPE_STRING */
+ E_ATTACHMENT_STORE_COLUMN_DESCRIPTION, /* G_TYPE_STRING */
E_ATTACHMENT_STORE_COLUMN_ICON, /* G_TYPE_ICON */
E_ATTACHMENT_STORE_COLUMN_LOADING, /* G_TYPE_BOOLEAN */
E_ATTACHMENT_STORE_COLUMN_PERCENT, /* G_TYPE_INT */
diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c
index f8a74d293f..f2c17cb078 100644
--- a/widgets/misc/e-attachment-tree-view.c
+++ b/widgets/misc/e-attachment-tree-view.c
@@ -493,7 +493,7 @@ attachment_tree_view_init (EAttachmentTreeView *tree_view)
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (column, TRUE);
gtk_tree_view_column_set_spacing (column, 3);
- gtk_tree_view_column_set_title (column, _("Name"));
+ gtk_tree_view_column_set_title (column, _("Description"));
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
renderer = gtk_cell_renderer_pixbuf_new ();
@@ -511,7 +511,7 @@ attachment_tree_view_init (EAttachmentTreeView *tree_view)
gtk_tree_view_column_add_attribute (
column, renderer, "text",
- E_ATTACHMENT_STORE_COLUMN_DISPLAY_NAME);
+ E_ATTACHMENT_STORE_COLUMN_DESCRIPTION);
renderer = gtk_cell_renderer_progress_new ();
g_object_set (renderer, "text", _("Loading"), NULL);
diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c
index 5c7acd4561..f976b71483 100644
--- a/widgets/misc/e-attachment-view.c
+++ b/widgets/misc/e-attachment-view.c
@@ -1456,6 +1456,28 @@ e_attachment_view_get_action (EAttachmentView *view,
}
GtkActionGroup *
+e_attachment_view_add_action_group (EAttachmentView *view,
+ const gchar *group_name)
+{
+ GtkActionGroup *action_group;
+ GtkUIManager *ui_manager;
+ const gchar *domain;
+
+ g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), NULL);
+ g_return_val_if_fail (group_name != NULL, NULL);
+
+ ui_manager = e_attachment_view_get_ui_manager (view);
+ domain = GETTEXT_PACKAGE;
+
+ action_group = gtk_action_group_new (group_name);
+ gtk_action_group_set_translation_domain (action_group, domain);
+ gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+ g_object_unref (action_group);
+
+ return action_group;
+}
+
+GtkActionGroup *
e_attachment_view_get_action_group (EAttachmentView *view,
const gchar *group_name)
{
diff --git a/widgets/misc/e-attachment-view.h b/widgets/misc/e-attachment-view.h
index 8285928c5b..8d1bd328dd 100644
--- a/widgets/misc/e-attachment-view.h
+++ b/widgets/misc/e-attachment-view.h
@@ -206,6 +206,9 @@ void e_attachment_view_drag_data_received
/* Popup Menu Management */
GtkAction * e_attachment_view_get_action (EAttachmentView *view,
const gchar *action_name);
+GtkActionGroup *e_attachment_view_add_action_group
+ (EAttachmentView *view,
+ const gchar *group_name);
GtkActionGroup *e_attachment_view_get_action_group
(EAttachmentView *view,
const gchar *group_name);
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 16bd9fd26c..a97ea1e70f 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -136,6 +136,7 @@ attachment_update_file_info_columns (EAttachment *attachment)
GtkTreeIter iter;
GFileInfo *file_info;
const gchar *content_type;
+ const gchar *description;
const gchar *display_name;
gchar *content_desc;
gchar *display_size;
@@ -162,17 +163,20 @@ attachment_update_file_info_columns (EAttachment *attachment)
content_desc = g_content_type_get_description (content_type);
display_size = g_format_size_for_display (size);
+ description = e_attachment_get_description (attachment);
+ description = (description != NULL) ? description : display_name;
+
if (size > 0)
caption = g_strdup_printf (
- "%s\n(%s)", display_name, display_size);
+ "%s\n(%s)", description, display_size);
else
- caption = g_strdup (display_name);
+ caption = g_strdup (description);
gtk_list_store_set (
GTK_LIST_STORE (model), &iter,
E_ATTACHMENT_STORE_COLUMN_CAPTION, caption,
E_ATTACHMENT_STORE_COLUMN_CONTENT_TYPE, content_desc,
- E_ATTACHMENT_STORE_COLUMN_DISPLAY_NAME, display_name,
+ E_ATTACHMENT_STORE_COLUMN_DESCRIPTION, description,
E_ATTACHMENT_STORE_COLUMN_SIZE, size,
-1);