const char *MainBar::SettingOpenDirectory = "MainWindow/OpenDirectory";
const char *MainBar::SettingSaveDirectory = "MainWindow/SaveDirectory";
const char *MainBar::SettingOpenDirectory = "MainWindow/OpenDirectory";
const char *MainBar::SettingSaveDirectory = "MainWindow/SaveDirectory";
-MainBar::MainBar(Session &session, QWidget *parent,
- pv::views::trace::View *view) :
+MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view) :
StandardBar(session, parent, view, false),
action_new_view_(new QAction(this)),
action_open_(new QAction(this)),
StandardBar(session, parent, view, false),
action_new_view_(new QAction(this)),
action_open_(new QAction(this)),
action_connect_(new QAction(this)),
open_button_(new QToolButton()),
save_button_(new QToolButton()),
action_connect_(new QAction(this)),
open_button_(new QToolButton()),
save_button_(new QToolButton()),
- device_selector_(parent, session.device_manager(),
- action_connect_),
+ device_selector_(parent, session.device_manager(), action_connect_),
widgets::ExportMenu *menu_file_export = new widgets::ExportMenu(this,
session.device_manager().context());
menu_file_export->setTitle(tr("&Export"));
widgets::ExportMenu *menu_file_export = new widgets::ExportMenu(this,
session.device_manager().context());
menu_file_export->setTitle(tr("&Export"));
- connect(menu_file_export,
- SIGNAL(format_selected(shared_ptr<sigrok::OutputFormat>)),
+ connect(menu_file_export, SIGNAL(format_selected(shared_ptr<sigrok::OutputFormat>)),
this, SLOT(export_file(shared_ptr<sigrok::OutputFormat>)));
widgets::ImportMenu *menu_file_import = new widgets::ImportMenu(this,
session.device_manager().context());
menu_file_import->setTitle(tr("&Import"));
this, SLOT(export_file(shared_ptr<sigrok::OutputFormat>)));
widgets::ImportMenu *menu_file_import = new widgets::ImportMenu(this,
session.device_manager().context());
menu_file_import->setTitle(tr("&Import"));
- connect(menu_file_import,
- SIGNAL(format_selected(shared_ptr<sigrok::InputFormat>)),
+ connect(menu_file_import, SIGNAL(format_selected(shared_ptr<sigrok::InputFormat>)),
this, SLOT(import_file(shared_ptr<sigrok::InputFormat>)));
action_connect_->setText(tr("&Connect to Device..."));
this, SLOT(import_file(shared_ptr<sigrok::InputFormat>)));
action_connect_->setText(tr("&Connect to Device..."));
// Open button
widgets::ImportMenu *import_menu = new widgets::ImportMenu(this,
session.device_manager().context(), action_open_);
// Open button
widgets::ImportMenu *import_menu = new widgets::ImportMenu(this,
session.device_manager().context(), action_open_);
- connect(import_menu,
- SIGNAL(format_selected(shared_ptr<sigrok::InputFormat>)),
- this,
- SLOT(import_file(shared_ptr<sigrok::InputFormat>)));
+ connect(import_menu, SIGNAL(format_selected(shared_ptr<sigrok::InputFormat>)),
+ this, SLOT(import_file(shared_ptr<sigrok::InputFormat>)));
open_button_->setMenu(import_menu);
open_button_->setDefaultAction(action_open_);
open_button_->setPopupMode(QToolButton::MenuButtonPopup);
// Save button
open_button_->setMenu(import_menu);
open_button_->setDefaultAction(action_open_);
open_button_->setPopupMode(QToolButton::MenuButtonPopup);
// Save button
open_actions.push_back(action_save_as_);
open_actions.push_back(action_save_selection_as_);
widgets::ExportMenu *export_menu = new widgets::ExportMenu(this,
open_actions.push_back(action_save_as_);
open_actions.push_back(action_save_selection_as_);
widgets::ExportMenu *export_menu = new widgets::ExportMenu(this,
- session.device_manager().context(),
- open_actions);
- connect(export_menu,
- SIGNAL(format_selected(shared_ptr<sigrok::OutputFormat>)),
- this,
- SLOT(export_file(shared_ptr<sigrok::OutputFormat>)));
+ session.device_manager().context(), open_actions);
+ connect(export_menu, SIGNAL(format_selected(shared_ptr<sigrok::OutputFormat>)),
+ this, SLOT(export_file(shared_ptr<sigrok::OutputFormat>)));
if (sr_dev->config_check(ConfigKey::SAMPLERATE, Capability::LIST)) {
try {
gvar_dict = sr_dev->config_list(ConfigKey::SAMPLERATE);
if (sr_dev->config_check(ConfigKey::SAMPLERATE, Capability::LIST)) {
try {
gvar_dict = sr_dev->config_list(ConfigKey::SAMPLERATE);
if ((gvar_list = g_variant_lookup_value(gvar_dict.gobj(),
"samplerate-steps", G_VARIANT_TYPE("at")))) {
elements = (const uint64_t *)g_variant_get_fixed_array(
if ((gvar_list = g_variant_lookup_value(gvar_dict.gobj(),
"samplerate-steps", G_VARIANT_TYPE("at")))) {
elements = (const uint64_t *)g_variant_get_fixed_array(
} 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(
} 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(
sample_rate_.show_list(elements, num_elements);
g_variant_unref(gvar_list);
}
sample_rate_.show_list(elements, num_elements);
g_variant_unref(gvar_list);
}
updating_sample_rate_ = true;
sample_rate_.set_value(samplerate);
updating_sample_rate_ = false;
updating_sample_rate_ = true;
sample_rate_.set_value(samplerate);
updating_sample_rate_ = false;
if (gvar.gobj())
g_variant_get(gvar.gobj(), "(tt)",
&min_sample_count, &max_sample_count);
if (gvar.gobj())
g_variant_get(gvar.gobj(), "(tt)",
&min_sample_count, &max_sample_count);
// Update the configure popup
DeviceOptions *const opts = new DeviceOptions(sr_dev, this);
// Update the configure popup
DeviceOptions *const opts = new DeviceOptions(sr_dev, this);
sr_dev->config_set(ConfigKey::SAMPLERATE,
Glib::Variant<guint64>::create(sample_rate));
update_sample_rate_selector();
sr_dev->config_set(ConfigKey::SAMPLERATE,
Glib::Variant<guint64>::create(sample_rate));
update_sample_rate_selector();
sr_dev->config_set(ConfigKey::LIMIT_SAMPLES,
Glib::Variant<guint64>::create(sample_count));
update_sample_count_selector();
sr_dev->config_set(ConfigKey::LIMIT_SAMPLES,
Glib::Variant<guint64>::create(sample_count));
update_sample_count_selector();
if (!trace_view->cursors()->enabled()) {
show_session_error(tr("Missing Cursors"), tr("You need to set the " \
if (!trace_view->cursors()->enabled()) {
show_session_error(tr("Missing Cursors"), tr("You need to set the " \
- "cursors before you can save the data enclosed by them " \
- "to a session file (e.g. using the Show Cursors button)."));
+ "cursors before you can save the data enclosed by them " \
+ "to a session file (e.g. using the Show Cursors button)."));
if ((start_sample == 0) && (end_sample == 0)) {
// Both cursors are negative and were clamped to 0
show_session_error(tr("Invalid Range"), tr("The cursors don't " \
if ((start_sample == 0) && (end_sample == 0)) {
// Both cursors are negative and were clamped to 0
show_session_error(tr("Invalid Range"), tr("The cursors don't " \
void MainBar::on_device_selected()
{
shared_ptr<devices::Device> device = device_selector_.selected_device();
void MainBar::on_device_selected()
{
shared_ptr<devices::Device> device = device_selector_.selected_device();
bool MainBar::eventFilter(QObject *watched, QEvent *event)
{
if (sample_count_supported_ && (watched == &sample_count_ ||
bool MainBar::eventFilter(QObject *watched, QEvent *event)
{
if (sample_count_supported_ && (watched == &sample_count_ ||
auto sec = pv::util::Timestamp(sample_count_.value()) / sample_rate_.value();
QHelpEvent *help_event = static_cast<QHelpEvent*>(event);
auto sec = pv::util::Timestamp(sample_count_.value()) / sample_rate_.value();
QHelpEvent *help_event = static_cast<QHelpEvent*>(event);