aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2017-02-02 07:58:22 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2017-02-02 07:58:22 +0000
commit13a37b6b6550495cf976e063bc97799b8cda7a0a (patch)
treefa47f106ace080ebbf59377171c4eb731e6ca217
parente8afa250c6319a8471b8801922a735644d452578 (diff)
added menus to open config/mimetmp folder.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3525 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog8
-rw-r--r--libsylph/utils.c9
-rw-r--r--src/mainwindow.c25
3 files changed, 41 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a9fef752..dc0c0446 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2017-02-02
+ * libsylph/utils.c: execute_open_file(): unix: implemented using
+ xdg-open.
+ src/mainwindow.c: added the following menus:
+ /Tools/Open configuration folder
+ /Tools/Open attachments folder
+
+2017-02-02
+
* nsis/COPYING.ja.txt
nsis/COPYING.txt
nsis/english.nsh
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 0faf6b48..1e40d52f 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -4211,6 +4211,15 @@ gint execute_open_file(const gchar *file, const gchar *content_type)
argv[1] = file;
execute_async(argv);
+#else
+ const gchar *argv[3] = {"xdg-open", NULL, NULL};
+
+ g_return_val_if_fail(file != NULL, -1);
+
+ log_print("opening %s - %s\n", file, content_type ? content_type : "");
+
+ argv[1] = file;
+ execute_async(argv);
#endif
return 0;
diff --git a/src/mainwindow.c b/src/mainwindow.c
index d94ff973..bc7e7135 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2017 Hiroyuki Yamamoto
*
* 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
@@ -442,6 +442,13 @@ static void execute_summary_cb (MainWindow *mainwin,
static void update_summary_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void open_config_folder_cb(MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void open_attachments_folder_cb
+ (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void prev_cb (MainWindow *mainwin,
guint action,
@@ -867,6 +874,10 @@ static GtkItemFactoryEntry mainwin_entries[] =
{N_("/_Tools/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Tools/E_xecute marked process"), "X", execute_summary_cb, 0, NULL},
{N_("/_Tools/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Tools/Op_en configuration folder"),
+ NULL, open_config_folder_cb, 0, NULL},
+ {N_("/_Tools/Open a_ttachments folder"),NULL, open_attachments_folder_cb, 0, NULL},
+ {N_("/_Tools/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Tools/_Log window"), "<shift><control>L", log_window_show_cb, 0, NULL},
{N_("/_Configuration"), NULL, NULL, 0, "<Branch>"},
@@ -3867,6 +3878,18 @@ static void update_summary_cb(MainWindow *mainwin, guint action,
TRUE);
}
+static void open_config_folder_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ execute_open_file(get_rc_dir(), NULL);
+}
+
+static void open_attachments_folder_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ execute_open_file(get_mime_tmp_dir(), NULL);
+}
+
static void prev_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
MessageView *messageview = mainwin->messageview;