summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c931083)
raw | patch | inline | side by side (parent: c931083)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 23 May 2012 01:21:05 +0000 (03:21 +0200) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 23 May 2012 02:04:26 +0000 (04:04 +0200) |
src/conf.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history | |
src/screen_chat.c | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 50feefee6e2807f3b5c5e9331e8291b6ad0eba3b..f9b6918e3df70cce1ba7ac5d0f5e717c6f4328bf 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#define CONF_LYRICS_SHOW_PLUGIN "lyrics-show-plugin"
#define CONF_TEXT_EDITOR "text-editor"
#define CONF_TEXT_EDITOR_ASK "text-editor-ask"
+#define CONF_CHAT_PREFIX "chat-prefix"
#define CONF_SECOND_COLUMN "second-column"
static bool
options.text_editor_ask = str2bool(value);
#else
{}
+#endif
+ else if (!strcasecmp(name, CONF_CHAT_PREFIX))
+#ifdef ENABLE_CHAT_SCREEN
+ options.chat_prefix = get_format(value);
+#else
+ {}
#endif
else if (!strcasecmp(CONF_SECOND_COLUMN, name))
#ifdef NCMPC_MINI
diff --git a/src/options.c b/src/options.c
index 0129b235eb31f554cd24a91d7d980b0ec91fff2d..6f674c6cd61b9d3736dfd27ebfd87d2ea224813b 100644 (file)
--- a/src/options.c
+++ b/src/options.c
#ifdef ENABLE_LYRICS_SCREEN
g_free(options.text_editor);
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ g_free(options.chat_prefix);
+#endif
}
diff --git a/src/options.h b/src/options.h
index c1a833d01066c3157e5badfd5421ac84f87d1213..74dfd4284657a31d3066742ea040c69b6b17d823 100644 (file)
--- a/src/options.h
+++ b/src/options.h
bool lyrics_show_plugin;
char *text_editor;
bool text_editor_ask;
+#endif
+#ifdef ENABLE_CHAT_SCREEN
+ char *chat_prefix;
#endif
bool find_wrap;
bool find_show_last_pattern;
diff --git a/src/screen_chat.c b/src/screen_chat.c
index 6daca65aecd25f31fc3788b887f08b04e39c9f8c..2b887bafbe3a6208cd2758e4521bd60fbe93eb89 100644 (file)
--- a/src/screen_chat.c
+++ b/src/screen_chat.c
if (prefix)
return prefix;
+ if (options.chat_prefix) {
+ /* Options are encoded in the "locale" charset */
+ prefix = locale_to_utf8(options.chat_prefix);
+ return prefix;
+ }
+
prefix = g_strconcat("<", g_get_user_name(), "> ", NULL);
return prefix;
}