author | zecke <zecke> | 2004-10-15 02:30:08 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-15 02:30:08 (UTC) |
commit | 5c3759f02725c17ba0efc386193a83da55a9a5da (patch) (unidiff) | |
tree | b03e604b282de315096b74b6f404851c2bba3ad6 /inputmethods/pickboard/pickboardpicks.cpp | |
parent | fefeafe35f8dac30f4baab9e3bff8e2ffbd1afd0 (diff) | |
download | opie-5c3759f02725c17ba0efc386193a83da55a9a5da.zip opie-5c3759f02725c17ba0efc386193a83da55a9a5da.tar.gz opie-5c3759f02725c17ba0efc386193a83da55a9a5da.tar.bz2 |
Apply patch from Qtopia1.7 to allow 'Umlaute' in the pickboard
and make 'strings' translatable.
This also fixes #501
Diffstat (limited to 'inputmethods/pickboard/pickboardpicks.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/pickboard/pickboardpicks.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/inputmethods/pickboard/pickboardpicks.cpp b/inputmethods/pickboard/pickboardpicks.cpp index a80bbf8..b9d9928 100644 --- a/inputmethods/pickboard/pickboardpicks.cpp +++ b/inputmethods/pickboard/pickboardpicks.cpp | |||
@@ -1,60 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "pickboardpicks.h" | 20 | #include "pickboardpicks.h" |
21 | #include "pickboardcfg.h" | 21 | #include "pickboardcfg.h" |
22 | 22 | ||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | 24 | ||
25 | #include <qpainter.h> | 25 | #include <qpainter.h> |
26 | #include <qlist.h> | 26 | #include <qlist.h> |
27 | #include <qbitmap.h> | 27 | #include <qbitmap.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qvbox.h> | 29 | #include <qvbox.h> |
30 | #include <qdialog.h> | 30 | #include <qdialog.h> |
31 | #include <qscrollview.h> | 31 | #include <qscrollview.h> |
32 | #include <qpopupmenu.h> | 32 | #include <qpopupmenu.h> |
33 | #include <qhbuttongroup.h> | 33 | #include <qhbuttongroup.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #ifdef QWS | ||
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
38 | #endif | ||
37 | 39 | ||
38 | void PickboardPicks::doMenu() | 40 | void PickboardPicks::doMenu() |
39 | { | 41 | { |
40 | QWidget* cause = (QWidget*)sender(); // evil | 42 | QWidget* cause = (QWidget*)sender(); // evil |
41 | 43 | ||
42 | QPopupMenu popup(this); | 44 | QPopupMenu popup(this); |
43 | config()->fillMenu(popup); | 45 | config()->fillMenu(popup); |
44 | 46 | ||
45 | QPoint pos = cause->mapToGlobal(cause->rect().topRight()); | 47 | QPoint pos = cause->mapToGlobal(cause->rect().topRight()); |
46 | QSize sz = popup.sizeHint(); | 48 | QSize sz = popup.sizeHint(); |
47 | pos.ry() -= sz.height(); | 49 | pos.ry() -= sz.height(); |
48 | pos.rx() -= sz.width(); | 50 | pos.rx() -= sz.width(); |
49 | popup.move(pos); | 51 | popup.move(pos); |
50 | config()->doMenu(popup.exec()); | 52 | config()->doMenu(popup.exec()); |
51 | } | 53 | } |
52 | 54 | ||
53 | static const char *BS_xpm[] = { | 55 | static const char *BS_xpm[] = { |
54 | "5 7 2 1", | 56 | "5 7 2 1", |
55 | "a c #000000", | 57 | "a c #000000", |
56 | ". c None", | 58 | ". c None", |
57 | "...aa", | 59 | "...aa", |
58 | "..aaa", | 60 | "..aaa", |
59 | ".aaaa", | 61 | ".aaaa", |
60 | "aaaaa", | 62 | "aaaaa", |
@@ -227,72 +229,69 @@ static const char *Tab_xpm[] = { | |||
227 | "....aa.a", | 229 | "....aa.a", |
228 | "aaaaaaaa", | 230 | "aaaaaaaa", |
229 | "....aa.a", | 231 | "....aa.a", |
230 | "....a..a", | 232 | "....a..a", |
231 | ".......a" | 233 | ".......a" |
232 | }; | 234 | }; |
233 | static const char *Space_xpm[] = { | 235 | static const char *Space_xpm[] = { |
234 | "9 9 2 1", | 236 | "9 9 2 1", |
235 | "a c #000000", | 237 | "a c #000000", |
236 | ". c None", | 238 | ". c None", |
237 | "aaaaaaaaa", | 239 | "aaaaaaaaa", |
238 | "a.......a", | 240 | "a.......a", |
239 | "a.......a", | 241 | "a.......a", |
240 | "a.......a", | 242 | "a.......a", |
241 | "a.......a", | 243 | "a.......a", |
242 | "a.......a", | 244 | "a.......a", |
243 | "a.......a", | 245 | "a.......a", |
244 | "a.......a", | 246 | "a.......a", |
245 | "aaaaaaaaa" | 247 | "aaaaaaaaa" |
246 | }; | 248 | }; |
247 | 249 | ||
248 | PickboardPicks::PickboardPicks(QWidget* parent, const char* name, WFlags f ) : | 250 | PickboardPicks::PickboardPicks(QWidget* parent, const char* name, WFlags f ) : |
249 | QFrame(parent,name,f) | 251 | QFrame(parent,name,f) |
250 | { | 252 | { |
253 | configs.setAutoDelete( TRUE ); | ||
251 | } | 254 | } |
252 | 255 | ||
253 | void PickboardPicks::initialise(void) | 256 | void PickboardPicks::initialise(void) |
254 | { | 257 | { |
255 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 258 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
256 | mode = 0; | 259 | mode = 0; |
257 | 260 | ||
258 | DictFilterConfig* dc = new DictFilterConfig(this); | 261 | DictFilterConfig* dc = new DictFilterConfig(this); |
259 | dc->addSet("ABC"); | 262 | QStringList sets_a = QStringList::split(' ',tr("ABC DEF GHI JKL MNO PQR STU VWX YZ-'")); |
260 | dc->addSet("DEF"); | 263 | QStringList sets = QStringList::split(' ', |
261 | dc->addSet("GHI"); | 264 | tr("ABC%/1iso8859-15 DEF%/1iso8859-15 GHI%/1iso8859-15 JKL MNO%/1iso8859-15 PQR%/1iso8859-15 STU%/1iso8859-15 VWX YZ-'%/1iso8859-15")); |
262 | dc->addSet("JKL"); | 265 | for (QStringList::ConstIterator it = sets.begin(), it_a = sets_a.begin(); it!=sets.end(); ++it,++it_a) |
263 | dc->addSet("MNO"); | 266 | dc->addSet(*it_a,*it); |
264 | dc->addSet("PQR"); | ||
265 | dc->addSet("STU"); | ||
266 | dc->addSet("VWX"); | ||
267 | dc->addSet("YZ-'"); | ||
268 | dc->addMode("123"); | 267 | dc->addMode("123"); |
269 | dc->addMode("@*!?"); | 268 | dc->addMode("@*!?"); |
270 | dc->addMode("KEY"); | 269 | dc->addMode(tr("KEY")); |
271 | dc->addMode("Space"); | 270 | dc->addMode(tr("Space")); |
272 | dc->addMode("Back"); | 271 | dc->addMode(tr("Back")); |
273 | dc->addMode("Enter"); | 272 | dc->addMode(tr("Enter")); |
274 | dc->addMode("Shift"); | 273 | dc->addMode(tr("Shift")); |
275 | configs.append(dc); | 274 | configs.append(dc); |
276 | 275 | ||
277 | CharStringConfig* number = new CharStringConfig(this); | 276 | CharStringConfig* number = new CharStringConfig(this); |
278 | number->addChar("0"); | 277 | number->addChar("0"); |
279 | number->addChar("1"); | 278 | number->addChar("1"); |
280 | number->addChar("2"); | 279 | number->addChar("2"); |
281 | number->addChar("3"); | 280 | number->addChar("3"); |
282 | number->addChar("4"); | 281 | number->addChar("4"); |
283 | number->addChar("5"); | 282 | number->addChar("5"); |
284 | number->addChar("6"); | 283 | number->addChar("6"); |
285 | number->addChar("7"); | 284 | number->addChar("7"); |
286 | number->addChar("8"); | 285 | number->addChar("8"); |
287 | number->addChar("9"); | 286 | number->addChar("9"); |
288 | number->addChar("."); // #### or "," in some locales | 287 | number->addChar("."); // #### or "," in some locales |
289 | configs.append(number); | 288 | configs.append(number); |
290 | 289 | ||
291 | CharConfig* punc = new CharConfig(this); | 290 | CharConfig* punc = new CharConfig(this); |
292 | 291 | ||
293 | punc->addChar(0,"\""); | 292 | punc->addChar(0,"\""); |
294 | punc->addChar(0,"`"); | 293 | punc->addChar(0,"`"); |
295 | punc->addChar(0,"'"); | 294 | punc->addChar(0,"'"); |
296 | punc->addChar(0,"\253"); | 295 | punc->addChar(0,"\253"); |
297 | punc->addChar(0,"\273"); | 296 | punc->addChar(0,"\273"); |
298 | punc->addChar(0,"\277"); | 297 | punc->addChar(0,"\277"); |