From: Joel Holdsworth Date: Sun, 27 Jan 2013 09:43:57 +0000 (+0000) Subject: Renamed pv::dialogs::HwCap to DeviceOptions X-Git-Tag: pulseview-0.1.0~136 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d755562ad376fc95184ff996ff8f1391c5f32b6b;p=pulseview.git Renamed pv::dialogs::HwCap to DeviceOptions --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dd7c259..c1d0eed0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ set(pulseview_SOURCES pv/data/signaldata.cpp pv/data/snapshot.cpp pv/dialogs/about.cpp - pv/dialogs/hwcap.cpp + pv/dialogs/deviceoptions.cpp pv/prop/enum.cpp pv/prop/property.cpp pv/prop/binding/binding.cpp diff --git a/pv/dialogs/deviceoptions.cpp b/pv/dialogs/deviceoptions.cpp new file mode 100644 index 00000000..b8f4cabf --- /dev/null +++ b/pv/dialogs/deviceoptions.cpp @@ -0,0 +1,53 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * 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 "deviceoptions.h" + +namespace pv { +namespace dialogs { + +DeviceOptions::DeviceOptions(QWidget *parent, struct sr_dev_inst *sdi) : + QDialog(parent), + _layout(this), + _button_box(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, + Qt::Horizontal, this), + _device_options_binding(sdi) +{ + setWindowTitle(tr("Configure Device")); + + connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); + connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); + + setLayout(&_layout); + + QWidget *const form = _device_options_binding.get_form(this); + _layout.addWidget(form); + + _layout.addWidget(&_button_box); +} + +void DeviceOptions::accept() +{ + QDialog::accept(); + _device_options_binding.commit(); +} + +} // namespace dialogs +} // namespace pv diff --git a/pv/dialogs/deviceoptions.h b/pv/dialogs/deviceoptions.h new file mode 100644 index 00000000..20f6b6b6 --- /dev/null +++ b/pv/dialogs/deviceoptions.h @@ -0,0 +1,51 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * 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_DEVICEOPTIONS_H +#define PULSEVIEW_PV_DEVICEOPTIONS_H + +#include +#include +#include + +#include + +namespace pv { +namespace dialogs { + +class DeviceOptions : public QDialog +{ +public: + DeviceOptions(QWidget *parent, struct sr_dev_inst *sdi); + +protected: + void accept(); + +private: + QVBoxLayout _layout; + QDialogButtonBox _button_box; + + pv::prop::binding::DeviceOptions _device_options_binding; +}; + +} // namespace dialogs +} // namespace pv + +#endif // PULSEVIEW_PV_DEVICEOPTIONS_H diff --git a/pv/dialogs/hwcap.cpp b/pv/dialogs/hwcap.cpp deleted file mode 100644 index f3b9400a..00000000 --- a/pv/dialogs/hwcap.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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), - _layout(this), - _button_box(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, - Qt::Horizontal, this), - _device_options_binding(sdi) -{ - setWindowTitle(tr("Configure Device")); - - connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); - connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); - - setLayout(&_layout); - - QWidget *const form = _device_options_binding.get_form(this); - _layout.addWidget(form); - - _layout.addWidget(&_button_box); -} - -void HwCap::accept() -{ - QDialog::accept(); - _device_options_binding.commit(); -} - -} // namespace dialogs -} // namespace pv diff --git a/pv/dialogs/hwcap.h b/pv/dialogs/hwcap.h deleted file mode 100644 index 692b743e..00000000 --- a/pv/dialogs/hwcap.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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 -#include -#include - -#include - -namespace pv { -namespace dialogs { - -class HwCap : public QDialog -{ -public: - HwCap(QWidget *parent, struct sr_dev_inst *sdi); - -protected: - void accept(); - -private: - QVBoxLayout _layout; - QDialogButtonBox _button_box; - - pv::prop::binding::DeviceOptions _device_options_binding; -}; - -} // namespace dialogs -} // namespace pv - -#endif // PULSEVIEW_PV_HWCAP_H diff --git a/pv/samplingbar.cpp b/pv/samplingbar.cpp index 7bc207ae..6195d899 100644 --- a/pv/samplingbar.cpp +++ b/pv/samplingbar.cpp @@ -30,7 +30,7 @@ extern "C" { #include "samplingbar.h" -#include +#include namespace pv { @@ -214,7 +214,7 @@ void SamplingBar::configure() sr_dev_inst *const sdi = get_selected_device(); assert(sdi); - pv::dialogs::HwCap dlg(this, sdi); + pv::dialogs::DeviceOptions dlg(this, sdi); dlg.exec(); }