author | hash <hash> | 2002-10-20 14:04:33 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-20 14:04:33 (UTC) |
commit | 6924185b50abfa448daa16a9f7cb6e532ec77ff9 (patch) (unidiff) | |
tree | cd00862fc27c3739e7658e6dfaa39624197d8452 /noncore/apps/opie-console/function_keyboard.cpp | |
parent | 97be4ef8e0579791095b2383e942cc53dd1e7fba (diff) | |
download | opie-6924185b50abfa448daa16a9f7cb6e532ec77ff9.zip opie-6924185b50abfa448daa16a9f7cb6e532ec77ff9.tar.gz opie-6924185b50abfa448daa16a9f7cb6e532ec77ff9.tar.bz2 |
added preliminary support for configuring the keyboard for each profile.
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 | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index 4119ad4..fd20e99 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <qevent.h> | 3 | #include <qevent.h> |
4 | #include <qwindowsystem_qws.h> | 4 | #include <qwindowsystem_qws.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <qlayout.h> | ||
6 | 7 | ||
7 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | 8 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : |
8 | QFrame(parent), numRows(2), numCols(11), | 9 | QFrame(parent), numRows(2), numCols(11), |
@@ -12,8 +13,8 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | |||
12 | 13 | ||
13 | Config conf("opie-console-keys"); | 14 | Config conf("opie-console-keys"); |
14 | conf.setGroup("keys"); | 15 | conf.setGroup("keys"); |
15 | for (int r = 0; r < numRows; r++) | 16 | for (uint r = 0; r < numRows; r++) |
16 | for (int c = 0; c < numCols; c++) { | 17 | for (uint c = 0; c < numCols; c++) { |
17 | 18 | ||
18 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); | 19 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); |
19 | QStringList value_list = conf.readListEntry( handle, '|'); | 20 | QStringList value_list = conf.readListEntry( handle, '|'); |
@@ -59,8 +60,8 @@ void FunctionKeyboard::paintEvent(QPaintEvent *e) { | |||
59 | p.drawLine(0, i, width(), i); | 60 | p.drawLine(0, i, width(), i); |
60 | } | 61 | } |
61 | 62 | ||
62 | for (int r = 0; r < numRows; r++) { | 63 | for (uint r = 0; r < numRows; r++) { |
63 | for (int c = 0; c < numCols; c++) { | 64 | for (uint c = 0; c < numCols; c++) { |
64 | 65 | ||
65 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); | 66 | QString handle = "r" + QString::number(r) + "c" + QString::number(c); |
66 | if (keys.contains(handle)) { | 67 | if (keys.contains(handle)) { |
@@ -155,3 +156,27 @@ void FunctionKeyboard::loadDefaults() { | |||
155 | keys.insert( "r1c10", FKey ("PD", 4119, 0)); | 156 | keys.insert( "r1c10", FKey ("PD", 4119, 0)); |
156 | 157 | ||
157 | } | 158 | } |
159 | |||
160 | |||
161 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : | ||
162 | ProfileDialogKeyWidget(name, parent) { | ||
163 | |||
164 | |||
165 | FunctionKeyboard *kb = new FunctionKeyboard(this); | ||
166 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); | ||
167 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit"), this); | ||
168 | |||
169 | QVBoxLayout *root = new QVBoxLayout(this, 2); | ||
170 | root->addWidget(kb); | ||
171 | root->addWidget(dimentions); | ||
172 | root->addWidget(editKey); | ||
173 | } | ||
174 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { | ||
175 | |||
176 | } | ||
177 | void FunctionKeyboardConfig::load (const Profile& prof) { | ||
178 | |||
179 | } | ||
180 | void FunctionKeyboardConfig::save (Profile& prof) { | ||
181 | |||
182 | } | ||