1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge pull request #1198 from ailin-nemui/actlist-sort-type

make actlist_sort a choice type now that we have it
This commit is contained in:
ailin-nemui 2020-05-24 18:59:15 +02:00 committed by GitHub
commit fbe62a34d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,28 +451,16 @@ static void item_input(SBAR_ITEM_REC *item, int get_size_only)
static void read_settings(void) static void read_settings(void)
{ {
const char *str;
if (active_entry != NULL) if (active_entry != NULL)
gui_entry_set_utf8(active_entry, term_type == TERM_TYPE_UTF8); gui_entry_set_utf8(active_entry, term_type == TERM_TYPE_UTF8);
str = settings_get_str("actlist_sort"); actlist_sort = settings_get_choice("actlist_sort");
if (g_ascii_strcasecmp(str, "recent") == 0)
actlist_sort = 1;
else if (g_ascii_strcasecmp(str, "level") == 0)
actlist_sort = 2;
else if (g_ascii_strcasecmp(str, "level,recent") == 0)
actlist_sort = 3;
else {
settings_set_str("actlist_sort", "refnum");
actlist_sort = 0;
}
} }
void statusbar_items_init(void) void statusbar_items_init(void)
{ {
settings_add_time("misc", "lag_min_show", "1sec"); settings_add_time("misc", "lag_min_show", "1sec");
settings_add_str("lookandfeel", "actlist_sort", "refnum"); settings_add_choice("lookandfeel", "actlist_sort", 0, "refnum;recent;level;level,recent");
settings_add_bool("lookandfeel", "actlist_names", FALSE); settings_add_bool("lookandfeel", "actlist_names", FALSE);
settings_add_bool("lookandfeel", "actlist_prefer_window_name", FALSE); settings_add_bool("lookandfeel", "actlist_prefer_window_name", FALSE);