* 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 <http://www.gnu.org/licenses/>.
*/
-#include "deviceoptions.h"
+#include "deviceoptions.hpp"
#include <QFormLayout>
#include <QListWidget>
-#include <pv/prop/property.h>
+#include <pv/prop/property.hpp>
-using boost::shared_ptr;
+#include <libsigrokcxx/libsigrokcxx.hpp>
+
+using std::shared_ptr;
+
+using sigrok::Device;
namespace pv {
namespace popups {
-DeviceOptions::DeviceOptions(shared_ptr<device::DevInst> dev_inst,
- QWidget *parent) :
+DeviceOptions::DeviceOptions(shared_ptr<Device> device, QWidget *parent) :
Popup(parent),
- _dev_inst(dev_inst),
- _layout(this),
- _binding(dev_inst)
+ device_(device),
+ layout_(this),
+ binding_(device)
{
- setLayout(&_layout);
+ setLayout(&layout_);
+
+ layout_.addWidget(binding_.get_property_form(this, true));
+}
- _layout.addWidget(_binding.get_property_form(this, true));
+pv::binding::Device& DeviceOptions::binding()
+{
+ return binding_;
}
-pv::prop::binding::DeviceOptions& DeviceOptions::binding()
+void DeviceOptions::show()
{
- return _binding;
+ // 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