diff options
author | Josh Rickmar <jrick@devio.us> | 2012-05-07 14:41:35 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-05-07 14:41:35 -0400 |
commit | 628ff04bcb7200e66491cb5342d71ad04ffe4030 (patch) | |
tree | d03465b29d2234ece5f277511d41ec630f054dff | |
parent | 04fe572e779be208d4c658f0185887baae49a0a8 (diff) | |
download | xombrero-628ff04bcb7200e66491cb5342d71ad04ffe4030.tar.gz |
Make show_url a runtime setting
-rw-r--r-- | settings.c | 18 | ||||
-rw-r--r-- | xxxterm.c | 3 | ||||
-rw-r--r-- | xxxterm.h | 5 |
3 files changed, 22 insertions, 4 deletions
diff --git a/settings.c b/settings.c index 6407779..eb81f77 100644 --- a/settings.c +++ b/settings.c @@ -140,6 +140,7 @@ int set_download_mode_rt(char *); int set_referer(struct settings *, char *); int set_referer_rt(char *); int set_show_tabs(char *); +int set_show_url(char *); int set_external_editor(char *); void walk_mime_type(struct settings *, void (*)(struct settings *, @@ -334,7 +335,7 @@ struct settings rs[] = { { "session_autosave", XT_S_INT, 0, &session_autosave, NULL, NULL, NULL, NULL }, { "single_instance", XT_S_INT, XT_SF_RESTART,&single_instance, NULL, NULL, NULL, NULL }, { "show_tabs", XT_S_INT, 0, &show_tabs, NULL, NULL, NULL, set_show_tabs }, - { "show_url", XT_S_INT, 0, &show_url, NULL, NULL, NULL, NULL }, + { "show_url", XT_S_INT, 0, &show_url, NULL, NULL, NULL, set_show_url }, { "show_statusbar", XT_S_INT, 0, &show_statusbar, NULL, NULL, NULL, NULL }, { "spell_check_languages", XT_S_STR, 0, NULL, &spell_check_languages, NULL, NULL, NULL }, { "ssl_ca_file", XT_S_STR, 0, NULL, &ssl_ca_file, NULL, NULL, NULL }, @@ -1211,6 +1212,21 @@ set_show_tabs(char *value) } int +set_show_url(char *value) +{ + struct karg args = {0}; + int val; + const char *errstr; + + val = strtonum(value, 0, 1, &errstr); + if (errstr) + return (-1); + args.i = val ? XT_URL_SHOW : XT_URL_HIDE; + urlaction(get_current_tab(), &args); + return (0); +} + +int set_external_editor(char *editor) { if (external_editor) diff --git a/xxxterm.c b/xxxterm.c index 6d0e1ea..120637e 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -170,9 +170,6 @@ TAILQ_HEAD(command_list, command_entry); #define XT_ZOOM_OUT (-2) #define XT_ZOOM_NORMAL (100) -#define XT_URL_SHOW (1) -#define XT_URL_HIDE (2) - #define XT_CMD_OPEN (0) #define XT_CMD_OPEN_CURRENT (1) #define XT_CMD_TABNEW (2) diff --git a/xxxterm.h b/xxxterm.h index e6b4891..dede898 100644 --- a/xxxterm.h +++ b/xxxterm.h @@ -539,6 +539,9 @@ int fork_exec(struct tab *, char *, const gchar *, char *, int); #define XT_TAB_NEXTSTYLE (8) #define XT_TAB_LOAD_IMAGES (9) +#define XT_URL_SHOW (1) +#define XT_URL_HIDE (2) + struct key_binding { char *cmd; guint mask; @@ -585,6 +588,8 @@ void init_keybindings(void); void config_parse(char *, int); char *get_setting_name(int); int tabaction(struct tab *, struct karg *); +int urlaction(struct tab *, struct karg *); +struct tab *get_current_tab(void); #define XT_DL_START (0) #define XT_DL_RESTART (1) |