mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
internal default.theme is used if it isn't found anywhere
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@910 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
f2a8cab907
commit
6ef409c4d0
@ -1,8 +1,10 @@
|
|||||||
# create default-config.h
|
# create default-config.h
|
||||||
config.h: default-config.h
|
config.h: default-config.h default-theme.h
|
||||||
|
|
||||||
default-config.h: $(srcdir)/config
|
default-config.h: $(srcdir)/config
|
||||||
$(srcdir)/file2header.sh $(srcdir)/config > default-config.h
|
$(srcdir)/file2header.sh $(srcdir)/config default_config > default-config.h
|
||||||
|
default-theme.h: $(srcdir)/default.theme
|
||||||
|
$(srcdir)/file2header.sh $(srcdir)/default.theme default_theme > default-theme.h
|
||||||
|
|
||||||
if BUILD_PLUGINS
|
if BUILD_PLUGINS
|
||||||
PLUGINS=plugins
|
PLUGINS=plugins
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "const char *default_config ="
|
echo "const char *$2 ="
|
||||||
cat $1|sed 's/\\/\\\\/g'|sed 's/"/\\"/g'|sed 's/^/\"/'|sed 's/$/\\n\"/'
|
cat $1|sed 's/\\/\\\\/g'|sed 's/"/\\"/g'|sed 's/^/\"/'|sed 's/$/\\n\"/'
|
||||||
echo ";"
|
echo ";"
|
||||||
|
@ -31,11 +31,13 @@
|
|||||||
#include "themes.h"
|
#include "themes.h"
|
||||||
#include "printtext.h"
|
#include "printtext.h"
|
||||||
|
|
||||||
|
#include "default-theme.h"
|
||||||
|
|
||||||
GSList *themes;
|
GSList *themes;
|
||||||
THEME_REC *current_theme;
|
THEME_REC *current_theme;
|
||||||
GHashTable *default_formats;
|
GHashTable *default_formats;
|
||||||
|
|
||||||
static void theme_read(THEME_REC *theme, const char *path);
|
static void theme_read(THEME_REC *theme, const char *path, const char *data);
|
||||||
|
|
||||||
THEME_REC *theme_create(const char *path, const char *name)
|
THEME_REC *theme_create(const char *path, const char *name)
|
||||||
{
|
{
|
||||||
@ -635,7 +637,7 @@ THEME_REC *theme_load(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
theme = theme_create(fname, name);
|
theme = theme_create(fname, name);
|
||||||
theme_read(theme, theme->path);
|
theme_read(theme, theme->path, NULL);
|
||||||
|
|
||||||
g_free(fname);
|
g_free(fname);
|
||||||
return theme;
|
return theme;
|
||||||
@ -652,19 +654,23 @@ static void theme_read_modules(const char *module, void *value,
|
|||||||
theme_init_module(rec->theme, module, rec->config);
|
theme_init_module(rec->theme, module, rec->config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void theme_read(THEME_REC *theme, const char *path)
|
static void theme_read(THEME_REC *theme, const char *path, const char *data)
|
||||||
{
|
{
|
||||||
CONFIG_REC *config;
|
CONFIG_REC *config;
|
||||||
THEME_READ_REC rec;
|
THEME_READ_REC rec;
|
||||||
|
|
||||||
config = config_open(path, -1);
|
if (data == NULL) {
|
||||||
if (config == NULL) {
|
config = config_open(path, -1);
|
||||||
/* didn't exist or no access? */
|
if (config == NULL) {
|
||||||
theme->default_color = 15;
|
/* didn't exist or no access? */
|
||||||
return;
|
theme->default_color = 15;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
config_parse(config);
|
||||||
|
} else {
|
||||||
|
config = config_open(NULL, -1);
|
||||||
|
config_parse_data(config, data, "internal");
|
||||||
}
|
}
|
||||||
|
|
||||||
config_parse(config);
|
|
||||||
theme->default_color = config_get_int(config, NULL, "default_color", 15);
|
theme->default_color = config_get_int(config, NULL, "default_color", 15);
|
||||||
theme_read_replaces(config, theme);
|
theme_read_replaces(config, theme);
|
||||||
theme_read_abstracts(config, theme);
|
theme_read_abstracts(config, theme);
|
||||||
@ -968,6 +974,7 @@ static void themes_read(void)
|
|||||||
g_get_home_dir());
|
g_get_home_dir());
|
||||||
current_theme = theme_create(fname, "default");
|
current_theme = theme_create(fname, "default");
|
||||||
current_theme->default_color = 15;
|
current_theme->default_color = 15;
|
||||||
|
theme_read(current_theme, NULL, default_theme);
|
||||||
g_free(fname);
|
g_free(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user