2005-10-20 [colin] 1.9.15cvs82
authorColin Leroy <colin@colino.net>
Thu, 20 Oct 2005 16:50:46 +0000 (16:50 +0000)
committerColin Leroy <colin@colino.net>
Thu, 20 Oct 2005 16:50:46 +0000 (16:50 +0000)
* src/mimeview.c
Use "Open with" on double click if no command
was found

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/mimeview.c

index bbd3d42..092452a 100644 (file)
@@ -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
index 2285cc8..adc2a81 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index d69d2b7..d3929c0 100644 (file)
@@ -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=
 
index 1a9d4e6..8618d4f 100644 (file)
@@ -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)