[node-patches] Change in ovirt-node[node-3.0]: ui: Fix Table if there is no selection

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue May 21 14:42:22 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: Ie57d781cfeb3fa5e0c18b0ef44ec427af81fa53f
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/41/14941/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/14941
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie57d781cfeb3fa5e0c18b0ef44ec427af81fa53f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list