[node-patches] Change in ovirt-node[master]: setup: Add class for the lock dialog

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Feb 14 15:33:47 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: setup: Add class for the lock dialog
......................................................................

setup: Add class for the lock dialog

The code for building the lock dialog got moved into a separate class.

Change-Id: Icf2d105f2bc4ec2ee1d186455717afb62479fa2a
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/setup/status_page.py
1 file changed, 18 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/74/12074/1

diff --git a/scripts/tui/src/ovirt/node/setup/status_page.py b/scripts/tui/src/ovirt/node/setup/status_page.py
index 3537578..3be1f81 100644
--- a/scripts/tui/src/ovirt/node/setup/status_page.py
+++ b/scripts/tui/src/ovirt/node/setup/status_page.py
@@ -123,7 +123,7 @@
         # Handle button presses
         if "action.lock" in changes:
             self.logger.info("Locking screen")
-            self._lock_dialog = self._build_lock_dialog()
+            self._lock_dialog = LockDialog()
             return self._lock_dialog
         elif "action.unlock" in changes and "password" in changes:
             self.logger.info("UnLocking screen")
@@ -153,19 +153,6 @@
 
         elif "_save" in changes:
             self.widgets["dialog.hostkey"].close()
-
-    def _build_lock_dialog(self):
-        widgets = [ui.Header("lock.label[0]",
-                             "Enter the admin password to unlock"),
-                   ui.KeywordLabel("username", "Username: ", os.getlogin()),
-                   ui.PasswordEntry("password", "Password:")
-                   ]
-
-        self.widgets.add(widgets)
-        page = ui.Dialog("lock.dialog", "This screen is locked.", widgets)
-        page.buttons = [ui.Button("action.unlock", "Unlock")]
-        page.escape_key = None
-        return page
 
     def _logging_summary(self):
         """Return a textual summary of the current log configuration
@@ -206,8 +193,25 @@
 
 
 class CPUFeaturesDialog(ui.Dialog):
+    """The dialog beeing displayed when th euser clicks CPU Details
+    """
     def __init__(self, path, title):
         super(CPUFeaturesDialog, self).__init__(path, title, [])
         self.children = [ui.Label("label[0]", utils.system.cpu_details()),
                          ]
         self.buttons = [ui.CloseButton("dialog.close")]
+
+
+class LockDialog(ui.Dialog):
+    """The dialog beeing displayed when the srceen is locked
+    """
+    def __init__(self, path="lock.dialog", title="This screen is locked."):
+        super(LockDialog, self).__init__(path, title, [])
+        self.children = [ui.Header("lock.label[0]",
+                                   "Enter the admin password to unlock"),
+                         ui.KeywordLabel("username", "Username: ",
+                                         os.getlogin()),
+                         ui.PasswordEntry("password", "Password:")
+                         ]
+        self.buttons = [ui.Button("action.unlock", "Unlock")]
+        self.escape_key = None


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf2d105f2bc4ec2ee1d186455717afb62479fa2a
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