Repository: biolab/orange3

Issue:
Widget Data table shows colours in header

##### Orange version
![screen shot 2017-11-14 at 16 34 26](https://user-images.githubusercontent.com/11367976/32788536-c0bf2404-c959-11e7-9fd9-a5d68f7a4790.png)


##### Expected behavior
1. If feature color changed in Color widget, it will not influence data in Data table.

2. Attribute names for metas shall be displayed in data table header.


##### Actual behavior
1. If some feture color is changed in Color widget, Data table widget displays color values as feature attribute.
![colors-error](https://user-images.githubusercontent.com/11367976/32788562-d81b22ec-c959-11e7-9003-56d6729f27d9.png)
2. If color is changed for meta data, Data table widget does not put attribute name (in this case color) in the header
![screen shot 2017-11-14 at 16 47 55](https://user-images.githubusercontent.com/11367976/32789242-a7d4d81a-c95b-11e7-9c8d-37cb0071e9a7.png)




##### Steps to reproduce the behavior
iris dataset:
1. change color for some feature
2. set some feature as meta and change color for it



##### Additional info (worksheets, data, screenshots, ...)




Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owtable.py b/Orange/widgets/data/owtable.py
--- a/Orange/widgets/data/owtable.py
+++ b/Orange/widgets/data/owtable.py
@@ -689,7 +689,8 @@ def _update_variable_labels(self, view):
                 RichTableModel.Labels | RichTableModel.Name)
 
             labelnames = set()
-            for a in model.source.domain.variables:
+            domain = model.source.domain
+            for a in itertools.chain(domain.metas, domain.variables):
                 labelnames.update(a.attributes.keys())
             labelnames = sorted(
                 [label for label in labelnames if not label.startswith("_")])


Test patch:
diff --git a/Orange/widgets/data/tests/test_owtable.py b/Orange/widgets/data/tests/test_owtable.py
--- a/Orange/widgets/data/tests/test_owtable.py
+++ b/Orange/widgets/data/tests/test_owtable.py
@@ -1,8 +1,8 @@
-# Test methods with long descriptive names can omit docstrings
-# pylint: disable=missing-docstring
+from unittest.mock import Mock
+
 from Orange.widgets.data.owtable import OWDataTable
 from Orange.widgets.tests.base import WidgetTest, WidgetOutputsTestMixin
-from Orange.data import Table
+from Orange.data import Table, Domain
 
 
 class TestOWDataTable(WidgetTest, WidgetOutputsTestMixin):
@@ -43,3 +43,16 @@ def _select_data(self):
         self.widget.selected_rows = list(range(0, len(self.data.domain), 10))
         self.widget.set_selection()
         return self.widget.selected_rows
+
+    def test_attrs_appear_in_corner_text(self):
+        iris = Table("iris")
+        domain = iris.domain
+        new_domain = Domain(
+            domain.attributes[1:], iris.domain.class_var, domain.attributes[:1])
+        new_domain.metas[0].attributes = {"c": "foo"}
+        new_domain.attributes[0].attributes = {"a": "bar", "c": "baz"}
+        new_domain.class_var.attributes = {"b": "foo"}
+        self.widget.set_corner_text = Mock()
+        self.send_signal(self.widget.Inputs.data, iris.transform(new_domain))
+        self.assertEqual(
+            self.widget.set_corner_text.call_args[0][1], "\na\nb\nc")