summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-03-20 17:59:11 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2018-03-20 17:59:11 +0100
commitee04cd503ff70a1aed79cdb2c9f787c98b075182 (patch)
treec4887c4fd1e8be725adfb4a3c52d63f2805a6784 /src/fe-text
parent977c2c0a0d911e3b7b43387ed19c5bfee565c617 (diff)
downloadirssi-ee04cd503ff70a1aed79cdb2c9f787c98b075182.zip
add disabled txt
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/module-formats.c1
-rw-r--r--src/fe-text/module-formats.h1
-rw-r--r--src/fe-text/statusbar-config.c8
3 files changed, 8 insertions, 2 deletions
diff --git a/src/fe-text/module-formats.c b/src/fe-text/module-formats.c
index b234f46c..277872c6 100644
--- a/src/fe-text/module-formats.c
+++ b/src/fe-text/module-formats.c
@@ -67,6 +67,7 @@ FORMAT_REC gui_text_formats[] =
{ "statusbar_info_item_footer", "", 0 },
{ "statusbar_info_item_name", "%# : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
{ "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
+ { "statusbar_not_found", "Statusbar is disabled: $0", 1, { 0 } },
{ "statusbar_item_not_found", "Statusbar item doesn't exist: $0", 1, { 0 } },
{ "statusbar_unknown_command", "Unknown statusbar command: $0", 1, { 0 } },
{ "statusbar_unknown_type", "Statusbar type must be 'window' or 'root'", 1, { 0 } },
diff --git a/src/fe-text/module-formats.h b/src/fe-text/module-formats.h
index b753238b..a9f4c6ae 100644
--- a/src/fe-text/module-formats.h
+++ b/src/fe-text/module-formats.h
@@ -42,6 +42,7 @@ enum {
TXT_STATUSBAR_INFO_ITEM_FOOTER,
TXT_STATUSBAR_INFO_ITEM_NAME,
TXT_STATUSBAR_NOT_FOUND,
+ TXT_STATUSBAR_NOT_ENABLED,
TXT_STATUSBAR_ITEM_NOT_FOUND,
TXT_STATUSBAR_UNKNOWN_COMMAND,
TXT_STATUSBAR_UNKNOWN_TYPE,
diff --git a/src/fe-text/statusbar-config.c b/src/fe-text/statusbar-config.c
index 0c6070fa..7b5b6884 100644
--- a/src/fe-text/statusbar-config.c
+++ b/src/fe-text/statusbar-config.c
@@ -388,8 +388,12 @@ static void cmd_statusbar_print_info(const char *name)
return;
}
- printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
- TXT_STATUSBAR_NOT_FOUND, name);
+ if (sbar_node(name, FALSE) != NULL || sbar_node_isdefault(name))
+ printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
+ TXT_STATUSBAR_NOT_ENABLED, name);
+ else
+ printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
+ TXT_STATUSBAR_NOT_FOUND, name);
}
/* SYNTAX: STATUSBAR ADD|MODIFY [-disable | -nodisable] [-type window|root]