fix save/restore of preferences torn-off-window state
This commit is contained in:
parent
7a1084d349
commit
dc43189c7e
@ -3574,6 +3574,11 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
|
|||||||
new_session->add_instant_xml (*n, false);
|
new_session->add_instant_xml (*n, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n = Config->instant_xml (X_("Preferences"));
|
||||||
|
if (n) {
|
||||||
|
new_session->add_instant_xml (*n, false);
|
||||||
|
}
|
||||||
|
|
||||||
/* Put the playhead at 0 and scroll fully left */
|
/* Put the playhead at 0 and scroll fully left */
|
||||||
n = new_session->instant_xml (X_("Editor"));
|
n = new_session->instant_xml (X_("Editor"));
|
||||||
if (n) {
|
if (n) {
|
||||||
@ -4544,6 +4549,24 @@ ARDOUR_UI::export_video (bool range)
|
|||||||
export_video_dialog->hide ();
|
export_video_dialog->hide ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XMLNode*
|
||||||
|
ARDOUR_UI::preferences_settings () const
|
||||||
|
{
|
||||||
|
XMLNode* node = 0;
|
||||||
|
|
||||||
|
if (_session) {
|
||||||
|
node = _session->instant_xml(X_("Preferences"));
|
||||||
|
} else {
|
||||||
|
node = Config->instant_xml(X_("Preferences"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!node) {
|
||||||
|
node = new XMLNode (X_("Preferences"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
XMLNode*
|
XMLNode*
|
||||||
ARDOUR_UI::mixer_settings () const
|
ARDOUR_UI::mixer_settings () const
|
||||||
{
|
{
|
||||||
|
@ -232,6 +232,7 @@ public:
|
|||||||
|
|
||||||
XMLNode* main_window_settings() const;
|
XMLNode* main_window_settings() const;
|
||||||
XMLNode* editor_settings() const;
|
XMLNode* editor_settings() const;
|
||||||
|
XMLNode* preferences_settings() const;
|
||||||
XMLNode* mixer_settings () const;
|
XMLNode* mixer_settings () const;
|
||||||
XMLNode* keyboard_settings () const;
|
XMLNode* keyboard_settings () const;
|
||||||
XMLNode* tearoff_settings (const char*) const;
|
XMLNode* tearoff_settings (const char*) const;
|
||||||
|
@ -733,6 +733,7 @@ ARDOUR_UI::save_ardour_state ()
|
|||||||
XMLNode& enode (editor->get_state());
|
XMLNode& enode (editor->get_state());
|
||||||
XMLNode& mnode (mixer->get_state());
|
XMLNode& mnode (mixer->get_state());
|
||||||
XMLNode& bnode (meterbridge->get_state());
|
XMLNode& bnode (meterbridge->get_state());
|
||||||
|
XMLNode& pnode (rc_option_editor->get_state());
|
||||||
|
|
||||||
Config->add_extra_xml (*window_node);
|
Config->add_extra_xml (*window_node);
|
||||||
Config->add_extra_xml (audio_midi_setup->get_state());
|
Config->add_extra_xml (audio_midi_setup->get_state());
|
||||||
@ -745,6 +746,7 @@ ARDOUR_UI::save_ardour_state ()
|
|||||||
_session->add_instant_xml (main_window_node);
|
_session->add_instant_xml (main_window_node);
|
||||||
_session->add_instant_xml (enode);
|
_session->add_instant_xml (enode);
|
||||||
_session->add_instant_xml (mnode);
|
_session->add_instant_xml (mnode);
|
||||||
|
_session->add_instant_xml (pnode);
|
||||||
_session->add_instant_xml (bnode);
|
_session->add_instant_xml (bnode);
|
||||||
if (location_ui) {
|
if (location_ui) {
|
||||||
_session->add_instant_xml (location_ui->ui().get_state ());
|
_session->add_instant_xml (location_ui->ui().get_state ());
|
||||||
@ -753,12 +755,17 @@ ARDOUR_UI::save_ardour_state ()
|
|||||||
Config->add_instant_xml (main_window_node);
|
Config->add_instant_xml (main_window_node);
|
||||||
Config->add_instant_xml (enode);
|
Config->add_instant_xml (enode);
|
||||||
Config->add_instant_xml (mnode);
|
Config->add_instant_xml (mnode);
|
||||||
|
Config->add_instant_xml (pnode);
|
||||||
Config->add_instant_xml (bnode);
|
Config->add_instant_xml (bnode);
|
||||||
if (location_ui) {
|
if (location_ui) {
|
||||||
Config->add_instant_xml (location_ui->ui().get_state ());
|
Config->add_instant_xml (location_ui->ui().get_state ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete &enode;
|
delete &enode;
|
||||||
|
delete &mnode;
|
||||||
|
delete &bnode;
|
||||||
|
delete &pnode;
|
||||||
|
|
||||||
Keyboard::save_keybindings ();
|
Keyboard::save_keybindings ();
|
||||||
}
|
}
|
||||||
|
@ -1854,6 +1854,13 @@ RCOptionEditor::RCOptionEditor ()
|
|||||||
, _rc_config (Config)
|
, _rc_config (Config)
|
||||||
, _mixer_strip_visibility ("mixer-element-visibility")
|
, _mixer_strip_visibility ("mixer-element-visibility")
|
||||||
{
|
{
|
||||||
|
XMLNode* node = ARDOUR_UI::instance()->preferences_settings();
|
||||||
|
if (node) {
|
||||||
|
/* gcc4 complains about ambiguity with Gtk::Widget::set_state
|
||||||
|
(Gtk::StateType) here !!!
|
||||||
|
*/
|
||||||
|
Tabbable::set_state (*node, Stateful::loading_state_version);
|
||||||
|
}
|
||||||
|
|
||||||
UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &RCOptionEditor::parameter_changed));
|
UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &RCOptionEditor::parameter_changed));
|
||||||
|
|
||||||
@ -3482,3 +3489,11 @@ RCOptionEditor::use_own_window (bool and_fill_it)
|
|||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XMLNode&
|
||||||
|
RCOptionEditor::get_state ()
|
||||||
|
{
|
||||||
|
XMLNode* node = new XMLNode (X_("Preferences"));
|
||||||
|
node->add_child_nocopy (Tabbable::get_state());
|
||||||
|
return *node;
|
||||||
|
}
|
||||||
|
@ -42,6 +42,7 @@ public:
|
|||||||
void populate_sync_options ();
|
void populate_sync_options ();
|
||||||
|
|
||||||
Gtk::Window* use_own_window (bool and_fill_it);
|
Gtk::Window* use_own_window (bool and_fill_it);
|
||||||
|
XMLNode& get_state ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parameter_changed (std::string const &);
|
void parameter_changed (std::string const &);
|
||||||
|
Loading…
Reference in New Issue
Block a user