home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd2.bin / suse / inst-sys / lib / YaST2 / clients / password.ycp < prev    next >
Encoding:
Text File  |  2000-03-30  |  494 b   |  18 lines

  1. // Ask user for a password.
  2. // Return the password, if he/she enters one
  3. // Return nil, if he/she cancels or closes the window
  4. {
  5.     return UI(``{
  6.     OpenDialog(
  7.            `VBox(
  8.              `Password(`id(`pw), _("Enter password:")),
  9.              `HBox(`PushButton(`id(`ok),    `opt(`hstretch, `default), _("&OK")),
  10.                    `PushButton(`id(`cancel),`opt(`hstretch),           _("&Cancel")))));
  11.     any ret = nil;
  12.     if (UserInput() == `ok)
  13.         ret = QueryWidget(`id(`pw), `Value);
  14.     CloseDialog();
  15.     return ret;
  16.     });
  17. }
  18.