From 2761f899c583c10e443c9fc9d52108d372502d50 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 22 May 2011 20:02:50 +0000 Subject: [PATCH] fix translation issue with verb substitution in quit/close dialog git-svn-id: svn://localhost/ardour2/branches/3.0@9567 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 19 +++++++++++-------- gtk2_ardour/ardour_ui.h | 2 +- gtk2_ardour/ardour_ui_dialogs.cc | 6 +++++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index dd6489f46e..40e88c6986 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -809,7 +809,11 @@ ARDOUR_UI::finish() } if (_session->dirty()) { - switch (ask_about_saving_session(_("quit"))) { + vector actions; + actions.push_back (_("Don't quit")); + actions.push_back (_("Just quit")); + actions.push_back (_("Save and quit")); + switch (ask_about_saving_session(actions)) { case -1: return; break; @@ -858,7 +862,7 @@ If you still wish to quit, please use the\n\n\ } int -ARDOUR_UI::ask_about_saving_session (const string & what) +ARDOUR_UI::ask_about_saving_session (const vector& actions) { ArdourDialog window (_("Unsaved Session")); Gtk::HBox dhbox; // the hbox for the image and text @@ -867,12 +871,11 @@ ARDOUR_UI::ask_about_saving_session (const string & what) string msg; - msg = string_compose(_("Don't %1"), what); - window.add_button (msg, RESPONSE_REJECT); - msg = string_compose(_("Just %1"), what); - window.add_button (msg, RESPONSE_APPLY); - msg = string_compose(_("Save and %1"), what); - window.add_button (msg, RESPONSE_ACCEPT); + assert (actions.size() >= 3); + + window.add_button (actions[0], RESPONSE_REJECT); + window.add_button (actions[1], RESPONSE_APPLY); + window.add_button (actions[2], RESPONSE_ACCEPT); window.set_default_response (RESPONSE_ACCEPT); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 793f279e2a..900cc6c3b4 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -303,7 +303,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void startup (); void shutdown (); - int ask_about_saving_session (const std::string & why); + int ask_about_saving_session (const std::vector& actions); /* periodic safety backup, to be precise */ gint autosave_session(); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 582c635ca7..5b53b37a92 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -185,7 +185,11 @@ int ARDOUR_UI::unload_session (bool hide_stuff) { if (_session && _session->dirty()) { - switch (ask_about_saving_session (_("close"))) { + std::vector actions; + actions.push_back (_("Don't close")); + actions.push_back (_("Just close")); + actions.push_back (_("Save and close")); + switch (ask_about_saving_session (actions)) { case -1: // cancel return 1;