diff options
author | David Robillard <d@drobilla.net> | 2012-11-22 03:17:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-11-22 03:17:28 +0000 |
commit | b6376fc247490134827c51c554a6108ab9f5a898 (patch) | |
tree | 1274679011e2f3da2a87adb43a217fe26861ca7e /src/gui | |
parent | b36e8ed06c9d1fbec67b8a3e3a207b3396e29a5a (diff) | |
download | ingen-b6376fc247490134827c51c554a6108ab9f5a898.tar.gz ingen-b6376fc247490134827c51c554a6108ab9f5a898.tar.bz2 ingen-b6376fc247490134827c51c554a6108ab9f5a898.zip |
Configuration file saving.
Automatically save and restore GUI settings (last patch directory, human names, etc.).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4848 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/App.cpp | 14 | ||||
-rw-r--r-- | src/gui/GraphBox.cpp | 3 | ||||
-rw-r--r-- | src/gui/LoadGraphWindow.cpp | 4 |
3 files changed, 19 insertions, 2 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 30c31f64..b458bc3c 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -23,13 +23,14 @@ #include <gtkmm/stock.h> #include "ganv/Edge.hpp" +#include "ingen/Configuration.hpp" #include "ingen/EngineBase.hpp" #include "ingen/Interface.hpp" #include "ingen/Log.hpp" #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/ObjectModel.hpp" #include "ingen/client/GraphModel.hpp" +#include "ingen/client/ObjectModel.hpp" #include "ingen/client/SigClientInterface.hpp" #include "ingen/runtime_paths.hpp" #include "lilv/lilv.h" @@ -74,6 +75,8 @@ App::App(Ingen::World* world) , _enable_signal(true) , _requested_plugins(false) { + _world->conf().load_default("ingen", "gui.ttl"); + WidgetFactory::get_widget_derived("connect_win", _connect_window); WidgetFactory::get_widget_derived("messages_win", _messages_window); WidgetFactory::get_widget_derived("graph_tree_win", _graph_tree_window); @@ -348,6 +351,15 @@ App::quit(Gtk::Window* dialog_parent) if (quit) Gtk::Main::quit(); + try { + const std::string path = _world->conf().save( + _world->uri_map(), "ingen", "gui.ttl", Configuration::GUI); + cout << (Raul::fmt("Saved GUI settings to %1%\n") % path); + } catch (const std::exception& e) { + cerr << (Raul::fmt("Error saving GUI settings (%1%)\n") + % e.what()); + } + return quit; } diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index 6607ebbd..0401143c 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -554,8 +554,9 @@ GraphBox::event_save_as() } _app->world()->conf().set( - "graph-folder", + "graph-directory", _app->world()->forge().alloc(dialog.get_current_folder())); + break; } } diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp index 760463ea..a547c279 100644 --- a/src/gui/LoadGraphWindow.cpp +++ b/src/gui/LoadGraphWindow.cpp @@ -197,6 +197,10 @@ LoadGraphWindow::ok_clicked() _graph.reset(); hide(); + + _app->world()->conf().set( + "graph-directory", + _app->world()->forge().alloc(get_current_folder())); } void |