[node-patches] Change in ovirt-node[master]: ui: Fix Table if there is no selection
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Tue May 21 12:19:47 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: ui: Fix Table if there is no selection
......................................................................
ui: Fix Table if there is no selection
Previously the table raised an error if there was no item to be selected
given.
Change-Id: I2c31e9d3b74c04b4b2f95416d16b45a355ca1cc7
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/ui/__init__.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/24/14924/1
diff --git a/src/ovirt/node/ui/__init__.py b/src/ovirt/node/ui/__init__.py
index eed6aea..6266b20 100644
--- a/src/ovirt/node/ui/__init__.py
+++ b/src/ovirt/node/ui/__init__.py
@@ -453,6 +453,7 @@
class Table(InputElement):
"""Represents a simple Table with one column
"""
+ _selected = None
on_activate = None
def __init__(self, path, label, header, items, selected_item=None,
@@ -486,7 +487,8 @@
self.selection(selected_item or [])
self.on_activate.connect(ChangeAction())
else:
- self.selection(selected_item or self.items[0][0])
+ if selected_item or self.items:
+ self.selection(selected_item or self.items[0][0])
self.on_activate.connect(ChangeAction())
self.on_activate.connect(SaveAction())
self.on_exception.connect(DisplayExceptionNotice())
--
To view, visit http://gerrit.ovirt.org/14924
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c31e9d3b74c04b4b2f95416d16b45a355ca1cc7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list