From 13a37b6b6550495cf976e063bc97799b8cda7a0a Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 2 Feb 2017 07:58:22 +0000 Subject: added menus to open config/mimetmp folder. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3525 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 8 ++++++++ libsylph/utils.c | 9 +++++++++ src/mainwindow.c | 25 ++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a9fef752..dc0c0446 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +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 diff --git a/libsylph/utils.c b/libsylph/utils.c index 0faf6b48..1e40d52f 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -4209,6 +4209,15 @@ gint execute_open_file(const gchar *file, const gchar *content_type) log_print("opening %s - %s\n", file, content_type ? 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 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, ""}, {N_("/_Tools/E_xecute marked process"), "X", execute_summary_cb, 0, NULL}, {N_("/_Tools/---"), NULL, NULL, 0, ""}, + {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, ""}, {N_("/_Tools/_Log window"), "L", log_window_show_cb, 0, NULL}, {N_("/_Configuration"), NULL, NULL, 0, ""}, @@ -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; -- cgit v1.2.3