summaryrefslogtreecommitdiff
authorhash <hash>2002-10-24 06:17:03 (UTC)
committer hash <hash>2002-10-24 06:17:03 (UTC)
commit2183d2b20cf6eb9144a616a3f8242a7eb585c557 (patch) (unidiff)
tree58cb46e892c243bfbf0c39cd0ffd62f2beedb339
parentbdd884e37dc1ee1969d317b29e926768ea5a14df (diff)
downloadopie-2183d2b20cf6eb9144a616a3f8242a7eb585c557.zip
opie-2183d2b20cf6eb9144a616a3f8242a7eb585c557.tar.gz
opie-2183d2b20cf6eb9144a616a3f8242a7eb585c557.tar.bz2
didnt merge with previous updates properly
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp
index 71cdea8..9d58383 100644
--- a/noncore/apps/opie-console/function_keyboard.cpp
+++ b/noncore/apps/opie-console/function_keyboard.cpp
@@ -1,338 +1,333 @@
1#include "function_keyboard.h" 1#include "function_keyboard.h"
2 2
3#include <qpe/resource.h> 3#include <qpe/resource.h>
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qsizepolicy.h> 5#include <qsizepolicy.h>
6#include <qevent.h> 6#include <qevent.h>
7#include <qwindowsystem_qws.h> 7#include <qwindowsystem_qws.h>
8#include <qapplication.h> 8#include <qapplication.h>
9#include <qlayout.h> 9#include <qlayout.h>
10#include <qspinbox.h> 10#include <qspinbox.h>
11#include <qlabel.h> 11#include <qlabel.h>
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qdir.h> 13#include <qdir.h>
14 14
15/* FunctionKeyboard {{{1 */ 15/* FunctionKeyboard {{{1 */
16 16
17FunctionKeyboard::FunctionKeyboard(QWidget *parent) : 17FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
18 QFrame(parent), numRows(2), numCols(11), 18 QFrame(parent), numRows(2), numCols(11),
19 pressedRow(0), pressedCol(0) { 19 pressedRow(0), pressedCol(0) {
20 20
21 setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); 21 setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
22 22
23 Config conf("opie-console-keys"); 23 Config conf("opie-console-keys");
24 conf.setGroup("keys"); 24 conf.setGroup("keys");
25 for (uint r = 0; r < numRows; r++) 25 for (uint r = 0; r < numRows; r++)
26 for (uint c = 0; c < numCols; c++) { 26 for (uint c = 0; c < numCols; c++) {
27 27
28 QString handle = "r" + QString::number(r) + "c" + QString::number(c); 28 QString handle = "r" + QString::number(r) + "c" + QString::number(c);
29 QStringList value_list = conf.readListEntry( handle, '|'); 29 QStringList value_list = conf.readListEntry( handle, '|');
30 30
31 if (value_list.isEmpty()) continue; 31 if (value_list.isEmpty()) continue;
32 32
33 keys.insert( 33 keys.insert(
34 34
35 handle, 35 handle,
36 FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) 36 FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort())
37 ); 37 );
38 } 38 }
39 //qWarning("loaded %d keys", keys.count()); 39 //qWarning("loaded %d keys", keys.count());
40 if (keys.isEmpty()) loadDefaults(); 40 if (keys.isEmpty()) loadDefaults();
41 41
42 42
43 43
44} 44}
45 45
46FunctionKeyboard::~FunctionKeyboard() { 46FunctionKeyboard::~FunctionKeyboard() {
47 47
48} 48}
49 49
50void FunctionKeyboard::changeRows(int r) { 50void FunctionKeyboard::changeRows(int r) {
51 51
52 numRows = r; 52 numRows = r;
53 repaint(false); 53 repaint(false);
54} 54}
55void FunctionKeyboard::changeCols(int c) { 55void FunctionKeyboard::changeCols(int c) {
56 56
57 numCols = c; 57 numCols = c;
58 keyWidth = (double)width()/numCols; // have to reset this thing too 58 keyWidth = (double)width()/numCols; // have to reset this thing too
59 repaint(false); 59 repaint(false);
60} 60}
61 61
62/* 62/*
63Key getKey(int row, int col) { 63Key getKey(int row, int col) {
64 64
65 return keys[ "r" + QString::number(row) + "c" + QString::number(col) ]; 65 return keys[ "r" + QString::number(row) + "c" + QString::number(col) ];
66} 66}
67*/ 67*/
68 68
69void FunctionKeyboard::paintEvent(QPaintEvent *e) { 69void FunctionKeyboard::paintEvent(QPaintEvent *e) {
70 70
71 QPainter p(this); 71 QPainter p(this);
72 p.setClipRect(e->rect()); 72 p.setClipRect(e->rect());
73 p.fillRect(0, 0, width(), height(), QColor(255,255,255)); 73 p.fillRect(0, 0, width(), height(), QColor(255,255,255));
74 74
75 p.setPen(QColor(0,0,0)); 75 p.setPen(QColor(0,0,0));
76 76
77 /* those decimals do count! becomes short if use plain int */ 77 /* those decimals do count! becomes short if use plain int */
78 for (double i = 0; i <= width(); i += keyWidth) { 78 for (double i = 0; i <= width(); i += keyWidth) {
79 79
80 p.drawLine((int)i, 0, (int)i, height()); 80 p.drawLine((int)i, 0, (int)i, height());
81 } 81 }
82 82
83 // sometimes the last line doesnt get drawn 83 // sometimes the last line doesnt get drawn
84 p.drawLine(width() -1, 0, width() -1, height()); 84 p.drawLine(width() -1, 0, width() -1, height());
85 85
86 for (int i = 0; i <= height(); i += keyHeight) { 86 for (int i = 0; i <= height(); i += keyHeight) {
87 87
88 p.drawLine(0, i, width(), i); 88 p.drawLine(0, i, width(), i);
89 } 89 }
90 90
91 for (uint r = 0; r < numRows; r++) { 91 for (uint r = 0; r < numRows; r++) {
92 for (uint c = 0; c < numCols; c++) { 92 for (uint c = 0; c < numCols; c++) {
93 93
94 QString handle = "r" + QString::number(r) + "c" + QString::number(c); 94 QString handle = "r" + QString::number(r) + "c" + QString::number(c);
95 if (keys.contains(handle)) { 95 if (keys.contains(handle)) {
96 96
97 p.drawText( 97 p.drawText(
98 c * keyWidth + 1, r * keyHeight + 1, 98 c * keyWidth + 1, r * keyHeight + 1,
99 keyWidth, keyHeight, 99 keyWidth, keyHeight,
100 Qt::AlignHCenter | Qt::AlignVCenter, 100 Qt::AlignHCenter | Qt::AlignVCenter,
101 keys[handle].label 101 keys[handle].label
102 ); 102 );
103 } 103 }
104 } 104 }
105 } 105 }
106} 106}
107 107
108void FunctionKeyboard::paintKey(uint row, uint col) { 108void FunctionKeyboard::paintKey(uint row, uint col) {
109 109
110 QPainter p(this); 110 QPainter p(this);
111 111
112 p.fillRect(QRect(QPoint(col * keyWidth + 1, row * keyHeight + 1), 112 p.fillRect(QRect(QPoint(col * keyWidth + 1, row * keyHeight + 1),
113 QPoint((col + 1) * keyWidth - 1, row * keyHeight + keyHeight- 1)), 113 QPoint((col + 1) * keyWidth - 1, row * keyHeight + keyHeight- 1)),
114 (pressedRow != -1 && pressedCol != -1 ) ? QColor(97,119,155) : QColor(255,255,255)); 114 (pressedRow != -1 && pressedCol != -1 ) ? QColor(97,119,155) : QColor(255,255,255));
115 p.drawText( 115 p.drawText(
116 col * keyWidth + 1, row * keyHeight + 1, 116 col * keyWidth + 1, row * keyHeight + 1,
117 keyWidth, keyHeight, 117 keyWidth, keyHeight,
118 Qt::AlignHCenter | Qt::AlignVCenter, 118 Qt::AlignHCenter | Qt::AlignVCenter,
119 keys["r" + QString::number(row) + "c" + QString::number(col)].label 119 keys["r" + QString::number(row) + "c" + QString::number(col)].label
120 ); 120 );
121 121
122 if (row == numRows) { 122 if (row == numRows) {
123 123
124 // sometimes it doesnt draw the last line 124 // sometimes it doesnt draw the last line
125 p.drawLine((col+1) * keyWidth -2, row * keyHeight, 125 p.drawLine((col+1) * keyWidth -2, row * keyHeight,
126 (col+1) * keyWidth -2, (row + 1) * keyHeight 126 (col+1) * keyWidth -2, (row + 1) * keyHeight
127 ); 127 );
128 } 128 }
129 129
130} 130}
131 131
132void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { 132void FunctionKeyboard::mousePressEvent(QMouseEvent *e) {
133 133
134 pressedRow = e->y() / keyHeight; 134 pressedRow = e->y() / keyHeight;
135 pressedCol = (int) (e->x() / keyWidth); 135 pressedCol = (int) (e->x() / keyWidth);
136 136
137 paintKey(pressedRow, pressedCol); 137 paintKey(pressedRow, pressedCol);
138 138
139 // emit that sucker! 139 // emit that sucker!
140 FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)]; 140 FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)];
141 emit keyPressed(k, pressedRow, pressedCol, 1); 141 emit keyPressed(k, pressedRow, pressedCol, 1);
142 142
143} 143}
144 144
145void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { 145void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) {
146 146
147 if (pressedRow != -1 && pressedRow != -1) { 147 if (pressedRow != -1 && pressedRow != -1) {
148 148
149 int row = pressedRow; pressedRow = -1; 149 int row = pressedRow; pressedRow = -1;
150 int col = pressedCol; pressedCol = -1; 150 int col = pressedCol; pressedCol = -1;
151 paintKey(row, col); 151 paintKey(row, col);
152 152
153 FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; 153 FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)];
154 emit keyPressed(k, row, col, 0); 154 emit keyPressed(k, row, col, 0);
155 } 155 }
156 156
157} 157}
158 158
159 159
160void FunctionKeyboard::resizeEvent(QResizeEvent*) { 160void FunctionKeyboard::resizeEvent(QResizeEvent*) {
161 161
162 /* set he default font height/width */ 162 /* set he default font height/width */
163 QFontMetrics fm=fontMetrics(); 163 QFontMetrics fm=fontMetrics();
164 keyHeight = fm.lineSpacing() + 2; 164 keyHeight = fm.lineSpacing() + 2;
165 keyWidth = (double)width()/numCols; 165 keyWidth = (double)width()/numCols;
166 166
167} 167}
168 168
169QSize FunctionKeyboard::sizeHint() const { 169QSize FunctionKeyboard::sizeHint() const {
170 170
171 return QSize(width(), keyHeight * numRows + 1); 171 return QSize(width(), keyHeight * numRows + 1);
172} 172}
173 173
174void FunctionKeyboard::loadDefaults() { 174void FunctionKeyboard::loadDefaults() {
175 175
176 /* what keys should be default? 176 /* what keys should be default?
177 keys.insert( "r0c0", FKey ("F1", 0, 4144, 0)); 177 keys.insert( "r0c0", FKey ("F1", 0, 4144, 0));
178 keys.insert( "r0c1", FKey ("F2", 0, 4145, 0)); 178 keys.insert( "r0c1", FKey ("F2", 0, 4145, 0));
179 keys.insert( "r0c2", FKey ("F3", 0, 4146, 0)); 179 keys.insert( "r0c2", FKey ("F3", 0, 4146, 0));
180 keys.insert( "r0c3", FKey ("F4", 0, 4147, 0)); 180 keys.insert( "r0c3", FKey ("F4", 0, 4147, 0));
181 keys.insert( "r0c4", FKey ("F5", 0, 4148, 0)); 181 keys.insert( "r0c4", FKey ("F5", 0, 4148, 0));
182 keys.insert( "r0c5", FKey ("F6", 0, 4149, 0)); 182 keys.insert( "r0c5", FKey ("F6", 0, 4149, 0));
183 keys.insert( "r0c6", FKey ("F7", 0, 4150, 0)); 183 keys.insert( "r0c6", FKey ("F7", 0, 4150, 0));
184 keys.insert( "r0c7", FKey ("F8", 0, 4151, 0)); 184 keys.insert( "r0c7", FKey ("F8", 0, 4151, 0));
185 keys.insert( "r0c8", FKey ("F9", 0, 4152, 0)); 185 keys.insert( "r0c8", FKey ("F9", 0, 4152, 0));
186 keys.insert( "r0c9", FKey ("F10", 0, 4153, 0)); 186 keys.insert( "r0c9", FKey ("F10", 0, 4153, 0));
187 keys.insert( "r0c10", FKey ("F11", 0, 4154, 0)); 187 keys.insert( "r0c10", FKey ("F11", 0, 4154, 0));
188 188
189 keys.insert( "r1c7", FKey ("Ho", 0, 4112, 0)); 189 keys.insert( "r1c7", FKey ("Ho", 0, 4112, 0));
190 keys.insert( "r1c8", FKey ("End", 0, 4113, 0)); 190 keys.insert( "r1c8", FKey ("End", 0, 4113, 0));
191 keys.insert( "r1c9", FKey ("PU", 0, 4118, 0)); 191 keys.insert( "r1c9", FKey ("PU", 0, 4118, 0));
192 keys.insert( "r1c10", FKey ("PD", 0, 4119, 0)); 192 keys.insert( "r1c10", FKey ("PD", 0, 4119, 0));
193 */ 193 */
194 194
195} 195}
196 196
197/* FunctionKeyboardConfig {{{1 */ 197/* FunctionKeyboardConfig {{{1 */
198 198
199<<<<<<< function_keyboard.cpp 199FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na )
200FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : 200 : ProfileDialogKeyWidget(name, parent, na),
201 ProfileDialogKeyWidget(name, parent),
202 selectedRow(0), selectedCol(0) 201 selectedRow(0), selectedCol(0)
203{ 202{
204=======
205FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na )
206 : ProfileDialogKeyWidget(name, parent, na) {
207 qWarning("FunctionKeyboardConfig"); 203 qWarning("FunctionKeyboardConfig");
208>>>>>>> 1.11
209 204
210 205
211 kb = new FunctionKeyboard(this); 206 kb = new FunctionKeyboard(this);
212 connect (kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), 207 connect (kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)),
213 this, SLOT(slotKeyPressed(FKey, ushort, ushort, bool))); 208 this, SLOT(slotKeyPressed(FKey, ushort, ushort, bool)));
214 209
215 QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); 210 QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this);
216 QLabel *l = new QLabel("Rows", dimentions); 211 QLabel *l = new QLabel("Rows", dimentions);
217 m_rowBox = new QSpinBox(1, 15, 1, dimentions); 212 m_rowBox = new QSpinBox(1, 15, 1, dimentions);
218 connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); 213 connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int)));
219 l = new QLabel("Columns", dimentions); 214 l = new QLabel("Columns", dimentions);
220 m_colBox = new QSpinBox(1, 15, 1, dimentions); 215 m_colBox = new QSpinBox(1, 15, 1, dimentions);
221 connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); 216 connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int)));
222 217
223 QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); 218 QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this);
224 l = new QLabel("Label", editKey); 219 l = new QLabel("Label", editKey);
225 m_labels = new QComboBox(true, editKey); 220 m_labels = new QComboBox(true, editKey);
226 m_labels->setInsertionPolicy(QComboBox::AtCurrent); 221 m_labels->setInsertionPolicy(QComboBox::AtCurrent);
227 m_labels->insertItem("custom"); 222 m_labels->insertItem("custom");
228 223
229 QStringList files = QDir(QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); 224 QStringList files = QDir(QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList();
230 225
231 for (uint i = 0; i < files.count(); i++) { 226 for (uint i = 0; i < files.count(); i++) {
232 227
233 m_labels->insertItem(Resource::loadPixmap("console/keys/" + files[i])); 228 m_labels->insertItem(Resource::loadPixmap("console/keys/" + files[i]));
234 } 229 }
235 connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); 230 connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int)));
236 connect (m_labels, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeLabelText(const QString&))); 231 connect (m_labels, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeLabelText(const QString&)));
237 232
238 l = new QLabel("KeyValue", editKey); 233 l = new QLabel("KeyValue", editKey);
239 m_qvalues = new QComboBox(false, editKey); 234 m_qvalues = new QComboBox(false, editKey);
240 m_qvalues->setInsertionPolicy(QComboBox::AtCurrent); 235 m_qvalues->setInsertionPolicy(QComboBox::AtCurrent);
241 m_qvalues->insertItem("custom"); 236 m_qvalues->insertItem("custom");
242 237
243 QVBoxLayout *root = new QVBoxLayout(this, 2); 238 QVBoxLayout *root = new QVBoxLayout(this, 2);
244 root->addWidget(kb); 239 root->addWidget(kb);
245 root->addWidget(dimentions); 240 root->addWidget(dimentions);
246 root->addWidget(editKey); 241 root->addWidget(editKey);
247} 242}
248FunctionKeyboardConfig::~FunctionKeyboardConfig() { 243FunctionKeyboardConfig::~FunctionKeyboardConfig() {
249 244
250} 245}
251void FunctionKeyboardConfig::load (const Profile& prof) { 246void FunctionKeyboardConfig::load (const Profile& prof) {
252 247
253 m_rowBox->setValue(prof.readNumEntry("keb_rows", 2)); 248 m_rowBox->setValue(prof.readNumEntry("keb_rows", 2));
254 m_colBox->setValue(prof.readNumEntry("keb_cols", 10)); 249 m_colBox->setValue(prof.readNumEntry("keb_cols", 10));
255 250
256 /* load all the keys to the keyboard */ 251 /* load all the keys to the keyboard */
257 for (int i = 0; i <= m_rowBox->value() -1; i++) 252 for (int i = 0; i <= m_rowBox->value() -1; i++)
258 for (int j = 0; j <= m_colBox->value() -1; j++) { 253 for (int j = 0; j <= m_colBox->value() -1; j++) {
259 254
260 QString h = "r" + QString::number(i) + "c" + QString::number(j); 255 QString h = "r" + QString::number(i) + "c" + QString::number(j);
261 QString values = prof.readEntry("keb_" + h); 256 QString values = prof.readEntry("keb_" + h);
262 257
263 if (!values.isEmpty()) { 258 if (!values.isEmpty()) {
264 259
265 QStringList l = QStringList::split(QChar('|'), values, TRUE); 260 QStringList l = QStringList::split(QChar('|'), values, TRUE);
266 kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); 261 kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt());
267 //qWarning("loading key... %s %s %s %d %d", values.ascii(), l[0].ascii(), l[1].ascii(), l[2].toInt(), l[3].toInt()); 262 //qWarning("loading key... %s %s %s %d %d", values.ascii(), l[0].ascii(), l[1].ascii(), l[2].toInt(), l[3].toInt());
268 } 263 }
269 } 264 }
270 265
271} 266}
272void FunctionKeyboardConfig::save (Profile& prof) { 267void FunctionKeyboardConfig::save (Profile& prof) {
273 268
274 prof.writeEntry("keb_rows", m_rowBox->value()); 269 prof.writeEntry("keb_rows", m_rowBox->value());
275 prof.writeEntry("keb_cols", m_colBox->value()); 270 prof.writeEntry("keb_cols", m_colBox->value());
276 271
277 QMap<QString, FKey>::Iterator it; 272 QMap<QString, FKey>::Iterator it;
278 for ( it = kb->keys.begin(); it != kb->keys.end(); it++) { 273 for ( it = kb->keys.begin(); it != kb->keys.end(); it++) {
279 274
280 FKey k = it.data(); 275 FKey k = it.data();
281 QString entry = k.label + "|" 276 QString entry = k.label + "|"
282 + k.pixFile + "|" 277 + k.pixFile + "|"
283 + QString::number(k.qcode) + "|" 278 + QString::number(k.qcode) + "|"
284 + QString::number(k.unicode); 279 + QString::number(k.unicode);
285 280
286 prof.writeEntry("keb_" + it.key(), entry); 281 prof.writeEntry("keb_" + it.key(), entry);
287 282
288 } 283 }
289 284
290} 285}
291void FunctionKeyboardConfig::slotChangeRows(int r) { 286void FunctionKeyboardConfig::slotChangeRows(int r) {
292 287
293 kb->changeRows(r); 288 kb->changeRows(r);
294 289
295 // have to do this so the whole thing gets redrawn 290 // have to do this so the whole thing gets redrawn
296 kb->hide(); kb->show(); 291 kb->hide(); kb->show();
297} 292}
298void FunctionKeyboardConfig::slotChangeCols(int c) { 293void FunctionKeyboardConfig::slotChangeCols(int c) {
299 294
300 kb->changeCols(c); 295 kb->changeCols(c);
301} 296}
302void FunctionKeyboardConfig::slotKeyPressed(FKey k, ushort r, ushort c, bool pressed) { 297void FunctionKeyboardConfig::slotKeyPressed(FKey k, ushort r, ushort c, bool pressed) {
303 298
304 if (!pressed) return; 299 if (!pressed) return;
305 300
306 selectedRow = r, selectedCol = c; 301 selectedRow = r, selectedCol = c;
307 302
308 if (k.pixFile.isEmpty()) { 303 if (k.pixFile.isEmpty()) {
309 304
310 m_labels->setCurrentItem(0); 305 m_labels->setCurrentItem(0);
311 m_labels->changeItem(k.label, 0); 306 m_labels->changeItem(k.label, 0);
312 m_labels->setEditable(true); 307 m_labels->setEditable(true);
313 308
314 } 309 }
315 m_qvalues->changeItem(QString::number(k.qcode), 0); 310 m_qvalues->changeItem(QString::number(k.qcode), 0);
316} 311}
317void FunctionKeyboardConfig::slotChangeIcon(int index) { 312void FunctionKeyboardConfig::slotChangeIcon(int index) {
318 313
319 if (index == 0) { 314 if (index == 0) {
320 315
321 // is text 316 // is text
322 m_labels->setEditable(true); 317 m_labels->setEditable(true);
323 // why tf does the text get erased unless i do this? 318 // why tf does the text get erased unless i do this?
324 m_labels->changeItem(m_labels->text(0), 0); 319 m_labels->changeItem(m_labels->text(0), 0);
325 320
326 } else { 321 } else {
327 322
328 // is a pixmap 323 // is a pixmap
329 m_labels->setEditable(false); 324 m_labels->setEditable(false);
330 } 325 }
331} 326}
332void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) { 327void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) {
333 328
334 kb->keys["r" + QString::number(selectedRow) + 329 kb->keys["r" + QString::number(selectedRow) +
335 "c" + QString::number(selectedCol)].label = label; 330 "c" + QString::number(selectedCol)].label = label;
336 331
337 kb->paintKey(selectedRow, selectedCol); 332 kb->paintKey(selectedRow, selectedCol);
338} 333}