From b36e8ed06c9d1fbec67b8a3e3a207b3396e29a5a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 21 Nov 2012 23:17:12 +0000 Subject: Move most recent graph open directory to Configuration. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4846 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/GraphBox.cpp | 9 ++++++--- src/gui/LoadGraphWindow.cpp | 7 +++++-- src/gui/Style.hpp | 6 ------ 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index a2f76100..6607ebbd 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -475,10 +475,11 @@ GraphBox::event_save_as() // Set current folder to most sensible default const Raul::Atom& document = _graph->get_property(uris.ingen_document); + const Raul::Atom& dir = _app->world()->conf().option("graph-directory"); if (document.type() == uris.forge.URI) dialog.set_uri(document.get_uri()); - else if (_app->style()->graph_folder().length() > 0) - dialog.set_current_folder(_app->style()->graph_folder()); + else if (dir.is_valid()) + dialog.set_current_folder(dir.get_string()); if (dialog.run() != Gtk::RESPONSE_OK) break; @@ -552,7 +553,9 @@ GraphBox::event_save_as() STATUS_CONTEXT_GRAPH); } - _app->style()->set_graph_folder(dialog.get_current_folder()); + _app->world()->conf().set( + "graph-folder", + _app->world()->forge().alloc(dialog.get_current_folder())); break; } } diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp index a7daf90f..760463ea 100644 --- a/src/gui/LoadGraphWindow.cpp +++ b/src/gui/LoadGraphWindow.cpp @@ -21,6 +21,7 @@ #include #include +#include "ingen/Configuration.hpp" #include "ingen/Interface.hpp" #include "ingen/client/BlockModel.hpp" #include "ingen/client/ClientStore.hpp" @@ -125,8 +126,10 @@ LoadGraphWindow::set_graph(SharedPtr graph) void LoadGraphWindow::on_show() { - if (_app->style()->graph_folder().length() > 0) - set_current_folder(_app->style()->graph_folder()); + const Raul::Atom& dir = _app->world()->conf().option("graph-directory"); + if (dir.is_valid()) { + set_current_folder(dir.get_string()); + } Gtk::FileChooserDialog::on_show(); } diff --git a/src/gui/Style.hpp b/src/gui/Style.hpp index e1bfaeb1..eb6947f8 100644 --- a/src/gui/Style.hpp +++ b/src/gui/Style.hpp @@ -42,17 +42,11 @@ public: void apply_settings(); - const std::string& graph_folder() { return _graph_folder; } - void set_graph_folder(const std::string& f) { _graph_folder = f; } - uint32_t get_port_color(const Client::PortModel* p); private: App& _app; - /** Most recent graph folder shown in open dialog */ - std::string _graph_folder; - uint32_t _audio_port_color; uint32_t _control_port_color; uint32_t _cv_port_color; -- cgit v1.2.1