Added /theme list command

This commit is contained in:
James Booth
2012-12-09 00:21:33 +00:00
parent 4c243722c6
commit 986967ef89
5 changed files with 49 additions and 1 deletions

View File

@@ -1223,10 +1223,19 @@ _cmd_prefs(gchar **args, struct cmd_help_t help)
static gboolean
_cmd_theme(gchar **args, struct cmd_help_t help)
{
if (theme_load(args[0])) {
// list themes
if (strcmp(args[0], "list") == 0) {
GSList *themes = theme_list();
cons_show_themes(themes);
g_slist_free_full(themes, g_free);
// load a theme
} else if (theme_load(args[0])) {
ui_load_colours();
prefs_set_theme(args[0]);
cons_show("Loaded theme: %s", args[0]);
// theme not found
} else {
cons_show("Couldn't find theme: %s", args[0]);
}