Skip to content

Commit

Permalink
Fixed up problem with remove when don't remove the button with state …
Browse files Browse the repository at this point in the history
…of when
  • Loading branch information
ibarbech committed Apr 1, 2019
1 parent c25a336 commit 929d571
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions learnbot_dsl/learnbotCode/LearnBlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@ def searchUpdate(self, text):
def newProject(self, resetAll=True):
if self.scene.shouldSave is False:
# Delete all whens
for x in copy.copy(self.listNameWhens):
self.delWhen(x[0])
for name, _ in copy.copy(self.listNameWhens):
self.delWhen(name)
# Delete all variables
for name in copy.copy(self.listNameVars):
self.delVar(name)
Expand Down Expand Up @@ -1539,7 +1539,7 @@ def delWhen(self, name):
rango = reversed(range(0, table.rowCount()))
for item, row in [(table.cellWidget(r, 0), r) for r in rango if
table.cellWidget(r, 0).getText() in [name, "activate " + name, "deactivate " + name,
"time_" + name]]:
"time_" + name, "state_" + name]]:
item.delete(row)
item.removeTmpFile()
self.listButtons.remove(item)
Expand Down

0 comments on commit 929d571

Please sign in to comment.