Diffstat (limited to 'noncore/apps/opie-console/function_keyboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index 0abe0d9..389618c 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -74,25 +74,25 @@ void FunctionKeyboard::load (const Profile& prof) { | |||
74 | 74 | ||
75 | QString h = "r" + QString::number(i) + "c" + QString::number(j); | 75 | QString h = "r" + QString::number(i) + "c" + QString::number(j); |
76 | QString values = prof.readEntry("keb_" + h); | 76 | QString values = prof.readEntry("keb_" + h); |
77 | 77 | ||
78 | if (!values.isEmpty()) { | 78 | if (!values.isEmpty()) { |
79 | 79 | ||
80 | QStringList l = QStringList::split(QChar('|'), values, TRUE); | 80 | QStringList l = QStringList::split(QChar('|'), values, TRUE); |
81 | keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); | 81 | keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); |
82 | 82 | ||
83 | // load pixmap if used | 83 | // load pixmap if used |
84 | if (!l[1].isEmpty()) { | 84 | if (!l[1].isEmpty()) { |
85 | 85 | ||
86 | keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) ); | 86 | keys[h].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + l[1] ) ); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | if (keys.isEmpty()) loadDefaults(); | 91 | if (keys.isEmpty()) loadDefaults(); |
92 | 92 | ||
93 | hide(); | 93 | hide(); |
94 | show(); | 94 | show(); |
95 | 95 | ||
96 | } | 96 | } |
97 | 97 | ||
98 | void FunctionKeyboard::paintEvent(QPaintEvent *e) { | 98 | void FunctionKeyboard::paintEvent(QPaintEvent *e) { |
@@ -268,26 +268,25 @@ FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* par | |||
268 | m_colBox = new QSpinBox(1, 15, 1, dimentions); | 268 | m_colBox = new QSpinBox(1, 15, 1, dimentions); |
269 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); | 269 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); |
270 | 270 | ||
271 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); | 271 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); |
272 | l = new QLabel(tr("Label"), editKey); | 272 | l = new QLabel(tr("Label"), editKey); |
273 | m_labels = new QComboBox(true, editKey); | 273 | m_labels = new QComboBox(true, editKey); |
274 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); | 274 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); |
275 | m_labels->insertItem(""); | 275 | m_labels->insertItem(""); |
276 | 276 | ||
277 | QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); | 277 | QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); |
278 | 278 | ||
279 | for (uint i = 0; i < files.count(); i++) { | 279 | for (uint i = 0; i < files.count(); i++) { |
280 | 280 | m_labels->insertItem( Opie::Core::OResource::loadPixmap("console/keys/" + files[i]), files[i]); | |
281 | m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]); | ||
282 | } | 281 | } |
283 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); | 282 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); |
284 | connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&))); | 283 | connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&))); |
285 | 284 | ||
286 | l = new QLabel(tr("Q Keycode", "Qt Key Code for the OnScreen Keyboard"), editKey); | 285 | l = new QLabel(tr("Q Keycode", "Qt Key Code for the OnScreen Keyboard"), editKey); |
287 | m_qvalues = new QComboBox(true, editKey); | 286 | m_qvalues = new QComboBox(true, editKey); |
288 | m_qvalues->setInsertionPolicy(QComboBox::AtTop); | 287 | m_qvalues->setInsertionPolicy(QComboBox::AtTop); |
289 | m_qvalues->setDuplicatesEnabled(false); | 288 | m_qvalues->setDuplicatesEnabled(false); |
290 | m_qvalues->insertItem(""); | 289 | m_qvalues->insertItem(""); |
291 | connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&))); | 290 | connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&))); |
292 | 291 | ||
293 | l = new QLabel(tr("Unicode Value", "The Unicode value of the key"), editKey); | 292 | l = new QLabel(tr("Unicode Value", "The Unicode value of the key"), editKey); |
@@ -319,25 +318,25 @@ void FunctionKeyboardConfig::load (const Profile& prof) { | |||
319 | 318 | ||
320 | QString h = "r" + QString::number(i) + "c" + QString::number(j); | 319 | QString h = "r" + QString::number(i) + "c" + QString::number(j); |
321 | QString values = prof.readEntry("keb_" + h); | 320 | QString values = prof.readEntry("keb_" + h); |
322 | 321 | ||
323 | if (!values.isEmpty()) { | 322 | if (!values.isEmpty()) { |
324 | 323 | ||
325 | QStringList l = QStringList::split(QChar('|'), values, TRUE); | 324 | QStringList l = QStringList::split(QChar('|'), values, TRUE); |
326 | kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); | 325 | kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); |
327 | 326 | ||
328 | // load pixmap if used | 327 | // load pixmap if used |
329 | if (!l[1].isEmpty()) { | 328 | if (!l[1].isEmpty()) { |
330 | 329 | ||
331 | kb->keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) ); | 330 | kb->keys[h].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + l[1] ) ); |
332 | } | 331 | } |
333 | } | 332 | } |
334 | } | 333 | } |
335 | 334 | ||
336 | } | 335 | } |
337 | void FunctionKeyboardConfig::save (Profile& prof) { | 336 | void FunctionKeyboardConfig::save (Profile& prof) { |
338 | 337 | ||
339 | prof.writeEntry("keb_rows", m_rowBox->value()); | 338 | prof.writeEntry("keb_rows", m_rowBox->value()); |
340 | prof.writeEntry("keb_cols", m_colBox->value()); | 339 | prof.writeEntry("keb_cols", m_colBox->value()); |
341 | 340 | ||
342 | QMap<QString, FKey>::Iterator it; | 341 | QMap<QString, FKey>::Iterator it; |
343 | for ( it = kb->keys.begin(); it != kb->keys.end(); it++) { | 342 | for ( it = kb->keys.begin(); it != kb->keys.end(); it++) { |
@@ -394,25 +393,25 @@ void FunctionKeyboardConfig::slotChangeIcon(int index) { | |||
394 | m_labels->setEditable(true); | 393 | m_labels->setEditable(true); |
395 | // why tf does the text get erased unless i do this? | 394 | // why tf does the text get erased unless i do this? |
396 | m_labels->changeItem(m_labels->text(0), 0); | 395 | m_labels->changeItem(m_labels->text(0), 0); |
397 | 396 | ||
398 | kb->keys[selectedHandle].pixFile = ""; | 397 | kb->keys[selectedHandle].pixFile = ""; |
399 | delete kb->keys[selectedHandle].pix; | 398 | delete kb->keys[selectedHandle].pix; |
400 | 399 | ||
401 | } else { | 400 | } else { |
402 | 401 | ||
403 | // is a pixmap | 402 | // is a pixmap |
404 | m_labels->setEditable(false); | 403 | m_labels->setEditable(false); |
405 | kb->keys[selectedHandle].pixFile = m_labels->currentText(); | 404 | kb->keys[selectedHandle].pixFile = m_labels->currentText(); |
406 | kb->keys[selectedHandle].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + m_labels->currentText() ) ); | 405 | kb->keys[selectedHandle].pix = new QPixmap( Opie::Core::OResource::loadPixmap( "console/keys/" + m_labels->currentText() ) ); |
407 | } | 406 | } |
408 | kb->paintKey(selectedRow, selectedCol); | 407 | kb->paintKey(selectedRow, selectedCol); |
409 | } | 408 | } |
410 | void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) { | 409 | void FunctionKeyboardConfig::slotChangeLabelText(const QString &label) { |
411 | 410 | ||
412 | kb->keys[selectedHandle].label = label; | 411 | kb->keys[selectedHandle].label = label; |
413 | 412 | ||
414 | kb->paintKey(selectedRow, selectedCol); | 413 | kb->paintKey(selectedRow, selectedCol); |
415 | } | 414 | } |
416 | void FunctionKeyboardConfig::slotChangeQCode(const QString& qcode) { | 415 | void FunctionKeyboardConfig::slotChangeQCode(const QString& qcode) { |
417 | 416 | ||
418 | kb->keys[selectedHandle].qcode = qcode.toUInt(); | 417 | kb->keys[selectedHandle].qcode = qcode.toUInt(); |