Change theme handling
So far when loading a theme it also overwrote the preferences the user set. Lengthy discussion can be found at https://github.com/profanity-im/profanity/issues/1077 Now we use `/theme load themename` to load the [colours] part of a themem only. `/theme full-load themename` will load the complete theme including preferences set in there. Regards https://github.com/profanity-im/profanity/issues/1077
This commit is contained in:
@@ -154,7 +154,7 @@ theme_init(const char *const theme_name)
|
||||
g_hash_table_insert(defaults, strdup("untrusted"), strdup("red"));
|
||||
g_hash_table_insert(defaults, strdup("cmd.wins.unread"), strdup("default"));
|
||||
|
||||
_load_preferences();
|
||||
//_load_preferences();
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -174,12 +174,14 @@ theme_exists(const char *const theme_name)
|
||||
}
|
||||
|
||||
gboolean
|
||||
theme_load(const char *const theme_name)
|
||||
theme_load(const char *const theme_name, gboolean load_theme_prefs)
|
||||
{
|
||||
color_pair_cache_reset();
|
||||
|
||||
if (_theme_load_file(theme_name)) {
|
||||
_load_preferences();
|
||||
if (load_theme_prefs) {
|
||||
_load_preferences();
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
|
||||
@@ -143,7 +143,7 @@ typedef enum {
|
||||
|
||||
void theme_init(const char *const theme_name);
|
||||
void theme_init_colours(void);
|
||||
gboolean theme_load(const char *const theme_name);
|
||||
gboolean theme_load(const char *const theme_name, gboolean load_theme_prefs);
|
||||
gboolean theme_exists(const char *const theme_name);
|
||||
GSList* theme_list(void);
|
||||
void theme_close(void);
|
||||
|
||||
Reference in New Issue
Block a user