Move UIConfiguration Singleton into UIConfiguration header

This removes the direct dependence on ardour_ui.h from 39 files
This commit is contained in:
Tim Mayberry 2015-01-02 21:44:54 +07:00 committed by Paul Davis
parent 45d487f16e
commit 6b019a4953
84 changed files with 726 additions and 712 deletions

View file

@ -39,6 +39,7 @@
#include "editor.h"
#include "gui_thread.h"
#include "time_axis_view.h"
#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
#include "audio_time_axis.h"
@ -1633,10 +1634,10 @@ Editor::toggle_sound_midi_notes ()
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
if (act) {
bool s = ARDOUR_UI::config()->get_sound_midi_notes();
bool s = UIConfiguration::instance().get_sound_midi_notes();
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active () != s) {
ARDOUR_UI::config()->set_sound_midi_notes (tact->get_active());
UIConfiguration::instance().set_sound_midi_notes (tact->get_active());
}
}
}
@ -1716,13 +1717,13 @@ Editor::parameter_changed (std::string p)
update_just_timecode ();
} else if (p == "show-zoom-tools") {
if (_zoom_tearoff) {
_zoom_tearoff->set_visible (ARDOUR_UI::config()->get_show_zoom_tools(), true);
_zoom_tearoff->set_visible (UIConfiguration::instance().get_show_zoom_tools(), true);
}
} else if (p == "sound-midi-notes") {
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
if (act) {
bool s = ARDOUR_UI::config()->get_sound_midi_notes();
bool s = UIConfiguration::instance().get_sound_midi_notes();
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active () != s) {
tact->set_active (s);
@ -1738,7 +1739,7 @@ Editor::parameter_changed (std::string p)
/* this doesn't really belong here but it has to go somewhere */
if (ARDOUR_UI::config()->get_use_tooltips()) {
if (UIConfiguration::instance().get_use_tooltips()) {
Gtkmm2ext::enable_tooltips ();
} else {
Gtkmm2ext::disable_tooltips ();