X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fpopups%2Fdeviceoptions.cpp;h=bfb702cf064ce062462b67e5c7f0d0eba3f822d0;hp=ac7c2b78f3c3eb0245e77e3d6dc248e47264e801;hb=dbed5609ae31cdfc3e9db10f3ab91b7607c08372;hpb=b786fcfd36fed2282a6602f26d74c2926957aff6 diff --git a/pv/popups/deviceoptions.cpp b/pv/popups/deviceoptions.cpp index ac7c2b78..bfb702cf 100644 --- a/pv/popups/deviceoptions.cpp +++ b/pv/popups/deviceoptions.cpp @@ -14,34 +14,48 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#include "deviceoptions.h" - -#include +#include "deviceoptions.hpp" #include #include -#include +#include + +#include + +using std::shared_ptr; -using namespace boost; -using namespace std; +using sigrok::Device; namespace pv { namespace popups { -DeviceOptions::DeviceOptions(sr_dev_inst *sdi, QWidget *parent) : +DeviceOptions::DeviceOptions(shared_ptr device, QWidget *parent) : Popup(parent), - _sdi(sdi), - _layout(this), - _binding(sdi) + device_(device), + layout_(this), + binding_(device) +{ + setLayout(&layout_); + + layout_.addWidget(binding_.get_property_form(this, true)); +} + +pv::binding::Device& DeviceOptions::binding() +{ + return binding_; +} + +void DeviceOptions::show() { - setLayout(&_layout); + // Update device config widgets with the current values supplied by the + // driver before actually showing the popup dialog + binding_.update_property_widgets(); - _layout.addWidget(_binding.get_property_form(this, true)); + Popup::show(); } } // namespace popups