author | dwmw2 <dwmw2> | 2002-09-19 13:29:25 (UTC) |
---|---|---|
committer | dwmw2 <dwmw2> | 2002-09-19 13:29:25 (UTC) |
commit | 0f1ad29634d6bf8a0f64272d7ae8bff74707a9b8 (patch) (unidiff) | |
tree | bc37fc135ad81d720d4d1e806024173bc29bccca /noncore/tools/opie-sh/inputdialog.cpp | |
parent | f339a98665a80dd6d5497629c3392cf63a456917 (diff) | |
download | opie-0f1ad29634d6bf8a0f64272d7ae8bff74707a9b8.zip opie-0f1ad29634d6bf8a0f64272d7ae8bff74707a9b8.tar.gz opie-0f1ad29634d6bf8a0f64272d7ae8bff74707a9b8.tar.bz2 |
Add '-p' option to opie-sh, to get user input and display '*'s
Diffstat (limited to 'noncore/tools/opie-sh/inputdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/opie-sh/inputdialog.cpp | 6 |
1 files changed, 6 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 | |||
@@ -70,38 +70,44 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString | |||
70 | listBox->insertStringList(QStringList::split('\n', string)); | 70 | listBox->insertStringList(QStringList::split('\n', string)); |
71 | } | 71 | } |
72 | else | 72 | else |
73 | { | 73 | { |
74 | QFile file; | 74 | QFile file; |
75 | file.open(IO_ReadOnly, 0); | 75 | file.open(IO_ReadOnly, 0); |
76 | QTextStream stream(&file); | 76 | QTextStream stream(&file); |
77 | QString string = stream.read(); | 77 | QString string = stream.read(); |
78 | 78 | ||
79 | listBox->insertStringList(QStringList::split('\n', string)); | 79 | listBox->insertStringList(QStringList::split('\n', string)); |
80 | } | 80 | } |
81 | break; | 81 | break; |
82 | case 3: | ||
83 | lineEdit = new QLineEdit(this, "line edit"); | ||
84 | lineEdit->setEchoMode(QLineEdit::Password); | ||
85 | layout->addWidget(lineEdit); | ||
86 | break; | ||
82 | } | 87 | } |
83 | layout->addSpacing(5); | 88 | layout->addSpacing(5); |
84 | 89 | ||
85 | x=(w/2)-(width()/2); | 90 | x=(w/2)-(width()/2); |
86 | y=(h/2)-(height()/2); | 91 | y=(h/2)-(height()/2); |
87 | 92 | ||
88 | move(x,y); | 93 | move(x,y); |
89 | } | 94 | } |
90 | 95 | ||
91 | QString InputDialog::getString() | 96 | QString InputDialog::getString() |
92 | { | 97 | { |
93 | switch (type) | 98 | switch (type) |
94 | { | 99 | { |
95 | case 0: | 100 | case 0: |
101 | case 3: | ||
96 | return ((QLineEdit *)child("line edit"))->text(); | 102 | return ((QLineEdit *)child("line edit"))->text(); |
97 | break; | 103 | break; |
98 | case 1: | 104 | case 1: |
99 | return ((QComboBox *)child("combo box"))->currentText(); | 105 | return ((QComboBox *)child("combo box"))->currentText(); |
100 | break; | 106 | break; |
101 | case 2: | 107 | case 2: |
102 | QString string; | 108 | QString string; |
103 | int i; | 109 | int i; |
104 | for(i = 0; i < listBox->count(); i++) | 110 | for(i = 0; i < listBox->count(); i++) |
105 | { | 111 | { |
106 | if(listBox->isSelected(i)) | 112 | if(listBox->isSelected(i)) |
107 | { | 113 | { |