X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fpopups%2Fdeviceoptions.cpp;h=bfb702cf064ce062462b67e5c7f0d0eba3f822d0;hp=c864865f4c854cea3ae96f8cec14286720c1cd35;hb=f4ab4b5c657e5613caba82feaa81a8a400e4f331;hpb=51d4a9ab96a6bf64a1fcd1700e7e174498d4c118 diff --git a/pv/popups/deviceoptions.cpp b/pv/popups/deviceoptions.cpp index c864865..bfb702c 100644 --- a/pv/popups/deviceoptions.cpp +++ b/pv/popups/deviceoptions.cpp @@ -14,39 +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 namespace boost; -using namespace std; +using std::shared_ptr; + +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); + setLayout(&layout_); - _layout.addWidget(_binding.get_property_form(this)); + layout_.addWidget(binding_.get_property_form(this, true)); } -void DeviceOptions::closeEvent(QCloseEvent*) +pv::binding::Device& DeviceOptions::binding() { - _binding.commit(); + return binding_; +} + +void DeviceOptions::show() +{ + // Update device config widgets with the current values supplied by the + // driver before actually showing the popup dialog + binding_.update_property_widgets(); + + Popup::show(); } } // namespace popups