[node-patches] Change in ovirt-node[master]: ui: Add TextViewDialog
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: Add TextViewDialog
......................................................................
ui: Add TextViewDialog
A dialog to view large portions of text.
Change-Id: I18dc8b8ca59d5b0e8095bc65e141a6ad7b47f15a
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/setup/diagnostics_page.py
M src/ovirt/node/ui/__init__.py
2 files changed, 15 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/23/14923/1
diff --git a/src/ovirt/node/setup/diagnostics_page.py b/src/ovirt/node/setup/diagnostics_page.py
index ab02ca2..3c7e4a3 100644
--- a/src/ovirt/node/setup/diagnostics_page.py
+++ b/src/ovirt/node/setup/diagnostics_page.py
@@ -19,12 +19,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA. A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
+from ovirt.node import plugins, ui
+from ovirt.node.utils import process
"""
Diagnostics page
"""
-from ovirt.node import plugins, ui
class Plugin(plugins.NodePlugin):
@@ -73,20 +74,11 @@
in self.__diagnostics())
cmd = cmds.get(changes[changed_field], None)
if cmd:
- return OutputDialog("output.dialog", "Command Output", cmd)
+ contents = process.check_output(cmd)
+ return ui.TextViewDialog("output.dialog", "Command Output",
+ contents)
def __diagnostics(self):
return [("multipath", "multipath -ll"),
("fdisk", "fdisk -l"),
("parted", "parted -l")]
-
-
-class OutputDialog(ui.Dialog):
-
- def __init__(self, path, title, cmd):
- from ovirt.node.utils import process
- super(OutputDialog, self).__init__(path, title, [])
- output = process.check_output(cmd)
- self.children = [ui.Table("output[0]", "", cmd,
- output, height=10)]
- self.buttons = [ui.CloseButton("dialog.close")]
diff --git a/src/ovirt/node/ui/__init__.py b/src/ovirt/node/ui/__init__.py
index 686b0d9..eed6aea 100644
--- a/src/ovirt/node/ui/__init__.py
+++ b/src/ovirt/node/ui/__init__.py
@@ -748,6 +748,16 @@
self.buttons = buttons or [CloseButton("dialog.close")]
+class TextViewDialog(Dialog):
+ """A dialog to display much text, e.g. log files
+ """
+ def __init__(self, path, title, contents, height=10):
+ super(TextViewDialog, self).__init__(path, title, [])
+ self.children = [Table("contents", "", "Contents",
+ contents, height=height)]
+ self.buttons = [CloseButton("dialog.close")]
+
+
class TransactionProgressDialog(Dialog):
"""Display the progress of a transaction in a dialog
"""
--
To view, visit http://gerrit.ovirt.org/14923
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I18dc8b8ca59d5b0e8095bc65e141a6ad7b47f15a
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