diff options
Diffstat (limited to 'gr-qtgui/python')
-rw-r--r-- | gr-qtgui/python/qtgui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-qtgui/python/qtgui/__init__.py | 1 | ||||
-rwxr-xr-x | gr-qtgui/python/qtgui/range.py.cmakein | 2 | ||||
-rw-r--r-- | gr-qtgui/python/qtgui/util.py.cmakein | 34 |
4 files changed, 39 insertions, 0 deletions
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..ec654d9ba2 --- /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 = QtWidgets.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) |