Skip to content

Commit

Permalink
Add qdarkstyle dep for grc (qt) and patches to fix running grc-qt (#264)
Browse files Browse the repository at this point in the history
automerged PR by conda-forge/automerge-action
  • Loading branch information
github-actions[bot] authored Apr 26, 2024
2 parents 1cd366b + 4069bb5 commit 904ac9c
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
grc/core/{Constants.py => Constants.py.in} | 2 ++
grc/grc.conf.in | 3 +--
grc/gui/Config.py | 3 +--
6 files changed, 27 insertions(+), 19 deletions(-)
grc/gui_qt/Config.py | 8 ++++----
7 files changed, 31 insertions(+), 23 deletions(-)
rename grc/core/{Constants.py => Constants.py.in} (97%)

diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt
Expand Down Expand Up @@ -173,6 +174,40 @@ index 5aab9d7b8..51301e79c 100644
Constants.update_font_size(self.font_size)

self.parser = configparser.ConfigParser()
diff --git a/grc/gui_qt/Config.py b/grc/gui_qt/Config.py
index 28b735773..c953aa8fa 100644
--- a/grc/gui_qt/Config.py
+++ b/grc/gui_qt/Config.py
@@ -1,7 +1,8 @@
import os
-from os.path import expanduser, normpath, expandvars, exists
+from os.path import expanduser, normpath, expandvars, exists, join
from collections import OrderedDict

+from . import Constants
from ..core.Config import Config as CoreConfig
from qtpy import QtCore

@@ -13,9 +14,8 @@ class Config(CoreConfig):
gui_prefs_file = os.environ.get(
'GRC_QT_PREFS_PATH', os.path.expanduser('~/.gnuradio/grc_qt.conf'))

- def __init__(self, install_prefix, *args, **kwargs):
+ def __init__(self, *args, **kwargs):
CoreConfig.__init__(self, *args, **kwargs)
- self.install_prefix = install_prefix
self.qsettings = QtCore.QSettings(self.gui_prefs_file, QtCore.QSettings.IniFormat)

@property
@@ -28,7 +28,7 @@ class Config(CoreConfig):
self.hier_block_lib_dir,
os.environ.get('GRC_BLOCKS_PATH', ''),
self._gr_prefs.get_string('grc', 'local_blocks_path', ''),
- self._gr_prefs.get_string('grc', 'global_blocks_path', ''),
+ normpath(join(self.install_prefix, Constants.GRC_BLOCKS_DIR)),
self.qsettings.value('grc/custom_block_paths', ''),
)

--
2.42.0

27 changes: 27 additions & 0 deletions recipe/0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ryan Volz <ryan.volz@gmail.com>
Date: Fri, 26 Apr 2024 15:28:30 -0400
Subject: [PATCH] grc-qt: Don't error when missing manifests dir

Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
---
grc/gui_qt/components/oot_browser.py | 3 +++
1 file changed, 3 insertions(+)

diff --git a/grc/gui_qt/components/oot_browser.py b/grc/gui_qt/components/oot_browser.py
index f25f67cd4..5e599e697 100644
--- a/grc/gui_qt/components/oot_browser.py
+++ b/grc/gui_qt/components/oot_browser.py
@@ -31,6 +31,9 @@ class OOTBrowser(QtWidgets.QDialog, base.Component):

self.manifest_dir = os.path.join(Paths.RESOURCES, "manifests")

+ if not os.path.exists(self.manifest_dir):
+ return
+
for f in os.listdir(self.manifest_dir):
with open(os.path.join(self.manifest_dir, f), 'r', encoding='utf8') as manifest:
text = manifest.read()
--
2.42.0

4 changes: 3 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ source:
- 0002-grc-Remove-global_blocks_path-preference-and-use-pre.patch
- 0003-filter-python-Drop-unused-args-argument-overriden-by.patch
- 0004-cmake-runtime-Manually-set-the-pybind11-internal-bui.patch
- 0005-grc-qt-Don-t-error-when-missing-manifests-dir.patch

build:
number: 0
number: 1

requirements:
build:
Expand Down Expand Up @@ -297,6 +298,7 @@ outputs:
- pygobject
- python
- pyyaml
- qdarkstyle
- qtpy
test:
requires:
Expand Down

0 comments on commit 904ac9c

Please sign in to comment.