X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=f72d1b7056041bd5cb34c563f68c7aed3523917e;hb=945745012eb57cefa1ef457daf48cfffa99f9ec2;hp=4de010af7a97282a37eeba8c18d177e7317ad838;hpb=d99dc9f29066fba8948f1fca8b18a54b33064837;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 4de010a..f72d1b7 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -39,6 +39,7 @@ #include "mainwindow.h" #include "devicemanager.h" +#include "device/devinst.h" #include "dialogs/about.h" #include "dialogs/connect.h" #include "dialogs/storeprogress.h" @@ -57,6 +58,7 @@ #include #include +using boost::shared_ptr; using std::list; namespace pv { @@ -159,6 +161,8 @@ void MainWindow::setup_ui() "MainWindow", "Zoom &In", 0, QApplication::UnicodeUTF8)); 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); action_view_zoom_in->setObjectName( QString::fromUtf8("actionViewZoomIn")); menu_view->addAction(action_view_zoom_in); @@ -168,6 +172,7 @@ void MainWindow::setup_ui() "MainWindow", "Zoom &Out", 0, QApplication::UnicodeUTF8)); action_view_zoom_out->setIcon(QIcon::fromTheme("zoom-out", QIcon(":/icons/zoom-out.png"))); + action_view_zoom_out->setShortcut(QKeySequence::ZoomOut); action_view_zoom_out->setObjectName( QString::fromUtf8("actionViewZoomOut")); menu_view->addAction(action_view_zoom_out); @@ -279,11 +284,13 @@ void MainWindow::session_error( Q_ARG(QString, info_text)); } -void MainWindow::update_device_list(struct sr_dev_inst *selected_device) +void MainWindow::update_device_list( + shared_ptr selected_device) { assert(_sampling_bar); - const list &devices = _device_manager.devices(); + const list< shared_ptr > &devices = + _device_manager.devices(); _sampling_bar->set_device_list(devices); if (!selected_device && !devices.empty()) { @@ -291,9 +298,10 @@ void MainWindow::update_device_list(struct sr_dev_inst *selected_device) selected_device = devices.front(); // Try and find the demo device and select that by default - BOOST_FOREACH (struct sr_dev_inst *sdi, devices) - if (strcmp(sdi->driver->name, "demo") == 0) { - selected_device = sdi; + BOOST_FOREACH (shared_ptr dev_inst, devices) + if (strcmp(dev_inst->dev_inst()->driver->name, + "demo") == 0) { + selected_device = dev_inst; } } @@ -362,10 +370,10 @@ void MainWindow::on_actionConnect_triggered() // If the user selected a device, select it in the device list. Select the // current device otherwise. - struct sr_dev_inst *const sdi = dlg.exec() ? + shared_ptr dev_inst = dlg.exec() ? dlg.get_selected_device() : _session.get_device(); - update_device_list(sdi); + update_device_list(dev_inst); } void MainWindow::on_actionQuit_triggered()