X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fwidgets%2Fdevicetoolbutton.hpp;h=46b2240a0fc90c60c919f3c74053a6fd24ed522b;hp=ed69a4b64a4ef1b0209daf004f2192117a9af8c6;hb=6f925ba9d6faf1077b73c5a5808259576081716a;hpb=da30ecb7e72bd2547e524258efa5ec642988b70b diff --git a/pv/widgets/devicetoolbutton.hpp b/pv/widgets/devicetoolbutton.hpp index ed69a4b..46b2240 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 @@ -30,6 +29,11 @@ #include #include +using std::list; +using std::shared_ptr; +using std::vector; +using std::weak_ptr; + struct srd_decoder; namespace pv { @@ -59,7 +63,7 @@ public: /** * Returns a reference to the selected device. */ - std::shared_ptr selected_device(); + shared_ptr selected_device(); /** * Sets the current list of devices. @@ -67,8 +71,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 list< shared_ptr > &devices, + shared_ptr selected); + + /** + * Sets the current device to "no device". Useful for when a selected + * device fails to open. + */ + void reset(); private: /** @@ -93,8 +103,8 @@ private: QMenu menu_; QSignalMapper mapper_; - std::shared_ptr selected_device_; - std::vector< std::weak_ptr > devices_; + shared_ptr selected_device_; + vector< weak_ptr > devices_; QString device_tooltip_; };