diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-06 14:56:26 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-06 14:56:26 (EST) |
commit | ad70ffabf7f6735b8bcde13fa30a1bd1dc83aec5 (patch) | |
tree | b102d6b3490e5a6774351d27df9783b0db6c9d47 /src/schemes/about | |
parent | e32c7ab394a88eec8893af7f5a7352e167a69968 (diff) | |
download | marquee-ad70ffabf7f6735b8bcde13fa30a1bd1dc83aec5.zip marquee-ad70ffabf7f6735b8bcde13fa30a1bd1dc83aec5.tar.gz marquee-ad70ffabf7f6735b8bcde13fa30a1bd1dc83aec5.tar.bz2 |
about:profiles: Set profile colors
Diffstat (limited to 'src/schemes/about')
-rw-r--r-- | src/schemes/about/profiles.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/schemes/about/profiles.c b/src/schemes/about/profiles.c index 0e7d804..d2a5e21 100644 --- a/src/schemes/about/profiles.c +++ b/src/schemes/about/profiles.c @@ -355,7 +355,8 @@ edit_profiles(MqProfiles *profiles, GHashTable *query) GList *keys; GList *key; gchar *id; - gchar *input_key; + gchar *name_key; + gchar *color_key; keys = g_hash_table_get_keys(query); @@ -363,16 +364,22 @@ edit_profiles(MqProfiles *profiles, GHashTable *query) if (g_str_has_prefix(key->data, "save_")) { id = (gchar *) key->data + strlen("save_"); if (id[0]) { /* Edit existing profile. */ - input_key = g_strconcat("name_", id, NULL); + name_key = g_strconcat("name_", id, NULL); + color_key = g_strconcat("color_", id, NULL); mq_profiles_set_name(profiles, id, - g_hash_table_lookup(query, input_key)); - g_free(input_key); + g_hash_table_lookup(query, name_key)); + mq_profiles_set_color(profiles, id, + g_hash_table_lookup(query, color_key)); + g_free(name_key); + g_free(color_key); } else { - input_key = g_strconcat("name_", id, NULL); + name_key = g_strconcat("name_", id, NULL); + color_key = g_strconcat("color_", id, NULL); mq_profiles_insert(profiles, - g_hash_table_lookup(query, input_key), - "#00ff00"); - g_free(input_key); + g_hash_table_lookup(query, name_key), + g_hash_table_lookup(query, color_key)); + g_free(name_key); + g_free(color_key); } } else if (g_str_has_prefix(key->data, "delete_")) { id = (gchar *) key->data + strlen("delete_"); |