summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-07 04:23:22 +0000
committerDavid Robillard <d@drobilla.net>2010-01-07 04:23:22 +0000
commit5f58582a4a9aebb3c223e7132d24a278ce29e1cb (patch)
treeec33e676afc2f9285ddf14cdbcf7a107e8a24c0e /src/gui/PatchWindow.cpp
parent2d3e27ef80e4fc8704390ea7a878068b5ae6a370 (diff)
downloadingen-5f58582a4a9aebb3c223e7132d24a278ce29e1cb.tar.gz
ingen-5f58582a4a9aebb3c223e7132d24a278ce29e1cb.tar.bz2
ingen-5f58582a4a9aebb3c223e7132d24a278ce29e1cb.zip
Quit cleanly from connect dialog when not connected to engine.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2357 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/PatchWindow.cpp')
-rw-r--r--src/gui/PatchWindow.cpp38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index c9ca705a..5450d815 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -644,43 +644,7 @@ PatchWindow::event_close()
void
PatchWindow::event_quit()
{
- Gtk::Widget* kill_img = Gtk::manage(
- new Gtk::Image(Gtk::Stock::CLOSE, Gtk::ICON_SIZE_BUTTON));
-
- Gtk::Widget* close_img = Gtk::manage(
- new Gtk::Image(Gtk::Stock::QUIT, Gtk::ICON_SIZE_BUTTON));
-
- const char* msg = (App::instance().world()->local_engine)
- ? "This will kill the engine as well.\nAre you sure you want to quit?"
- : "Would you like to quit just the GUI,\nor kill the engine as well?";
-
- Gtk::MessageDialog d(*this, msg,
- true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true);
-
- d.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-
- if (!App::instance().world()->local_engine) {
- Gtk::Button* b = d.add_button(Gtk::Stock::REMOVE, 2);
- b->set_label("_Kill Engine");
- b->set_image(*kill_img);
- }
-
- Gtk::Button* b = d.add_button(Gtk::Stock::QUIT, 1);
- b->set_label("_Quit");
- b->set_image(*close_img);
- b->grab_default();
-
- switch (d.run()) {
- case 1:
- App::instance().quit();
- break;
- case 2:
- App::instance().engine()->quit();
- App::instance().quit();
- break;
- default:
- break;
- }
+ App::instance().quit(*this);
}