diff options
Diffstat (limited to 'src/libs/gui')
-rw-r--r-- | src/libs/gui/LoadPatchWindow.cpp | 7 | ||||
-rw-r--r-- | src/libs/gui/PatchWindow.cpp | 15 | ||||
-rw-r--r-- | src/libs/gui/ingen_gui.glade | 4 |
3 files changed, 15 insertions, 11 deletions
diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp index 66aec5b0..57ae1536 100644 --- a/src/libs/gui/LoadPatchWindow.cpp +++ b/src/libs/gui/LoadPatchWindow.cpp @@ -15,10 +15,10 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "LoadPatchWindow.hpp" #include <sys/types.h> #include <dirent.h> #include <boost/optional/optional.hpp> +#include "LoadPatchWindow.hpp" #include "interface/EngineInterface.hpp" #include "client/PatchModel.hpp" #include "App.hpp" @@ -127,8 +127,11 @@ LoadPatchWindow::ok_clicked() if (_poly_from_user_radio->get_active()) _initial_data.insert(make_pair("ingen:polyphony", _poly_spinbutton->get_value_as_int())); - if (_replace) + if (_replace) { App::instance().engine()->clear_patch(_patch->path()); + App::instance().engine()->set_variable(_patch->path(), "ingen:document", + Atom(get_uri().c_str())); + } if (_patch->path() != "/") parent = _patch->path().parent(); diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index 716d4356..5569c037 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -304,10 +304,11 @@ PatchWindow::event_import_location() void PatchWindow::event_save() { - if (_patch->filename() == "") + GraphObject::Variables::const_iterator doc = _patch->variables().find("ingen:document"); + if (doc == _patch->variables().end()) event_save_as(); else - App::instance().loader()->save_patch(_patch, _patch->filename()); + App::instance().loader()->save_patch(_patch, doc->second.get_string()); } @@ -330,9 +331,9 @@ PatchWindow::event_save_as() save_button->property_has_default() = true; // Set current folder to most sensible default - const string& current_filename = _patch->filename(); - if (current_filename.length() > 0) - dialog.set_filename(current_filename); + GraphObject::Variables::const_iterator doc = _patch->variables().find("ingen:document"); + if (doc != _patch->variables().end()) + dialog.set_uri(doc->second.get_string()); else if (App::instance().configuration()->patch_folder().length() > 0) dialog.set_current_folder(App::instance().configuration()->patch_folder()); @@ -365,8 +366,8 @@ PatchWindow::event_save_as() if (confirm) { App::instance().loader()->save_patch(_patch, filename); - _patch->set_filename(filename); - //_patch->set_variable("filename", Atom(filename.c_str())); + App::instance().engine()->set_variable(_patch->path(), "ingen:document", + Atom(Glib::filename_to_uri(filename).c_str())); } } App::instance().configuration()->set_patch_folder(dialog.get_current_folder()); diff --git a/src/libs/gui/ingen_gui.glade b/src/libs/gui/ingen_gui.glade index 18090268..e3f66321 100644 --- a/src/libs/gui/ingen_gui.glade +++ b/src/libs/gui/ingen_gui.glade @@ -404,8 +404,8 @@ <widget class="GtkScrolledWindow" id="patch_win_scrolledwin"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> - <property name="vscrollbar_policy">GTK_POLICY_NEVER</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <child> <widget class="GtkViewport" id="patch_win_viewport"> <property name="visible">True</property> |