author | spiralman <spiralman> | 2002-05-27 00:59:37 (UTC) |
---|---|---|
committer | spiralman <spiralman> | 2002-05-27 00:59:37 (UTC) |
commit | d3451ccc7191bc2f761bae12b50c7ce274647bdb (patch) (unidiff) | |
tree | f96f3c210de2c91d793d999e19bbcbc81ff02a99 /noncore/tools/opie-sh/opie-sh.cpp | |
parent | 95d2a3806a39bb31c9cca38c2c6158ecb77818e9 (diff) | |
download | opie-d3451ccc7191bc2f761bae12b50c7ce274647bdb.zip opie-d3451ccc7191bc2f761bae12b50c7ce274647bdb.tar.gz opie-d3451ccc7191bc2f761bae12b50c7ce274647bdb.tar.bz2 |
added help files and an icon in the Applications tab
Diffstat (limited to 'noncore/tools/opie-sh/opie-sh.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/opie-sh/opie-sh.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/noncore/tools/opie-sh/opie-sh.cpp b/noncore/tools/opie-sh/opie-sh.cpp index a1b8035..e898cb1 100644 --- a/noncore/tools/opie-sh/opie-sh.cpp +++ b/noncore/tools/opie-sh/opie-sh.cpp | |||
@@ -107,114 +107,122 @@ void printusage() | |||
107 | printf("Usage instructions for Opie-sh\n"); | 107 | printf("Usage instructions for Opie-sh\n"); |
108 | printf("Usage: opie-sh [dialog type] [type specific options]\n"); | 108 | printf("Usage: opie-sh [dialog type] [type specific options]\n"); |
109 | printf("Types:\n"); | 109 | printf("Types:\n"); |
110 | printf(" -m Message Box\n"); | 110 | printf(" -m Message Box\n"); |
111 | printf(" -f [filename] View file [Default = stdin]\n"); | 111 | printf(" -f [filename] View file [Default = stdin]\n"); |
112 | printf(" -i Input dialog\n"); | 112 | printf(" -i Input dialog\n"); |
113 | printf(" -h --help These instructions\n"); | 113 | printf(" -h --help These instructions\n"); |
114 | printf(" -t [title] The window/dialog title\n"); | 114 | printf(" -t [title] The window/dialog title\n"); |
115 | printf("Message box options:\n"); | 115 | printf("Message box options:\n"); |
116 | printf(" -M [message] The message to display\n"); | 116 | printf(" -M [message] The message to display\n"); |
117 | printf(" -I Use information icon\n"); | 117 | printf(" -I Use information icon\n"); |
118 | printf(" -w Use the warning icon\n"); | 118 | printf(" -w Use the warning icon\n"); |
119 | printf(" -e Use the error icon\n"); | 119 | printf(" -e Use the error icon\n"); |
120 | printf(" -0 [text] First button text [Default = OK]\n"); | 120 | printf(" -0 [text] First button text [Default = OK]\n"); |
121 | printf(" -1 [text] Second button text\n"); | 121 | printf(" -1 [text] Second button text\n"); |
122 | printf(" -2 [text] Third button text\n"); | 122 | printf(" -2 [text] Third button text\n"); |
123 | printf(" -g Disable fullscreen\n"); | 123 | printf(" -g Disable fullscreen\n"); |
124 | printf("Input Dialog options:\n"); | 124 | printf("Input Dialog options:\n"); |
125 | printf(" -s A single line of input (output to console)\n"); | 125 | printf(" -s A single line of input (output to console)\n"); |
126 | printf(" -l List input (newline separated list read in from file)\n"); | 126 | printf(" -l List input (newline separated list read in from file)\n"); |
127 | printf(" -b A list box, enabling multiple selections (input same as -l)\n"); | 127 | printf(" -b A list box, enabling multiple selections (input same as -l)\n"); |
128 | printf(" -L [label] The label for the input field\n"); | 128 | printf(" -L [label] The label for the input field\n"); |
129 | printf(" -F [filename] An input file (for when it makes sense) [Default = stdin]\n"); | 129 | printf(" -F [filename] An input file (for when it makes sense) [Default = stdin]\n"); |
130 | printf(" -E Makes list input editable\n"); | 130 | printf(" -E Makes list input editable\n"); |
131 | printf(" -g Disable fullscreen\n"); | 131 | printf(" -g Disable fullscreen\n\0"); |
132 | } | 132 | } |
133 | 133 | ||
134 | int fileviewer(QPEApplication *a, int argc, QStringList args) | 134 | int fileviewer(QPEApplication *a, int argc, QStringList args) |
135 | { | 135 | { |
136 | int i; | 136 | int i; |
137 | QString filename, title; | 137 | QString filename, title, icon; |
138 | bool update=false; | 138 | bool update=false; |
139 | 139 | ||
140 | for(i=0; i < argc; i++) | 140 | for(i=0; i < argc; i++) |
141 | { | 141 | { |
142 | if(args[i] == "-f") | 142 | if(args[i] == "-f") |
143 | { | 143 | { |
144 | if(args[i+1][0] != '-') | 144 | if(args[i+1][0] != '-') |
145 | { | 145 | { |
146 | filename = args[i+1]; | 146 | filename = args[i+1]; |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | if(args[i] == "-I") | ||
151 | { | ||
152 | icon=args[i+1]; | ||
153 | } | ||
154 | |||
150 | if(args[i] == "-t") | 155 | if(args[i] == "-t") |
151 | { | 156 | { |
152 | title = args[i+1]; | 157 | title = args[i+1]; |
153 | } | 158 | } |
154 | } | 159 | } |
155 | FViewer *fview = new FViewer(filename, title, 0, (QString) "fileviewer"); | 160 | FViewer *fview = new FViewer(icon, filename, title, 0, (QString) "fileviewer"); |
156 | a->setMainWidget(fview); | 161 | a->setMainWidget(fview); |
157 | fview->showMaximized(); | 162 | fview->showMaximized(); |
158 | return a->exec(); | 163 | return a->exec(); |
159 | } | 164 | } |
160 | 165 | ||
161 | int input(int wi, int h, QWidget *w, int argc, QStringList args) | 166 | int input(int wi, int h, QWidget *w, int argc, QStringList args) |
162 | { | 167 | { |
163 | int i, type = 0; | 168 | int i, type = 0; |
164 | QString title, label, filename; | 169 | QString title, label, filename; |
165 | bool edit=false, full=true; | 170 | bool edit=false, full=true; |
166 | 171 | ||
167 | for(i=0; i < argc; i++) | 172 | for(i=0; i < argc; i++) |
168 | { | 173 | { |
169 | if(args[i] == "-s") | 174 | if(args[i] == "-s") |
170 | { | 175 | { |
171 | type = 0; | 176 | type = 0; |
172 | } | 177 | } |
173 | 178 | ||
174 | if(args[i] == "-l") | 179 | if(args[i] == "-l") |
175 | { | 180 | { |
176 | type = 1; | 181 | type = 1; |
177 | } | 182 | } |
178 | 183 | ||
179 | if(args[i] == "-b") | 184 | if(args[i] == "-b") |
180 | { | 185 | { |
181 | type = 2; | 186 | type = 2; |
182 | } | 187 | } |
183 | 188 | ||
184 | if(args[i] == "-t") | 189 | if(args[i] == "-t") |
185 | { | 190 | { |
186 | title = args[i+1]; | 191 | title = args[i+1]; |
187 | } | 192 | } |
188 | 193 | ||
189 | if(args[i] == "-L") | 194 | if(args[i] == "-L") |
190 | { | 195 | { |
191 | label = args[i+1]; | 196 | label = args[i+1]; |
192 | } | 197 | } |
193 | 198 | ||
194 | if(args[i] == "-F") | 199 | if(args[i] == "-F") |
195 | { | 200 | { |
196 | filename = args[i+1]; | 201 | if(args[i+1][0] != '-') |
202 | { | ||
203 | filename = args[i+1]; | ||
204 | } | ||
197 | } | 205 | } |
198 | 206 | ||
199 | if(args[i] =="-E") | 207 | if(args[i] =="-E") |
200 | { | 208 | { |
201 | edit = true; | 209 | edit = true; |
202 | } | 210 | } |
203 | 211 | ||
204 | if(args[i] == "-g") | 212 | if(args[i] == "-g") |
205 | { | 213 | { |
206 | full = false; | 214 | full = false; |
207 | } | 215 | } |
208 | } | 216 | } |
209 | InputDialog *id = new InputDialog(wi, h, type, label, title, filename, edit, w); | 217 | InputDialog *id = new InputDialog(wi, h, type, label, title, filename, edit, w); |
210 | if(full) | 218 | if(full) |
211 | { | 219 | { |
212 | w->setCaption(title); | 220 | w->setCaption(title); |
213 | w->showMaximized(); | 221 | w->showMaximized(); |
214 | } | 222 | } |
215 | if( id->exec() == 1) | 223 | if( id->exec() == 1) |
216 | { | 224 | { |
217 | printf("%s\n", id->getString().latin1()); | 225 | printf("%s\n", id->getString().latin1()); |
218 | return 0; | 226 | return 0; |
219 | } | 227 | } |
220 | else | 228 | else |