TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kiopassdlgtest.cpp 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. #include <tdeapplication.h>
  2. #include <tdelocale.h>
  3. #include <tdeaboutdata.h>
  4. #include <tdemessagebox.h>
  5. #include <tdecmdlineargs.h>
  6. #include "passdlg.h"
  7. int main ( int argc, char** argv )
  8. {
  9. TDEAboutData aboutData("kiopassdlgtest", "TDEIO Password Dialog Test", "1.0");
  10. TDECmdLineArgs::init(argc, argv, &aboutData);
  11. TDEApplication app;
  12. TQString usr, pass, comment, label;
  13. label = "Site:";
  14. comment = "<b>localhost</b>";
  15. int res = TDEIO::PasswordDialog::getNameAndPassword( usr, pass, 0L,
  16. TQString::null, false,
  17. TQString::null, comment,
  18. label );
  19. if ( res == TQDialog::Accepted )
  20. KMessageBox::information( 0L, TQString("You entered:\n"
  21. " Username: %1\n"
  22. " Password: %2").arg(usr).arg(pass),
  23. "Test Result");
  24. else
  25. KMessageBox::information( 0L, "Password dialog was canceled!",
  26. "Test Result");
  27. return 0;
  28. }