summaryrefslogtreecommitdiff
path: root/inputmethods
Unidiff
Diffstat (limited to 'inputmethods') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp3
-rw-r--r--inputmethods/multikey/keyboard.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index 68c31be..6ec8d0e 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -8,96 +8,99 @@
8 * 8 *
9 * 9 *
10 */ 10 */
11 11
12#include <qpe/qpeapplication.h> 12#include <qpe/qpeapplication.h>
13#include <qpe/config.h> 13#include <qpe/config.h>
14 14
15#include <qwidget.h> 15#include <qwidget.h>
16#include <qdialog.h> 16#include <qdialog.h>
17#include <qtabwidget.h> 17#include <qtabwidget.h>
18#include <qvbox.h> 18#include <qvbox.h>
19#include <qgrid.h> 19#include <qgrid.h>
20#include <qgroupbox.h> 20#include <qgroupbox.h>
21#include <qlabel.h> 21#include <qlabel.h>
22#include <qcheckbox.h> 22#include <qcheckbox.h>
23#include <qsizepolicy.h> 23#include <qsizepolicy.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include "configdlg.h" 26#include "configdlg.h"
27#include "keyboard.h" 27#include "keyboard.h"
28 28
29ConfigDlg::ConfigDlg () : QTabWidget () 29ConfigDlg::ConfigDlg () : QTabWidget ()
30{ 30{
31 setCaption( tr("Multikey Configuration") ); 31 setCaption( tr("Multikey Configuration") );
32 32
33 /* 33 /*
34 * 'general config' tab 34 * 'general config' tab
35 */ 35 */
36 36
37 QVBox *gen_box = new QVBox (this); 37 QVBox *gen_box = new QVBox (this);
38 gen_box->setMargin(3); 38 gen_box->setMargin(3);
39 addTab(gen_box, tr("General Settings")); 39 addTab(gen_box, tr("General Settings"));
40 40
41 QGroupBox *map_group = new QGroupBox (2, Qt::Horizontal, tr("Keymap File"), gen_box); 41 QGroupBox *map_group = new QGroupBox (2, Qt::Horizontal, tr("Keymap File"), gen_box);
42 42
43 map_combo = new QComboBox ((bool)0, map_group); 43 map_combo = new QComboBox ((bool)0, map_group);
44 map_combo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); 44 map_combo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
45 45
46 QString cur(tr("Current Language")); 46 QString cur(tr("Current Language"));
47 map_combo->insertItem(cur); 47 map_combo->insertItem(cur);
48 connect(map_combo, SIGNAL(activated(int)), SLOT(setMap(int))); 48 connect(map_combo, SIGNAL(activated(int)), SLOT(setMap(int)));
49 49
50 QString ko(tr("/opt/opie/share/multikey/ko.keymap")); 50 QString ko(tr("/opt/opie/share/multikey/ko.keymap"));
51 map_combo->insertItem(ko); 51 map_combo->insertItem(ko);
52 52
53 QString en(tr("/opt/opie/share/multikey/en.keymap")); 53 QString en(tr("/opt/opie/share/multikey/en.keymap"));
54 map_combo->insertItem(en); 54 map_combo->insertItem(en);
55 55
56 QString de(tr("/opt/opie/share/multikey/de.keymap"));
57 map_combo->insertItem(de);
58
56 QPushButton *button = new QPushButton(tr("Browse..."), map_group); 59 QPushButton *button = new QPushButton(tr("Browse..."), map_group);
57 button->setFlat((bool)1); 60 button->setFlat((bool)1);
58 61
59 pick_button = new QCheckBox(tr("Pickboard"), gen_box); 62 pick_button = new QCheckBox(tr("Pickboard"), gen_box);
60 63
61 Config config ("multikey"); 64 Config config ("multikey");
62 config.setGroup ("pickboard"); 65 config.setGroup ("pickboard");
63 bool pick_open = config.readBoolEntry ("open", "0"); // default closed 66 bool pick_open = config.readBoolEntry ("open", "0"); // default closed
64 if (pick_open) { 67 if (pick_open) {
65 68
66 pick_button->setChecked(true); 69 pick_button->setChecked(true);
67 } 70 }
68 71
69 // by connecting it after checking it, the signal isn't emmited 72 // by connecting it after checking it, the signal isn't emmited
70 connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); 73 connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog()));
71 74
72 /* 75 /*
73 * 'color' tab 76 * 'color' tab
74 */ 77 */
75 78
76 QGrid *color_box = new QGrid(2, this); 79 QGrid *color_box = new QGrid(2, this);
77 color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); 80 color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
78 color_box->setMargin(3); 81 color_box->setMargin(3);
79 addTab(color_box, tr("Colors")); 82 addTab(color_box, tr("Colors"));
80 83
81 QLabel *label; 84 QLabel *label;
82 85
83 label = new QLabel(tr("Key Color"), color_box); 86 label = new QLabel(tr("Key Color"), color_box);
84 button = new QPushButton(color_box); 87 button = new QPushButton(color_box);
85 button->setFlat((bool)1); 88 button->setFlat((bool)1);
86 label = new QLabel(tr("Key Pressed Color"), color_box); 89 label = new QLabel(tr("Key Pressed Color"), color_box);
87 button = new QPushButton(color_box); 90 button = new QPushButton(color_box);
88 button->setFlat((bool)1); 91 button->setFlat((bool)1);
89 label = new QLabel(tr("Line Color"), color_box); 92 label = new QLabel(tr("Line Color"), color_box);
90 button = new QPushButton(color_box); 93 button = new QPushButton(color_box);
91 button->setFlat((bool)1); 94 button->setFlat((bool)1);
92 label = new QLabel(tr("Text Color"), color_box); 95 label = new QLabel(tr("Text Color"), color_box);
93 button = new QPushButton(color_box); 96 button = new QPushButton(color_box);
94 button->setFlat((bool)1); 97 button->setFlat((bool)1);
95 98
96 label = new QLabel("", color_box); // a spacer so the above buttons dont expand 99 label = new QLabel("", color_box); // a spacer so the above buttons dont expand
97 label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); 100 label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
98 101
99} 102}
100 103
101void ConfigDlg::pickTog() { 104void ConfigDlg::pickTog() {
102 105
103 Config config ("multikey"); 106 Config config ("multikey");
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index 1d91b82..b793391 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -410,97 +410,97 @@ void Keyboard::mouseReleaseEvent(QMouseEvent*)
410 repaint(FALSE); 410 repaint(FALSE);
411 411
412 } 412 }
413 else 413 else
414 414
415 clearHighlight(); 415 clearHighlight();
416} 416}
417 417
418/* Keyboard::timerEvent {{{1 */ 418/* Keyboard::timerEvent {{{1 */
419/* 419/*
420void Keyboard::timerEvent(QTimerEvent* e) 420void Keyboard::timerEvent(QTimerEvent* e)
421{ 421{
422 if ( e->timerId() == pressTid ) { 422 if ( e->timerId() == pressTid ) {
423 killTimer(pressTid); 423 killTimer(pressTid);
424 pressTid = 0; 424 pressTid = 0;
425 if ( !pressed ) 425 if ( !pressed )
426 cout << "calling clearHighlight from timerEvent\n"; 426 cout << "calling clearHighlight from timerEvent\n";
427 clearHighlight(); 427 clearHighlight();
428 } 428 }
429} 429}
430*/ 430*/
431 431
432void Keyboard::repeat() 432void Keyboard::repeat()
433{ 433{
434 434
435 repeatTimer->start( 200 ); 435 repeatTimer->start( 200 );
436 emit key( unicode, 0, modifiers, true, true ); 436 emit key( unicode, 0, modifiers, true, true );
437} 437}
438 438
439void Keyboard::clearHighlight() 439void Keyboard::clearHighlight()
440{ 440{
441 if ( pressedKeyRow >= 0 && pressedKeyCol >= 0) { 441 if ( pressedKeyRow >= 0 && pressedKeyCol >= 0) {
442 int tmpRow = pressedKeyRow; 442 int tmpRow = pressedKeyRow;
443 int tmpCol = pressedKeyCol; 443 int tmpCol = pressedKeyCol;
444 444
445 pressedKeyRow = -1; 445 pressedKeyRow = -1;
446 pressedKeyCol = -1; 446 pressedKeyCol = -1;
447 447
448 QPainter p(this); 448 QPainter p(this);
449 drawKeyboard(p, tmpRow, tmpCol); 449 drawKeyboard(p, tmpRow, tmpCol);
450 } 450 }
451} 451}
452 452
453 453
454/* Keyboard::sizeHint {{{1 */ 454/* Keyboard::sizeHint {{{1 */
455QSize Keyboard::sizeHint() const 455QSize Keyboard::sizeHint() const
456{ 456{
457 QFontMetrics fm=fontMetrics(); 457 QFontMetrics fm=fontMetrics();
458 int keyHeight = fm.lineSpacing(); 458 int keyHeight = fm.lineSpacing() + 2;
459 459
460 return QSize( 240, keyHeight * 5 + (usePicks ? picks->sizeHint().height() : 0) + 1); 460 return QSize( 240, keyHeight * 5 + (usePicks ? picks->sizeHint().height() : 0) + 1);
461} 461}
462 462
463 463
464void Keyboard::resetState() 464void Keyboard::resetState()
465{ 465{
466 schar = mchar = echar = 0; 466 schar = mchar = echar = 0;
467 picks->resetState(); 467 picks->resetState();
468} 468}
469 469
470/* Keyboard::togglePickboard {{{1 */ 470/* Keyboard::togglePickboard {{{1 */
471void Keyboard::togglePickboard(bool on_off) 471void Keyboard::togglePickboard(bool on_off)
472{ 472{
473 usePicks = on_off; 473 usePicks = on_off;
474 if (usePicks) { 474 if (usePicks) {
475 picks->show(); 475 picks->show();
476 //move(x(), y() - picks->height()); // not required anymore because QCopChannel::send 476 //move(x(), y() - picks->height()); // not required anymore because QCopChannel::send
477 //adjustSize(); 477 //adjustSize();
478 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), 478 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
479 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); 479 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
480 } else { 480 } else {
481 481
482 picks->hide(); 482 picks->hide();
483 picks->resetState(); 483 picks->resetState();
484 //move(x(), y() + picks->height()); 484 //move(x(), y() + picks->height());
485 //adjustSize(); 485 //adjustSize();
486 QObject::disconnect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), 486 QObject::disconnect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
487 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); 487 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
488 488
489 } 489 }
490 /* 490 /*
491 * this closes && opens the input method 491 * this closes && opens the input method
492 */ 492 */
493 QCopChannel::send ("QPE/TaskBar", "hideInputMethod()"); 493 QCopChannel::send ("QPE/TaskBar", "hideInputMethod()");
494 QCopChannel::send ("QPE/TaskBar", "showInputMethod()"); 494 QCopChannel::send ("QPE/TaskBar", "showInputMethod()");
495} 495}
496 496
497/* Keyboard::setMapTo ... {{{1 */ 497/* Keyboard::setMapTo ... {{{1 */
498void Keyboard::setMapToDefault() { 498void Keyboard::setMapToDefault() {
499 499
500 500
501 /* load current locale language map */ 501 /* load current locale language map */
502 Config *config = new Config("locale"); 502 Config *config = new Config("locale");
503 config->setGroup( "Language" ); 503 config->setGroup( "Language" );
504 QString l = config->readEntry( "Language" , "en" ); 504 QString l = config->readEntry( "Language" , "en" );
505 delete config; 505 delete config;
506 506