+ if (!found) {
+ warning << string_compose (_("Color file for %1 not found along %2"), color_file.get(), theme_search_path().to_string()) << endmsg;
+ return -1;
+ }
+
+ (void) load_color_file (cfile);
+
+ if (allow_own) {
+
+ found = false;
+
+ PBD::Searchpath sp (user_config_directory());
+
+ /* user's own color files never have the program name in them */
+
+ if (find_file (sp, color_file_name (true, true), cfile)) {
+ found = true;
+ }
+
+ if (!found) {
+ if (find_file (sp, color_file_name (true, false), cfile)) {
+ found = true;
+ }
+ }
+
+ if (found) {
+ (void) load_color_file (cfile);
+ }
+
+ }
+
+ ColorsChanged ();
+
+ return 0;
+}
+
+int
+UIConfiguration::store_color_theme ()
+{
+ XMLNode* root;
+
+ root = new XMLNode("Ardour");
+
+ XMLNode* parent = new XMLNode (X_("Colors"));
+ for (Colors::const_iterator i = colors.begin(); i != colors.end(); ++i) {
+ XMLNode* node = new XMLNode (X_("Color"));
+ node->set_property (X_("name"), i->first);
+ node->set_property (X_("value"), color_to_hex_string (i->second));
+ parent->add_child_nocopy (*node);
+ }
+ root->add_child_nocopy (*parent);
+
+ parent = new XMLNode (X_("ColorAliases"));
+ for (ColorAliases::const_iterator i = color_aliases.begin(); i != color_aliases.end(); ++i) {
+ XMLNode* node = new XMLNode (X_("ColorAlias"));
+ node->set_property (X_("name"), i->first);
+ node->set_property (X_("alias"), i->second);
+ parent->add_child_nocopy (*node);
+ }
+ root->add_child_nocopy (*parent);
+
+ parent = new XMLNode (X_("Modifiers"));
+ for (Modifiers::const_iterator i = modifiers.begin(); i != modifiers.end(); ++i) {
+ XMLNode* node = new XMLNode (X_("Modifier"));
+ node->set_property (X_("name"), i->first);
+ node->set_property (X_("modifier"), i->second.to_string());
+ parent->add_child_nocopy (*node);
+ }
+ root->add_child_nocopy (*parent);
+
+ XMLTree tree;
+ std::string colorfile = Glib::build_filename (user_config_directory(), color_file_name (true, true));;
+
+ tree.set_root (root);