Add preferences for tab display
This commit is contained in:
@@ -201,6 +201,8 @@ static Autocomplete presence_ac;
|
||||
static Autocomplete presence_setting_ac;
|
||||
static Autocomplete winpos_ac;
|
||||
static Autocomplete statusbar_ac;
|
||||
static Autocomplete statusbar_chat_ac;
|
||||
static Autocomplete statusbar_room_ac;
|
||||
static Autocomplete statusbar_show_ac;
|
||||
|
||||
void
|
||||
@@ -784,6 +786,16 @@ cmd_ac_init(void)
|
||||
autocomplete_add(statusbar_ac, "show");
|
||||
autocomplete_add(statusbar_ac, "hide");
|
||||
autocomplete_add(statusbar_ac, "maxtabs");
|
||||
autocomplete_add(statusbar_ac, "chat");
|
||||
autocomplete_add(statusbar_ac, "room");
|
||||
|
||||
statusbar_chat_ac = autocomplete_new();
|
||||
autocomplete_add(statusbar_chat_ac, "user");
|
||||
autocomplete_add(statusbar_chat_ac, "jid");
|
||||
|
||||
statusbar_room_ac = autocomplete_new();
|
||||
autocomplete_add(statusbar_room_ac, "room");
|
||||
autocomplete_add(statusbar_room_ac, "jid");
|
||||
|
||||
statusbar_show_ac = autocomplete_new();
|
||||
autocomplete_add(statusbar_show_ac, "empty");
|
||||
@@ -1070,6 +1082,8 @@ cmd_ac_reset(ProfWin *window)
|
||||
autocomplete_reset(presence_setting_ac);
|
||||
autocomplete_reset(winpos_ac);
|
||||
autocomplete_reset(statusbar_ac);
|
||||
autocomplete_reset(statusbar_chat_ac);
|
||||
autocomplete_reset(statusbar_room_ac);
|
||||
autocomplete_reset(statusbar_show_ac);
|
||||
|
||||
autocomplete_reset(script_ac);
|
||||
@@ -1199,6 +1213,8 @@ cmd_ac_uninit(void)
|
||||
autocomplete_free(presence_setting_ac);
|
||||
autocomplete_free(winpos_ac);
|
||||
autocomplete_free(statusbar_ac);
|
||||
autocomplete_free(statusbar_chat_ac);
|
||||
autocomplete_free(statusbar_room_ac);
|
||||
autocomplete_free(statusbar_show_ac);
|
||||
}
|
||||
|
||||
@@ -3221,5 +3237,15 @@ _statusbar_autocomplete(ProfWin *window, const char *const input, gboolean previ
|
||||
return found;
|
||||
}
|
||||
|
||||
found = autocomplete_param_with_ac(input, "/statusbar chat", statusbar_chat_ac, TRUE, previous);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
|
||||
found = autocomplete_param_with_ac(input, "/statusbar room", statusbar_room_ac, TRUE, previous);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1367,6 +1367,8 @@ static struct cmd_t command_defs[] =
|
||||
"/statusbar show empty|name",
|
||||
"/statusbar hide empty|name",
|
||||
"/statusbar maxtabs <value>",
|
||||
"/statusbar chat user|jid",
|
||||
"/statusbar room room|jid",
|
||||
"/statusbar up",
|
||||
"/statusbar down")
|
||||
CMD_DESC(
|
||||
@@ -1375,11 +1377,14 @@ static struct cmd_t command_defs[] =
|
||||
{ "maxtabs <value>", "Set the maximum number of tabs to display, <value> must be between 0 and 10" },
|
||||
{ "show|hide empty", "Show or hide empty tabs." },
|
||||
{ "show|hide name", "Show or hide names 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." },
|
||||
{ "down", "Move the status bar down the screen." })
|
||||
CMD_EXAMPLES(
|
||||
"/statusbar maxtabs 5",
|
||||
"/statusbar show empty",
|
||||
"/statusbar chat jid",
|
||||
"/statusbar hide name")
|
||||
},
|
||||
|
||||
|
||||
@@ -2095,7 +2095,7 @@ cmd_who(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
|
||||
if (window->type != WIN_CONSOLE && window->type != WIN_MUC) {
|
||||
status_bar_new(1, "console");
|
||||
status_bar_new(1, WIN_CONSOLE, "console");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -5848,6 +5848,7 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
|
||||
} else {
|
||||
cons_show("Status bar tabs set to %d.", intval);
|
||||
}
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
} else {
|
||||
cons_show(err_msg);
|
||||
@@ -5857,6 +5858,40 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "chat") == 0) {
|
||||
if (g_strcmp0(args[1], "jid") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_CHAT, "jid");
|
||||
cons_show("Using jid for chat tabs.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "user") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_CHAT, "user");
|
||||
cons_show("Using user for chat tabs.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
cons_bad_cmd_usage(command);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "room") == 0) {
|
||||
if (g_strcmp0(args[1], "jid") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_ROOM, "jid");
|
||||
cons_show("Using jid for room tabs.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "room") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_ROOM, "room");
|
||||
cons_show("Using room name for room tabs.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
cons_bad_cmd_usage(command);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "up") == 0) {
|
||||
gboolean result = prefs_statusbar_pos_up();
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user