summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/function_keyboard.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/function_keyboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp9
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,64 +1,69 @@
#include "function_keyboard.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qlayout.h>
#include <qlistbox.h>
#include <qlabel.h>
#include <qdir.h>
#define DEFAULT_ROWS 2
#define DEFAULT_COLS 12
/* FunctionKeyboard {{{1 */
FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
QFrame(parent), numRows(DEFAULT_ROWS), numCols(DEFAULT_COLS),
pressedRow(0), pressedCol(0) {
setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
/*
* all the saving/loading is now done in a profile. downside is that you cant modify
* the keyboard for all profiles, but must do it on a profile-basis
*
Config conf("opie-console-keys");
conf.setGroup("keys");
for (uint r = 0; r < numRows; r++)
for (uint c = 0; c < numCols; c++) {
QString handle = "r" + QString::number(r) + "c" + QString::number(c);
QStringList value_list = conf.readListEntry( handle, '|');
if (value_list.isEmpty()) continue;
keys.insert(
handle,
FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort())
);
}
- //qWarning("loaded %d keys", keys.count());
+ //owarn << "loaded " << keys.count() << " keys" << oendl;
*/
if (keys.isEmpty()) loadDefaults();
}
FunctionKeyboard::~FunctionKeyboard() {}
void FunctionKeyboard::changeRows(int r) {
numRows = r;
// have to do this so the whole thing gets redrawn
hide(); show();
}
void FunctionKeyboard::changeCols(int c) {
numCols = c;
keyWidth = (double)width()/numCols; // have to reset this thing too
repaint(false);
}
void FunctionKeyboard::load (const Profile& prof) {
@@ -235,49 +240,49 @@ void FunctionKeyboard::loadDefaults() {
keys.insert( "r0c11", FKey ("Esc", 0, Qt::Key_Escape, 0xfff));
keys.insert( "r1c0", FKey ("F1", 0, 4144, 0));
keys.insert( "r1c1", FKey ("F2", 0, 4145, 0));
keys.insert( "r1c2", FKey ("F3", 0, 4146, 0));
keys.insert( "r1c3", FKey ("F4", 0, 4147, 0));
keys.insert( "r1c4", FKey ("F5", 0, 4148, 0));
keys.insert( "r1c5", FKey ("F6", 0, 4149, 0));
keys.insert( "r1c6", FKey ("F7", 0, 4150, 0));
keys.insert( "r1c7", FKey ("F8", 0, 4151, 0));
keys.insert( "r1c8", FKey ("F9", 0, 4152, 0));
keys.insert( "r1c9", FKey ("F10", 0, 4153, 0));
keys.insert( "r1c10", FKey ("F11", 0, 4154, 0));
keys.insert( "r1c11", FKey ("F12", 0, 4155, 0));
}
/* FunctionKeyboardConfig {{{1 */
FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na )
: ProfileDialogKeyWidget(name, parent, na),
selectedRow(0), selectedCol(0)
{
- qWarning("FunctionKeyboardConfig");
+ owarn << "FunctionKeyboardConfig" << oendl;
kb = new FunctionKeyboard(this);
connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)),
this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool)));
QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this);
QLabel *l = new QLabel("Rows", dimentions);
m_rowBox = new QSpinBox(1, 15, 1, dimentions);
connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int)));
l = new QLabel("Columns", dimentions);
m_colBox = new QSpinBox(1, 15, 1, dimentions);
connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int)));
QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this);
l = new QLabel("Label", editKey);
m_labels = new QComboBox(true, editKey);
m_labels->setInsertionPolicy(QComboBox::AtCurrent);
m_labels->insertItem("");
QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList();
for (uint i = 0; i < files.count(); i++) {