Fix crash when X11 is not available for VST UIs
[ardour.git] / gtk2_ardour / session_import_dialog.cc
index 8c95a332075f81c464b0f487642df67ffcb7b6a7..00567da2cac0edcdca9adba1d50d03dc4b25d0f8 100644 (file)
@@ -1,22 +1,24 @@
 /*
-    Copyright (C) 2008 Paul Davis
-    Author: Sakari Bergen
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2008-2009 Sakari Bergen <sakari.bergen@beatwaves.net>
+ * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
+ * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2015-2018 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <gtkmm/messagedialog.h>
 #include <gtkmm/stock.h>
@@ -33,6 +35,7 @@
 #include "gtkmm2ext/utils.h"
 #include "widgets/prompter.h"
 
+#include "ardour_message.h"
 #include "gui_thread.h"
 #include "session_import_dialog.h"
 #include "ui_config.h"
@@ -132,7 +135,7 @@ SessionImportDialog::load_session (const string& filename)
                if (ElementImportHandler::dirty()) {
                        // Warn user
                        string txt = _("Some elements had errors in them. Please see the log for details");
-                       MessageDialog msg (txt, false, MESSAGE_WARNING, BUTTONS_OK, true);
+                       ArdourMessageDialog msg (txt, false, MESSAGE_WARNING, BUTTONS_OK, true);
                        msg.run();
                }
        }
@@ -216,7 +219,7 @@ SessionImportDialog::do_merge ()
        if (ElementImportHandler::errors()) {
                // Warn user
                string txt = _("Some elements had errors in them. Please see the log for details");
-               MessageDialog msg (txt, false, MESSAGE_WARNING, BUTTONS_OK, true);
+               ArdourMessageDialog msg (txt, false, MESSAGE_WARNING, BUTTONS_OK, true);
                msg.run();
        }
 }
@@ -232,7 +235,7 @@ SessionImportDialog::update (string path)
                {
                        // Prompt user for verification
                        string txt = _("This will select all elements of this type!");
-                       MessageDialog msg (txt, false, MESSAGE_QUESTION, BUTTONS_OK_CANCEL, true);
+                       ArdourMessageDialog msg (txt, false, MESSAGE_QUESTION, BUTTONS_OK_CANCEL, true);
                        if (msg.run() == RESPONSE_CANCEL) {
                                (*cell)[sb_cols.queued] = false;
                                return;
@@ -272,7 +275,7 @@ SessionImportDialog::show_info(const TreeModel::Path& path, TreeViewColumn*)
        TreeModel::iterator cell = session_browser.get_model()->get_iter (path);
        string info = (*cell)[sb_cols.info];
 
-       MessageDialog msg (info, false, MESSAGE_INFO, BUTTONS_OK, true);
+       ArdourMessageDialog msg (info, false, MESSAGE_INFO, BUTTONS_OK, true);
        msg.run();
 }
 
@@ -309,7 +312,7 @@ SessionImportDialog::open_rename_dialog (string text, string name)
 bool
 SessionImportDialog::open_prompt_dialog (string text)
 {
-       MessageDialog msg (text, false, MESSAGE_QUESTION, BUTTONS_OK_CANCEL, true);
+       ArdourMessageDialog msg (text, false, MESSAGE_QUESTION, BUTTONS_OK_CANCEL, true);
        if (msg.run() == RESPONSE_OK) {
                return true;
        }