From: Joel Holdsworth Date: Sat, 4 May 2013 08:44:22 +0000 (+0100) Subject: Added empty context bar X-Git-Tag: pulseview-0.2.0~359 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=404aad0ed6bd90566739af6ecb57475bc02a7c8e Added empty context bar --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a754020..9714d68c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,7 @@ set(pulseview_SOURCES pv/prop/property.cpp pv/prop/binding/binding.cpp pv/prop/binding/deviceoptions.cpp + pv/toolbars/contextbar.cpp pv/toolbars/samplingbar.cpp pv/view/analogsignal.cpp pv/view/cursor.cpp @@ -139,6 +140,7 @@ set(pulseview_HEADERS pv/dialogs/about.h pv/dialogs/connect.h pv/dialogs/deviceoptions.h + pv/toolbars/contextbar.h pv/toolbars/samplingbar.h pv/view/cursor.h pv/view/header.h diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index b916999f..6b3398f2 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -41,6 +41,7 @@ #include "devicemanager.h" #include "dialogs/about.h" #include "dialogs/connect.h" +#include "toolbars/contextbar.h" #include "toolbars/samplingbar.h" #include "view/view.h" @@ -204,6 +205,11 @@ void MainWindow::setup_ui() SLOT(run_stop())); addToolBar(_sampling_bar); + // Setup the context bar + _context_bar = new toolbars::ContextBar(this); + addToolBar(_context_bar); + insertToolBarBreak(_context_bar); + // Set the title setWindowTitle(QApplication::translate("MainWindow", "PulseView", 0, QApplication::UnicodeUTF8)); diff --git a/pv/mainwindow.h b/pv/mainwindow.h index 02b792ea..51577bdb 100644 --- a/pv/mainwindow.h +++ b/pv/mainwindow.h @@ -40,6 +40,7 @@ namespace pv { class DeviceManager; namespace toolbars { +class ContextBar; class SamplingBar; } @@ -122,6 +123,7 @@ private: QToolBar *_toolbar; toolbars::SamplingBar *_sampling_bar; + toolbars::ContextBar *_context_bar; }; } // namespace pv diff --git a/pv/toolbars/contextbar.cpp b/pv/toolbars/contextbar.cpp new file mode 100644 index 00000000..8e92676a --- /dev/null +++ b/pv/toolbars/contextbar.cpp @@ -0,0 +1,34 @@ +/* + * 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 "contextbar.h" + +using namespace std; + +namespace pv { +namespace toolbars { + +ContextBar::ContextBar(QWidget *parent) : + QToolBar(tr("Context Bar"), parent) +{ +} + +} // namespace toolbars +} // namespace pv diff --git a/pv/toolbars/contextbar.h b/pv/toolbars/contextbar.h new file mode 100644 index 00000000..02ff37e1 --- /dev/null +++ b/pv/toolbars/contextbar.h @@ -0,0 +1,40 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2013 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_TOOLBARS_CONTEXTBAR_H +#define PULSEVIEW_PV_TOOLBARS_CONTEXTBAR_H + +#include + +namespace pv { +namespace toolbars { + +class ContextBar : public QToolBar +{ + Q_OBJECT + +public: + ContextBar(QWidget *parent); +}; + +} // namespace toolbars +} // namespace pv + +#endif // PULSEVIEW_PV_TOOLBARS_CONTEXTBAR_H