fix drawing of zero-length notes
[ardour.git] / gtk2_ardour / missing_plugin_dialog.cc
1 /*
2  * Copyright (C) 2010-2011 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2011-2012 David Robillard <d@drobilla.net>
4  * Copyright (C) 2011-2016 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2013-2016 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #include <gtkmm/label.h>
23 #include "missing_plugin_dialog.h"
24 #include "pbd/i18n.h"
25
26 using namespace Gtk;
27 using namespace std;
28 using namespace ARDOUR;
29 using namespace PBD;
30
31 MissingPluginDialog::MissingPluginDialog (Session * s, list<string> const & plugins)
32         : ArdourDialog (_("Missing Plugins"), true, false)
33 {
34         /* This dialog is always shown programatically. Center the window.*/
35         set_position (Gtk::WIN_POS_CENTER);
36
37         set_session (s);
38
39         add_button (_("OK"), RESPONSE_OK);
40         set_default_response (RESPONSE_OK);
41
42         Label* m = manage (new Label);
43
44         stringstream t;
45         t << _("This session contains the following plugins that cannot be found on this system:\n\n");
46
47         for (list<string>::const_iterator i = plugins.begin(); i != plugins.end(); ++i) {
48                 t << *i << "\n";
49         }
50
51         t << _("\nThose plugins will be replaced with inactive stubs.\n"
52                "It is recommended that you install the missing plugins and re-load the session.\n"
53                "(also check the blacklist, Window > Log and Preferences > Plugins)");
54
55         m->set_markup (t.str ());
56         get_vbox()->pack_start (*m, false, false);
57
58         show_all ();
59 }