From 0f1ad29634d6bf8a0f64272d7ae8bff74707a9b8 Mon Sep 17 00:00:00 2001 From: dwmw2 Date: Thu, 19 Sep 2002 13:29:25 +0000 Subject: Add '-p' option to opie-sh, to get user input and display '*'s --- (limited to 'noncore') diff --git a/noncore/tools/opie-sh/inputdialog.cpp b/noncore/tools/opie-sh/inputdialog.cpp index 1c4e688..8046795 100644 --- a/noncore/tools/opie-sh/inputdialog.cpp +++ b/noncore/tools/opie-sh/inputdialog.cpp @@ -79,6 +79,11 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString listBox->insertStringList(QStringList::split('\n', string)); } break; + case 3: + lineEdit = new QLineEdit(this, "line edit"); + lineEdit->setEchoMode(QLineEdit::Password); + layout->addWidget(lineEdit); + break; } layout->addSpacing(5); @@ -93,6 +98,7 @@ QString InputDialog::getString() switch (type) { case 0: + case 3: return ((QLineEdit *)child("line edit"))->text(); break; case 1: diff --git a/noncore/tools/opie-sh/opie-sh.cpp b/noncore/tools/opie-sh/opie-sh.cpp index 96b4b93..a353d3f 100644 --- a/noncore/tools/opie-sh/opie-sh.cpp +++ b/noncore/tools/opie-sh/opie-sh.cpp @@ -126,6 +126,7 @@ void printusage() printf(" -s A single line of input (output to console)\n"); printf(" -l List input (newline separated list read in from file)\n"); printf(" -b A list box, enabling multiple selections (input same as -l)\n"); + printf(" -p Password input (display '*'s)\n"); printf(" -L [label] The label for the input field\n"); printf(" -F [filename] An input file (for when it makes sense) [Default = stdin]\n"); printf(" -E Makes list input editable\n"); @@ -187,6 +188,11 @@ int input(int wi, int h, QWidget *w, int argc, QStringList args) type = 2; } + if(args[i] == "-p") + { + type = 3; + } + if(args[i] == "-t") { title = args[i+1]; -- cgit v0.9.0.2