diff options
author | Daniel Carl <danielcarl@gmx.de> | 2013-04-14 20:01:20 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2013-04-14 21:54:21 +0200 |
commit | 07c0a84ec428f6e47226d74db4869d1f0b8b086f (patch) | |
tree | 3762b86794e8e56d6fecc8a471248b9325e03737 /src/setting.c | |
parent | cdf7389ab3c4876a2701d79bffc0451e60958b2d (diff) |
Added command to open input boxes or text areas with editor (#15).
Diffstat (limited to 'src/setting.c')
-rw-r--r-- | src/setting.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/setting.c b/src/setting.c index 8ed1886..671470d 100644 --- a/src/setting.c +++ b/src/setting.c @@ -42,6 +42,7 @@ static gboolean download_path(const Setting *s, const SettingType type); static gboolean proxy(const Setting *s, const SettingType type); static gboolean user_style(const Setting *s, const SettingType type); static gboolean history_max_items(const Setting *s, const SettingType type); +static gboolean editor_command(const Setting *s, const SettingType type); static Setting default_settings[] = { /* webkit settings */ @@ -103,6 +104,7 @@ static Setting default_settings[] = { {NULL, "home-page", TYPE_CHAR, home_page, {0}}, {NULL, "download-path", TYPE_CHAR, download_path, {0}}, {NULL, "history-max-items", TYPE_INTEGER, history_max_items, {0}}, + {NULL, "editor-command", TYPE_CHAR, editor_command, {0}}, }; void setting_init(void) @@ -691,3 +693,19 @@ static gboolean history_max_items(const Setting *s, const SettingType type) return true; } + +static gboolean editor_command(const Setting *s, const SettingType type) +{ + if (type == SETTING_GET) { + print_value(s, vb.config.editor_command); + + return true; + } + + if (!util_valid_format_string(s->arg.s, 's', 1)) { + return false; + } + OVERWRITE_STRING(vb.config.editor_command, s->arg.s); + + return true; +} |