summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-14 07:06:49 +0000
committerDavid Robillard <d@drobilla.net>2015-02-14 07:06:49 +0000
commit1115a7820a7a9dda9d2042c39ad5b7bb10919f86 (patch)
tree4e0390a81bd9483de4265327a58bee3336f8d5ed /src/gui
parent2d39bd620f88ae2e13b5be39d57f8dcd7618f079 (diff)
downloadingen-1115a7820a7a9dda9d2042c39ad5b7bb10919f86.tar.gz
ingen-1115a7820a7a9dda9d2042c39ad5b7bb10919f86.tar.bz2
ingen-1115a7820a7a9dda9d2042c39ad5b7bb10919f86.zip
Fix save issues.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5564 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp9
-rw-r--r--src/gui/GraphBox.cpp12
2 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 3deda1a2..730243a7 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -349,8 +349,11 @@ App::quit(Gtk::Window* dialog_parent)
quit = (d.run() == Gtk::RESPONSE_CLOSE);
}
- if (quit)
- Gtk::Main::quit();
+ if (!quit) {
+ return false;
+ }
+
+ Gtk::Main::quit();
try {
const std::string path = _world->conf().save(
@@ -361,7 +364,7 @@ App::quit(Gtk::Window* dialog_parent)
% e.what());
}
- return quit;
+ return true;
}
bool
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 8e59c0e7..9c100f93 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -145,8 +145,6 @@ GraphBox::GraphBox(BaseObjectType* cobject,
sigc::mem_fun(this, &GraphBox::event_port_names_toggled));
_menu_arrange->signal_activate().connect(
sigc::mem_fun(this, &GraphBox::event_arrange));
- _menu_quit->signal_activate().connect(
- sigc::mem_fun(this, &GraphBox::event_quit));
_menu_zoom_in->signal_activate().connect(
sigc::mem_fun(this, &GraphBox::event_zoom_in));
_menu_zoom_out->signal_activate().connect(
@@ -501,7 +499,7 @@ GraphBox::event_save_as()
const URIs& uris = _app->uris();
while (true) {
Gtk::FileChooserDialog dialog(
- "Save Graph", Gtk::FILE_CHOOSER_ACTION_CREATE_FOLDER);
+ "Save Graph", Gtk::FILE_CHOOSER_ACTION_SAVE);
if (_window) {
dialog.set_transient_for(*_window);
}
@@ -532,6 +530,11 @@ GraphBox::event_save_as()
if (basename.find('.') == std::string::npos) {
filename += ".ingen";
basename += ".ingen";
+ } else if (filename.substr(filename.length() - 4) == ".ttl") {
+ const Glib::ustring dir = Glib::path_get_dirname(filename);
+ if (dir.substr(dir.length() - 6) != ".ingen") {
+ error("<b>File does not appear to be in an Ingen bundle.");
+ }
} else if (filename.substr(filename.length() - 6) != ".ingen") {
error("<b>Ingen bundles must end in \".ingen\"</b>");
continue;
@@ -579,8 +582,7 @@ GraphBox::event_save_as()
_app->loader()->save_graph(_graph, uri);
const_cast<GraphModel*>(_graph.get())->set_property(
uris.ingen_file,
- _app->forge().alloc_uri(uri.c_str()),
- Resource::Graph::EXTERNAL);
+ _app->forge().alloc_uri(uri.c_str()));
_status_bar->push(
(boost::format("Saved %1% to %2%") % _graph->path().c_str()
% filename).str(),