Added /roster char resource
This commit is contained in:
@@ -506,6 +506,40 @@ prefs_clear_roster_contact_char(void)
|
||||
_save_prefs();
|
||||
}
|
||||
|
||||
char
|
||||
prefs_get_roster_resource_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.resource.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_resource_char(char ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.resource.char", str);
|
||||
_save_prefs();
|
||||
}
|
||||
|
||||
void
|
||||
prefs_clear_roster_resource_char(void)
|
||||
{
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.resource.char", NULL);
|
||||
_save_prefs();
|
||||
}
|
||||
|
||||
gint
|
||||
prefs_get_roster_contact_indent(void)
|
||||
{
|
||||
|
||||
@@ -172,6 +172,9 @@ void prefs_clear_roster_header_char(void);
|
||||
char prefs_get_roster_contact_char(void);
|
||||
void prefs_set_roster_contact_char(char ch);
|
||||
void prefs_clear_roster_contact_char(void);
|
||||
char prefs_get_roster_resource_char(void);
|
||||
void prefs_set_roster_resource_char(char ch);
|
||||
void prefs_clear_roster_resource_char(void);
|
||||
|
||||
gint prefs_get_roster_contact_indent(void);
|
||||
void prefs_set_roster_contact_indent(gint value);
|
||||
|
||||
@@ -484,6 +484,13 @@ _load_preferences(void)
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
if (g_key_file_has_key(theme, "ui", "roster.resource.char", NULL)) {
|
||||
gchar *ch = g_key_file_get_string(theme, "ui", "roster.resource.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_resource_char(ch[0]);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
if (g_key_file_has_key(theme, "ui", "roster.contact.indent", NULL)) {
|
||||
gint contact_indent = g_key_file_get_integer(theme, "ui", "roster.contact.indent", NULL);
|
||||
prefs_set_roster_contact_indent(contact_indent);
|
||||
|
||||
Reference in New Issue
Block a user