# HG changeset patch # User nadvornik # Date 1237566523 0 # Node ID 2b95dbb20a874e3e53e5f6bfb53eb7e46ba0c1f8 # Parent 6e020d3ab168a64fcd953cf6dd2d289a08e608ef added "load config" command to remote control diff -r 6e020d3ab168 -r 2b95dbb20a87 src/remote.c --- a/src/remote.c Fri Mar 20 14:36:59 2009 +0000 +++ b/src/remote.c Fri Mar 20 16:28:43 2009 +0000 @@ -22,6 +22,7 @@ #include "misc.h" #include "slideshow.h" #include "ui_fileops.h" +#include "rcfile.h" #include #include @@ -499,6 +500,22 @@ g_free(filename); } +static void gr_config_load(const gchar *text, gpointer data) +{ + gchar *filename = expand_tilde(text); + + if (isfile(filename)) + { + load_options_from(filename, options, FALSE); + } + else + { + log_printf("remote sent filename that does not exist:\"%s\"\n", filename); + } + + g_free(filename); +} + static void gr_file_view(const gchar *text, gpointer data) { gchar *filename = expand_tilde(text); @@ -585,6 +602,7 @@ { "+t", "--tools-show", gr_tools_show, FALSE, TRUE, N_("show tools") }, { "-t", "--tools-hide", gr_tools_hide, FALSE, TRUE, N_("hide tools") }, { "-q", "--quit", gr_quit, FALSE, FALSE, N_("quit") }, + { "-cl","--config-load", gr_config_load, TRUE, FALSE, N_("load config file") }, { NULL, "file:", gr_file_load, TRUE, FALSE, N_("open file") }, { NULL, "view:", gr_file_view, TRUE, FALSE, N_("open file in new window") }, { NULL, "--list-clear", gr_list_clear, FALSE, FALSE, NULL },