2 Copyright (C) 2012 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <sigc++/bind.h>
22 #include <gtkmm/stock.h>
24 #include "pbd/convert.h"
25 #include <gtkmm2ext/utils.h>
27 #include "midi_port_dialog.h"
34 using namespace Gtkmm2ext;
36 static const char* mode_strings[] = { "duplex", "output", "input", (char*) 0 };
38 MidiPortDialog::MidiPortDialog ()
39 : ArdourDialog (_("Add MIDI Port"))
40 , port_label (_("Port name:"))
43 set_skip_taskbar_hint (true);
44 set_resizable (false);
45 set_name (N_("MidiPortDialog"));
47 vector<string> str = internationalize (PACKAGE, mode_strings);
48 set_popdown_strings (port_mode_combo, str);
49 port_mode_combo.set_active_text (str.front());
51 hpacker.set_spacing (6);
52 hpacker.set_border_width (5);
54 hpacker.pack_start (port_label);
55 hpacker.pack_start (port_name);
56 hpacker.pack_start (port_mode_combo);
58 get_vbox()->pack_start (hpacker);
60 port_name.signal_activate().connect (sigc::mem_fun (*this, &MidiPortDialog::entry_activated));
62 add_button (Stock::CANCEL, RESPONSE_CANCEL);
63 add_button (Stock::ADD, RESPONSE_ACCEPT);
69 MidiPortDialog::entry_activated ()
71 response (RESPONSE_ACCEPT);
74 MidiPortDialog::~MidiPortDialog ()