projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hide the configure device button when the popup would be empty
[pulseview.git]
/
pv
/
toolbars
/
samplingbar.cpp
diff --git
a/pv/toolbars/samplingbar.cpp
b/pv/toolbars/samplingbar.cpp
index db7e8e0b1a1dc330397099ea0cfb63794db093a6..0e3ce62374bf2c053ebf8a5eb57bd188bfcf11a8 100644
(file)
--- a/
pv/toolbars/samplingbar.cpp
+++ b/
pv/toolbars/samplingbar.cpp
@@
-34,7
+34,7
@@
#include <pv/devicemanager.h>
#include <pv/popups/deviceoptions.h>
#include <pv/devicemanager.h>
#include <pv/popups/deviceoptions.h>
-using
namespace std
;
+using
std::string
;
namespace pv {
namespace toolbars {
namespace pv {
namespace toolbars {
@@
-70,6
+70,7
@@
SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
_device_selector(this),
_updating_device_selector(false),
_configure_button(this),
_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),
_probes_button(this),
_probes_popup(_session, this),
_record_length_selector(this),
@@
-92,7
+93,7
@@
SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
{
const uint64_t &l = RecordLengths[i];
char *const text = sr_si_string_u64(l, " samples");
{
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);
qVariantFromValue(l));
g_free(text);
@@
-112,7
+113,7
@@
SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
_run_stop_button.setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
addWidget(&_device_selector);
_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);
addWidget(&_probes_button);
addWidget(&_record_length_selector);
_sample_rate_list_action = addWidget(&_sample_rate_list);
@@
-219,7
+220,7
@@
void SamplingBar::update_sample_rate_selector()
for (unsigned int i = 0; i < num_elements; i++)
{
char *const s = sr_samplerate_string(elements[i]);
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);
}
qVariantFromValue(elements[i]));
g_free(s);
}
@@
-303,7
+304,7
@@
void SamplingBar::commit_sample_rate()
void SamplingBar::on_device_selected()
{
void SamplingBar::on_device_selected()
{
- using
namespace pv::popup
s;
+ using
pv::popups::DeviceOption
s;
if (_updating_device_selector)
return;
if (_updating_device_selector)
return;
@@
-313,7
+314,11
@@
void SamplingBar::on_device_selected()
sr_dev_inst *const sdi = get_selected_device();
_session.set_device(sdi);
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()
}
void SamplingBar::on_sample_rate_changed()