mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 20:06:21 +00:00
WIP add self prefs for statusbar
This commit is contained in:
@@ -201,6 +201,7 @@ static Autocomplete presence_ac;
|
||||
static Autocomplete presence_setting_ac;
|
||||
static Autocomplete winpos_ac;
|
||||
static Autocomplete statusbar_ac;
|
||||
static Autocomplete statusbar_self_ac;
|
||||
static Autocomplete statusbar_chat_ac;
|
||||
static Autocomplete statusbar_room_ac;
|
||||
static Autocomplete statusbar_show_ac;
|
||||
@@ -784,9 +785,16 @@ cmd_ac_init(void)
|
||||
autocomplete_add(statusbar_ac, "show");
|
||||
autocomplete_add(statusbar_ac, "hide");
|
||||
autocomplete_add(statusbar_ac, "maxtabs");
|
||||
autocomplete_add(statusbar_ac, "self");
|
||||
autocomplete_add(statusbar_ac, "chat");
|
||||
autocomplete_add(statusbar_ac, "room");
|
||||
|
||||
statusbar_self_ac = autocomplete_new();
|
||||
autocomplete_add(statusbar_self_ac, "user");
|
||||
autocomplete_add(statusbar_self_ac, "barejid");
|
||||
autocomplete_add(statusbar_self_ac, "fulljid");
|
||||
autocomplete_add(statusbar_self_ac, "off");
|
||||
|
||||
statusbar_chat_ac = autocomplete_new();
|
||||
autocomplete_add(statusbar_chat_ac, "user");
|
||||
autocomplete_add(statusbar_chat_ac, "jid");
|
||||
@@ -1080,6 +1088,7 @@ cmd_ac_reset(ProfWin *window)
|
||||
autocomplete_reset(presence_setting_ac);
|
||||
autocomplete_reset(winpos_ac);
|
||||
autocomplete_reset(statusbar_ac);
|
||||
autocomplete_reset(statusbar_self_ac);
|
||||
autocomplete_reset(statusbar_chat_ac);
|
||||
autocomplete_reset(statusbar_room_ac);
|
||||
autocomplete_reset(statusbar_show_ac);
|
||||
@@ -1211,6 +1220,7 @@ cmd_ac_uninit(void)
|
||||
autocomplete_free(presence_setting_ac);
|
||||
autocomplete_free(winpos_ac);
|
||||
autocomplete_free(statusbar_ac);
|
||||
autocomplete_free(statusbar_self_ac);
|
||||
autocomplete_free(statusbar_chat_ac);
|
||||
autocomplete_free(statusbar_room_ac);
|
||||
autocomplete_free(statusbar_show_ac);
|
||||
@@ -3230,6 +3240,11 @@ _statusbar_autocomplete(ProfWin *window, const char *const input, gboolean previ
|
||||
return found;
|
||||
}
|
||||
|
||||
found = autocomplete_param_with_ac(input, "/statusbar self", statusbar_self_ac, TRUE, previous);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
|
||||
found = autocomplete_param_with_ac(input, "/statusbar chat", statusbar_chat_ac, TRUE, previous);
|
||||
if (found) {
|
||||
return found;
|
||||
|
||||
@@ -1361,6 +1361,7 @@ static struct cmd_t command_defs[] =
|
||||
"/statusbar show name|number",
|
||||
"/statusbar hide name|number",
|
||||
"/statusbar maxtabs <value>",
|
||||
"/statusbar self user|barejid|fulljid|off",
|
||||
"/statusbar chat user|jid",
|
||||
"/statusbar room room|jid",
|
||||
"/statusbar up",
|
||||
@@ -1368,16 +1369,18 @@ static struct cmd_t command_defs[] =
|
||||
CMD_DESC(
|
||||
"Manage statusbar display preferences.")
|
||||
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." },
|
||||
{ "down", "Move the status bar down the screen." })
|
||||
{ "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." },
|
||||
{ "self user|barejid|fulljid", "Show account user name, barejid, fulljid as status bar title." },
|
||||
{ "self off", "Disable showing self as status bar title." },
|
||||
{ "chat user|jid", "Show users name, or the fulljid if no nick is present for chat tabs." },
|
||||
{ "room room|jid", "Show room name, or the fulljid 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 hide name",
|
||||
"/statusbar self user",
|
||||
"/statusbar chat jid",
|
||||
"/statusbar hide name")
|
||||
},
|
||||
|
||||
@@ -5846,6 +5846,35 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "self") == 0) {
|
||||
if (g_strcmp0(args[1], "barejid") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_SELF, "barejid");
|
||||
cons_show("Using barejid for statusbar title.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "fulljid") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_SELF, "fulljid");
|
||||
cons_show("Using fulljid for statusbar title.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "user") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_SELF, "user");
|
||||
cons_show("Using user for statusbar title.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "off") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_SELF, "off");
|
||||
cons_show("Disabling statusbar title.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
cons_bad_cmd_usage(command);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "chat") == 0) {
|
||||
if (g_strcmp0(args[1], "jid") == 0) {
|
||||
prefs_set_string(PREF_STATUSBAR_CHAT, "jid");
|
||||
|
||||
Reference in New Issue
Block a user