Skip to content

Commit 929d571

Browse files
committed
Fixed up problem with remove when don't remove the button with state of when
1 parent c25a336 commit 929d571

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

learnbot_dsl/learnbotCode/LearnBlock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,8 @@ def searchUpdate(self, text):
914914
def newProject(self, resetAll=True):
915915
if self.scene.shouldSave is False:
916916
# Delete all whens
917-
for x in copy.copy(self.listNameWhens):
918-
self.delWhen(x[0])
917+
for name, _ in copy.copy(self.listNameWhens):
918+
self.delWhen(name)
919919
# Delete all variables
920920
for name in copy.copy(self.listNameVars):
921921
self.delVar(name)
@@ -1539,7 +1539,7 @@ def delWhen(self, name):
15391539
rango = reversed(range(0, table.rowCount()))
15401540
for item, row in [(table.cellWidget(r, 0), r) for r in rango if
15411541
table.cellWidget(r, 0).getText() in [name, "activate " + name, "deactivate " + name,
1542-
"time_" + name]]:
1542+
"time_" + name, "state_" + name]]:
15431543
item.delete(row)
15441544
item.removeTmpFile()
15451545
self.listButtons.remove(item)

0 commit comments

Comments
 (0)