diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-03-24 10:05:26 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-03-24 10:05:26 +0800 |
commit | 6e163b39c75dbba470d073b4f79a897aa6fb0e54 (patch) | |
tree | 86e93752711579676337bb7cfef18c903b6c7538 /widgets/misc/e-attachment-dialog.c | |
parent | 4cec9fc7169dc3b810321555a70cda916720867d (diff) | |
download | gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.tar gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.tar.gz gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.tar.bz2 gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.tar.lz gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.tar.xz gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.tar.zst gsoc2013-evolution-6e163b39c75dbba470d073b4f79a897aa6fb0e54.zip |
Saving progress again on the attachment rewrite.
svn path=/branches/kill-bonobo/; revision=37470
Diffstat (limited to 'widgets/misc/e-attachment-dialog.c')
-rw-r--r-- | widgets/misc/e-attachment-dialog.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/widgets/misc/e-attachment-dialog.c b/widgets/misc/e-attachment-dialog.c index f697df1fe9..da3c3a855c 100644 --- a/widgets/misc/e-attachment-dialog.c +++ b/widgets/misc/e-attachment-dialog.c @@ -52,6 +52,7 @@ attachment_dialog_update (EAttachmentDialog *dialog) const gchar *display_name; const gchar *description; const gchar *disposition; + gchar *type_description = NULL; gboolean sensitive; gboolean active; @@ -71,32 +72,42 @@ attachment_dialog_update (EAttachmentDialog *dialog) disposition = NULL; } + if (content_type != NULL) { + gchar *comment; + gchar *mime_type; + + comment = g_content_type_get_description (content_type); + mime_type = g_content_type_get_mime_type (content_type); + + type_description = + g_strdup_printf ("%s (%s)", comment, mime_type); + + g_free (comment); + g_free (mime_type); + } + sensitive = G_IS_FILE_INFO (file_info); gtk_dialog_set_response_sensitive ( GTK_DIALOG (dialog), GTK_RESPONSE_OK, sensitive); - if (display_name == NULL) - display_name = ""; widget = dialog->priv->display_name_entry; gtk_widget_set_sensitive (widget, sensitive); gtk_entry_set_text (GTK_ENTRY (widget), display_name); - if (description == NULL) - description = ""; widget = dialog->priv->description_entry; gtk_widget_set_sensitive (widget, sensitive); gtk_entry_set_text (GTK_ENTRY (widget), description); - if (content_type == NULL) - content_type = ""; widget = dialog->priv->content_type_label; - gtk_label_set_text (GTK_LABEL (widget), content_type); + gtk_label_set_text (GTK_LABEL (widget), type_description); active = (g_strcmp0 (disposition, "inline") == 0); widget = dialog->priv->disposition_checkbox; gtk_widget_set_sensitive (widget, sensitive); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), active); + + g_free (type_description); } static void |