From 21cc53bdfdb70bc375bf6b4c46593889b9702489 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 20 May 2020 10:41:59 +0200 Subject: [PATCH] Make urlopen command configurable --- src/command/cmd_funcs.c | 2 +- src/config/preferences.c | 4 ++++ src/config/preferences.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index d0f97810..f91a901c 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -8871,7 +8871,7 @@ cmd_urlopen(ProfWin *window, const char *const command, gchar **args) return TRUE; } - call_external("xdg-open", args[0]); + call_external(prefs_get_string(PREF_URL_OPEN_CMD), args[0]); } else { cons_show("urlopen not supported in this window"); } diff --git a/src/config/preferences.c b/src/config/preferences.c index 9a2105c0..3821f024 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -1783,6 +1783,7 @@ _get_group(preference_t pref) case PREF_LOG_ROTATE: case PREF_LOG_SHARED: case PREF_AVATAR_CMD: + case PREF_URL_OPEN_CMD: return PREF_GROUP_LOGGING; case PREF_AUTOAWAY_CHECK: case PREF_AUTOAWAY_MODE: @@ -2070,6 +2071,8 @@ _get_key(preference_t pref) return "slashguard"; case PREF_MAM: return "mam"; + case PREF_URL_OPEN_CMD: + return "urlopen.cmd"; default: return NULL; } @@ -2205,6 +2208,7 @@ _get_default_string(preference_t pref) case PREF_COLOR_NICK: return "false"; case PREF_AVATAR_CMD: + case PREF_URL_OPEN_CMD: return "xdg-open"; default: return NULL; diff --git a/src/config/preferences.h b/src/config/preferences.h index 7d651ac3..fc6eeafc 100644 --- a/src/config/preferences.h +++ b/src/config/preferences.h @@ -170,6 +170,7 @@ typedef enum { PREF_AVATAR_CMD, PREF_SLASH_GUARD, PREF_MAM, + PREF_URL_OPEN_CMD, } preference_t; typedef struct prof_alias_t {