-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 29 | ||||
-rw-r--r-- | inputmethods/multikey/configdlg.h | 2 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 33 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.h | 2 |
4 files changed, 53 insertions, 13 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 7bea589..c4f7413 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp | |||
@@ -7,79 +7,93 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <qpe/qpeapplication.h> | 9 | #include <qpe/qpeapplication.h> |
10 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
11 | 11 | ||
12 | #include <qwidget.h> | 12 | #include <qwidget.h> |
13 | #include <qdialog.h> | 13 | #include <qdialog.h> |
14 | #include <qtabwidget.h> | 14 | #include <qtabwidget.h> |
15 | #include <qvbox.h> | 15 | #include <qvbox.h> |
16 | #include <qgrid.h> | 16 | #include <qgrid.h> |
17 | #include <qgroupbox.h> | 17 | #include <qgroupbox.h> |
18 | #include <qlabel.h> | 18 | #include <qlabel.h> |
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.h> |
20 | #include <qsizepolicy.h> | 20 | #include <qsizepolicy.h> |
21 | #include <qpushbutton.h> | 21 | #include <qpushbutton.h> |
22 | #include <qlistbox.h> | 22 | #include <qlistbox.h> |
23 | #include <qstringlist.h> | ||
23 | #include "configdlg.h" | 24 | #include "configdlg.h" |
24 | #include "keyboard.h" | 25 | #include "keyboard.h" |
25 | 26 | ||
26 | ConfigDlg::ConfigDlg () : QTabWidget () | 27 | ConfigDlg::ConfigDlg () : QTabWidget () |
27 | { | 28 | { |
28 | setCaption( tr("Multikey Configuration") ); | 29 | setCaption( tr("Multikey Configuration") ); |
30 | Config config ("multikey"); | ||
29 | 31 | ||
30 | /* | 32 | /* |
31 | * 'general config' tab | 33 | * 'general config' tab |
32 | */ | 34 | */ |
33 | 35 | ||
34 | QVBox *gen_box = new QVBox (this); | 36 | QVBox *gen_box = new QVBox (this); |
35 | gen_box->setMargin(3); | 37 | gen_box->setMargin(3); |
36 | addTab(gen_box, tr("General Settings")); | 38 | addTab(gen_box, tr("General Settings")); |
37 | 39 | ||
38 | QGroupBox *map_group = new QGroupBox (2, Qt::Vertical, tr("Keymap File"), gen_box); | 40 | QGroupBox *map_group = new QGroupBox (2, Qt::Vertical, tr("Keymap File"), gen_box); |
39 | 41 | ||
40 | keymaps = new QListBox (map_group); | 42 | keymaps = new QListBox (map_group); |
41 | keymaps->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 43 | keymaps->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); |
42 | //keymaps->setMaximumHeight(150); | ||
43 | 44 | ||
44 | QString cur(tr("Current Language")); | 45 | QString cur(tr("Current Language")); |
45 | keymaps->insertItem(cur); | 46 | keymaps->insertItem(cur); |
47 | |||
48 | config.setGroup ("keymaps"); | ||
49 | QStringList maps = config.readListEntry("maps", QChar('|')); | ||
50 | |||
51 | for (unsigned int i = 0; i < maps.count(); i++) { | ||
52 | |||
53 | keymaps->insertItem(maps[i]); | ||
54 | } | ||
55 | |||
56 | // have to "+1" because the "current language" listItem... remember? | ||
57 | keymaps->setSelected(config.readNumEntry("current", 0) + 1, true); | ||
58 | |||
46 | connect(keymaps, SIGNAL(highlighted(int)), SLOT(setMap(int))); | 59 | connect(keymaps, SIGNAL(highlighted(int)), SLOT(setMap(int))); |
47 | 60 | ||
61 | /* | ||
48 | QString ko(QPEApplication::qpeDir() + "/share/multikey/ko.keymap"); | 62 | QString ko(QPEApplication::qpeDir() + "/share/multikey/ko.keymap"); |
49 | keymaps->insertItem(ko); | 63 | keymaps->insertItem(ko); |
50 | 64 | ||
51 | QString en(QPEApplication::qpeDir() + "/share/multikey/en.keymap"); | 65 | QString en(QPEApplication::qpeDir() + "/share/multikey/en.keymap"); |
52 | keymaps->insertItem(en); | 66 | keymaps->insertItem(en); |
53 | 67 | ||
54 | QString de(QPEApplication::qpeDir() + "/share/multikey/de.keymap"); | 68 | QString de(QPEApplication::qpeDir() + "/share/multikey/de.keymap"); |
55 | keymaps->insertItem(de); | 69 | keymaps->insertItem(de); |
70 | */ | ||
56 | 71 | ||
57 | QGrid *add_remove_grid = new QGrid(2, map_group); | 72 | QGrid *add_remove_grid = new QGrid(2, map_group); |
58 | add_remove_grid->setMargin(3); | 73 | add_remove_grid->setMargin(3); |
59 | add_remove_grid->setSpacing(3); | 74 | add_remove_grid->setSpacing(3); |
60 | 75 | ||
61 | add_button = new QPushButton(tr("Add"), add_remove_grid); | 76 | add_button = new QPushButton(tr("Add"), add_remove_grid); |
62 | add_button->setFlat((bool)1); | 77 | add_button->setFlat((bool)1); |
63 | 78 | ||
64 | remove_button = new QPushButton(tr("Remove"), add_remove_grid); | 79 | remove_button = new QPushButton(tr("Remove"), add_remove_grid); |
65 | remove_button->setFlat((bool)1); | 80 | remove_button->setFlat((bool)1); |
66 | 81 | ||
67 | pick_button = new QCheckBox(tr("Pickboard"), gen_box); | 82 | pick_button = new QCheckBox(tr("Pickboard"), gen_box); |
68 | 83 | ||
69 | Config config ("multikey"); | ||
70 | config.setGroup ("pickboard"); | 84 | config.setGroup ("pickboard"); |
71 | bool pick_open = config.readBoolEntry ("open", "0"); // default closed | 85 | bool pick_open = config.readBoolEntry ("open", "0"); // default closed |
72 | if (pick_open) { | 86 | if (pick_open) { |
73 | 87 | ||
74 | pick_button->setChecked(true); | 88 | pick_button->setChecked(true); |
75 | } | 89 | } |
76 | 90 | ||
77 | // by connecting it after checking it, the signal isn't emmited | 91 | // by connecting it after checking it, the signal isn't emmited |
78 | connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); | 92 | connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); |
79 | 93 | ||
80 | /* | 94 | /* |
81 | * 'color' tab | 95 | * 'color' tab |
82 | */ | 96 | */ |
83 | 97 | ||
84 | QGrid *color_box = new QGrid(2, this); | 98 | QGrid *color_box = new QGrid(2, this); |
85 | color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); | 99 | color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); |
@@ -103,41 +117,50 @@ ConfigDlg::ConfigDlg () : QTabWidget () | |||
103 | button->setFlat((bool)1); | 117 | button->setFlat((bool)1); |
104 | 118 | ||
105 | label = new QLabel("", color_box); // a spacer so the above buttons dont expand | 119 | label = new QLabel("", color_box); // a spacer so the above buttons dont expand |
106 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 120 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); |
107 | 121 | ||
108 | } | 122 | } |
109 | 123 | ||
110 | void ConfigDlg::pickTog() { | 124 | void ConfigDlg::pickTog() { |
111 | 125 | ||
112 | Config config ("multikey"); | 126 | Config config ("multikey"); |
113 | config.setGroup ("pickboard"); | 127 | config.setGroup ("pickboard"); |
114 | config.writeEntry ("open", pick_button->isChecked()); // default closed | 128 | config.writeEntry ("open", pick_button->isChecked()); // default closed |
115 | 129 | ||
116 | emit pickboardToggled(pick_button->isChecked()); | 130 | emit pickboardToggled(pick_button->isChecked()); |
117 | } | 131 | } |
118 | 132 | ||
133 | /* | ||
134 | * the index is kinda screwy, because in the config file, index 0 is just the | ||
135 | * first element in the QStringList, but here it's the "Current Language" | ||
136 | * listItem. therefor you have to minus one to the index before you access | ||
137 | * it from the config file. | ||
138 | * | ||
139 | * and later on, the "current language" setting should be -1 in the config file | ||
140 | */ | ||
141 | |||
119 | void ConfigDlg::setMap(int index) { | 142 | void ConfigDlg::setMap(int index) { |
120 | 143 | ||
121 | if (index == 0) { | 144 | if (index == 0) { |
122 | 145 | ||
123 | if (remove_button->isEnabled()) | 146 | if (remove_button->isEnabled()) |
124 | remove_button->setDisabled(true); | 147 | remove_button->setDisabled(true); |
125 | 148 | ||
126 | emit setMapToDefault(); | 149 | emit setMapToDefault(); |
127 | } | 150 | } |
128 | else { | 151 | else { |
129 | 152 | ||
130 | if (!remove_button->isEnabled()) | 153 | if (!remove_button->isEnabled()) |
131 | remove_button->setEnabled(true); | 154 | remove_button->setEnabled(true); |
132 | 155 | ||
133 | emit setMapToFile(keymaps->text(index)); | 156 | emit setMapToFile(index - 1); |
134 | } | 157 | } |
135 | } | 158 | } |
136 | 159 | ||
137 | void ConfigDlg::addMap() { | 160 | void ConfigDlg::addMap() { |
138 | 161 | ||
139 | } | 162 | } |
140 | 163 | ||
141 | void ConfigDlg::removeMap(int index) { | 164 | void ConfigDlg::removeMap(int index) { |
142 | 165 | ||
143 | } | 166 | } |
diff --git a/inputmethods/multikey/configdlg.h b/inputmethods/multikey/configdlg.h index 1a64764..03a3547 100644 --- a/inputmethods/multikey/configdlg.h +++ b/inputmethods/multikey/configdlg.h | |||
@@ -4,33 +4,33 @@ | |||
4 | #include <qlistbox.h> | 4 | #include <qlistbox.h> |
5 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
6 | 6 | ||
7 | #ifndef CONFIGDLG_H | 7 | #ifndef CONFIGDLG_H |
8 | #define CONFIGDLG_H | 8 | #define CONFIGDLG_H |
9 | 9 | ||
10 | class ConfigDlg : public QTabWidget | 10 | class ConfigDlg : public QTabWidget |
11 | { | 11 | { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | 13 | ||
14 | public: | 14 | public: |
15 | ConfigDlg (); | 15 | ConfigDlg (); |
16 | 16 | ||
17 | signals: | 17 | signals: |
18 | void pickboardToggled(bool on_off); | 18 | void pickboardToggled(bool on_off); |
19 | void setMapToDefault(); | 19 | void setMapToDefault(); |
20 | void setMapToFile(QString file); | 20 | void setMapToFile(int index); |
21 | 21 | ||
22 | private slots: | 22 | private slots: |
23 | void pickTog(); | 23 | void pickTog(); |
24 | void setMap(int index); | 24 | void setMap(int index); |
25 | void addMap(); | 25 | void addMap(); |
26 | void removeMap(int index); | 26 | void removeMap(int index); |
27 | 27 | ||
28 | private: | 28 | private: |
29 | QCheckBox *pick_button; | 29 | QCheckBox *pick_button; |
30 | QListBox *keymaps; | 30 | QListBox *keymaps; |
31 | QPushButton *add_button; | 31 | QPushButton *add_button; |
32 | QPushButton *remove_button; | 32 | QPushButton *remove_button; |
33 | 33 | ||
34 | }; | 34 | }; |
35 | 35 | ||
36 | #endif | 36 | #endif |
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 671868c..c53ae6c 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp | |||
@@ -20,32 +20,34 @@ | |||
20 | 20 | ||
21 | #include "keyboard.h" | 21 | #include "keyboard.h" |
22 | #include "configdlg.h" | 22 | #include "configdlg.h" |
23 | 23 | ||
24 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
26 | 26 | ||
27 | #include <qwindowsystem_qws.h> | 27 | #include <qwindowsystem_qws.h> |
28 | #include <qpainter.h> | 28 | #include <qpainter.h> |
29 | #include <qfontmetrics.h> | 29 | #include <qfontmetrics.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
33 | #include <ctype.h> | 33 | #include <ctype.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qstringlist.h> | ||
37 | #include <iostream.h> | ||
36 | 38 | ||
37 | #include <sys/utsname.h> | 39 | #include <sys/utsname.h> |
38 | 40 | ||
39 | 41 | ||
40 | #define USE_SMALL_BACKSPACE | 42 | #define USE_SMALL_BACKSPACE |
41 | 43 | ||
42 | /* Keyboard::Keyboard {{{1 */ | 44 | /* Keyboard::Keyboard {{{1 */ |
43 | Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | 45 | Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : |
44 | QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), | 46 | QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), |
45 | alt(0), useLargeKeys(TRUE), usePicks(0), pressedKeyRow(-1), pressedKeyCol(-1), | 47 | alt(0), useLargeKeys(TRUE), usePicks(0), pressedKeyRow(-1), pressedKeyCol(-1), |
46 | unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), | 48 | unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), |
47 | configdlg(0) | 49 | configdlg(0) |
48 | 50 | ||
49 | { | 51 | { |
50 | // get the default font | 52 | // get the default font |
51 | Config *config = new Config( "qpe" ); | 53 | Config *config = new Config( "qpe" ); |
@@ -275,34 +277,34 @@ void Keyboard::mousePressEvent(QMouseEvent *e) | |||
275 | bool need_repaint = FALSE; | 277 | bool need_repaint = FALSE; |
276 | 278 | ||
277 | if (unicode == 0) { // either Qt char, or nothing | 279 | if (unicode == 0) { // either Qt char, or nothing |
278 | 280 | ||
279 | if (qkeycode == Qt::Key_F1) { // toggle the pickboard | 281 | if (qkeycode == Qt::Key_F1) { // toggle the pickboard |
280 | 282 | ||
281 | if ( configdlg ) { | 283 | if ( configdlg ) { |
282 | delete (ConfigDlg *) configdlg; | 284 | delete (ConfigDlg *) configdlg; |
283 | configdlg = 0; | 285 | configdlg = 0; |
284 | } | 286 | } |
285 | else { | 287 | else { |
286 | configdlg = new ConfigDlg (); | 288 | configdlg = new ConfigDlg (); |
287 | connect(configdlg, SIGNAL(pickboardToggled(bool)), | 289 | connect(configdlg, SIGNAL(pickboardToggled(bool)), |
288 | this, SLOT(togglePickboard(bool))); | 290 | this, SLOT(togglePickboard(bool))); |
289 | connect(configdlg, SIGNAL(setMapToDefault()), | 291 | connect(configdlg, SIGNAL(setMapToDefault()), |
290 | this, SLOT(setMapToDefault())); | 292 | this, SLOT(setMapToDefault())); |
291 | connect(configdlg, SIGNAL(setMapToFile(QString)), | 293 | connect(configdlg, SIGNAL(setMapToFile(int)), |
292 | this, SLOT(setMapToFile(QString))); | 294 | this, SLOT(setMapToFile(int))); |
293 | configdlg->showMaximized(); | 295 | configdlg->showMaximized(); |
294 | configdlg->show(); | 296 | configdlg->show(); |
295 | configdlg->raise(); | 297 | configdlg->raise(); |
296 | } | 298 | } |
297 | 299 | ||
298 | } else if (qkeycode == Qt::Key_Control) { | 300 | } else if (qkeycode == Qt::Key_Control) { |
299 | ctrl = keys->pressedPtr(row, col); | 301 | ctrl = keys->pressedPtr(row, col); |
300 | need_repaint = TRUE; | 302 | need_repaint = TRUE; |
301 | *ctrl = !keys->pressed(row, col); | 303 | *ctrl = !keys->pressed(row, col); |
302 | 304 | ||
303 | } else if (qkeycode == Qt::Key_Alt) { | 305 | } else if (qkeycode == Qt::Key_Alt) { |
304 | alt = keys->pressedPtr(row, col); | 306 | alt = keys->pressedPtr(row, col); |
305 | need_repaint = TRUE; | 307 | need_repaint = TRUE; |
306 | *alt = !keys->pressed(row, col); | 308 | *alt = !keys->pressed(row, col); |
307 | 309 | ||
308 | } else if (qkeycode == Qt::Key_Shift) { | 310 | } else if (qkeycode == Qt::Key_Shift) { |
@@ -504,52 +506,60 @@ void Keyboard::togglePickboard(bool on_off) | |||
504 | /* Keyboard::setMapTo ... {{{1 */ | 506 | /* Keyboard::setMapTo ... {{{1 */ |
505 | void Keyboard::setMapToDefault() { | 507 | void Keyboard::setMapToDefault() { |
506 | 508 | ||
507 | 509 | ||
508 | /* load current locale language map */ | 510 | /* load current locale language map */ |
509 | Config *config = new Config("locale"); | 511 | Config *config = new Config("locale"); |
510 | config->setGroup( "Language" ); | 512 | config->setGroup( "Language" ); |
511 | QString l = config->readEntry( "Language" , "en" ); | 513 | QString l = config->readEntry( "Language" , "en" ); |
512 | delete config; | 514 | delete config; |
513 | 515 | ||
514 | QString key_map = QPEApplication::qpeDir() + "/share/multikey/" | 516 | QString key_map = QPEApplication::qpeDir() + "/share/multikey/" |
515 | + l + ".keymap"; | 517 | + l + ".keymap"; |
516 | 518 | ||
517 | /* save change to multikey config file */ | 519 | /* save change to multikey config file */ |
518 | config = new Config("multikey"); | 520 | config = new Config("multikey"); |
519 | config->setGroup ("keymaps"); | 521 | config->setGroup ("keymaps"); |
520 | config->writeEntry ("current", key_map); // default closed | 522 | config->writeEntry ("current", -1); // default closed |
521 | delete config; | 523 | delete config; |
522 | 524 | ||
523 | delete keys; | 525 | delete keys; |
524 | keys = new Keys(key_map); | 526 | keys = new Keys(key_map); |
525 | 527 | ||
526 | // have to repaint the keyboard | 528 | // have to repaint the keyboard |
527 | repaint(FALSE); | 529 | repaint(FALSE); |
528 | } | 530 | } |
529 | 531 | ||
530 | void Keyboard::setMapToFile(QString file) { | 532 | void Keyboard::setMapToFile(int index) { |
531 | 533 | ||
532 | /* save change to multikey config file */ | 534 | /* save change to multikey config file */ |
533 | Config *config = new Config("multikey"); | 535 | Config *config = new Config("multikey"); |
534 | config->setGroup ("keymaps"); | 536 | config->setGroup ("keymaps"); |
535 | config->writeEntry ("current", file); // default closed | 537 | config->writeEntry ("current", index); // default closed |
538 | |||
539 | |||
540 | /* now you have to retrieve the map */ | ||
541 | QStringList maps = config->readListEntry("maps", QChar('|')); | ||
536 | delete config; | 542 | delete config; |
537 | 543 | ||
538 | delete keys; | 544 | delete keys; |
539 | keys = new Keys(file); | 545 | if (index < 0 || (int)maps.count() <= index) |
546 | keys = new Keys(); | ||
547 | else | ||
548 | keys = new Keys(maps[index]); | ||
549 | |||
540 | repaint(FALSE); | 550 | repaint(FALSE); |
541 | 551 | ||
542 | } | 552 | } |
543 | 553 | ||
544 | /* korean input functions {{{1 | 554 | /* korean input functions {{{1 |
545 | * | 555 | * |
546 | * TODO | 556 | * TODO |
547 | * one major problem with this implementation is that you can't move the | 557 | * one major problem with this implementation is that you can't move the |
548 | * cursor after inputing korean chars, otherwise it will eat up and replace | 558 | * cursor after inputing korean chars, otherwise it will eat up and replace |
549 | * the char before the cursor you move to. fix that | 559 | * the char before the cursor you move to. fix that |
550 | * | 560 | * |
551 | * make backspace delete one single char, not the whole thing if still | 561 | * make backspace delete one single char, not the whole thing if still |
552 | * editing. | 562 | * editing. |
553 | * | 563 | * |
554 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 564 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
555 | * | 565 | * |
@@ -836,45 +846,52 @@ ushort Keyboard::constoe(const ushort c) { | |||
836 | case 0x11c1: return 0x1111; | 846 | case 0x11c1: return 0x1111; |
837 | case 0x11c2: return 0x1112; | 847 | case 0x11c2: return 0x1112; |
838 | default: return 0; | 848 | default: return 0; |
839 | 849 | ||
840 | } | 850 | } |
841 | 851 | ||
842 | } | 852 | } |
843 | } | 853 | } |
844 | 854 | ||
845 | 855 | ||
846 | // Keys::Keys {{{1 | 856 | // Keys::Keys {{{1 |
847 | 857 | ||
848 | Keys::Keys() { | 858 | Keys::Keys() { |
849 | 859 | ||
850 | Config *config = new Config ("multikey"); | 860 | Config *config = new Config ("multikey"); |
851 | config->setGroup( "keymaps" ); | 861 | config->setGroup( "keymaps" ); |
852 | QString key_map = config->readEntry( "current" ); | 862 | QStringList maps = config->readListEntry ("maps", QChar('|')); |
863 | |||
864 | int index = config->readNumEntry( "current", -1 ); | ||
853 | delete config; | 865 | delete config; |
854 | 866 | ||
855 | if (key_map.isNull()) { | 867 | QString key_map; |
868 | |||
869 | if (index < 0 || (int)maps.count() <= index) { | ||
856 | 870 | ||
857 | Config *config = new Config("locale"); | 871 | Config *config = new Config("locale"); |
858 | config->setGroup( "Language" ); | 872 | config->setGroup( "Language" ); |
859 | QString l = config->readEntry( "Language" , "en" ); | 873 | QString l = config->readEntry( "Language" , "en" ); |
860 | delete config; | 874 | delete config; |
861 | 875 | ||
862 | key_map = QPEApplication::qpeDir() + "/share/multikey/" | 876 | key_map = QPEApplication::qpeDir() + "/share/multikey/" |
863 | + l + ".keymap"; | 877 | + l + ".keymap"; |
864 | 878 | ||
879 | } else { | ||
880 | |||
881 | key_map = maps[index]; | ||
865 | } | 882 | } |
866 | 883 | ||
867 | 884 | ||
868 | setKeysFromFile(key_map); | 885 | setKeysFromFile(key_map); |
869 | } | 886 | } |
870 | 887 | ||
871 | Keys::Keys(const char * filename) { | 888 | Keys::Keys(const char * filename) { |
872 | 889 | ||
873 | setKeysFromFile(filename); | 890 | setKeysFromFile(filename); |
874 | } | 891 | } |
875 | 892 | ||
876 | // Keys::setKeysFromFile {{{2 | 893 | // Keys::setKeysFromFile {{{2 |
877 | void Keys::setKeysFromFile(const char * filename) { | 894 | void Keys::setKeysFromFile(const char * filename) { |
878 | 895 | ||
879 | QFile f(filename); | 896 | QFile f(filename); |
880 | 897 | ||
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index 400edc0..7a8d4b4 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h | |||
@@ -100,33 +100,33 @@ public: | |||
100 | void mousePressEvent(QMouseEvent*); | 100 | void mousePressEvent(QMouseEvent*); |
101 | void mouseReleaseEvent(QMouseEvent*); | 101 | void mouseReleaseEvent(QMouseEvent*); |
102 | void resizeEvent(QResizeEvent*); | 102 | void resizeEvent(QResizeEvent*); |
103 | void paintEvent(QPaintEvent* e); | 103 | void paintEvent(QPaintEvent* e); |
104 | //void timerEvent(QTimerEvent* e); | 104 | //void timerEvent(QTimerEvent* e); |
105 | void drawKeyboard( QPainter &p, int row = -1, int col = -1); | 105 | void drawKeyboard( QPainter &p, int row = -1, int col = -1); |
106 | 106 | ||
107 | QSize sizeHint() const; | 107 | QSize sizeHint() const; |
108 | 108 | ||
109 | signals: | 109 | signals: |
110 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); | 110 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); |
111 | 111 | ||
112 | private slots: | 112 | private slots: |
113 | void repeat(); | 113 | void repeat(); |
114 | void togglePickboard(bool on_off); | 114 | void togglePickboard(bool on_off); |
115 | void setMapToDefault(); | 115 | void setMapToDefault(); |
116 | void setMapToFile(QString file); | 116 | void setMapToFile(int index); |
117 | 117 | ||
118 | private: | 118 | private: |
119 | int getKey( int &w, int j = -1 ); | 119 | int getKey( int &w, int j = -1 ); |
120 | void clearHighlight(); | 120 | void clearHighlight(); |
121 | 121 | ||
122 | bool *shift; | 122 | bool *shift; |
123 | bool *lock; | 123 | bool *lock; |
124 | bool *ctrl; | 124 | bool *ctrl; |
125 | bool *alt; | 125 | bool *alt; |
126 | uint useLargeKeys:1; | 126 | uint useLargeKeys:1; |
127 | uint usePicks:1; | 127 | uint usePicks:1; |
128 | 128 | ||
129 | int pressedKeyRow; | 129 | int pressedKeyRow; |
130 | int pressedKeyCol; | 130 | int pressedKeyCol; |
131 | 131 | ||
132 | KeyboardPicks *picks; | 132 | KeyboardPicks *picks; |