Version: 0.8.3 (using KDE KDE 3.5.0) Installed from: SuSE RPMs OS: Linux Normally, when I typed in new vocabulary, the keyboard-layout sets automatically (German <=> Czech) when I began to type something in the column. Now I updated from KDE 3.4.2 to 3.5, this feature doesn't function any more. So I looked into the settings: the set languages were away. So I deleted the empty entries and inserted new languages from the KDE-language-database. However, I cannot set the keyboard-layout... this way the layout cannot be changed automatically when changing to the column of the foreign language... Would be nice, if this is fixed soon. ;-) Thanks!
SVN commit 487802 by hedlund: Make keyboard layout switching work again. BUG:117391 CCMAIL:kde-edu@kde.org M +49 -22 kvoctraintable.cpp M +3 -2 kvoctraintable.h --- branches/KDE/3.5/kdeedu/kvoctrain/kvoctrain/kvoctraintable.cpp #487801:487802 @@ -66,6 +66,8 @@ QHeader *header = horizontalHeader(); connect(header, SIGNAL(pressed(int)), this, SLOT(headerPressEvent(int))); connect(header, SIGNAL(released(int)), this, SLOT(headerReleaseEvent(int))); + + connect(this, SIGNAL(currentChanged(int, int)), this, SLOT(slotCurrentChanged(int, int))); } @@ -73,28 +75,30 @@ { setCurrentRow(row, currentColumn()); } - +/* QWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) { - if (KApplication::dcopClient()->isApplicationRegistered("kxkb")) { + if (KApplication::dcopClient()->isApplicationRegistered("kxkb")) + { + if (m_doc) + { + QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); - if (m_doc) { - QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() - : m_doc->getIdent(col - KV_EXTRA_COLS); - - if (langs) { + if (langs) + { QString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); - if (!kbLayout.isEmpty()) { + kdDebug() << "Keyboard Layout: " << kbLayout << endl; + if (!kbLayout.isEmpty()) + { QByteArray data, replyData; QCString replyType; QDataStream arg(data, IO_WriteOnly); arg << kbLayout; - if (!KApplication::dcopClient()->call("kxkb", "kxkb", - "setLayout(QString)", - data, replyType, replyData)) { - kdDebug() << "kskb dcop error" << endl; - } + if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(QString)", data, replyType, replyData)) + { + kdDebug() << "kxkb dcop error: beginEdit()" << endl; + } } } } @@ -104,17 +108,9 @@ void KVocTrainTable::endEdit(int row, int col, bool accept, bool replace) { -// if (KApplication::dcopClient()->isApplicationRegistered("kxkb")) { -// QByteArray data, replyData; -// QCString replyType; - -// if (!KApplication::dcopClient()->call("kxkb", "kxkb", -// "setLayout(QString)", -// data, replyType, replyData)) { -// } QTable::endEdit(row, col, accept, replace); } - +*/ void KVocTrainTable::sortByColumn(int header, bool alpha) { if (header == KV_COL_MARK) return; @@ -569,4 +565,35 @@ } +void KVocTrainTable::slotCurrentChanged(int row, int col) +{ + Q_UNUSED(row); + if (KApplication::dcopClient()->isApplicationRegistered("kxkb")) + { + if (m_doc) + { + QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); + + if (langs) + { + QString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); + //kdDebug() << "Keyboard Layout: " << kbLayout << endl; + if (!kbLayout.isEmpty()) + { + QByteArray data, replyData; + QCString replyType; + QDataStream arg(data, IO_WriteOnly); + arg << kbLayout; + + if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(QString)", data, replyType, replyData)) + { + kdDebug() << "kxkb dcop error: beginEdit()" << endl; + } + } + } + } + } + +} + #include "kvoctraintable.moc" --- branches/KDE/3.5/kdeedu/kvoctrain/kvoctrain/kvoctraintable.h #487801:487802 @@ -71,6 +71,7 @@ void sortByColumn_alpha(int index); void sortByColumn_index(int index); void slotSelectionChanged(); + void slotCurrentChanged(int, int); protected slots: void menuTriggerTimeout(); @@ -79,8 +80,8 @@ protected: int current; - QWidget* beginEdit(int row, int col, bool replace); - void endEdit(int row, int col, bool accept, bool replace); + //QWidget* beginEdit(int row, int col, bool replace); + //void endEdit(int row, int col, bool accept, bool replace); void paintCell(QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg); void setItem(int row, int col, QTableItem * item); QTableItem* item (int row, int col) const;