]> sigrok.org Git - pulseview.git/blame - pv/popups/deviceoptions.cpp
DecoderSelector: Make PD names italic
[pulseview.git] / pv / popups / deviceoptions.cpp
CommitLineData
51d4a9ab
JH
1/*
2 * This file is part of the PulseView project.
3 *
4 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
efdec55a 17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
51d4a9ab
JH
18 */
19
2acdb232 20#include "deviceoptions.hpp"
51d4a9ab 21
51d4a9ab
JH
22#include <QFormLayout>
23#include <QListWidget>
24
2acdb232 25#include <pv/prop/property.hpp>
51d4a9ab 26
fe3a1c21 27#include <libsigrokcxx/libsigrokcxx.hpp>
e8d00928 28
f9abf97e 29using std::shared_ptr;
19adbc2c 30
e8d00928
ML
31using sigrok::Device;
32
51d4a9ab
JH
33namespace pv {
34namespace popups {
35
e8d00928 36DeviceOptions::DeviceOptions(shared_ptr<Device> device, QWidget *parent) :
51d4a9ab 37 Popup(parent),
8dbbc7f0
JH
38 device_(device),
39 layout_(this),
40 binding_(device)
51d4a9ab 41{
8dbbc7f0 42 setLayout(&layout_);
51d4a9ab 43
8dbbc7f0 44 layout_.addWidget(binding_.get_property_form(this, true));
51d4a9ab
JH
45}
46
3cc9ad7b 47pv::binding::Device& DeviceOptions::binding()
b3e8a5d8 48{
8dbbc7f0 49 return binding_;
b3e8a5d8
JH
50}
51
dbed5609
SA
52void DeviceOptions::show()
53{
54 // Update device config widgets with the current values supplied by the
55 // driver before actually showing the popup dialog
56 binding_.update_property_widgets();
57
58 Popup::show();
59}
60
51d4a9ab
JH
61} // namespace popups
62} // namespace pv