Sfoglia il codice sorgente

wxGUI/gui_core: fix right mouse click on the root tree node to invoke menu (#2119)

Tomas Zigo 3 anni fa
parent
commit
7d7ee05fda
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      gui/wxpython/gui_core/query.py

+ 3 - 2
gui/wxpython/gui_core/query.py

@@ -133,8 +133,9 @@ class QueryDialog(wx.Dialog):
         else:
             label1 = nodes[0].label
             texts.append((_("Copy '%s'" % self._cutLabel(label1)), label1))
-            if nodes[0].data and nodes[0].data[self._colNames[1]]:
-                label2 = nodes[0].data[self._colNames[1]]
+            col1 = self._colNames[1]
+            if nodes[0].data and col1 in nodes[0].data and nodes[0].data[col1]:
+                label2 = nodes[0].data[col1]
                 texts.insert(0, (_("Copy '%s'" % self._cutLabel(label2)), label2))
                 texts.append((_("Copy line"), label1 + ": " + label2))