def on_network_control_button_pressed(self): layer = BeeApp().master.getLayerById(self.windowid, self.layerkey) win = layer.getWindow() proplock = qtcore.QReadLocker(layer.propertieslock) if layer.type == LayerTypes.floating: parent = layer.layerparent parent.anchor(layer) # the layer is owned locally so change it to be owned by no one elif win.ownedByMe(layer.owner): # print_debug("adding give up layer to queue for layer key: %d" % layer.key) if len(layer.childItems()): result = qtgui.QMessageBox.warning( win, "Floating layers can not be given up", "You are attempting to give up ownership of layer that has floting layers, if you continue the floating layers will be destroyed. To avoid having them destroyed please anchor them or move them to other layers.", "Continue", "Cancel", ) if result: return win.addGiveUpLayerToQueue(layer.key) # if the layer is owned by nobody then request it elif win.ownedByNobody(layer.owner): win.addRequestLayerToQueue(layer.key)
def on_visibility_box_toggled(self, state): layer = BeeApp().master.getLayerById(self.windowid, self.layerkey) window = layer.getWindow() # change visibility layer.setVisible(state) # recomposite whole image window.reCompositeImage()
def on_blend_mode_box_activated(self, value): # we only want the event with the string if not type(value) is qtcore.QString: return newmode = BlendTranslations.nameToMode(value) if newmode != None: layer = BeeApp().master.getLayerById(self.windowid, self.layerkey) if layer: win = layer.getWindow() win.addBlendModeChangeToQueue(layer.key, newmode)