Skip to content

Commit

Permalink
When refresh layers happens, it just replaces everything with what's …
Browse files Browse the repository at this point in the history
…in the dataprep xml. Put the tabs in there using tech-properties-tabs
  • Loading branch information
atait committed Jun 21, 2019
1 parent a108d88 commit 586c46a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions lymask/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

from lymask.invocation import gui_main
from lymask.utilities import insert_layer_tab, tech_dataprep_layer_properties, reload_lys
from lymask.utilities import insert_layer_tab, tech_dataprep_layer_properties, reload_lys, gui_view

DEFAULT_TECH = 'OLMAC'

Expand Down Expand Up @@ -73,10 +73,11 @@ def reload_dataprep_menu(tech_name=None):
menu = pya.Application.instance().main_window().menu()
def refresh_layers():
reload_lys(tech_name)
insert_layer_tab(tech_dataprep_layer_properties(), tab_name='Dataprep')
# insert_layer_tab(tab_name='Masks')
lv = gui_view()
lv.load_layer_props(tech_dataprep_layer_properties())
lv.current_layer_list = 0
layer_action = _gen_new_action(refresh_layers)
layer_action.title = 'Refresh layer display'
# layer_action.shortcut = 'Shift+Ctrl+P'
layer_action.shortcut = 'Shift+Ctrl+P'
menu.insert_separator('soen_menu.dataprep.begin', 'SEP2')
menu.insert_item('soen_menu.dataprep.begin', 'dataprep_layer_refresh', layer_action)
8 changes: 4 additions & 4 deletions lymask/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def tech_layer_properties(pya_tech=None):


def tech_dataprep_layer_properties(pya_tech=None):
''' Returns the file containing the main layer properties
''' Returns the file containing the dataprep layer properties
'''
if pya_tech is None:
pya_tech = active_technology()
Expand Down Expand Up @@ -148,16 +148,16 @@ def fromFile(cls, filename):
new_obj[short_name] = source2pyaLayerInfo(memb['source'])
return new_obj

def append(self, other):
def append(self, other, doubles_ok=False):
for layname in other.keys():
if layname in self.keys():
if layname in self.keys() and not doubles_ok:
raise ValueError('Layer is doubly defined: {}'.format(layname))
self[layname] = other.get_as_LayerInfo(layname)

def appendFile(self, filename):
other = LayerSet.fromFile(filename)
other.active_layout = self.active_layout
self.append(other)
self.append(other, doubles_ok=True)


def name2shortName(name_str):
Expand Down

0 comments on commit 586c46a

Please sign in to comment.