[node-patches] Change in ovirt-node[master]: make plugin page smarter

mburns at redhat.com mburns at redhat.com
Fri Jun 14 19:48:06 UTC 2013


Michael Burns has uploaded a new change for review.

Change subject: make plugin page smarter
......................................................................

make plugin page smarter

Make it display a message when there are no plugins

Change-Id: I3ada11b4772317bfb3dbf5babd8f2d2bc392407f
Bug-Url: https://bugzilla.redhat.com/974673
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M src/ovirt/node/setup/core/plugins_page.py
1 file changed, 23 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/32/15732/1

diff --git a/src/ovirt/node/setup/core/plugins_page.py b/src/ovirt/node/setup/core/plugins_page.py
index c6c87eb..7da4c94 100644
--- a/src/ovirt/node/setup/core/plugins_page.py
+++ b/src/ovirt/node/setup/core/plugins_page.py
@@ -41,30 +41,36 @@
 
     def ui_content(self):
         all_plugins = self.__list_of_plugins()
-        selected_plugin = all_plugins[0][0] if all_plugins else None
+        if all_plugins:
+            selected_plugin = all_plugins[0][0]
+            ws = [ui.Header("header[0]", "Installed Plugins"),
 
-        ws = [ui.Header("header[0]", "Installed Plugins"),
+                  ui.Table("plugins.installed", "", "Installed plugins:",
+                           all_plugins, selected_plugin),
 
-              ui.Table("plugins.installed", "", "Installed plugins:",
-                       all_plugins, selected_plugin),
+                  ui.Divider("divider[0]"),
 
-              ui.Divider("divider[0]"),
+                  ui.Row("row[0]", [ui.Label("label[0]", "Name:"),
+                                    ui.Label("plugin.name", "")]),
 
-              ui.Row("row[0]", [ui.Label("label[0]", "Name:"),
-                                ui.Label("plugin.name", "")]),
+                  ui.Row("row[1]", [ui.Label("label[0]", "Version:"),
+                                    ui.Label("plugin.version", "")]),
 
-              ui.Row("row[1]", [ui.Label("label[0]", "Version:"),
-                                ui.Label("plugin.version", "")]),
+                  ui.Row("row[2]", [ui.Label("label[0]", "Date installed:"),
+                                    ui.Label("plugin.createdat", "")]),
 
-              ui.Row("row[2]", [ui.Label("label[0]", "Date installed:"),
-                                ui.Label("plugin.createdat", "")]),
+                  ui.Divider("divider[1]"),
 
-              ui.Divider("divider[1]"),
-
-              ui.Row("row[3]", [ui.SaveButton("button.drpm", "RPM Diff"),
-                                ui.SaveButton("button.dsrpm", "SRPM Diff"),
-                                ui.SaveButton("button.dfile", "File Diff")])
-              ]
+                  ui.Row("row[3]", [ui.SaveButton("button.drpm", "RPM Diff"),
+                                    ui.SaveButton("button.dsrpm",
+                                                  "SRPM Diff"),
+                                    ui.SaveButton("button.dfile",
+                                                  "File Diff")])
+                  ]
+        else:
+            ws = [ui.Header("header[0]", "Plugins"),
+                  ui.Label("label[0]", "There are no plugins currently " +
+                          "installed")]
 
         page = ui.Page("page", ws)
         page.buttons = []


-- 
To view, visit http://gerrit.ovirt.org/15732
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ada11b4772317bfb3dbf5babd8f2d2bc392407f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>



More information about the node-patches mailing list