summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/opie-sh/inputdialog.cpp6
-rw-r--r--noncore/tools/opie-sh/opie-sh.cpp6
2 files changed, 12 insertions, 0 deletions
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
@@ -66,46 +66,52 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString
file.open(IO_ReadOnly);
QTextStream stream(&file);
QString string = stream.read();
listBox->insertStringList(QStringList::split('\n', string));
}
else
{
QFile file;
file.open(IO_ReadOnly, 0);
QTextStream stream(&file);
QString string = stream.read();
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);
x=(w/2)-(width()/2);
y=(h/2)-(height()/2);
move(x,y);
}
QString InputDialog::getString()
{
switch (type)
{
case 0:
+ case 3:
return ((QLineEdit *)child("line edit"))->text();
break;
case 1:
return ((QComboBox *)child("combo box"))->currentText();
break;
case 2:
QString string;
int i;
for(i = 0; i < listBox->count(); i++)
{
if(listBox->isSelected(i))
{
string+=listBox->text(i)+'\n';
}
}
if(string[string.length()-1] == '\n')
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
@@ -113,32 +113,33 @@ void printusage()
printf(" -i Input dialog\n");
printf(" -h --help These instructions\n");
printf(" -t [title] The window/dialog title\n");
printf("Message box options:\n");
printf(" -M [message] The message to display\n");
printf(" -I Use information icon\n");
printf(" -w Use the warning icon\n");
printf(" -e Use the error icon\n");
printf(" -0 [text] First button text [Default = OK]\n");
printf(" -1 [text] Second button text\n");
printf(" -2 [text] Third button text\n");
printf(" -g Disable fullscreen\n");
printf("Input Dialog options:\n");
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");
printf(" -g Disable fullscreen\n");
}
int fileviewer(QPEApplication *a, int argc, QStringList args)
{
int i;
QString filename, title, icon;
bool update=false;
for(i=0; i < argc; i++)
{
if(args[i] == "-f")
{
@@ -174,32 +175,37 @@ int input(int wi, int h, QWidget *w, int argc, QStringList args)
{
if(args[i] == "-s")
{
type = 0;
}
if(args[i] == "-l")
{
type = 1;
}
if(args[i] == "-b")
{
type = 2;
}
+ if(args[i] == "-p")
+ {
+ type = 3;
+ }
+
if(args[i] == "-t")
{
title = args[i+1];
}
if(args[i] == "-L")
{
label = args[i+1];
}
if(args[i] == "-F")
{
if(args[i+1][0] != '-')
{
filename = args[i+1];
}