From f73cdac9e237c19fb26fe25b8b8382390e922815 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 31 Jan 2021 11:53:38 +0100 Subject: [PATCH] Only allow the delete item command in the project tree if it has focus --- nw/gui/projtree.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 49ca0fcb..ea81c068 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -419,6 +419,9 @@ class GuiProjectTree(QTreeWidget): logger.error("No project open") return False + if not self.hasFocus(): + return False + if tHandle is None: tHandle = self.getSelectedHandle()