connect(main_bar.get(), SIGNAL(new_view(Session*)),
this, SLOT(on_new_view(Session*)));
+
+ main_bar->action_view_show_cursors()->setChecked(v->cursors_shown());
} else {
/* Additional view, create a standard bar */
- dock_main->addToolBar(
- new pv::views::trace::StandardBar(session, this, v.get()));
- }
- main_bar->action_view_show_cursors()->setChecked(v->cursors_shown());
+ pv::views::trace::StandardBar *standard_bar =
+ new pv::views::trace::StandardBar(session, this, v.get());
+ dock_main->addToolBar(standard_bar);
- connect(v.get(), SIGNAL(always_zoom_to_fit_changed(bool)),
- main_bar.get(), SLOT(on_always_zoom_to_fit_changed(bool)));
+ standard_bar->action_view_show_cursors()->setChecked(v->cursors_shown());
+ }
}
return v;
QIcon(":/icons/zoom-fit.png")));
action_view_zoom_fit_->setShortcut(QKeySequence(Qt::Key_F));
connect(action_view_zoom_fit_, SIGNAL(triggered(bool)),
- this, SLOT(on_actionViewZoomFit_triggered()));
+ this, SLOT(on_actionViewZoomFit_triggered(bool)));
action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One"));
action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original",
this, SLOT(on_actionViewShowCursors_triggered()));
action_view_show_cursors_->setText(tr("Show &Cursors"));
+ connect(view_, SIGNAL(always_zoom_to_fit_changed(bool)),
+ this, SLOT(on_always_zoom_to_fit_changed(bool)));
+
if (add_default_widgets)
add_toolbar_widgets();
}
view_->zoom(-1);
}
-void StandardBar::on_actionViewZoomFit_triggered()
+void StandardBar::on_actionViewZoomFit_triggered(bool checked)
{
- view_->zoom_fit(action_view_zoom_fit_->isChecked());
+ view_->zoom_fit(checked);
}
void StandardBar::on_actionViewZoomOneToOne_triggered()
void on_actionViewZoomOut_triggered();
- void on_actionViewZoomFit_triggered();
+ void on_actionViewZoomFit_triggered(bool checked);
void on_actionViewZoomOneToOne_triggered();