}
if (_session->dirty()) {
}
if (_session->dirty()) {
- switch (ask_about_saving_session(_("quit"))) {
+ vector<string> actions;
+ actions.push_back (_("Don't quit"));
+ actions.push_back (_("Just quit"));
+ actions.push_back (_("Save and quit"));
+ switch (ask_about_saving_session(actions)) {
-ARDOUR_UI::ask_about_saving_session (const string & what)
+ARDOUR_UI::ask_about_saving_session (const vector<string>& actions)
{
ArdourDialog window (_("Unsaved Session"));
Gtk::HBox dhbox; // the hbox for the image and text
{
ArdourDialog window (_("Unsaved Session"));
Gtk::HBox dhbox; // the hbox for the image and text
- 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);
window.set_default_response (RESPONSE_ACCEPT);
void startup ();
void shutdown ();
void startup ();
void shutdown ();
- int ask_about_saving_session (const std::string & why);
+ int ask_about_saving_session (const std::vector<std::string>& actions);
/* periodic safety backup, to be precise */
gint autosave_session();
/* periodic safety backup, to be precise */
gint autosave_session();
ARDOUR_UI::unload_session (bool hide_stuff)
{
if (_session && _session->dirty()) {
ARDOUR_UI::unload_session (bool hide_stuff)
{
if (_session && _session->dirty()) {
- switch (ask_about_saving_session (_("close"))) {
+ std::vector<std::string> 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;
case -1:
// cancel
return 1;