summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-10-17 07:57:24 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-10-17 07:57:24 -0700
commit58bed0d449c663701a348461d1f9e6b6f4b94c18 (patch)
tree506ee6c2e3030a49612c0642657d31c8437b6316
parentd806c4f416302f09292bbc5fb96647382368424d (diff)
parent6431a11b26cec7162e520d4eba0efbd2cfb4ba5c (diff)
Merge branch 'master' into next
Conflicts: gr-qtgui/python/qtgui/CMakeLists.txt gr-qtgui/python/qtgui/range.py.cmakein grc/core/generator/flow_graph.tmpl
-rw-r--r--gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc12
-rw-r--r--gr-qtgui/include/gnuradio/qtgui/utils.h3
-rw-r--r--gr-qtgui/lib/const_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/edit_box_msg_impl.cc6
-rw-r--r--gr-qtgui/lib/freq_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/freq_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/histogram_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/qtgui_util.cc12
-rw-r--r--gr-qtgui/lib/sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/time_raster_sink_b_impl.cc6
-rw-r--r--gr-qtgui/lib/time_raster_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/time_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/time_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/vector_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/waterfall_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/waterfall_sink_f_impl.cc6
-rw-r--r--gr-qtgui/python/qtgui/CMakeLists.txt2
-rw-r--r--gr-qtgui/python/qtgui/__init__.py1
-rwxr-xr-xgr-qtgui/python/qtgui/range.py.cmakein2
-rw-r--r--gr-qtgui/python/qtgui/util.py.cmakein34
-rw-r--r--grc/core/generator/flow_graph.tmpl3
22 files changed, 70 insertions, 83 deletions
diff --git a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
index ca4c6a6099..3ae1debb01 100644
--- a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
+++ b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
@@ -211,9 +211,6 @@ namespace gr {
m_16apsk[13] = gr_complex(0.4984, -1.2088);
m_16apsk[14] = gr_complex(-1.2088, -0.4984);
m_16apsk[15] = gr_complex(-0.4984, -1.2088);
- for (int i = 0; i < 16; i++) {
- m_16apsk[i] /= 1.2088;
- }
}
else if (rate == C20_30) {
m_16apsk[0] = gr_complex(0.5061, 0.2474);
@@ -232,9 +229,6 @@ namespace gr {
m_16apsk[13] = gr_complex(0.4909, -1.2007);
m_16apsk[14] = gr_complex(-1.2007, -0.4909);
m_16apsk[15] = gr_complex(-0.4909, -1.2007);
- for (int i = 0; i < 16; i++) {
- m_16apsk[i] /= 1.2007;
- }
}
else {
r2 = m;
@@ -1102,9 +1096,6 @@ namespace gr {
m_256apsk[253] = gr_complex(-0.1909, -0.3627);
m_256apsk[254] = gr_complex(-0.3224, -0.5236);
m_256apsk[255] = gr_complex(-0.3016, -0.5347);
- for (int i = 0; i < 256; i++) {
- m_256apsk[i] /= 1.6747;
- }
}
else if (rate == C22_30) {
m_256apsk[0] = gr_complex(1.5977, 0.1526);
@@ -1363,9 +1354,6 @@ namespace gr {
m_256apsk[253] = gr_complex(0.3110, -0.5686);
m_256apsk[254] = gr_complex(-0.3893, -0.7143);
m_256apsk[255] = gr_complex(-0.3110, -0.5686);
- for (int i = 0; i < 256; i++) {
- m_256apsk[i] /= 1.6329;
- }
}
else {
r8 = m;
diff --git a/gr-qtgui/include/gnuradio/qtgui/utils.h b/gr-qtgui/include/gnuradio/qtgui/utils.h
index 2c51b24820..438c965ed5 100644
--- a/gr-qtgui/include/gnuradio/qtgui/utils.h
+++ b/gr-qtgui/include/gnuradio/qtgui/utils.h
@@ -28,6 +28,7 @@
#include <qwt_plot_picker.h>
#include <qwt_picker_machine.h>
#include <QString>
+#include <QCoreApplication>
/*!
* From QSS file name, extracts the file contents and returns a
@@ -66,4 +67,6 @@ public:
const QEvent *e);
};
+void check_set_qss(QApplication *app);
+
#endif /* INCLUDED_QTGUI_UTILS_H */
diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc
index 7aa99a1c68..26ddf793dc 100644
--- a/gr-qtgui/lib/const_sink_c_impl.cc
+++ b/gr-qtgui/lib/const_sink_c_impl.cc
@@ -136,11 +136,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new ConstellationDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc
index e0b5f256b6..0dee1fa18b 100644
--- a/gr-qtgui/lib/edit_box_msg_impl.cc
+++ b/gr-qtgui/lib/edit_box_msg_impl.cc
@@ -69,11 +69,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
d_is_pair = is_pair;
d_is_static = is_static;
diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc
index 544c8b3c47..c697e8c269 100644
--- a/gr-qtgui/lib/freq_sink_c_impl.cc
+++ b/gr-qtgui/lib/freq_sink_c_impl.cc
@@ -162,11 +162,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new FreqDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc
index 816b37415e..046414ffaf 100644
--- a/gr-qtgui/lib/freq_sink_f_impl.cc
+++ b/gr-qtgui/lib/freq_sink_f_impl.cc
@@ -161,11 +161,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new FreqDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc
index 376f50a4a4..13e50b217c 100644
--- a/gr-qtgui/lib/histogram_sink_f_impl.cc
+++ b/gr-qtgui/lib/histogram_sink_f_impl.cc
@@ -123,11 +123,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new HistogramDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/qtgui_util.cc b/gr-qtgui/lib/qtgui_util.cc
index 07cf3cc9a3..0a0c826bbe 100644
--- a/gr-qtgui/lib/qtgui_util.cc
+++ b/gr-qtgui/lib/qtgui_util.cc
@@ -21,8 +21,11 @@
*/
#include <gnuradio/qtgui/utils.h>
+#include <gnuradio/prefs.h>
#include <QDebug>
#include <QFile>
+#include <QCoreApplication>
+#include <qapplication.h>
QString
get_qt_style_sheet(QString filename)
@@ -101,3 +104,12 @@ QwtDblClickPlotPicker::stateMachine(int n) const
{
return new QwtPickerDblClickPointMachine;
}
+
+void check_set_qss(QApplication *app){
+ std::string qssfile = gr::prefs::singleton()->get_string("qtgui","qss","");
+ if(qssfile.size() > 0) {
+ QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
+ app->setStyleSheet(sstext);
+ }
+}
+
diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc
index 14ddde8e20..ba1be4b7c3 100644
--- a/gr-qtgui/lib/sink_c_impl.cc
+++ b/gr-qtgui/lib/sink_c_impl.cc
@@ -138,11 +138,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
if(d_center_freq < 0) {
throw std::runtime_error("sink_c_impl: Received bad center frequency.\n");
diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc
index e60e98a59b..73b6fcad83 100644
--- a/gr-qtgui/lib/sink_f_impl.cc
+++ b/gr-qtgui/lib/sink_f_impl.cc
@@ -138,11 +138,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
uint64_t maxBufferSize = 32768;
d_main_gui = new SpectrumGUIClass(maxBufferSize, d_fftsize,
diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc
index 7b252a4d1c..1e2fe360b1 100644
--- a/gr-qtgui/lib/time_raster_sink_b_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc
@@ -138,11 +138,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
// Create time raster plot; as a bit input, we expect to see 1's
// and 0's from each stream, so we set the maximum intensity
diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc
index 0e4cb1d345..e4cbb0d38f 100644
--- a/gr-qtgui/lib/time_raster_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc
@@ -136,11 +136,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
// Create time raster plot; as a bit input, we expect to see 1's
// and 0's from each stream, so we set the maximum intensity
diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc
index b59e4c9461..25d5a687d1 100644
--- a/gr-qtgui/lib/time_sink_c_impl.cc
+++ b/gr-qtgui/lib/time_sink_c_impl.cc
@@ -137,11 +137,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 2;
d_main_gui = new TimeDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc
index 28bbb44ee9..419a9243c4 100644
--- a/gr-qtgui/lib/time_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_sink_f_impl.cc
@@ -134,11 +134,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new TimeDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/vector_sink_f_impl.cc b/gr-qtgui/lib/vector_sink_f_impl.cc
index bafd1b73aa..fedef9654d 100644
--- a/gr-qtgui/lib/vector_sink_f_impl.cc
+++ b/gr-qtgui/lib/vector_sink_f_impl.cc
@@ -147,11 +147,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
d_main_gui = new VectorDisplayForm(d_nconnections, d_parent);
d_main_gui->setVecSize(d_vlen);
diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc
index d3ca347c36..4306b97d71 100644
--- a/gr-qtgui/lib/waterfall_sink_c_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc
@@ -162,11 +162,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new WaterfallDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc
index 4b062de14d..9789c2cf6d 100644
--- a/gr-qtgui/lib/waterfall_sink_f_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc
@@ -162,11 +162,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new WaterfallDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/python/qtgui/CMakeLists.txt b/gr-qtgui/python/qtgui/CMakeLists.txt
index 23e75e6583..5df3a7d91b 100644
--- a/gr-qtgui/python/qtgui/CMakeLists.txt
+++ b/gr-qtgui/python/qtgui/CMakeLists.txt
@@ -27,10 +27,12 @@ else()
endif()
configure_file(range.py.cmakein "${CMAKE_CURRENT_BINARY_DIR}/range.py" @ONLY)
+configure_file(util.py.cmakein "${CMAKE_CURRENT_BINARY_DIR}/util.py" @ONLY)
GR_PYTHON_INSTALL(
FILES __init__.py
"${CMAKE_CURRENT_BINARY_DIR}/range.py"
+ "${CMAKE_CURRENT_BINARY_DIR}/util.py"
DESTINATION ${GR_PYTHON_DIR}/gnuradio/qtgui
)
diff --git a/gr-qtgui/python/qtgui/__init__.py b/gr-qtgui/python/qtgui/__init__.py
index 224bde071e..8b60dc6dbe 100644
--- a/gr-qtgui/python/qtgui/__init__.py
+++ b/gr-qtgui/python/qtgui/__init__.py
@@ -35,3 +35,4 @@ except ImportError:
from qtgui_swig import *
from range import Range, RangeWidget
+import util
diff --git a/gr-qtgui/python/qtgui/range.py.cmakein b/gr-qtgui/python/qtgui/range.py.cmakein
index 45aa762ae3..00db509762 100755
--- a/gr-qtgui/python/qtgui/range.py.cmakein
+++ b/gr-qtgui/python/qtgui/range.py.cmakein
@@ -22,6 +22,7 @@
#
@PY_QT_IMPORT@
+import util
class Range(object):
def __init__(self, minv, maxv, step, default, min_length):
@@ -32,6 +33,7 @@ class Range(object):
self.min_length = min_length
self.find_precision()
self.find_nsteps()
+ util.check_set_qss()
def find_precision(self):
# Get the decimal part of the step
diff --git a/gr-qtgui/python/qtgui/util.py.cmakein b/gr-qtgui/python/qtgui/util.py.cmakein
new file mode 100644
index 0000000000..ca2b3b37c5
--- /dev/null
+++ b/gr-qtgui/python/qtgui/util.py.cmakein
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2016 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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 3, or (at your option)
+# any later version.
+#
+# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+@PY_QT_IMPORT@
+from gnuradio import gr
+
+def check_set_qss():
+ app = QtGui.qApp
+ qssfile = gr.prefs().get_string("qtgui","qss","")
+ if(len(qssfile)>0):
+ try:
+ app.setStyleSheet(open(qssfile).read())
+ except:
+ print "WARNING: bad QSS file, %s"%(qssfile)
diff --git a/grc/core/generator/flow_graph.tmpl b/grc/core/generator/flow_graph.tmpl
index 059703340e..2adb555486 100644
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -80,7 +80,7 @@ $imp
#set $class_name = $flow_graph.get_option('id')
#set $param_str = ', '.join(['self'] + ['%s=%s'%(param.get_id(), param.get_make()) for param in $parameters])
#if $generate_options == 'qt_gui'
-
+from gnuradio import qtgui
class $(class_name)(gr.top_block, Qt.QWidget):
@@ -88,6 +88,7 @@ class $(class_name)(gr.top_block, Qt.QWidget):
gr.top_block.__init__(self, "$title")
Qt.QWidget.__init__(self)
self.setWindowTitle("$title")
+ qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except: