vector<QAction *> open_actions;
open_actions.push_back(main_window.action_save_as());
+ open_actions.push_back(main_window.action_save_selection_as());
widgets::ExportMenu *export_menu = new widgets::ExportMenu(this,
session.device_manager().context(),
(*iter).second.find(sigrok::LIST) != (*iter).second.end()) {
try {
gvar_dict = sr_dev->config_list(ConfigKey::SAMPLERATE);
- } catch(const sigrok::Error &e) {
+ } catch (const sigrok::Error &e) {
// Failed to enunmerate samplerate
(void)e;
}
}
if ((gvar_list = g_variant_lookup_value(gvar_dict.gobj(),
- "samplerate-steps", G_VARIANT_TYPE("at"))))
- {
+ "samplerate-steps", G_VARIANT_TYPE("at")))) {
elements = (const uint64_t *)g_variant_get_fixed_array(
gvar_list, &num_elements, sizeof(uint64_t));
if (step == 1)
sample_rate_.show_125_list(min, max);
- else
- {
+ else {
// When the step is not 1, we cam't make a 1-2-5-10
// list of sample rates, because we may not be able to
// make round numbers. Therefore in this case, show a
// spin box.
sample_rate_.show_min_max_step(min, max, step);
}
- }
- else if ((gvar_list = g_variant_lookup_value(gvar_dict.gobj(),
- "samplerates", G_VARIANT_TYPE("at"))))
- {
+ } else if ((gvar_list = g_variant_lookup_value(gvar_dict.gobj(),
+ "samplerates", G_VARIANT_TYPE("at")))) {
elements = (const uint64_t *)g_variant_get_fixed_array(
gvar_list, &num_elements, sizeof(uint64_t));
sample_rate_.show_list(elements, num_elements);
assert(!updating_sample_count_);
updating_sample_count_ = true;
- if (!sample_count_supported_)
- {
+ if (!sample_count_supported_) {
sample_count_.show_none();
updating_sample_count_ = false;
return;
if (gvar.gobj())
g_variant_get(gvar.gobj(), "(tt)",
&min_sample_count, &max_sample_count);
- } catch(const sigrok::Error &e) {
+ } catch (const sigrok::Error &e) {
// Failed to query sample limit
(void)e;
}
sample_count_supported_ = false;
try {
- for (auto entry : sr_dev->config_keys(ConfigKey::DEVICE_OPTIONS))
- {
+ for (auto entry : sr_dev->config_keys(ConfigKey::DEVICE_OPTIONS)) {
auto key = entry.first;
auto capabilities = entry.second;
switch (key->id()) {
sample_count_supported_ = true;
break;
case SR_CONF_LIMIT_FRAMES:
- if (capabilities.count(Capability::SET))
- {
+ if (capabilities.count(Capability::SET)) {
sr_dev->config_set(ConfigKey::LIMIT_FRAMES,
Glib::Variant<guint64>::create(1));
on_config_changed();
const shared_ptr<sigrok::Device> sr_dev = device->device();
sample_count = sample_count_.value();
- if (sample_count_supported_)
- {
+ if (sample_count_supported_) {
try {
sr_dev->config_set(ConfigKey::LIMIT_SAMPLES,
Glib::Variant<guint64>::create(sample_count));
bool MainBar::eventFilter(QObject *watched, QEvent *event)
{
- if ((watched == &sample_count_ || watched == &sample_rate_) &&
- (event->type() == QEvent::ToolTip)) {
+ if (sample_count_supported_ && (watched == &sample_count_ ||
+ watched == &sample_rate_) &&
+ (event->type() == QEvent::ToolTip)) {
auto sec = pv::util::Timestamp(sample_count_.value()) / sample_rate_.value();
QHelpEvent *help_event = static_cast<QHelpEvent*>(event);