projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
views: Increase precision on analog views
[pulseview.git]
/
pv
/
widgets
/
devicetoolbutton.hpp
diff --git
a/pv/widgets/devicetoolbutton.hpp
b/pv/widgets/devicetoolbutton.hpp
index 1fb0a54486057cbcd776b3f782580d54f416ea43..ee7b12ae81aaeed1decbb3f90c502ad7c675e28b 100644
(file)
--- a/
pv/widgets/devicetoolbutton.hpp
+++ b/
pv/widgets/devicetoolbutton.hpp
@@
-14,12
+14,11
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
*/
-#ifndef PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_H
-#define PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_H
+#ifndef PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_H
PP
+#define PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_H
PP
#include <list>
#include <memory>
#include <list>
#include <memory>
@@
-30,16
+29,21
@@
#include <QSignalMapper>
#include <QToolButton>
#include <QSignalMapper>
#include <QToolButton>
-struct srd_decoder;
+using std::list;
+using std::shared_ptr;
+using std::vector;
+using std::weak_ptr;
-namespace sigrok {
-class Device;
-}
+struct srd_decoder;
namespace pv {
class DeviceManager;
namespace pv {
class DeviceManager;
+namespace devices {
+class Device;
+}
+
namespace widgets {
class DeviceToolButton : public QToolButton
namespace widgets {
class DeviceToolButton : public QToolButton
@@
-59,7
+63,7
@@
public:
/**
* Returns a reference to the selected device.
*/
/**
* Returns a reference to the selected device.
*/
- s
td::shared_ptr<sigrok
::Device> selected_device();
+ s
hared_ptr<devices
::Device> selected_device();
/**
* Sets the current list of devices.
/**
* Sets the current list of devices.
@@
-67,8
+71,14
@@
public:
* @param selected_device the currently active device.
*/
void set_device_list(
* @param selected_device the currently active device.
*/
void set_device_list(
- const std::list< std::shared_ptr<sigrok::Device> > &devices,
- std::shared_ptr<sigrok::Device> selected);
+ const list< shared_ptr<devices::Device> > &devices,
+ shared_ptr<devices::Device> selected);
+
+ /**
+ * Sets the current device to "no device". Useful for when a selected
+ * device fails to open.
+ */
+ void reset();
private:
/**
private:
/**
@@
-79,6
+89,10
@@
private:
private Q_SLOTS:
void on_action(QObject *action);
private Q_SLOTS:
void on_action(QObject *action);
+ void on_menu_hovered(QAction *action);
+
+ void on_menu_hover_timeout();
+
Q_SIGNALS:
void device_selected();
Q_SIGNALS:
void device_selected();
@@
-89,11
+103,13
@@
private:
QMenu menu_;
QSignalMapper mapper_;
QMenu menu_;
QSignalMapper mapper_;
- std::shared_ptr<sigrok::Device> selected_device_;
- std::vector< std::weak_ptr<sigrok::Device> > devices_;
+ shared_ptr<devices::Device> selected_device_;
+ vector< weak_ptr<devices::Device> > devices_;
+
+ QString device_tooltip_;
};
};
-}
//
widgets
-}
//
pv
+}
// namespace
widgets
+}
// namespace
pv
-#endif // PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_H
+#endif // PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_H
PP