remove using namespace sigc everywhere to ensure clarity over which bind/mem_fun...
[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
17 static const char* mode_strings[] = { "duplex", "output", "input",  (char*) 0 };
18
19 MidiPortDialog::MidiPortDialog ()
20         : ArdourDialog ("add MIDI port dialog")
21         , port_label (_("Port name:"))
22 {
23         set_modal (true);
24         set_skip_taskbar_hint (true);
25         set_resizable (false);
26         set_position (Gtk::WIN_POS_MOUSE);
27         set_name (N_("MidiPortDialog"));
28
29         set_title (_("Add MIDI Port"));
30
31         vector<string> str = internationalize (PACKAGE, mode_strings);
32         set_popdown_strings (port_mode_combo, str);
33         port_mode_combo.set_active_text (str.front());
34
35         hpacker.set_spacing (6);
36         hpacker.set_border_width (5);
37
38         hpacker.pack_start (port_label);
39         hpacker.pack_start (port_name);
40         hpacker.pack_start (port_mode_combo);
41
42         get_vbox()->pack_start (hpacker);
43
44         port_name.signal_activate().connect (sigc::mem_fun (*this, &MidiPortDialog::entry_activated));
45
46         add_button (Stock::CANCEL, RESPONSE_CANCEL);
47         add_button (Stock::ADD, RESPONSE_ACCEPT);
48
49         show_all_children ();
50 }
51
52 void
53 MidiPortDialog::entry_activated ()
54 {
55         response (RESPONSE_ACCEPT);
56 }
57
58 MidiPortDialog::~MidiPortDialog ()
59 {
60
61 }