Remove empty tabs
This commit is contained in:
@@ -391,8 +391,6 @@ cmd_ac_init(void)
|
||||
wins_ac = autocomplete_new();
|
||||
autocomplete_add(wins_ac, "unread");
|
||||
autocomplete_add(wins_ac, "prune");
|
||||
autocomplete_add(wins_ac, "tidy");
|
||||
autocomplete_add(wins_ac, "autotidy");
|
||||
autocomplete_add(wins_ac, "swap");
|
||||
|
||||
roster_ac = autocomplete_new();
|
||||
@@ -798,7 +796,6 @@ cmd_ac_init(void)
|
||||
autocomplete_add(statusbar_room_ac, "jid");
|
||||
|
||||
statusbar_show_ac = autocomplete_new();
|
||||
autocomplete_add(statusbar_show_ac, "empty");
|
||||
autocomplete_add(statusbar_show_ac, "name");
|
||||
}
|
||||
|
||||
@@ -1335,7 +1332,7 @@ _cmd_ac_complete_params(ProfWin *window, const char *const input, gboolean previ
|
||||
|
||||
// autocomplete boolean settings
|
||||
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype", "/flash", "/splash", "/chlog", "/grlog",
|
||||
"/history", "/vercheck", "/privileges", "/wrap", "/winstidy", "/carbons", "/encwarn",
|
||||
"/history", "/vercheck", "/privileges", "/wrap", "/carbons", "/encwarn",
|
||||
"/lastactivity" };
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
|
||||
@@ -2667,11 +2664,6 @@ _wins_autocomplete(ProfWin *window, const char *const input, gboolean previous)
|
||||
{
|
||||
char *result = NULL;
|
||||
|
||||
result = autocomplete_param_with_func(input, "/wins autotidy", prefs_autocomplete_boolean_choice, previous);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_ac(input, "/wins", wins_ac, TRUE, previous);
|
||||
if (result) {
|
||||
return result;
|
||||
|
||||
@@ -962,18 +962,14 @@ static struct cmd_t command_defs[] =
|
||||
parse_args, 0, 3, NULL,
|
||||
CMD_SUBFUNCS(
|
||||
{ "unread", cmd_wins_unread },
|
||||
{ "tidy", cmd_wins_tidy },
|
||||
{ "prune", cmd_wins_prune },
|
||||
{ "swap", cmd_wins_swap },
|
||||
{ "autotidy", cmd_wins_autotidy })
|
||||
{ "swap", cmd_wins_swap })
|
||||
CMD_MAINFUNC(cmd_wins)
|
||||
CMD_TAGS(
|
||||
CMD_TAG_UI)
|
||||
CMD_SYN(
|
||||
"/wins",
|
||||
"/wins unread",
|
||||
"/wins tidy",
|
||||
"/wins autotidy on|off",
|
||||
"/wins prune",
|
||||
"/wins swap <source> <target>")
|
||||
CMD_DESC(
|
||||
@@ -981,9 +977,7 @@ static struct cmd_t command_defs[] =
|
||||
"Passing no argument will list all currently active windows and information about their usage.")
|
||||
CMD_ARGS(
|
||||
{ "unread", "List windows with unread messages." },
|
||||
{ "tidy", "Move windows so there are no gaps." },
|
||||
{ "autotidy on|off", "Automatically remove gaps when closing windows." },
|
||||
{ "prune", "Close all windows with no unread messages, and then tidy so there are no gaps." },
|
||||
{ "prune", "Close all windows with no unread messages." },
|
||||
{ "swap <source> <target>", "Swap windows, target may be an empty position." })
|
||||
CMD_NOEXAMPLES
|
||||
},
|
||||
@@ -1364,8 +1358,8 @@ static struct cmd_t command_defs[] =
|
||||
CMD_TAGS(
|
||||
CMD_TAG_UI)
|
||||
CMD_SYN(
|
||||
"/statusbar show empty|name",
|
||||
"/statusbar hide empty|name",
|
||||
"/statusbar show name",
|
||||
"/statusbar hide name",
|
||||
"/statusbar maxtabs <value>",
|
||||
"/statusbar chat user|jid",
|
||||
"/statusbar room room|jid",
|
||||
@@ -1375,7 +1369,6 @@ static struct cmd_t command_defs[] =
|
||||
"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 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." },
|
||||
@@ -1383,7 +1376,7 @@ static struct cmd_t command_defs[] =
|
||||
{ "down", "Move the status bar down the screen." })
|
||||
CMD_EXAMPLES(
|
||||
"/statusbar maxtabs 5",
|
||||
"/statusbar show empty",
|
||||
"/statusbar hide name",
|
||||
"/statusbar chat jid",
|
||||
"/statusbar hide name")
|
||||
},
|
||||
|
||||
@@ -1252,17 +1252,6 @@ cmd_wins_unread(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_wins_tidy(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
if (wins_tidy()) {
|
||||
cons_show("Windows tidied.");
|
||||
} else {
|
||||
cons_show("No tidy needed.");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_wins_prune(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
@@ -1298,23 +1287,6 @@ cmd_wins_swap(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_wins_autotidy(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
if (g_strcmp0(args[1], "on") == 0) {
|
||||
cons_show("Window autotidy enabled");
|
||||
prefs_set_boolean(PREF_WINS_AUTO_TIDY, TRUE);
|
||||
wins_tidy();
|
||||
} else if (g_strcmp0(args[1], "off") == 0) {
|
||||
cons_show("Window autotidy disabled");
|
||||
prefs_set_boolean(PREF_WINS_AUTO_TIDY, FALSE);
|
||||
} else {
|
||||
cons_bad_cmd_usage(command);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_wins(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
@@ -1407,11 +1379,7 @@ cmd_close(ProfWin *window, const char *const command, gchar **args)
|
||||
// close the window
|
||||
ui_close_win(index);
|
||||
cons_show("Closed window %d", index);
|
||||
|
||||
// Tidy up the window list.
|
||||
if (prefs_get_boolean(PREF_WINS_AUTO_TIDY)) {
|
||||
wins_tidy();
|
||||
}
|
||||
wins_tidy();
|
||||
|
||||
rosterwin_roster();
|
||||
return TRUE;
|
||||
@@ -1442,11 +1410,7 @@ cmd_close(ProfWin *window, const char *const command, gchar **args)
|
||||
// close the window
|
||||
ui_close_win(index);
|
||||
cons_show("Closed window %s", args[0]);
|
||||
|
||||
// Tidy up the window list.
|
||||
if (prefs_get_boolean(PREF_WINS_AUTO_TIDY)) {
|
||||
wins_tidy();
|
||||
}
|
||||
wins_tidy();
|
||||
|
||||
rosterwin_roster();
|
||||
return TRUE;
|
||||
@@ -5793,12 +5757,6 @@ gboolean
|
||||
cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
if (g_strcmp0(args[0], "show") == 0) {
|
||||
if (g_strcmp0(args[1], "empty") == 0) {
|
||||
prefs_set_boolean(PREF_STATUSBAR_SHOW_EMPTY, TRUE);
|
||||
cons_show("Enabled showing empty tabs.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "name") == 0) {
|
||||
prefs_set_boolean(PREF_STATUSBAR_SHOW_NAME, TRUE);
|
||||
cons_show("Enabled showing tab names.");
|
||||
@@ -5810,12 +5768,6 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "hide") == 0) {
|
||||
if (g_strcmp0(args[1], "empty") == 0) {
|
||||
prefs_set_boolean(PREF_STATUSBAR_SHOW_EMPTY, FALSE);
|
||||
cons_show("Disabled showing empty tabs.");
|
||||
ui_resize();
|
||||
return TRUE;
|
||||
}
|
||||
if (g_strcmp0(args[1], "name") == 0) {
|
||||
prefs_set_boolean(PREF_STATUSBAR_SHOW_NAME, FALSE);
|
||||
cons_show("Disabled showing tab names.");
|
||||
|
||||
@@ -205,10 +205,8 @@ gboolean cmd_otr_answer(ProfWin *window, const char *const command, gchar **args
|
||||
|
||||
gboolean cmd_wins(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_wins_unread(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_wins_tidy(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_wins_prune(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_wins_swap(ProfWin *window, const char *const command, gchar **args);
|
||||
gboolean cmd_wins_autotidy(ProfWin *window, const char *const command, gchar **args);
|
||||
|
||||
gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user