]> sigrok.org Git - pulseview.git/commitdiff
Added empty HwCap dialog
authorJoel Holdsworth <redacted>
Fri, 28 Dec 2012 09:51:12 +0000 (09:51 +0000)
committerJoel Holdsworth <redacted>
Fri, 28 Dec 2012 09:55:58 +0000 (09:55 +0000)
CMakeLists.txt
pv/dialogs/hwcap.cpp [new file with mode: 0644]
pv/dialogs/hwcap.h [new file with mode: 0644]
pv/samplingbar.cpp
pv/samplingbar.h

index b1208d64d256c6989da9ebe90b72adef3b51efdf..189e778ae27edc819d04b08885b26b00b5088746 100644 (file)
@@ -90,6 +90,7 @@ set(pulseview_SOURCES
        pv/data/signaldata.cpp
        pv/data/snapshot.cpp
        pv/dialogs/about.cpp
+       pv/dialogs/hwcap.cpp
        pv/prop/binding/hwcap.cpp
        pv/view/analogsignal.cpp
        pv/view/cursor.cpp
diff --git a/pv/dialogs/hwcap.cpp b/pv/dialogs/hwcap.cpp
new file mode 100644 (file)
index 0000000..d6481ab
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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
+ */
+
+#include "hwcap.h"
+
+namespace pv {
+namespace dialogs {
+
+HwCap::HwCap(QWidget *parent, struct sr_dev_inst *sdi) :
+       QDialog(parent),
+       _hw_cap_binding(sdi)
+{
+}
+
+} // namespace dialogs
+} // namespace pv
diff --git a/pv/dialogs/hwcap.h b/pv/dialogs/hwcap.h
new file mode 100644 (file)
index 0000000..7b826fe
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_HWCAP_H
+#define PULSEVIEW_PV_HWCAP_H
+
+#include <QDialog>
+
+#include <pv/prop/binding/hwcap.h>
+
+namespace pv {
+namespace dialogs {
+
+class HwCap : public QDialog
+{
+public:
+       HwCap(QWidget *parent, struct sr_dev_inst *sdi);
+
+private:
+       pv::prop::binding::HwCap _hw_cap_binding;
+};
+
+} // namespace dialogs
+} // namespace pv
+
+#endif // PULSEVIEW_PV_HWCAP_H
index 5f9e4371bd691fa98acb52ffb2ac88aa915a0c5d..468c1c539ef6e536fdcd551d68914d33f053532c 100644 (file)
@@ -30,6 +30,8 @@ extern "C" {
 
 #include "samplingbar.h"
 
+#include <pv/dialogs/hwcap.h>
+
 namespace pv {
 
 const uint64_t SamplingBar::RecordLengths[11] = {
@@ -49,13 +51,17 @@ const uint64_t SamplingBar::RecordLengths[11] = {
 SamplingBar::SamplingBar(QWidget *parent) :
        QToolBar("Sampling Bar", parent),
        _device_selector(this),
+       _configure_button(this),
        _record_length_selector(this),
        _sample_rate_list(this),
        _run_stop_button(this)
 {
-       connect(&_run_stop_button, SIGNAL(clicked()), this, SIGNAL(run_stop()));
+       connect(&_run_stop_button, SIGNAL(clicked()),
+               this, SIGNAL(run_stop()));
        connect(&_device_selector, SIGNAL(currentIndexChanged (int)),
                this, SLOT(on_device_selected()));
+       connect(&_configure_button, SIGNAL(clicked()),
+               this, SLOT(configure()));
 
        _sample_rate_value.setDecimals(0);
        _sample_rate_value.setSuffix("Hz");
@@ -70,7 +76,10 @@ SamplingBar::SamplingBar(QWidget *parent) :
 
        set_sampling(false);
 
+       _configure_button.setIcon(QIcon::fromTheme("configure"));
+
        addWidget(&_device_selector);
+       addWidget(&_configure_button);
        addWidget(&_record_length_selector);
        _sample_rate_list_action = addWidget(&_sample_rate_list);
        _sample_rate_value_action = addWidget(&_sample_rate_value);
@@ -194,4 +203,13 @@ void SamplingBar::on_device_selected()
        update_sample_rate_selector();
 }
 
+void SamplingBar::configure()
+{
+       sr_dev_inst *const sdi = get_selected_device();
+       assert(sdi);
+
+       pv::dialogs::HwCap dlg(this, sdi);
+       dlg.exec();
+}
+
 } // namespace pv
index 8c6511a8f33d639b008ee1a291d09f9c5dc80505..a9ceb6bd96af85e7e5ffb7c4c38303b7e1647e74 100644 (file)
@@ -57,9 +57,11 @@ private:
 
 private slots:
        void on_device_selected();
+       void configure();
 
 private:
        QComboBox _device_selector;
+       QToolButton _configure_button;
 
        QComboBox _record_length_selector;