aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-02-25 06:34:07 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-02-25 06:34:07 +0000
commit070e412f18875b74e329d932d65b2917d8d81bd7 (patch)
tree9a892d712cf507a9bcef1df2a65481020c3b9427 /src
parentb81cb2016a3fb6bb6f297a057516aac13e5bcf42 (diff)
use 'open' command on OS X.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2847 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/mimeview.c15
-rw-r--r--src/prefs_common_dialog.c4
2 files changed, 18 insertions, 1 deletions
diff --git a/src/mimeview.c b/src/mimeview.c
index 41768d0b..be13eaf5 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -1226,6 +1226,21 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo,
}
execute_open_file(filename, partinfo->content_type);
return;
+#elif defined(__APPLE__)
+ if (g_file_test(filename, G_FILE_TEST_IS_EXECUTABLE) ||
+ str_has_suffix_case(filename, ".py") ||
+ str_has_suffix_case(filename, ".rb") ||
+ str_has_suffix_case(filename, ".sh")) {
+ alertpanel_full
+ (_("Opening executable file"),
+ _("This is an executable file. Opening executable file is restricted for security.\n"
+ "If you want to launch it, save it to somewhere and make sure it is not an virus or something like a malicious program."),
+ ALERT_WARNING, G_ALERTDEFAULT, FALSE,
+ GTK_STOCK_OK, NULL, NULL);
+ return;
+ }
+ execute_open_file(filename, partinfo->content_type);
+ return;
#else
if (MIME_IMAGE == partinfo->mime_type)
cmd = prefs_common.mime_image_viewer;
diff --git a/src/prefs_common_dialog.c b/src/prefs_common_dialog.c
index 36554540..6a4108e7 100644
--- a/src/prefs_common_dialog.c
+++ b/src/prefs_common_dialog.c
@@ -2732,7 +2732,7 @@ static GtkWidget *prefs_extcmd_create(void)
gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtkut_combo_set_items (GTK_COMBO (uri_combo),
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(__APPLE__)
_("(Default browser)"),
#else
DEFAULT_BROWSER_CMD,
@@ -2760,6 +2760,8 @@ static GtkWidget *prefs_extcmd_create(void)
gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
#ifdef G_OS_WIN32
"notepad '%s'",
+#elif defined(__APPLE__)
+ "open -t '%s'",
#else
"gedit %s",
"kedit %s",