From: Colin Leroy Date: Thu, 20 Oct 2005 16:50:46 +0000 (+0000) Subject: 2005-10-20 [colin] 1.9.15cvs82 X-Git-Tag: rel_1_9_99~53 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=1b783555ff03554e8297cbc9f37011f1a41e829c;hp=bf9f71b87f94b83e3999e63ddf96b0c149c5c754 2005-10-20 [colin] 1.9.15cvs82 * src/mimeview.c Use "Open with" on double click if no command was found --- diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index bbd3d429f..092452a4b 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,9 @@ +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 diff --git a/PATCHSETS b/PATCHSETS index 2285cc8b7..adc2a8143 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -918,3 +918,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index d69d2b7cd..d3929c00d 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=15 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=81 +EXTRA_VERSION=82 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/mimeview.c b/src/mimeview.c index 1a9d4e6de..8618d4f9e 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -118,7 +118,8 @@ static void mimeview_launch (MimeView *mimeview); static void mimeview_open_with (MimeView *mimeview); static void mimeview_view_file (const gchar *filename, MimeInfo *partinfo, - const gchar *cmdline); + const gchar *cmdline, + MimeView *mimeview); static gboolean icon_clicked_cb (GtkWidget *button, GdkEventButton *event, MimeView *mimeview); @@ -1270,7 +1271,7 @@ static void mimeview_launch(MimeView *mimeview) alertpanel_error (_("Can't save the part of multipart message.")); else - mimeview_view_file(filename, partinfo, NULL); + mimeview_view_file(filename, partinfo, NULL, mimeview); g_free(filename); } @@ -1283,6 +1284,7 @@ static void mimeview_open_with(MimeView *mimeview) gchar *mime_command = NULL; gchar *content_type = NULL; + if (!mimeview) return; if (!mimeview->opened) return; if (!mimeview->file) return; @@ -1322,7 +1324,7 @@ static void mimeview_open_with(MimeView *mimeview) 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 = @@ -1333,7 +1335,7 @@ static void mimeview_open_with(MimeView *mimeview) } static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo, - const gchar *cmdline) + const gchar *cmdline, MimeView *mimeview) { static gchar *default_image_cmdline = DEFAULT_IMAGE_VIEWER_CMD; static gchar *default_audio_cmdline = DEFAULT_AUDIO_PLAYER_CMD; @@ -1350,6 +1352,7 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo, 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; @@ -1379,11 +1382,14 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo, g_warning("MIME viewer command line is invalid: '%s'", cmd); if (def_cmd) g_snprintf(buf, sizeof(buf), def_cmd, filename); - else + else { + mimeview_open_with(mimeview); return; + } } - execute_command_line(buf, TRUE); + if (execute_command_line(buf, TRUE) != 0) + mimeview_open_with(mimeview); } void mimeview_register_viewer_factory(MimeViewerFactory *factory)