+ setMovable(false);
+ setFloatable(false);
+ setContextMenuPolicy(Qt::PreventContextMenu);
+
+ // Open button
+ QToolButton *const open_button = new QToolButton(this);
+
+ widgets::ImportMenu *import_menu = new widgets::ImportMenu(this,
+ session.device_manager().context(),
+ main_window.action_open());
+ connect(import_menu,
+ SIGNAL(format_selected(std::shared_ptr<sigrok::InputFormat>)),
+ &main_window_,
+ SLOT(import_file(std::shared_ptr<sigrok::InputFormat>)));
+
+ open_button->setMenu(import_menu);
+ open_button->setDefaultAction(main_window.action_open());
+ open_button->setPopupMode(QToolButton::MenuButtonPopup);
+
+ // Save button
+ QToolButton *const save_button = new QToolButton(this);
+
+ widgets::ExportMenu *export_menu = new widgets::ExportMenu(this,
+ session.device_manager().context(),
+ main_window.action_save_as());
+ connect(export_menu,
+ SIGNAL(format_selected(std::shared_ptr<sigrok::OutputFormat>)),
+ &main_window_,
+ SLOT(export_file(std::shared_ptr<sigrok::OutputFormat>)));
+
+ save_button->setMenu(export_menu);
+ save_button->setDefaultAction(main_window.action_save_as());
+ save_button->setPopupMode(QToolButton::MenuButtonPopup);
+
+ // Device selector menu
+ connect(&device_selector_, SIGNAL(device_selected()),
+ this, SLOT(on_device_selected()));
+
+ // Setup the decoder button
+#ifdef ENABLE_DECODE
+ QToolButton *add_decoder_button = new QToolButton(this);
+ add_decoder_button->setIcon(QIcon::fromTheme("add-decoder",
+ QIcon(":/icons/add-decoder.svg")));
+ add_decoder_button->setPopupMode(QToolButton::InstantPopup);
+ add_decoder_button->setMenu(main_window_.menu_decoder_add());
+#endif
+
+ // Setup the burger menu
+ QMenu *const menu = new QMenu(this);
+
+ QMenu *const menu_view = new QMenu;
+ menu_view->setTitle(tr("&View"));
+ menu_view->addAction(main_window.action_view_sticky_scrolling());
+
+ QMenu *const menu_help = new QMenu;
+ menu_help->setTitle(tr("&Help"));
+ menu_help->addAction(main_window.action_about());
+
+ menu->addAction(menu_view->menuAction());
+ menu->addSeparator();
+ menu->addAction(menu_help->menuAction());
+ menu->addSeparator();
+ menu->addAction(main_window.action_quit());
+
+ menu_button_.setMenu(menu);
+ menu_button_.setPopupMode(QToolButton::InstantPopup);
+ menu_button_.setIcon(QIcon::fromTheme("menu",
+ QIcon(":/icons/menu.svg")));
+
+ // Setup the toolbar
+ addWidget(open_button);
+ addWidget(save_button);
+ addSeparator();
+ addAction(main_window.action_view_zoom_in());
+ addAction(main_window.action_view_zoom_out());
+ addAction(main_window.action_view_zoom_fit());
+ addAction(main_window.action_view_zoom_one_to_one());
+ addSeparator();
+ addAction(main_window.action_view_show_cursors());
+ addSeparator();
+