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.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index eb32551..6613183 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -1,14 +1,19 @@ | |||
1 | #include "function_keyboard.h" | 1 | #include "function_keyboard.h" |
2 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
3 | #include <qlayout.h> | 8 | #include <qlayout.h> |
4 | #include <qlistbox.h> | 9 | #include <qlistbox.h> |
5 | #include <qlabel.h> | 10 | #include <qlabel.h> |
6 | #include <qdir.h> | 11 | #include <qdir.h> |
7 | 12 | ||
8 | #define DEFAULT_ROWS 2 | 13 | #define DEFAULT_ROWS 2 |
9 | #define DEFAULT_COLS 12 | 14 | #define DEFAULT_COLS 12 |
10 | 15 | ||
11 | /* FunctionKeyboard {{{1 */ | 16 | /* FunctionKeyboard {{{1 */ |
12 | 17 | ||
13 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | 18 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : |
14 | QFrame(parent), numRows(DEFAULT_ROWS), numCols(DEFAULT_COLS), | 19 | QFrame(parent), numRows(DEFAULT_ROWS), numCols(DEFAULT_COLS), |
@@ -28,25 +33,25 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | |||
28 | 33 | ||
29 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); | 34 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); |
30 | QStringList value_list = conf.readListEntry( handle, '|'); | 35 | QStringList value_list = conf.readListEntry( handle, '|'); |
31 | 36 | ||
32 | if (value_list.isEmpty()) continue; | 37 | if (value_list.isEmpty()) continue; |
33 | 38 | ||
34 | keys.insert( | 39 | keys.insert( |
35 | 40 | ||
36 | handle, | 41 | handle, |
37 | FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) | 42 | FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) |
38 | ); | 43 | ); |
39 | } | 44 | } |
40 | //qWarning("loaded %d keys", keys.count()); | 45 | //owarn << "loaded " << keys.count() << " keys" << oendl; |
41 | */ | 46 | */ |
42 | if (keys.isEmpty()) loadDefaults(); | 47 | if (keys.isEmpty()) loadDefaults(); |
43 | 48 | ||
44 | 49 | ||
45 | 50 | ||
46 | } | 51 | } |
47 | 52 | ||
48 | FunctionKeyboard::~FunctionKeyboard() {} | 53 | FunctionKeyboard::~FunctionKeyboard() {} |
49 | 54 | ||
50 | void FunctionKeyboard::changeRows(int r) { | 55 | void FunctionKeyboard::changeRows(int r) { |
51 | 56 | ||
52 | numRows = r; | 57 | numRows = r; |
@@ -247,25 +252,25 @@ void FunctionKeyboard::loadDefaults() { | |||
247 | keys.insert( "r1c10", FKey ("F11", 0, 4154, 0)); | 252 | keys.insert( "r1c10", FKey ("F11", 0, 4154, 0)); |
248 | keys.insert( "r1c11", FKey ("F12", 0, 4155, 0)); | 253 | keys.insert( "r1c11", FKey ("F12", 0, 4155, 0)); |
249 | 254 | ||
250 | 255 | ||
251 | } | 256 | } |
252 | 257 | ||
253 | /* FunctionKeyboardConfig {{{1 */ | 258 | /* FunctionKeyboardConfig {{{1 */ |
254 | 259 | ||
255 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) | 260 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) |
256 | : ProfileDialogKeyWidget(name, parent, na), | 261 | : ProfileDialogKeyWidget(name, parent, na), |
257 | selectedRow(0), selectedCol(0) | 262 | selectedRow(0), selectedCol(0) |
258 | { | 263 | { |
259 | qWarning("FunctionKeyboardConfig"); | 264 | owarn << "FunctionKeyboardConfig" << oendl; |
260 | 265 | ||
261 | 266 | ||
262 | kb = new FunctionKeyboard(this); | 267 | kb = new FunctionKeyboard(this); |
263 | connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), | 268 | connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), |
264 | this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); | 269 | this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); |
265 | 270 | ||
266 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); | 271 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); |
267 | QLabel *l = new QLabel("Rows", dimentions); | 272 | QLabel *l = new QLabel("Rows", dimentions); |
268 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); | 273 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); |
269 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); | 274 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); |
270 | l = new QLabel("Columns", dimentions); | 275 | l = new QLabel("Columns", dimentions); |
271 | m_colBox = new QSpinBox(1, 15, 1, dimentions); | 276 | m_colBox = new QSpinBox(1, 15, 1, dimentions); |