X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fwidgets%2Fdevicetoolbutton.hpp;h=cedf49e78386d58482e42b6ac98c439ab89c5b98;hb=e6d42eec32b61b6831b7926a9d6a5cd03d1f3430;hp=af9e6e686da2a0dfe5662adf3a48d6d4b52b976e;hpb=7a01bd3654ed046216308fa64edfd79be7cd525f;p=pulseview.git
diff --git a/pv/widgets/devicetoolbutton.hpp b/pv/widgets/devicetoolbutton.hpp
index af9e6e6..cedf49e 100644
--- a/pv/widgets/devicetoolbutton.hpp
+++ b/pv/widgets/devicetoolbutton.hpp
@@ -14,8 +14,7 @@
* 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 .
*/
#ifndef PULSEVIEW_PV_WIDGETS_DEVICETOOLBUTTON_HPP
@@ -32,14 +31,14 @@
struct srd_decoder;
-namespace sigrok {
-class Device;
-}
-
namespace pv {
class DeviceManager;
+namespace devices {
+class Device;
+}
+
namespace widgets {
class DeviceToolButton : public QToolButton
@@ -59,7 +58,7 @@ public:
/**
* Returns a reference to the selected device.
*/
- std::shared_ptr selected_device();
+ std::shared_ptr selected_device();
/**
* Sets the current list of devices.
@@ -67,8 +66,14 @@ public:
* @param selected_device the currently active device.
*/
void set_device_list(
- const std::list< std::shared_ptr > &devices,
- std::shared_ptr selected);
+ const std::list< std::shared_ptr > &devices,
+ std::shared_ptr selected);
+
+ /**
+ * Sets the current device to "no device". Useful for when a selected
+ * device fails to open.
+ */
+ void reset();
private:
/**
@@ -93,8 +98,8 @@ private:
QMenu menu_;
QSignalMapper mapper_;
- std::shared_ptr selected_device_;
- std::vector< std::weak_ptr > devices_;
+ std::shared_ptr selected_device_;
+ std::vector< std::weak_ptr > devices_;
QString device_tooltip_;
};