13
0

fix up a logic problem when editing palette colors

This commit is contained in:
Paul Davis 2014-12-07 13:44:12 -05:00
parent d7ca81cced
commit b37be190f3

View File

@ -693,8 +693,6 @@ ThemeManager::alias_palette_event (GdkEvent* ev, string new_alias, string target
void void
ThemeManager::alias_palette_response (int response, std::string target_name, std::string old_alias) ThemeManager::alias_palette_response (int response, std::string target_name, std::string old_alias)
{ {
palette_response_connection.disconnect ();
switch (response) { switch (response) {
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
case GTK_RESPONSE_ACCEPT: case GTK_RESPONSE_ACCEPT:
@ -721,7 +719,8 @@ ThemeManager::choose_color_from_palette (string const & name)
return; return;
} }
if (!palette_window) { delete palette_window;
palette_window = new ArdourDialog (_("Color Palette")); palette_window = new ArdourDialog (_("Color Palette"));
palette_window->add_button (Stock::CANCEL, RESPONSE_CANCEL); palette_window->add_button (Stock::CANCEL, RESPONSE_CANCEL);
palette_window->add_button (Stock::OK, RESPONSE_OK); palette_window->add_button (Stock::OK, RESPONSE_OK);
@ -735,9 +734,7 @@ ThemeManager::choose_color_from_palette (string const & name)
palette_window->get_vbox()->pack_start (*canvas); palette_window->get_vbox()->pack_start (*canvas);
palette_window->show_all (); palette_window->show_all ();
}
palette_response_connection.disconnect ();
palette_response_connection = palette_window->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ThemeManager::alias_palette_response), name, i->second)); palette_response_connection = palette_window->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ThemeManager::alias_palette_response), name, i->second));
palette_window->set_position (WIN_POS_MOUSE); palette_window->set_position (WIN_POS_MOUSE);