about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c1
-rw-r--r--src/command/cmd_defs.c5
-rw-r--r--src/command/cmd_funcs.c22
3 files changed, 26 insertions, 2 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 31f719bd..de57ac82 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -797,6 +797,7 @@ cmd_ac_init(void)
 
     statusbar_show_ac = autocomplete_new();
     autocomplete_add(statusbar_show_ac, "name");
+    autocomplete_add(statusbar_show_ac, "number");
 }
 
 void
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index fd1c5697..5a873309 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -1358,8 +1358,8 @@ static struct cmd_t command_defs[] =
         CMD_TAGS(
             CMD_TAG_UI)
         CMD_SYN(
-            "/statusbar show name",
-            "/statusbar hide name",
+            "/statusbar show name|number",
+            "/statusbar hide name|number",
             "/statusbar maxtabs <value>",
             "/statusbar chat user|jid",
             "/statusbar room room|jid",
@@ -1370,6 +1370,7 @@ static struct cmd_t command_defs[] =
         CMD_ARGS(
             { "maxtabs <value>",    "Set the maximum number of tabs to display, <value> must be between 0 and 10" },
             { "show|hide name",     "Show or hide names in tabs." },
+            { "show|hide number",   "Show or hide numbers in tabs." },
             { "chat user|jid",      "Show only the users name, or the full jid if no nick is present for chat tabs." },
             { "room room|jid",      "Show only the rooms name, or the full jid for room tabs." },
             { "up",                 "Move the status bar up the screen." },
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index ae7f2abc..e6e53ca4 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -5776,17 +5776,39 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
             ui_resize();
             return TRUE;
         }
+        if (g_strcmp0(args[1], "number") == 0) {
+            prefs_set_boolean(PREF_STATUSBAR_SHOW_NUMBER, TRUE);
+            cons_show("Enabled showing tab numbers.");
+            ui_resize();
+            return TRUE;
+        }
         cons_bad_cmd_usage(command);
         return TRUE;
     }
 
     if (g_strcmp0(args[0], "hide") == 0) {
         if (g_strcmp0(args[1], "name") == 0) {
+            if (prefs_get_boolean(PREF_STATUSBAR_SHOW_NUMBER) == FALSE) {
+                cons_show("Cannot disable both names and numbers in statusbar.");
+                cons_show("Use '/statusbar maxtabs 0' to hide tabs.");
+                return TRUE;
+            }
             prefs_set_boolean(PREF_STATUSBAR_SHOW_NAME, FALSE);
             cons_show("Disabled showing tab names.");
             ui_resize();
             return TRUE;
         }
+        if (g_strcmp0(args[1], "number") == 0) {
+            if (prefs_get_boolean(PREF_STATUSBAR_SHOW_NAME) == FALSE) {
+                cons_show("Cannot disable both names and numbers in statusbar.");
+                cons_show("Use '/statusbar maxtabs 0' to hide tabs.");
+                return TRUE;
+            }
+            prefs_set_boolean(PREF_STATUSBAR_SHOW_NUMBER, FALSE);
+            cons_show("Disabled showing tab numbers.");
+            ui_resize();
+            return TRUE;
+        }
         cons_bad_cmd_usage(command);
         return TRUE;
     }