projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
son't try to select non-existent notes after editing (and thus crash).
[ardour.git]
/
gtk2_ardour
/
color_theme_manager.cc
diff --git
a/gtk2_ardour/color_theme_manager.cc
b/gtk2_ardour/color_theme_manager.cc
index 6438650bcae88bc676fb6572d8d5072e3e4098d0..fc2a823c68032e0f12a1fd496048b89503c238e1 100644
(file)
--- a/
gtk2_ardour/color_theme_manager.cc
+++ b/
gtk2_ardour/color_theme_manager.cc
@@
-46,7
+46,7
@@
#include "ui_config.h"
#include "utils.h"
#include "ui_config.h"
#include "utils.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace std;
using namespace Gtk;
using namespace std;
using namespace Gtk;
@@
-71,7
+71,6
@@
ColorThemeManager::ColorThemeManager ()
theme_list = TreeStore::create (color_theme_columns);
TreeModel::iterator selected_iter = theme_list->children().end();
theme_list = TreeStore::create (color_theme_columns);
TreeModel::iterator selected_iter = theme_list->children().end();
- const bool running_from_source = running_from_source_tree();
for (std::map<string,string>::iterator c = color_themes.begin(); c != color_themes.end(); ++c) {
TreeModel::Row row;
for (std::map<string,string>::iterator c = color_themes.begin(); c != color_themes.end(); ++c) {
TreeModel::Row row;
@@
-81,21
+80,12
@@
ColorThemeManager::ColorThemeManager ()
string color_file_name = c->second;
string color_file_name = c->second;
- if (running_from_source) {
- /* color themes from within the source tree are
- suffixed by "-PROGRAM-NAME" (lowercased)
- */
- replace_all (color_file_name, string_compose ("-%1", downcase (PROGRAM_NAME)), "");
- }
-
row[color_theme_columns.path] = color_file_name;
/* match second (path; really basename) since that is
what we store/restore.
*/
row[color_theme_columns.path] = color_file_name;
/* match second (path; really basename) since that is
what we store/restore.
*/
- cerr << "selected CF is " << UIConfiguration::instance().get_color_file () << " this is " << c->second << endl;
-
if (UIConfiguration::instance().get_color_file() == color_file_name) {
selected_iter = row;
}
if (UIConfiguration::instance().get_color_file() == color_file_name) {
selected_iter = row;
}
@@
-175,6
+165,16
@@
ColorThemeManager::ColorThemeManager ()
show_all ();
}
show_all ();
}
+
+ColorThemeManager::~ColorThemeManager ()
+{
+ if (palette_group) {
+ palette_group->clear (true);
+ delete palette_group;
+ }
+}
+
+
void
ColorThemeManager::setup_modifiers ()
{
void
ColorThemeManager::setup_modifiers ()
{
@@
-233,7
+233,9
@@
ColorThemeManager::reset_canvas_colors()
string cfile;
string basename;
string cfile;
string basename;
- basename = UIConfiguration::instance().color_file_name (false, running_from_source_tree(), false);
+ /* look for a versioned user-owned color file, and try to rename it */
+
+ basename = UIConfiguration::instance().color_file_name (true, true);
if (find_file (ardour_config_search_path(), basename, cfile)) {
string backup = cfile + string (X_(".old"));
if (find_file (ardour_config_search_path(), basename, cfile)) {
string backup = cfile + string (X_(".old"));
@@
-319,7
+321,6
@@
ColorThemeManager::build_palette_canvas (ArdourCanvas::Canvas& canvas, ArdourCan
for (uint32_t y = 0; y < height - box_size && color_num < color_limit; y += box_size) {
for (uint32_t x = 0; x < width - box_size && color_num < color_limit; x += box_size) {
ArdourCanvas::Rectangle* r = new ArdourCanvas::Rectangle (&group, ArdourCanvas::Rect (x, y, x + box_size, y + box_size));
for (uint32_t y = 0; y < height - box_size && color_num < color_limit; y += box_size) {
for (uint32_t x = 0; x < width - box_size && color_num < color_limit; x += box_size) {
ArdourCanvas::Rectangle* r = new ArdourCanvas::Rectangle (&group, ArdourCanvas::Rect (x, y, x + box_size, y + box_size));
-
string name = nc[color_num++].name;
UIConfiguration::Colors::iterator c = colors.find (name);
string name = nc[color_num++].name;
UIConfiguration::Colors::iterator c = colors.find (name);
@@
-624,7
+625,6
@@
ColorThemeManager::on_color_theme_changed ()
if (row) {
string new_theme = row[color_theme_columns.path];
if (row) {
string new_theme = row[color_theme_columns.path];
- cerr << "New theme name = " << new_theme << endl;
UIConfiguration::instance().set_color_file (new_theme);
}
}
UIConfiguration::instance().set_color_file (new_theme);
}
}