def add_gesture(self,name,comment,command,sequence): if not sequence: self.alert("Gesture cant exist without states!!") return if not name: self.alert("Gesture Name must NOT be empty") return if not command: self.alert("Command must NOT be empty") return if sequence[-2:]=="->": sequence=sequence[:-2] if gesture.search_gesture_by_field('sequence',sequence): self.alert("Gesture sequence already exists!!") return if gesture.search_gesture_by_field('command',command): self.alert("Gesture command already exists!!") return if gesture.search_gesture_by_field('name',name): self.alert("Gesture name already exists!!") return gesture_list=sequence.split("->") for gesture_state in gesture_list: if gesture_state not in ['SLR','SRL','VTB','VBT']: self.alert("Gesture sequence invalid!") return gesture.add_gesture(sequence,name,comment,command) self.alert("Successfully added gesture!","info") self.destroy()
def add_gesture(self, name, comment, command, sequence): if not sequence: self.alert("Gesture cant exist without states!!") return if not name: self.alert("Gesture Name must NOT be empty") return if not command: self.alert("Command must NOT be empty") return if sequence[-2:] == "->": sequence = sequence[:-2] if gesture.search_gesture_by_field('sequence', sequence): self.alert("Gesture sequence already exists!!") return if gesture.search_gesture_by_field('command', command): self.alert("Gesture command already exists!!") return if gesture.search_gesture_by_field('name', name): self.alert("Gesture name already exists!!") return gesture_list = sequence.split("->") for gesture_state in gesture_list: if gesture_state not in ['SLR', 'SRL', 'VTB', 'VBT']: self.alert("Gesture sequence invalid!") return gesture.add_gesture(sequence, name, comment, command) self.alert("Successfully added gesture!", "info") self.destroy()
def add_gesture(self, name, comment, command, sequence): if not sequence: self.alert("Gesture cant exist without states!!") return if not command: self.alert("Command must NOT be empty") return if sequence[-2:] == "->": sequence = sequence[:-2] result = gesture.search_gesture_by_field("sequence", sequence) if result and str(result[0][0]) != name: self.alert("Gesture sequence already exists!!") return result = gesture.search_gesture_by_field("command", command) if result and str(result[0][0]) != name: self.alert("Gesture command already exists!!") return gesture.update_gesture(sequence, name, comment, command) self.alert("Successfully updated gesture!", "info") self.destroy()
def add_gesture(self, name, comment, command, sequence): if not sequence: self.alert("Gesture cant exist without states!!") return if not command: self.alert("Command must NOT be empty") return if sequence[-2:] == "->": sequence = sequence[:-2] result = gesture.search_gesture_by_field('sequence', sequence) if result and str(result[0][0]) != name: self.alert("Gesture sequence already exists!!") return result = gesture.search_gesture_by_field('command', command) if result and str(result[0][0]) != name: self.alert("Gesture command already exists!!") return gesture.update_gesture(sequence, name, comment, command) self.alert("Successfully updated gesture!", "info") self.destroy()
def edit(self,widget): gesture_name=" ".join(widget.get_label().split(" ")[1:]) gest=gesture.search_gesture_by_field('name',gesture_name)[0] dialog=edit_gesture_dialog.Edit(str(gest[0]),str(gest[1]),str(gest[2]),str(gest[3])) dialog.connect("destroy",lambda x:self.refresh_list())
def edit(self, widget): gesture_name = " ".join(widget.get_label().split(" ")[1:]) gest = gesture.search_gesture_by_field('name', gesture_name)[0] dialog = edit_gesture_dialog.Edit(str(gest[0]), str(gest[1]), str(gest[2]), str(gest[3])) dialog.connect("destroy", lambda x: self.refresh_list())