+ // Actions
+ action_new_session_->setText(tr("New &Session"));
+ action_new_session_->setIcon(QIcon::fromTheme("document-new",
+ QIcon(":/icons/document-new.png")));
+ connect(action_new_session_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionNewSession_triggered()));
+
+ action_new_view_->setText(tr("New &View"));
+ action_new_view_->setIcon(QIcon::fromTheme("window-new",
+ QIcon(":/icons/window-new.png")));
+ connect(action_new_view_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionNewView_triggered()));
+
+ action_open_->setText(tr("&Open..."));
+ action_open_->setIcon(QIcon::fromTheme("document-open",
+ QIcon(":/icons/document-open.png")));
+ action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
+ connect(action_open_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionOpen_triggered()));
+
+ action_save_as_->setText(tr("&Save As..."));
+ action_save_as_->setIcon(QIcon::fromTheme("document-save-as",
+ QIcon(":/icons/document-save-as.png")));
+ action_save_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
+ connect(action_save_as_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionSaveAs_triggered()));
+
+ action_save_selection_as_->setText(tr("Save Selected &Range As..."));
+ action_save_selection_as_->setIcon(QIcon::fromTheme("document-save-as",
+ QIcon(":/icons/document-save-as.png")));
+ action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
+ connect(action_save_selection_as_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionSaveSelectionAs_triggered()));
+
+ 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(std::shared_ptr<sigrok::OutputFormat>)),
+ this, SLOT(export_file(std::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(std::shared_ptr<sigrok::InputFormat>)),
+ this, SLOT(import_file(std::shared_ptr<sigrok::InputFormat>)));
+
+ action_connect_->setText(tr("&Connect to Device..."));
+ connect(action_connect_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionConnect_triggered()));
+
+ action_view_zoom_in_->setText(tr("Zoom &In"));
+ action_view_zoom_in_->setIcon(QIcon::fromTheme("zoom-in",
+ QIcon(":/icons/zoom-in.png")));
+ // simply using Qt::Key_Plus shows no + in the menu
+ action_view_zoom_in_->setShortcut(QKeySequence::ZoomIn);
+ connect(action_view_zoom_in_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionViewZoomIn_triggered()));
+
+ action_view_zoom_out_->setText(tr("Zoom &Out"));
+ action_view_zoom_out_->setIcon(QIcon::fromTheme("zoom-out",
+ QIcon(":/icons/zoom-out.png")));
+ action_view_zoom_out_->setShortcut(QKeySequence::ZoomOut);
+ connect(action_view_zoom_out_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionViewZoomOut_triggered()));
+
+ action_view_zoom_fit_->setCheckable(true);
+ action_view_zoom_fit_->setText(tr("Zoom to &Fit"));
+ action_view_zoom_fit_->setIcon(QIcon::fromTheme("zoom-fit",
+ 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()));
+
+ 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",
+ QIcon(":/icons/zoom-original.png")));
+ action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O));
+ connect(action_view_zoom_one_to_one_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionViewZoomOneToOne_triggered()));
+
+ action_view_show_cursors_->setCheckable(true);
+ action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors",
+ QIcon(":/icons/show-cursors.svg")));
+ action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C));
+ connect(action_view_show_cursors_, SIGNAL(triggered(bool)),
+ this, SLOT(on_actionViewShowCursors_triggered()));
+ action_view_show_cursors_->setText(tr("Show &Cursors"));
+