home *** CD-ROM | disk | FTP | other *** search
- /**
- * File: clients/password.ycp
- * Package: yast2
- * Summary: Ask user for password
- * Authors: Michal Svec <msvec@suse.cz>
- *
- * $Id: password.ycp 14119 2004-02-11 10:03:43Z msvec $
- *
- * Return the password, if user entered one.
- * Return nil, if user canceled or closed the window.
- */
-
- {
-
- textdomain "base";
- import "Label";
-
- term contents = `VBox(
- /* TextEntry label */
- `Password(`id(`pw), _("&Enter Password:")),
- `HBox(
- `PushButton(`id(`ok), `opt(`hstretch, `default), Label::OKButton()),
- `PushButton(`id(`cancel), `opt(`hstretch), Label::CancelButton())
- )
- );
-
- UI::OpenDialog(contents);
- UI::SetFocus(`id(`pw));
- string ret = nil;
- if(UI::UserInput() == `ok)
- ret = (string) UI::QueryWidget(`id(`pw), `Value);
- UI::CloseDialog();
- return ret;
-
- /* EOF */
- }
-