/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2008 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
mime_toggle = gtk_event_box_new();
gtk_event_box_set_visible_window(GTK_EVENT_BOX(mime_toggle), FALSE);
- g_signal_connect(G_OBJECT(mime_toggle), "visibility-notify-event",
- G_CALLBACK(mimeview_visi_notify), mimeview);
g_signal_connect(G_OBJECT(mime_toggle), "motion-notify-event",
G_CALLBACK(mimeview_visi_notify), mimeview);
g_signal_connect(G_OBJECT(mime_toggle), "leave-notify-event",
mimeview_clear(mimeview);
- g_return_if_fail(file != NULL);
- g_return_if_fail(mimeinfo != NULL);
+ cm_return_if_fail(file != NULL);
+ cm_return_if_fail(mimeinfo != NULL);
mimeview->mimeinfo = mimeinfo;
{
GtkCMCTreeNode *node;
- g_return_if_fail(mimeinfo != NULL);
+ cm_return_if_fail(mimeinfo != NULL);
while (mimeinfo != NULL) {
node = mimeview_append_part(mimeview, mimeinfo, parent);
StockPixmap icon = STOCK_PIXMAP_PRIVACY_SIGNED;
SignatureStatus mycode = SIGNATURE_UNCHECKED;
- g_return_if_fail(mimeview != NULL);
- g_return_if_fail(mimeinfo != NULL);
+ cm_return_if_fail(mimeview != NULL);
+ cm_return_if_fail(mimeinfo != NULL);
if (special)
mycode = code;
MimeInfo *siginfo;
MimeInfo *first_text;
- g_return_if_fail(mimeview != NULL);
- g_return_if_fail(selected != NULL);
+ cm_return_if_fail(mimeview != NULL);
+ cm_return_if_fail(selected != NULL);
if (selected->type == MIMETYPE_MESSAGE
&& !g_ascii_strcasecmp(selected->subtype, "rfc822")) {
GdkDragContext *context;
MimeInfo *partinfo;
- g_return_if_fail(mimeview != NULL);
+ cm_return_if_fail(mimeview != NULL);
partinfo = mimeview_get_selected_part(mimeview);
if (partinfo->disposition == DISPOSITIONTYPE_INLINE) return;
KEY_PRESS_EVENT_STOP();
mimeview_launch(mimeview, NULL);
return TRUE;
-#ifndef G_OS_WIN32
case GDK_o:
BREAK_ON_MODIFIER_KEY();
KEY_PRESS_EVENT_STOP();
+#ifndef G_OS_WIN32
mimeview_open_with(mimeview);
- return TRUE;
#endif
+ return TRUE;
case GDK_c:
BREAK_ON_MODIFIER_KEY();
KEY_PRESS_EVENT_STOP();
gchar *filename;
filename = g_strdup(get_part_name(partinfo));
- if (!filename || !*filename)
+ if (!filename || !*filename) {
+ g_free(filename);
filename = g_strdup_printf("noname.%d", number);
+ }
if (!g_utf8_validate(filename, -1, NULL)) {
gchar *tmp = conv_filename_to_utf8(filename);
partinfo = mimeview_get_part_to_use(mimeview);
- g_return_if_fail(partinfo != NULL);
+ cm_return_if_fail(partinfo != NULL);
if (get_part_name(partinfo) == NULL) {
return;
subst_for_filename(partname);
- if (prefs_common.attach_save_dir)
+ if (prefs_common.attach_save_dir && *prefs_common.attach_save_dir)
filepath = g_strconcat(prefs_common.attach_save_dir,
G_DIR_SEPARATOR_S, partname, NULL);
else
partinfo = mimeview_get_part_to_use(mimeview);
mimeview_select_mimepart_icon(mimeview, partinfo);
- g_return_if_fail(partinfo != NULL);
+ cm_return_if_fail(partinfo != NULL);
mimeview_show_message_part(mimeview, partinfo);
}
if (!partinfo)
partinfo = mimeview_get_part_to_use(mimeview);
- g_return_if_fail(partinfo != NULL);
+ cm_return_if_fail(partinfo != NULL);
filename = procmime_get_tmp_file_name(partinfo);
gchar *uri;
int r = 0;
#endif
- g_return_if_fail(partinfo != NULL);
+ cm_return_if_fail(partinfo != NULL);
filename = procmime_get_tmp_file_name(partinfo);
mimeview->icon_count++;
button = gtk_event_box_new();
- g_signal_connect(G_OBJECT(button), "visibility-notify-event",
- G_CALLBACK(mimeview_visi_notify), mimeview);
g_signal_connect(G_OBJECT(button), "motion-notify-event",
G_CALLBACK(mimeview_visi_notify), mimeview);
g_signal_connect(G_OBJECT(button), "leave-notify-event",
stockp = STOCK_PIXMAP_MIME_MESSAGE;
break;
case MIMETYPE_APPLICATION:
- if (mimeinfo->subtype && !g_ascii_strcasecmp(mimeinfo->subtype, "pgp-signature"))
+ if (mimeinfo->subtype && (!g_ascii_strcasecmp(mimeinfo->subtype, "pgp-signature")
+ || !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-signature")
+ || !g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-signature")))
stockp = STOCK_PIXMAP_MIME_PGP_SIG;
else if (mimeinfo->subtype && !g_ascii_strcasecmp(mimeinfo->subtype, "pdf"))
stockp = STOCK_PIXMAP_MIME_PDF;
{
GtkRequisition size;
- g_return_if_fail(mimeinfo != NULL);
+ cm_return_if_fail(mimeinfo != NULL);
while (mimeinfo != NULL) {
if (mimeinfo->type != MIMETYPE_MULTIPART)