Diffstat (limited to 'inputmethods/pickboard/pickboardcfg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | inputmethods/pickboard/pickboardcfg.cpp | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/inputmethods/pickboard/pickboardcfg.cpp b/inputmethods/pickboard/pickboardcfg.cpp index d500266..70a89cd 100644 --- a/inputmethods/pickboard/pickboardcfg.cpp +++ b/inputmethods/pickboard/pickboardcfg.cpp | |||
@@ -1,5 +1,5 @@ | |||
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 | ** |
@@ -36,6 +36,8 @@ | |||
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | #ifdef QWS | ||
37 | #include <qwindowsystem_qws.h> | 38 | #include <qwindowsystem_qws.h> |
39 | #endif | ||
38 | 40 | ||
39 | static const char * pickboard_help = | 41 | static const char * pickboard_help = |
40 | "<h1>The Pickboard</h1>" | 42 | QT_TRANSLATE_NOOP("PickboardConfig", "<h1>The Pickboard</h1>" |
41 | "<i>The smallest and fastest way to type.</i>" | 43 | "<i>The smallest and fastest way to type.</i>" |
@@ -46,3 +48,3 @@ static const char * pickboard_help = | |||
46 | "<br>Press \"Shift\" twice for an all-capitals word." | 48 | "<br>Press \"Shift\" twice for an all-capitals word." |
47 | "<br>Add custom words by picking them, then selecting \"Add...\" from the menu on the right." | 49 | "<br>Add custom words by picking them, then selecting \"Add...\" from the menu on the right." ) |
48 | ; | 50 | ; |
@@ -78,4 +80,8 @@ void PickboardConfig::generateText(const QString& s) | |||
78 | for (int i=0; i<(int)s.length(); i++) { | 80 | for (int i=0; i<(int)s.length(); i++) { |
79 | parent->emitKey(s[i].unicode(), 0, 0, true, false); | 81 | uint code = 0; |
80 | parent->emitKey(s[i].unicode(), 0, 0, false, false); | 82 | if ( s[i].unicode() >= 'a' && s[i].unicode() <= 'z' ) { |
83 | code = s[i].unicode() - 'a' + Key_A; | ||
84 | } | ||
85 | parent->emitKey(s[i].unicode(), code, 0, true, false); | ||
86 | parent->emitKey(s[i].unicode(), code, 0, false, false); | ||
81 | } | 87 | } |
@@ -114,5 +120,5 @@ void PickboardConfig::fillMenu(QPopupMenu& menu) | |||
114 | { | 120 | { |
115 | menu.insertItem("Reset",100); | 121 | menu.insertItem(tr("Reset"),100); |
116 | menu.insertSeparator(); | 122 | menu.insertSeparator(); |
117 | menu.insertItem("Help",1); | 123 | menu.insertItem(tr("Help"),1); |
118 | } | 124 | } |
@@ -129,3 +135,3 @@ void PickboardConfig::doMenu(int i) | |||
129 | case 1: { | 135 | case 1: { |
130 | QMessageBox help("Pickboard Help", pickboard_help, | 136 | QMessageBox help(tr("Pickboard Help"), tr(pickboard_help), |
131 | QMessageBox::NoIcon, 1, 0, 0); | 137 | QMessageBox::NoIcon, 1, 0, 0); |
@@ -160,6 +166,6 @@ void StringConfig::draw(QPainter* p) | |||
160 | if ( highlight(r,i) ) { | 166 | if ( highlight(r,i) ) { |
161 | p->fillRect(x-xw/2,1+fm.descent()-fm.lineSpacing(),w,fm.lineSpacing(),::Qt::black); | 167 | p->fillRect(x-xw/2,1+fm.descent()-fm.lineSpacing(),w,fm.lineSpacing(),Qt::black); |
162 | p->setPen(::Qt::white); | 168 | p->setPen(Qt::white); |
163 | }else{ | 169 | }else{ |
164 | p->setPen(::Qt::black); | 170 | p->setPen(Qt::black); |
165 | } | 171 | } |
@@ -295,5 +301,5 @@ PickboardAdd::PickboardAdd(QWidget* owner, const QStringList& setlist) : | |||
295 | hb->setSpacing(0); | 301 | hb->setSpacing(0); |
296 | yes = new QPushButton("OK",hb); | 302 | yes = new QPushButton(tr("OK"),hb); |
297 | yes->setEnabled(FALSE); | 303 | yes->setEnabled(FALSE); |
298 | QPushButton *no = new QPushButton("Cancel",hb); | 304 | QPushButton *no = new QPushButton(tr("Cancel"),hb); |
299 | connect(yes, SIGNAL(clicked()), this, SLOT(accept())); | 305 | connect(yes, SIGNAL(clicked()), this, SLOT(accept())); |
@@ -345,7 +351,7 @@ void DictFilterConfig::doMenu(int i) | |||
345 | if ( input.count() == 0 ) { | 351 | if ( input.count() == 0 ) { |
346 | QMessageBox::information(0, "Adding Words", | 352 | QMessageBox::information(0, tr("Adding Words"), |
347 | "To add words, pick the letters,\nthen " | 353 | tr("To add words, pick the letters,\nthen " |
348 | "open the Add dialog. In that\ndialog, tap " | 354 | "open the Add dialog. In that\ndialog, tap " |
349 | "the correct letters\nfrom the list " | 355 | "the correct letters\nfrom the list " |
350 | "(tap twice for\ncapitals)."); | 356 | "(tap twice for\ncapitals).")); |
351 | } else { | 357 | } else { |
@@ -376,3 +382,3 @@ QString DictFilterConfig::text(int r, int i) | |||
376 | { | 382 | { |
377 | QStringList l = r ? sets : input.isEmpty() ? othermodes : matches; | 383 | QStringList l = r ? sets_a : input.isEmpty() ? othermodes : matches; |
378 | return i < (int)l.count() ? | 384 | return i < (int)l.count() ? |
@@ -428,12 +434,12 @@ void DictFilterConfig::pick(bool press, int row, int item) | |||
428 | lit0 = item; | 434 | lit0 = item; |
429 | if ( othermodes[item] == "Space" ) { | 435 | if ( othermodes[item] == PickboardPicks::tr("Space") ) { |
430 | updateItem(row,item); | 436 | updateItem(row,item); |
431 | generateText(" "); | 437 | generateText(" "); |
432 | } else if ( othermodes[item] == "Back" ) { | 438 | } else if ( othermodes[item] == PickboardPicks::tr("Back") ) { |
433 | updateItem(row,item); | 439 | updateItem(row,item); |
434 | generateKey(::Qt::Key_Backspace); | 440 | generateKey(::Qt::Key_Backspace); |
435 | } else if ( othermodes[item] == "Enter" ) { | 441 | } else if ( othermodes[item] == PickboardPicks::tr("Enter") ) { |
436 | updateItem(row,item); | 442 | updateItem(row,item); |
437 | generateKey(::Qt::Key_Return); | 443 | generateKey(::Qt::Key_Return); |
438 | } else if ( othermodes[item] == "Shift" ) { | 444 | } else if ( othermodes[item] == PickboardPicks::tr("Shift") ) { |
439 | updateItem(row,item); | 445 | updateItem(row,item); |
@@ -457,3 +463,3 @@ void DictFilterConfig::pick(bool press, int row, int item) | |||
457 | if ( lit0 >= 0 ) { | 463 | if ( lit0 >= 0 ) { |
458 | if ( !shift || othermodes[lit0] != "Shift" ) { | 464 | if ( !shift || othermodes[lit0] != PickboardPicks::tr("Shift") ) { |
459 | updateItem(0,lit0); | 465 | updateItem(0,lit0); |
@@ -570,5 +576,6 @@ bool DictFilterConfig::highlight(int r,int c) const | |||
570 | 576 | ||
571 | void DictFilterConfig::addSet(const QString& s) | 577 | void DictFilterConfig::addSet(const QString& appearance, const QString& set) |
572 | { | 578 | { |
573 | sets.append(s); | 579 | sets_a.append( appearance ); |
580 | sets.append( set ); | ||
574 | } | 581 | } |
@@ -582,3 +589,3 @@ void DictFilterConfig::fillMenu(QPopupMenu& menu) | |||
582 | { | 589 | { |
583 | menu.insertItem("Add...",300); | 590 | menu.insertItem(tr("Add..."),300); |
584 | StringConfig::fillMenu(menu); | 591 | StringConfig::fillMenu(menu); |