author | hash <hash> | 2002-10-24 06:17:03 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-24 06:17:03 (UTC) |
commit | 2183d2b20cf6eb9144a616a3f8242a7eb585c557 (patch) (unidiff) | |
tree | 58cb46e892c243bfbf0c39cd0ffd62f2beedb339 | |
parent | bdd884e37dc1ee1969d317b29e926768ea5a14df (diff) | |
download | opie-2183d2b20cf6eb9144a616a3f8242a7eb585c557.zip opie-2183d2b20cf6eb9144a616a3f8242a7eb585c557.tar.gz opie-2183d2b20cf6eb9144a616a3f8242a7eb585c557.tar.bz2 |
didnt merge with previous updates properly
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index 71cdea8..9d58383 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -151,106 +151,101 @@ void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { | |||
151 | paintKey(row, col); | 151 | paintKey(row, col); |
152 | 152 | ||
153 | FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; | 153 | FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; |
154 | emit keyPressed(k, row, col, 0); | 154 | emit keyPressed(k, row, col, 0); |
155 | } | 155 | } |
156 | 156 | ||
157 | } | 157 | } |
158 | 158 | ||
159 | 159 | ||
160 | void FunctionKeyboard::resizeEvent(QResizeEvent*) { | 160 | void FunctionKeyboard::resizeEvent(QResizeEvent*) { |
161 | 161 | ||
162 | /* set he default font height/width */ | 162 | /* set he default font height/width */ |
163 | QFontMetrics fm=fontMetrics(); | 163 | QFontMetrics fm=fontMetrics(); |
164 | keyHeight = fm.lineSpacing() + 2; | 164 | keyHeight = fm.lineSpacing() + 2; |
165 | keyWidth = (double)width()/numCols; | 165 | keyWidth = (double)width()/numCols; |
166 | 166 | ||
167 | } | 167 | } |
168 | 168 | ||
169 | QSize FunctionKeyboard::sizeHint() const { | 169 | QSize FunctionKeyboard::sizeHint() const { |
170 | 170 | ||
171 | return QSize(width(), keyHeight * numRows + 1); | 171 | return QSize(width(), keyHeight * numRows + 1); |
172 | } | 172 | } |
173 | 173 | ||
174 | void FunctionKeyboard::loadDefaults() { | 174 | void FunctionKeyboard::loadDefaults() { |
175 | 175 | ||
176 | /* what keys should be default? | 176 | /* what keys should be default? |
177 | keys.insert( "r0c0", FKey ("F1", 0, 4144, 0)); | 177 | keys.insert( "r0c0", FKey ("F1", 0, 4144, 0)); |
178 | keys.insert( "r0c1", FKey ("F2", 0, 4145, 0)); | 178 | keys.insert( "r0c1", FKey ("F2", 0, 4145, 0)); |
179 | keys.insert( "r0c2", FKey ("F3", 0, 4146, 0)); | 179 | keys.insert( "r0c2", FKey ("F3", 0, 4146, 0)); |
180 | keys.insert( "r0c3", FKey ("F4", 0, 4147, 0)); | 180 | keys.insert( "r0c3", FKey ("F4", 0, 4147, 0)); |
181 | keys.insert( "r0c4", FKey ("F5", 0, 4148, 0)); | 181 | keys.insert( "r0c4", FKey ("F5", 0, 4148, 0)); |
182 | keys.insert( "r0c5", FKey ("F6", 0, 4149, 0)); | 182 | keys.insert( "r0c5", FKey ("F6", 0, 4149, 0)); |
183 | keys.insert( "r0c6", FKey ("F7", 0, 4150, 0)); | 183 | keys.insert( "r0c6", FKey ("F7", 0, 4150, 0)); |
184 | keys.insert( "r0c7", FKey ("F8", 0, 4151, 0)); | 184 | keys.insert( "r0c7", FKey ("F8", 0, 4151, 0)); |
185 | keys.insert( "r0c8", FKey ("F9", 0, 4152, 0)); | 185 | keys.insert( "r0c8", FKey ("F9", 0, 4152, 0)); |
186 | keys.insert( "r0c9", FKey ("F10", 0, 4153, 0)); | 186 | keys.insert( "r0c9", FKey ("F10", 0, 4153, 0)); |
187 | keys.insert( "r0c10", FKey ("F11", 0, 4154, 0)); | 187 | keys.insert( "r0c10", FKey ("F11", 0, 4154, 0)); |
188 | 188 | ||
189 | keys.insert( "r1c7", FKey ("Ho", 0, 4112, 0)); | 189 | keys.insert( "r1c7", FKey ("Ho", 0, 4112, 0)); |
190 | keys.insert( "r1c8", FKey ("End", 0, 4113, 0)); | 190 | keys.insert( "r1c8", FKey ("End", 0, 4113, 0)); |
191 | keys.insert( "r1c9", FKey ("PU", 0, 4118, 0)); | 191 | keys.insert( "r1c9", FKey ("PU", 0, 4118, 0)); |
192 | keys.insert( "r1c10", FKey ("PD", 0, 4119, 0)); | 192 | keys.insert( "r1c10", FKey ("PD", 0, 4119, 0)); |
193 | */ | 193 | */ |
194 | 194 | ||
195 | } | 195 | } |
196 | 196 | ||
197 | /* FunctionKeyboardConfig {{{1 */ | 197 | /* FunctionKeyboardConfig {{{1 */ |
198 | 198 | ||
199 | <<<<<<< function_keyboard.cpp | 199 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) |
200 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : | 200 | : ProfileDialogKeyWidget(name, parent, na), |
201 | ProfileDialogKeyWidget(name, parent), | ||
202 | selectedRow(0), selectedCol(0) | 201 | selectedRow(0), selectedCol(0) |
203 | { | 202 | { |
204 | ======= | ||
205 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) | ||
206 | : ProfileDialogKeyWidget(name, parent, na) { | ||
207 | qWarning("FunctionKeyboardConfig"); | 203 | qWarning("FunctionKeyboardConfig"); |
208 | >>>>>>> 1.11 | ||
209 | 204 | ||
210 | 205 | ||
211 | kb = new FunctionKeyboard(this); | 206 | kb = new FunctionKeyboard(this); |
212 | connect (kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), | 207 | connect (kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), |
213 | this, SLOT(slotKeyPressed(FKey, ushort, ushort, bool))); | 208 | this, SLOT(slotKeyPressed(FKey, ushort, ushort, bool))); |
214 | 209 | ||
215 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); | 210 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); |
216 | QLabel *l = new QLabel("Rows", dimentions); | 211 | QLabel *l = new QLabel("Rows", dimentions); |
217 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); | 212 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); |
218 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); | 213 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); |
219 | l = new QLabel("Columns", dimentions); | 214 | l = new QLabel("Columns", dimentions); |
220 | m_colBox = new QSpinBox(1, 15, 1, dimentions); | 215 | m_colBox = new QSpinBox(1, 15, 1, dimentions); |
221 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); | 216 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); |
222 | 217 | ||
223 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); | 218 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); |
224 | l = new QLabel("Label", editKey); | 219 | l = new QLabel("Label", editKey); |
225 | m_labels = new QComboBox(true, editKey); | 220 | m_labels = new QComboBox(true, editKey); |
226 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); | 221 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); |
227 | m_labels->insertItem("custom"); | 222 | m_labels->insertItem("custom"); |
228 | 223 | ||
229 | QStringList files = QDir(QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); | 224 | QStringList files = QDir(QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); |
230 | 225 | ||
231 | for (uint i = 0; i < files.count(); i++) { | 226 | for (uint i = 0; i < files.count(); i++) { |
232 | 227 | ||
233 | m_labels->insertItem(Resource::loadPixmap("console/keys/" + files[i])); | 228 | m_labels->insertItem(Resource::loadPixmap("console/keys/" + files[i])); |
234 | } | 229 | } |
235 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); | 230 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); |
236 | connect (m_labels, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeLabelText(const QString&))); | 231 | connect (m_labels, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeLabelText(const QString&))); |
237 | 232 | ||
238 | l = new QLabel("KeyValue", editKey); | 233 | l = new QLabel("KeyValue", editKey); |
239 | m_qvalues = new QComboBox(false, editKey); | 234 | m_qvalues = new QComboBox(false, editKey); |
240 | m_qvalues->setInsertionPolicy(QComboBox::AtCurrent); | 235 | m_qvalues->setInsertionPolicy(QComboBox::AtCurrent); |
241 | m_qvalues->insertItem("custom"); | 236 | m_qvalues->insertItem("custom"); |
242 | 237 | ||
243 | QVBoxLayout *root = new QVBoxLayout(this, 2); | 238 | QVBoxLayout *root = new QVBoxLayout(this, 2); |
244 | root->addWidget(kb); | 239 | root->addWidget(kb); |
245 | root->addWidget(dimentions); | 240 | root->addWidget(dimentions); |
246 | root->addWidget(editKey); | 241 | root->addWidget(editKey); |
247 | } | 242 | } |
248 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { | 243 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { |
249 | 244 | ||
250 | } | 245 | } |
251 | void FunctionKeyboardConfig::load (const Profile& prof) { | 246 | void FunctionKeyboardConfig::load (const Profile& prof) { |
252 | 247 | ||
253 | m_rowBox->setValue(prof.readNumEntry("keb_rows", 2)); | 248 | m_rowBox->setValue(prof.readNumEntry("keb_rows", 2)); |
254 | m_colBox->setValue(prof.readNumEntry("keb_cols", 10)); | 249 | m_colBox->setValue(prof.readNumEntry("keb_cols", 10)); |
255 | 250 | ||
256 | /* load all the keys to the keyboard */ | 251 | /* load all the keys to the keyboard */ |