2 * This file is part of the PulseView project.
4 * Copyright (C) 2019 Soeren Apel <soeren@apelpie.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include <libsigrokdecode/libsigrokdecode.h>
24 #include <QVBoxLayout>
28 #include "pv/session.hpp"
29 #include "pv/util.hpp"
31 using pv::util::TimeUnit;
32 using pv::util::Timestamp;
34 using std::shared_ptr;
38 namespace decoder_output {
40 View::View(Session &session, bool is_main_view, QMainWindow *parent) :
41 ViewBase(session, is_main_view, parent)
43 // Note: Place defaults in View::reset_view_state(), not here
45 QVBoxLayout *root_layout = new QVBoxLayout(this);
46 root_layout->setContentsMargins(0, 0, 0, 0);
48 QToolBar* tool_bar = new QToolBar();
49 tool_bar->setContextMenuPolicy(Qt::PreventContextMenu);
51 parent->addToolBar(tool_bar);
60 void View::reset_view_state()
62 ViewBase::reset_view_state();
65 void View::clear_signals()
67 ViewBase::clear_signalbases();
70 void View::clear_decode_signals()
74 void View::add_decode_signal(shared_ptr<data::DecodeSignal> signal)
76 connect(signal.get(), SIGNAL(name_changed(const QString&)),
77 this, SLOT(on_signal_name_changed()));
80 void View::remove_decode_signal(shared_ptr<data::DecodeSignal> signal)
85 void View::save_settings(QSettings &settings) const
90 void View::restore_settings(QSettings &settings)
92 // Note: It is assumed that this function is only called once,
93 // immediately after restoring a previous session.
97 void View::on_signal_name_changed()
101 } // namespace decoder_output