author | ar <ar> | 2004-02-21 19:09:12 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-21 19:09:12 (UTC) |
commit | c7e563cbb26c20807e66dd4284d1ce9cbf8e1419 (patch) (unidiff) | |
tree | e55119af88abe930c1ce492f30efb72c929a730c /noncore/tools/opie-sh/opie-sh.cpp | |
parent | 536f271b1e6a1d1886e96a28524a3503c4c38c4e (diff) | |
download | opie-c7e563cbb26c20807e66dd4284d1ce9cbf8e1419.zip opie-c7e563cbb26c20807e66dd4284d1ce9cbf8e1419.tar.gz opie-c7e563cbb26c20807e66dd4284d1ce9cbf8e1419.tar.bz2 |
improve support for BigScreen
Diffstat (limited to 'noncore/tools/opie-sh/opie-sh.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/tools/opie-sh/opie-sh.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/noncore/tools/opie-sh/opie-sh.cpp b/noncore/tools/opie-sh/opie-sh.cpp index a353d3f..7d54a03 100644 --- a/noncore/tools/opie-sh/opie-sh.cpp +++ b/noncore/tools/opie-sh/opie-sh.cpp | |||
@@ -5,35 +5,41 @@ Copyright (C) 2002 Thomas Stephens | |||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | |||
18 | #include "mbox.h" | ||
19 | #include "fviewer.h" | ||
20 | #include "inputdialog.h" | ||
21 | |||
22 | /* OPIE */ | ||
23 | #include <qpe/qpeapplication.h> | ||
24 | |||
25 | /* QT */ | ||
17 | #include <qstring.h> | 26 | #include <qstring.h> |
18 | #include <qstringlist.h> | 27 | #include <qstringlist.h> |
19 | #include <qpe/qpeapplication.h> | ||
20 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
21 | #include <qwidget.h> | 29 | #include <qwidget.h> |
22 | 30 | ||
31 | /* STD */ | ||
23 | #include <stdio.h> | 32 | #include <stdio.h> |
24 | 33 | ||
25 | #include "mbox.h" | ||
26 | #include "fviewer.h" | ||
27 | #include "inputdialog.h" | ||
28 | 34 | ||
29 | int myMessageBox(int wi, int h, QWidget *w, int argc, QStringList args) | 35 | int myMessageBox(int wi, int h, QWidget *w, int argc, QStringList args) |
30 | { | 36 | { |
31 | int i, type=0; | 37 | int i, type=0; |
32 | QString button0Text, button1Text, button2Text, string, title; | 38 | QString button0Text, button1Text, button2Text, string, title; |
33 | bool full=true; | 39 | bool full=true; |
34 | 40 | ||
35 | for(i=0; i<argc; i++) | 41 | for(i=0; i<argc; i++) |
36 | { | 42 | { |
37 | if(args[i] == "-t") | 43 | if(args[i] == "-t") |
38 | { | 44 | { |
39 | title = args[i+1]; | 45 | title = args[i+1]; |
@@ -75,25 +81,25 @@ int myMessageBox(int wi, int h, QWidget *w, int argc, QStringList args) | |||
75 | } | 81 | } |
76 | 82 | ||
77 | if(args[i] == "-g") | 83 | if(args[i] == "-g") |
78 | { | 84 | { |
79 | full = false; | 85 | full = false; |
80 | } | 86 | } |
81 | } | 87 | } |
82 | 88 | ||
83 | MBox *mbox = new MBox(wi, h, (int)type, title, string, &button0Text, &button1Text, &button2Text, w, (QString)"messagebox"); | 89 | MBox *mbox = new MBox(wi, h, (int)type, title, string, &button0Text, &button1Text, &button2Text, w, (QString)"messagebox"); |
84 | if(full) | 90 | if(full) |
85 | { | 91 | { |
86 | w->setCaption(title); | 92 | w->setCaption(title); |
87 | w->showMaximized(); | 93 | QPEApplication::showWidget( w ); |
88 | } | 94 | } |
89 | //mbox->show(); | 95 | //mbox->show(); |
90 | switch(mbox->exec() ) | 96 | switch(mbox->exec() ) |
91 | { | 97 | { |
92 | case 0: | 98 | case 0: |
93 | return -1; | 99 | return -1; |
94 | case 1: | 100 | case 1: |
95 | return -1; | 101 | return -1; |
96 | case 2: | 102 | case 2: |
97 | return 0; | 103 | return 0; |
98 | case 3: | 104 | case 3: |
99 | return 1; | 105 | return 1; |
@@ -152,25 +158,25 @@ int fileviewer(QPEApplication *a, int argc, QStringList args) | |||
152 | if(args[i] == "-I") | 158 | if(args[i] == "-I") |
153 | { | 159 | { |
154 | icon=args[i+1]; | 160 | icon=args[i+1]; |
155 | } | 161 | } |
156 | 162 | ||
157 | if(args[i] == "-t") | 163 | if(args[i] == "-t") |
158 | { | 164 | { |
159 | title = args[i+1]; | 165 | title = args[i+1]; |
160 | } | 166 | } |
161 | } | 167 | } |
162 | FViewer *fview = new FViewer(icon, filename, title, 0, (QString) "fileviewer"); | 168 | FViewer *fview = new FViewer(icon, filename, title, 0, (QString) "fileviewer"); |
163 | a->setMainWidget(fview); | 169 | a->setMainWidget(fview); |
164 | fview->showMaximized(); | 170 | QPEApplication::showWidget( fview ); |
165 | return a->exec(); | 171 | return a->exec(); |
166 | } | 172 | } |
167 | 173 | ||
168 | int input(int wi, int h, QWidget *w, int argc, QStringList args) | 174 | int input(int wi, int h, QWidget *w, int argc, QStringList args) |
169 | { | 175 | { |
170 | int i, type = 0; | 176 | int i, type = 0; |
171 | QString title, label, filename; | 177 | QString title, label, filename; |
172 | bool edit=false, full=true; | 178 | bool edit=false, full=true; |
173 | 179 | ||
174 | for(i=0; i < argc; i++) | 180 | for(i=0; i < argc; i++) |
175 | { | 181 | { |
176 | if(args[i] == "-s") | 182 | if(args[i] == "-s") |
@@ -216,25 +222,25 @@ int input(int wi, int h, QWidget *w, int argc, QStringList args) | |||
216 | edit = true; | 222 | edit = true; |
217 | } | 223 | } |
218 | 224 | ||
219 | if(args[i] == "-g") | 225 | if(args[i] == "-g") |
220 | { | 226 | { |
221 | full = false; | 227 | full = false; |
222 | } | 228 | } |
223 | } | 229 | } |
224 | InputDialog *id = new InputDialog(wi, h, type, label, title, filename, edit, w); | 230 | InputDialog *id = new InputDialog(wi, h, type, label, title, filename, edit, w); |
225 | if(full) | 231 | if(full) |
226 | { | 232 | { |
227 | w->setCaption(title); | 233 | w->setCaption(title); |
228 | w->showMaximized(); | 234 | QPEApplication::showWidget( w ); |
229 | } | 235 | } |
230 | if( id->exec() == 1) | 236 | if( id->exec() == 1) |
231 | { | 237 | { |
232 | printf("%s\n", id->getString().latin1()); | 238 | printf("%s\n", id->getString().latin1()); |
233 | return 0; | 239 | return 0; |
234 | } | 240 | } |
235 | else | 241 | else |
236 | { | 242 | { |
237 | return -1; | 243 | return -1; |
238 | } | 244 | } |
239 | } | 245 | } |
240 | 246 | ||