summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/function_keyboard.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/function_keyboard.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp
index 6613183..0abe0d9 100644
--- a/noncore/apps/opie-console/function_keyboard.cpp
+++ b/noncore/apps/opie-console/function_keyboard.cpp
@@ -1,18 +1,14 @@
1#include "function_keyboard.h" 1#include "function_keyboard.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */ 3/* QT */
8#include <qlayout.h> 4#include <qlayout.h>
9#include <qlistbox.h> 5#include <qlistbox.h>
10#include <qlabel.h> 6#include <qlabel.h>
11#include <qdir.h> 7#include <qdir.h>
12 8
13#define DEFAULT_ROWS 2 9#define DEFAULT_ROWS 2
14#define DEFAULT_COLS 12 10#define DEFAULT_COLS 12
15 11
16/* FunctionKeyboard {{{1 */ 12/* FunctionKeyboard {{{1 */
17 13
18FunctionKeyboard::FunctionKeyboard(QWidget *parent) : 14FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
@@ -33,25 +29,24 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
33 29
34 QString handle = "r" + QString::number(r) + "c" + QString::number(c); 30 QString handle = "r" + QString::number(r) + "c" + QString::number(c);
35 QStringList value_list = conf.readListEntry( handle, '|'); 31 QStringList value_list = conf.readListEntry( handle, '|');
36 32
37 if (value_list.isEmpty()) continue; 33 if (value_list.isEmpty()) continue;
38 34
39 keys.insert( 35 keys.insert(
40 36
41 handle, 37 handle,
42 FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) 38 FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort())
43 ); 39 );
44 } 40 }
45 //owarn << "loaded " << keys.count() << " keys" << oendl;
46 */ 41 */
47 if (keys.isEmpty()) loadDefaults(); 42 if (keys.isEmpty()) loadDefaults();
48 43
49 44
50 45
51} 46}
52 47
53FunctionKeyboard::~FunctionKeyboard() {} 48FunctionKeyboard::~FunctionKeyboard() {}
54 49
55void FunctionKeyboard::changeRows(int r) { 50void FunctionKeyboard::changeRows(int r) {
56 51
57 numRows = r; 52 numRows = r;
@@ -252,62 +247,59 @@ void FunctionKeyboard::loadDefaults() {
252 keys.insert( "r1c10", FKey ("F11", 0, 4154, 0)); 247 keys.insert( "r1c10", FKey ("F11", 0, 4154, 0));
253 keys.insert( "r1c11", FKey ("F12", 0, 4155, 0)); 248 keys.insert( "r1c11", FKey ("F12", 0, 4155, 0));
254 249
255 250
256} 251}
257 252
258/* FunctionKeyboardConfig {{{1 */ 253/* FunctionKeyboardConfig {{{1 */
259 254
260FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) 255FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na )
261 : ProfileDialogKeyWidget(name, parent, na), 256 : ProfileDialogKeyWidget(name, parent, na),
262 selectedRow(0), selectedCol(0) 257 selectedRow(0), selectedCol(0)
263{ 258{
264 owarn << "FunctionKeyboardConfig" << oendl;
265
266
267 kb = new FunctionKeyboard(this); 259 kb = new FunctionKeyboard(this);
268 connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), 260 connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)),
269 this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); 261 this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool)));
270 262
271 QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); 263 QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this);
272 QLabel *l = new QLabel("Rows", dimentions); 264 QLabel *l = new QLabel(tr("Rows"), dimentions);
273 m_rowBox = new QSpinBox(1, 15, 1, dimentions); 265 m_rowBox = new QSpinBox(1, 15, 1, dimentions);
274 connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); 266 connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int)));
275 l = new QLabel("Columns", dimentions); 267 l = new QLabel(tr("Columns"), dimentions);
276 m_colBox = new QSpinBox(1, 15, 1, dimentions); 268 m_colBox = new QSpinBox(1, 15, 1, dimentions);
277 connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); 269 connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int)));
278 270
279 QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); 271 QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this);
280 l = new QLabel("Label", editKey); 272 l = new QLabel(tr("Label"), editKey);
281 m_labels = new QComboBox(true, editKey); 273 m_labels = new QComboBox(true, editKey);
282 m_labels->setInsertionPolicy(QComboBox::AtCurrent); 274 m_labels->setInsertionPolicy(QComboBox::AtCurrent);
283 m_labels->insertItem(""); 275 m_labels->insertItem("");
284 276
285 QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); 277 QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList();
286 278
287 for (uint i = 0; i < files.count(); i++) { 279 for (uint i = 0; i < files.count(); i++) {
288 280
289 m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]); 281 m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]);
290 } 282 }
291 connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); 283 connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int)));
292 connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&))); 284 connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&)));
293 285
294 l = new QLabel("Q Keycode", editKey); 286 l = new QLabel(tr("Q Keycode", "Qt Key Code for the OnScreen Keyboard"), editKey);
295 m_qvalues = new QComboBox(true, editKey); 287 m_qvalues = new QComboBox(true, editKey);
296 m_qvalues->setInsertionPolicy(QComboBox::AtTop); 288 m_qvalues->setInsertionPolicy(QComboBox::AtTop);
297 m_qvalues->setDuplicatesEnabled(false); 289 m_qvalues->setDuplicatesEnabled(false);
298 m_qvalues->insertItem(""); 290 m_qvalues->insertItem("");
299 connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&))); 291 connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&)));
300 292
301 l = new QLabel("Unicode Value", editKey); 293 l = new QLabel(tr("Unicode Value", "The Unicode value of the key"), editKey);
302 m_uniValues = new QComboBox(true, editKey); 294 m_uniValues = new QComboBox(true, editKey);
303 m_uniValues->setInsertionPolicy(QComboBox::AtTop); 295 m_uniValues->setInsertionPolicy(QComboBox::AtTop);
304 m_uniValues->setDuplicatesEnabled(false); 296 m_uniValues->setDuplicatesEnabled(false);
305 m_uniValues->insertItem(""); 297 m_uniValues->insertItem("");
306 connect (m_uniValues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeUnicode(const QString&))); 298 connect (m_uniValues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeUnicode(const QString&)));
307 299
308 QVBoxLayout *root = new QVBoxLayout(this, 2); 300 QVBoxLayout *root = new QVBoxLayout(this, 2);
309 root->addWidget(kb); 301 root->addWidget(kb);
310 root->addWidget(dimentions); 302 root->addWidget(dimentions);
311 root->addWidget(editKey); 303 root->addWidget(editKey);
312} 304}
313FunctionKeyboardConfig::~FunctionKeyboardConfig() { 305FunctionKeyboardConfig::~FunctionKeyboardConfig() {