#include <pv/devicemanager.h>
#include <pv/popups/deviceoptions.h>
-using namespace std;
+using std::string;
namespace pv {
namespace toolbars {
_device_selector(this),
_updating_device_selector(false),
_configure_button(this),
+ _configure_button_action(NULL),
_probes_button(this),
_probes_popup(_session, this),
_record_length_selector(this),
{
const uint64_t &l = RecordLengths[i];
char *const text = sr_si_string_u64(l, " samples");
- _record_length_selector.addItem(QString(text),
+ _record_length_selector.addItem(QString::fromUtf8(text),
qVariantFromValue(l));
g_free(text);
_run_stop_button.setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
addWidget(&_device_selector);
- addWidget(&_configure_button);
+ _configure_button_action = addWidget(&_configure_button);
addWidget(&_probes_button);
addWidget(&_record_length_selector);
_sample_rate_list_action = addWidget(&_sample_rate_list);
for (unsigned int i = 0; i < num_elements; i++)
{
char *const s = sr_samplerate_string(elements[i]);
- _sample_rate_list.addItem(QString(s),
+ _sample_rate_list.addItem(QString::fromUtf8(s),
qVariantFromValue(elements[i]));
g_free(s);
}
void SamplingBar::on_device_selected()
{
- using namespace pv::popups;
+ using pv::popups::DeviceOptions;
if (_updating_device_selector)
return;
sr_dev_inst *const sdi = get_selected_device();
_session.set_device(sdi);
- _configure_button.set_popup(new DeviceOptions(sdi, this));
+ // Update the configure popup
+ DeviceOptions *const opts = new DeviceOptions(sdi, this);
+ _configure_button_action->setVisible(
+ !opts->binding().properties().empty());
+ _configure_button.set_popup(opts);
}
void SamplingBar::on_sample_rate_changed()