@@ -69,19 +69,25 @@ def __init__(self, parent=None, node_graph=None):
6969 self ._limit .setToolTip ('Set display nodes limit.' )
7070 self ._limit .setMaximum (10 )
7171 self ._limit .setMinimum (0 )
72- self ._limit .setValue (1 )
72+ self ._limit .setValue (2 )
7373 self ._limit .valueChanged .connect (self .__on_limit_changed )
7474 self .resize (400 , 400 )
7575
7676 self ._block_signal = False
7777
78+ self .lock = False
79+ self .btn_lock = QtWidgets .QPushButton ('lock' )
80+ self .btn_lock .setToolTip ('Lock the properties bin.' )
81+ self .btn_lock .clicked .connect (self .lock_bin )
82+
7883 btn_clr = QtWidgets .QPushButton ('clear' )
7984 btn_clr .setToolTip ('Clear the properties bin.' )
8085 btn_clr .clicked .connect (self .clear_bin )
8186
8287 top_layout = QtWidgets .QHBoxLayout ()
8388 top_layout .addWidget (self ._limit )
8489 top_layout .addStretch (1 )
90+ top_layout .addWidget (self .btn_lock )
8591 top_layout .addWidget (btn_clr )
8692
8793 layout = QtWidgets .QVBoxLayout (self )
@@ -90,7 +96,7 @@ def __init__(self, parent=None, node_graph=None):
9096
9197 # wire up node graph.
9298 node_graph .add_properties_bin (self )
93- node_graph .node_selected .connect (self .add_node )
99+ node_graph .node_double_clicked .connect (self .add_node )
94100 node_graph .nodes_deleted .connect (self .__on_nodes_deleted )
95101 node_graph .property_changed .connect (self .__on_graph_property_changed )
96102
@@ -174,6 +180,8 @@ def add_node(self, node):
174180 """
175181 if self .limit () == 0 :
176182 return
183+ if self .lock :
184+ return
177185
178186 itm_find = self ._prop_list .findItems (node .id , QtCore .Qt .MatchExactly )
179187
@@ -206,6 +214,16 @@ def remove_node(self, node):
206214 node_id = node if isinstance (node , str ) else node .id
207215 self .__on_prop_close (node_id )
208216
217+ def lock_bin (self ):
218+ """
219+ Lock/UnLock the properties bin.
220+ """
221+ self .lock = not self .lock
222+ if self .lock :
223+ self .btn_lock .setText ("UnLock" )
224+ else :
225+ self .btn_lock .setText ("Lock" )
226+
209227 def clear_bin (self ):
210228 """
211229 Clear the properties bin.
0 commit comments