]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/connect.hpp
Fix #1146 by replacing the check box by a combo box
[pulseview.git] / pv / dialogs / connect.hpp
index a8f793ac1dc3e8f4b73ee9b9f86ead60c19343c6..914c58783ee3693b87ed6b7c2a3232c0eb119a62 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
  */
 
 #ifndef PULSEVIEW_PV_CONNECT_HPP
 
 #include <memory>
 
+#include <QCheckBox>
 #include <QComboBox>
 #include <QDialog>
 #include <QDialogButtonBox>
 #include <QFormLayout>
+#include <QHBoxLayout>
 #include <QLineEdit>
 #include <QListWidget>
 #include <QPushButton>
+#include <QSpinBox>
 #include <QVBoxLayout>
 
+using std::shared_ptr;
+
 namespace sigrok {
 class Driver;
 }
@@ -42,8 +46,8 @@ class HardwareDevice;
 }
 }
 
-Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Driver>);
-Q_DECLARE_METATYPE(std::shared_ptr<pv::devices::HardwareDevice>);
+Q_DECLARE_METATYPE(shared_ptr<sigrok::Driver>);
+Q_DECLARE_METATYPE(shared_ptr<pv::devices::HardwareDevice>);
 
 namespace pv {
 
@@ -58,19 +62,20 @@ class Connect : public QDialog
 public:
        Connect(QWidget *parent, pv::DeviceManager &device_manager);
 
-       std::shared_ptr<devices::HardwareDevice> get_selected_device() const;
+       shared_ptr<devices::HardwareDevice> get_selected_device() const;
 
 private:
        void populate_drivers();
 
-       void populate_serials(std::shared_ptr<sigrok::Driver> driver);
+       void populate_serials(shared_ptr<sigrok::Driver> driver);
 
        void unset_connection();
 
-       void set_serial_connection(std::shared_ptr<sigrok::Driver> driver);
-
 private Q_SLOTS:
-       void device_selected(int index);
+       void driver_selected(int index);
+
+       void serial_toggled(bool checked);
+       void tcp_toggled(bool checked);
 
        void scan_pressed();
 
@@ -86,6 +91,11 @@ private:
 
        QComboBox serial_devices_;
 
+       QWidget *tcp_config_;
+       QLineEdit *tcp_host_;
+       QSpinBox *tcp_port_;
+       QComboBox *tcp_protocol_;
+
        QPushButton scan_button_;
        QListWidget device_list_;