2 #include <sigc++/bind.h>
3 #include <gtkmm/stock.h>
5 #include "pbd/convert.h"
6 #include <gtkmm2ext/utils.h>
8 #include "midi_port_dialog.h"
15 using namespace Gtkmm2ext
;
17 static const char* mode_strings
[] = { "duplex", "output", "input", (char*) 0 };
19 MidiPortDialog::MidiPortDialog ()
20 : ArdourDialog (_("Add MIDI Port"))
21 , port_label (_("Port name:"))
24 set_skip_taskbar_hint (true);
25 set_resizable (false);
26 set_position (Gtk::WIN_POS_MOUSE
);
27 set_name (N_("MidiPortDialog"));
29 vector
<string
> str
= internationalize (PACKAGE
, mode_strings
);
30 set_popdown_strings (port_mode_combo
, str
);
31 port_mode_combo
.set_active_text (str
.front());
33 hpacker
.set_spacing (6);
34 hpacker
.set_border_width (5);
36 hpacker
.pack_start (port_label
);
37 hpacker
.pack_start (port_name
);
38 hpacker
.pack_start (port_mode_combo
);
40 get_vbox()->pack_start (hpacker
);
42 port_name
.signal_activate().connect (sigc::mem_fun (*this, &MidiPortDialog::entry_activated
));
44 add_button (Stock::CANCEL
, RESPONSE_CANCEL
);
45 add_button (Stock::ADD
, RESPONSE_ACCEPT
);
51 MidiPortDialog::entry_activated ()
53 response (RESPONSE_ACCEPT
);
56 MidiPortDialog::~MidiPortDialog ()