summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
authorJosh Morman <mormjb@gmail.com>2020-01-08 12:47:25 -0500
committerMartin Braun <martin.braun@ettus.com>2020-01-08 10:21:20 -0800
commite3c27362d7a0d7c0da55b97ec8b7ba0c7ef1ed84 (patch)
treeb882bded5435af11b81c477997ed82340d1f0cc6 /grc
parent445aa4792dcdf4a8bf14600e6d931451e36f0eaa (diff)
grc: remove canvas_size as a flowgraph option
It was mostly removed with the feature of auto-resizing the canvase This just removes the option from the options block and some other unused code
Diffstat (limited to 'grc')
-rw-r--r--grc/blocks/options.block.yml7
-rw-r--r--grc/gui/Config.py14
-rw-r--r--grc/gui/Constants.py2
3 files changed, 1 insertions, 22 deletions
diff --git a/grc/blocks/options.block.yml b/grc/blocks/options.block.yml
index 7d5d0389f8..e6d84a26d5 100644
--- a/grc/blocks/options.block.yml
+++ b/grc/blocks/options.block.yml
@@ -19,10 +19,6 @@ parameters:
label: Description
dtype: string
hide: ${ ('none' if description else 'part') }
-- id: window_size
- label: Canvas Size
- dtype: int_vector
- hide: part
- id: output_language
label: Output Language
dtype: enum
@@ -130,9 +126,6 @@ parameters:
hide: part
asserts:
-- ${ not window_size or len(window_size) == 2 }
-- ${ not window_size or 300 <= window_size[0] <= 4096 }
-- ${ not window_size or 300 <= window_size[1] <= 4096 }
- ${ len(placement) == 4 or len(placement) == 2 }
- ${ all(i >= 0 for i in placement) }
diff --git a/grc/gui/Config.py b/grc/gui/Config.py
index d78c3f040a..03bc927034 100644
--- a/grc/gui/Config.py
+++ b/grc/gui/Config.py
@@ -101,18 +101,6 @@ class Config(CoreConfig):
return self._gr_prefs.get_string('grc-docs', 'wiki_block_docs_url_prefix', '')
@property
- def default_canvas_size(self):
- try: # ugly, but matches current code style
- raw = self._gr_prefs.get_string('grc', 'canvas_default_size', '1280, 1024')
- value = tuple(int(x.strip('() ')) for x in raw.split(','))
- if len(value) != 2 or not all(300 < x < 4096 for x in value):
- raise ValueError
- return value
- except (ValueError, TypeError):
- print("Error: invalid 'canvas_default_size' setting.", file=sys.stderr)
- return Constants.DEFAULT_CANVAS_SIZE_DEFAULT
-
- @property
def font_size(self):
try: # ugly, but matches current code style
font_size = self._gr_prefs.get_long('grc', 'canvas_font_size',
@@ -192,7 +180,7 @@ class Config(CoreConfig):
def variable_editor_position(self, pos=None, sidebar=False):
# Figure out default
if sidebar:
- w, h = self.main_window_size()
+ _, h = self.main_window_size()
return self.entry('variable_editor_sidebar_position', pos, default=int(h*0.7))
else:
return self.entry('variable_editor_position', pos, default=int(self.blocks_window_position()*0.5))
diff --git a/grc/gui/Constants.py b/grc/gui/Constants.py
index 573fabe82b..82a59a7fc3 100644
--- a/grc/gui/Constants.py
+++ b/grc/gui/Constants.py
@@ -41,8 +41,6 @@ MIN_DIALOG_HEIGHT = 500
DEFAULT_BLOCKS_WINDOW_WIDTH = 100
DEFAULT_CONSOLE_WINDOW_WIDTH = 100
-DEFAULT_CANVAS_SIZE_DEFAULT = 1280, 1024
-
FONT_SIZE = DEFAULT_FONT_SIZE = 8
FONT_FAMILY = "Sans"
BLOCK_FONT = PORT_FONT = "Sans 8"