Build plugin menu only when plugins change, and build the first version of it before...
[ardour.git] / gtk2_ardour / midi_port_dialog.cc
1 #include <string>
2 #include <sigc++/bind.h>
3 #include <gtkmm/stock.h>
4
5 #include "pbd/convert.h"
6 #include <gtkmm2ext/utils.h>
7
8 #include "midi_port_dialog.h"
9
10 #include "i18n.h"
11
12 using namespace std;
13 using namespace PBD;
14 using namespace Gtk;
15 using namespace Gtkmm2ext;
16 using namespace sigc;
17
18 static const char* mode_strings[] = { "duplex", "output", "input",  (char*) 0 };
19
20 MidiPortDialog::MidiPortDialog ()
21         : ArdourDialog ("add MIDI port dialog")
22         , port_label (_("Port name:"))
23 {
24         set_modal (true);
25         set_skip_taskbar_hint (true);
26         set_resizable (false);
27         set_position (Gtk::WIN_POS_MOUSE);
28         set_name (N_("MidiPortDialog"));
29
30         set_title (_("Add MIDI Port"));
31
32         vector<string> str = internationalize (PACKAGE, mode_strings);
33         set_popdown_strings (port_mode_combo, str);
34         port_mode_combo.set_active_text (str.front());
35
36         hpacker.set_spacing (6);
37         hpacker.set_border_width (5);
38
39         hpacker.pack_start (port_label);
40         hpacker.pack_start (port_name);
41         hpacker.pack_start (port_mode_combo);
42
43         get_vbox()->pack_start (hpacker);
44
45         port_name.signal_activate().connect (mem_fun (*this, &MidiPortDialog::entry_activated));
46
47         add_button (Stock::CANCEL, RESPONSE_CANCEL);
48         add_button (Stock::ADD, RESPONSE_ACCEPT);
49
50         show_all_children ();
51 }
52
53 void
54 MidiPortDialog::entry_activated ()
55 {
56         response (RESPONSE_ACCEPT);
57 }
58
59 MidiPortDialog::~MidiPortDialog ()
60 {
61
62 }