summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-21 23:17:12 +0000
committerDavid Robillard <d@drobilla.net>2012-11-21 23:17:12 +0000
commitb36e8ed06c9d1fbec67b8a3e3a207b3396e29a5a (patch)
tree6f0cf01d3f5b18c5f61fc2f1fbfb8709845ee077 /src/gui
parentdb9c67b9130d6d7eeb78a7d01289c5edaf2d5bfb (diff)
downloadingen-b36e8ed06c9d1fbec67b8a3e3a207b3396e29a5a.tar.gz
ingen-b36e8ed06c9d1fbec67b8a3e3a207b3396e29a5a.tar.bz2
ingen-b36e8ed06c9d1fbec67b8a3e3a207b3396e29a5a.zip
Move most recent graph open directory to Configuration.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4846 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/GraphBox.cpp9
-rw-r--r--src/gui/LoadGraphWindow.cpp7
-rw-r--r--src/gui/Style.hpp6
3 files changed, 11 insertions, 11 deletions
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 <boost/optional.hpp>
#include <glibmm/miscutils.h>
+#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<const GraphModel> 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;