author | hash <hash> | 2002-08-19 07:21:51 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-19 07:21:51 (UTC) |
commit | 9cc94030d7f6a04b79da8db83e6c609c1580a3d3 (patch) (side-by-side diff) | |
tree | b7c0fbc543d633ec9bd0f9d2ef762ebb92b2da55 /inputmethods | |
parent | 64a00421be85d223072e087d4d3c9ecdad464095 (diff) | |
download | opie-9cc94030d7f6a04b79da8db83e6c609c1580a3d3.zip opie-9cc94030d7f6a04b79da8db83e6c609c1580a3d3.tar.gz opie-9cc94030d7f6a04b79da8db83e6c609c1580a3d3.tar.bz2 |
parses dir and also lets you add/remove maps located in other places
-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 2 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index a6e4dad..ac132d3 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp @@ -155,48 +155,50 @@ void ConfigDlg::pickTog() { config.writeEntry ("open", pick_button->isChecked()); // default closed emit pickboardToggled(pick_button->isChecked()); } /* * the index is kinda screwy, because in the config file, index 0 is just the * first element in the QStringList, but here it's the "Current Language" * listItem. therefor you have to minus one to the index before you access it. * */ void ConfigDlg::setMap(int index) { if (index == 0) { remove_button->setDisabled(true); emit setMapToDefault(); } else if ((uint)index <= default_maps.count()) { remove_button->setDisabled(true); + emit setMapToFile(keymaps->text(index)); + } else { remove_button->setEnabled(true); emit setMapToFile(keymaps->text(index)); } } void ConfigDlg::addMap() { QString map = OFileDialog::getOpenFileName(1, QDir::home().absPath()); Config config ("multikey"); config.setGroup("keymaps"); QStringList maps = config.readListEntry("maps", QChar('|')); maps.append(map); keymaps->insertItem(map); keymaps->setSelected(keymaps->count() - 1, true); config.writeEntry("maps", maps.join("|")); config.writeEntry("current", map); } diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index 805f0ed..8c4e666 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h @@ -48,49 +48,49 @@ public: virtual QSize sizeHint() const; KeyboardConfig *dc; }; class Keys { public: Keys(); Keys(const char * filename); ~Keys(); ushort uni(const int row, const int col); int qcode(const int row, const int col); int width(const int row, const int col); bool pressed(const int row, const int col); bool *pressedPtr(const int row, const int col); ushort shift(const ushort); QPixmap *pix(const int row, const int col); int numKeys(const int row); void setKeysFromFile(const char *filename); void setKey(const int row, const int qcode, const ushort unicode, const int width, QPixmap *pix); void setPressed(const int row, const int col, const bool pressed); QString lang; - QString title; + QString label; private: typedef struct Key { int qcode; // are qt key codes just unicode values? ushort unicode; int width; // not pixels but relative key width. normal key is 2 // only needed for keys like ctrl that can have multiple keys pressed at once bool *pressed; QPixmap *pix; }; QList<Key> keys[6]; QMap<ushort,ushort> shiftMap; }; class Keyboard : public QFrame { Q_OBJECT public: Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); ~Keyboard(); |