* src/mimeview.c
Use "Open with" on double click if no command
was found
+2005-10-20 [colin] 1.9.15cvs82
+
+ * src/mimeview.c
+ Use "Open with" on double click if no command
+ was found
+
2005-10-20 [colin] 1.9.15cvs81
* src/imap.c
2005-10-20 [colin] 1.9.15cvs81
* src/imap.c
( cvs diff -u -r 1.100.2.27 -r 1.100.2.28 AUTHORS; cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/plugins/pgpmime/pgpmime.c; ) > 1.9.15cvs79.patchset
( cvs diff -u -r 1.213.2.65 -r 1.213.2.66 src/folder.c; ) > 1.9.15cvs80.patchset
( cvs diff -u -r 1.179.2.80 -r 1.179.2.81 src/imap.c; cvs diff -u -r 1.1.4.23 -r 1.1.4.24 src/etpan/imap-thread.c; ) > 1.9.15cvs81.patchset
( cvs diff -u -r 1.100.2.27 -r 1.100.2.28 AUTHORS; cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/plugins/pgpmime/pgpmime.c; ) > 1.9.15cvs79.patchset
( cvs diff -u -r 1.213.2.65 -r 1.213.2.66 src/folder.c; ) > 1.9.15cvs80.patchset
( cvs diff -u -r 1.179.2.80 -r 1.179.2.81 src/imap.c; cvs diff -u -r 1.1.4.23 -r 1.1.4.24 src/etpan/imap-thread.c; ) > 1.9.15cvs81.patchset
+( cvs diff -u -r 1.83.2.48 -r 1.83.2.49 src/mimeview.c; ) > 1.9.15cvs82.patchset
MICRO_VERSION=15
INTERFACE_AGE=0
BINARY_AGE=0
MICRO_VERSION=15
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
static void mimeview_open_with (MimeView *mimeview);
static void mimeview_view_file (const gchar *filename,
MimeInfo *partinfo,
static void mimeview_open_with (MimeView *mimeview);
static void mimeview_view_file (const gchar *filename,
MimeInfo *partinfo,
+ const gchar *cmdline,
+ MimeView *mimeview);
static gboolean icon_clicked_cb (GtkWidget *button,
GdkEventButton *event,
MimeView *mimeview);
static gboolean icon_clicked_cb (GtkWidget *button,
GdkEventButton *event,
MimeView *mimeview);
alertpanel_error
(_("Can't save the part of multipart message."));
else
alertpanel_error
(_("Can't save the part of multipart message."));
else
- mimeview_view_file(filename, partinfo, NULL);
+ mimeview_view_file(filename, partinfo, NULL, mimeview);
gchar *mime_command = NULL;
gchar *content_type = NULL;
gchar *mime_command = NULL;
gchar *content_type = NULL;
if (!mimeview->opened) return;
if (!mimeview->file) return;
if (!mimeview->opened) return;
if (!mimeview->file) return;
TRUE);
g_free(mime_command);
if (cmd) {
TRUE);
g_free(mime_command);
if (cmd) {
- mimeview_view_file(filename, partinfo, cmd);
+ mimeview_view_file(filename, partinfo, cmd, mimeview);
g_free(prefs_common.mime_open_cmd);
prefs_common.mime_open_cmd = cmd;
prefs_common.mime_open_cmd_history =
g_free(prefs_common.mime_open_cmd);
prefs_common.mime_open_cmd = cmd;
prefs_common.mime_open_cmd_history =
}
static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo,
}
static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo,
+ const gchar *cmdline, MimeView *mimeview)
{
static gchar *default_image_cmdline = DEFAULT_IMAGE_VIEWER_CMD;
static gchar *default_audio_cmdline = DEFAULT_AUDIO_PLAYER_CMD;
{
static gchar *default_image_cmdline = DEFAULT_IMAGE_VIEWER_CMD;
static gchar *default_audio_cmdline = DEFAULT_AUDIO_PLAYER_CMD;
def_cmd = NULL;
} else if (MIMETYPE_APPLICATION == partinfo->type &&
!g_ascii_strcasecmp(partinfo->subtype, "octet-stream")) {
def_cmd = NULL;
} else if (MIMETYPE_APPLICATION == partinfo->type &&
!g_ascii_strcasecmp(partinfo->subtype, "octet-stream")) {
+ mimeview_open_with(mimeview);
return;
} else if (MIMETYPE_IMAGE == partinfo->type) {
cmd = prefs_common.mime_image_viewer;
return;
} else if (MIMETYPE_IMAGE == partinfo->type) {
cmd = prefs_common.mime_image_viewer;
g_warning("MIME viewer command line is invalid: '%s'", cmd);
if (def_cmd)
g_snprintf(buf, sizeof(buf), def_cmd, filename);
g_warning("MIME viewer command line is invalid: '%s'", cmd);
if (def_cmd)
g_snprintf(buf, sizeof(buf), def_cmd, filename);
+ else {
+ mimeview_open_with(mimeview);
- execute_command_line(buf, TRUE);
+ if (execute_command_line(buf, TRUE) != 0)
+ mimeview_open_with(mimeview);
}
void mimeview_register_viewer_factory(MimeViewerFactory *factory)
}
void mimeview_register_viewer_factory(MimeViewerFactory *factory)