changeset 1467:2b95dbb20a87

added "load config" command to remote control
author nadvornik
date Fri, 20 Mar 2009 16:28:43 +0000
parents 6e020d3ab168
children e9f9d3da3f43
files src/remote.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <sys/socket.h>
 #include <sys/un.h>
@@ -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 },