-rw-r--r-- | inputmethods/multikey/config.in | 2 | ||||
-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 13 | ||||
-rw-r--r-- | inputmethods/multikey/multikey.pro | 2 | ||||
-rw-r--r-- | inputmethods/multikey/opie-multikey.control | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/inputmethods/multikey/config.in b/inputmethods/multikey/config.in index 4eeb326..dd3192b 100644 --- a/inputmethods/multikey/config.in +++ b/inputmethods/multikey/config.in @@ -1,4 +1,4 @@ config MULTIKEY boolean "opie-multikey (OnScreen keyboard for multiple languages)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && PICKBOARD && LIBQTAUX && LIBOPIE2UI + depends ( LIBQPE || LIBQPE-X11 ) && PICKBOARD && LIBQTAUX && LIBOPIE2CORE && LIBOPIE2UI diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index fe5051d..52c498b 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp @@ -1,168 +1,171 @@ /* * TODO * make a font selection thing (size too) * make a keymap editor * make keys translucent * make vertical keys possible * * */ +#include <opie2/ofiledialog.h> +#include <opie2/qcolordialog.h> +#include <opie2/oresource.h> + #include <qpe/qpeapplication.h> #include <qpe/config.h> -#include <qpe/resource.h> #include <qlayout.h> #include <qwidget.h> #include <qdialog.h> #include <qtabwidget.h> #include <qvbox.h> #include <qgrid.h> #include <qgroupbox.h> #include <qlabel.h> #include <qcheckbox.h> #include <qsizepolicy.h> #include <qpushbutton.h> #include <qlistbox.h> #include <qstringlist.h> #include <qtoolbutton.h> -#include <opie2/ofiledialog.h> -#include <opie2/qcolordialog.h> #include <qdir.h> #include <qfileinfo.h> #include "configdlg.h" #include "keyboard.h" using namespace Opie; using namespace Opie::Ui; // ConfigDlg::ConfigDlg() {{{1 ConfigDlg::ConfigDlg () : QDialog () { setCaption( tr("Multikey Configuration") ); Config config ("multikey"); config.setGroup("keymaps"); QString current_map = config.readEntry("current", 0); /* * 'general config' tab */ QVBoxLayout *base_lay = new QVBoxLayout(this); QTabWidget *tabs = new QTabWidget(this, "tabs"); QWidget *gen_box = new QWidget(tabs, "gen_tab"); QVBoxLayout *gen_lay = new QVBoxLayout(gen_box); gen_lay->setMargin(3); QGroupBox *map_group = new QGroupBox (2, Qt::Vertical, tr("Keymap File"), gen_box); QHBox *hbox1 = new QHBox(map_group); keymaps = new QListBox(hbox1); keymaps->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); QVBox *vbox1 = new QVBox(hbox1); QToolButton *tb1 = new QToolButton(vbox1, tr("Move Up")); - tb1->setPixmap(Resource::loadPixmap("up")); + tb1->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); + tb1->setPixmap(Opie::Core::OResource::loadPixmap("up", Opie::Core::OResource::SmallIcon)); tb1->setAutoRaise(TRUE); tb1->setFocusPolicy(QWidget::NoFocus); tb1->setToggleButton(FALSE); connect(tb1, SIGNAL(clicked()), this, SLOT(moveSelectedUp())); QToolButton *tb2 = new QToolButton(vbox1, tr("Move Down")); - tb2->setPixmap(Resource::loadPixmap("down")); + tb2->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); + tb2->setPixmap(Opie::Core::OResource::loadPixmap("down", Opie::Core::OResource::SmallIcon)); tb2->setAutoRaise(TRUE); tb2->setFocusPolicy(QWidget::NoFocus); tb2->setToggleButton(FALSE); connect(tb2, SIGNAL(clicked()), this, SLOT(moveSelectedDown())); QString cur(tr("Current Language")); keymaps->insertItem(cur); keymaps->setSelected(0, true); QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); default_maps = map_dir.entryList(); // so i can access it in other places custom_maps = config.readListEntry("maps", QChar('|')); sw_maps = ConfigDlg::loadSw(); QStringList sw_copy(sw_maps); for (uint i = 0; i < sw_copy.count(); i++) { QString keymap_map; if (sw_copy[i][0] != '/') { /* share/multikey */ keymap_map = map_dir.absPath() + "/" + sw_copy[i]; } else { if (map_dir.exists(QFileInfo(sw_copy[i]).fileName(), false) || !QFile::exists(sw_copy[i])) { custom_maps.remove(sw_copy[i]); sw_maps.remove(sw_copy[i]); // remove it from the list too config.writeEntry("maps", custom_maps.join("|")); continue; } keymap_map = sw_copy[i]; } QFile map(keymap_map); if (map.open(IO_ReadOnly)) { QString line; bool found = 0; map.readLine(line, 1024); while (!map.atEnd()) { if (line.find(QRegExp("^title\\s*=\\s*")) != -1) { keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace()); found = 1; break; } map.readLine(line, 1024); } if (!found) keymaps->insertItem(keymap_map); map.close(); } if (keymap_map == current_map) { keymaps->setSelected(i + 1, true); } } // have to "+1" because the "current language" listItem... remember? connect(keymaps, SIGNAL(highlighted(int)), SLOT(setMap(int))); QGrid *add_remove_grid = new QGrid(2, map_group); add_remove_grid->setMargin(3); add_remove_grid->setSpacing(3); add_button = new QPushButton(tr("Add"), add_remove_grid); add_button->setFlat(TRUE); connect(add_button, SIGNAL(clicked()), SLOT(addMap())); remove_button = new QPushButton(tr("Remove"), add_remove_grid); remove_button->setFlat(TRUE); if (keymaps->currentItem() == 0 || default_maps.find(QFileInfo(current_map).fileName()) != default_maps.end()) remove_button->setDisabled(true); connect(remove_button, SIGNAL(clicked()), SLOT(removeMap())); gen_lay->addWidget(map_group); // make a box that will contain the buttons on the bottom QGrid *other_grid = new QGrid(2, gen_box); pick_button = new QCheckBox(tr("Pickboard"), other_grid); config.setGroup ("general"); bool pick_open = config.readBoolEntry ("usePickboard", FALSE); // default closed if (pick_open) { pick_button->setChecked(true); } repeat_button = new QCheckBox(tr("Key Repeat"), other_grid); bool repeat_on = config.readBoolEntry ("useRepeat", TRUE); diff --git a/inputmethods/multikey/multikey.pro b/inputmethods/multikey/multikey.pro index 3fd621f..4ad1923 100644 --- a/inputmethods/multikey/multikey.pro +++ b/inputmethods/multikey/multikey.pro @@ -1,18 +1,18 @@ TEMPLATE = lib CONFIG += qt plugin warn_on release HEADERS = keyboard.h \ configdlg.h \ keyboardimpl.h SOURCES = keyboard.cpp \ configdlg.cpp \ keyboardimpl.cpp TARGET = qmultikey DESTDIR = $(OPIEDIR)/plugins/inputmethods INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += ../../launcher -LIBS += -lqpe -L$(OPIEDIR)/plugins/inputmethods -lqpickboard -lqtaux2 -lopieui2 +LIBS += -lqpe -L$(OPIEDIR)/plugins/inputmethods -lqpickboard -lqtaux2 -lopiecore2 -lopieui2 QMAKE_LFLAGS += -Wl,-rpath,/opt/QtPalmtop/plugins/inputmethods VERSION = 1.0.0 include( $(OPIEDIR)/include.pro ) target.path = $$prefix/plugins/inputmethods diff --git a/inputmethods/multikey/opie-multikey.control b/inputmethods/multikey/opie-multikey.control index 5a5ce77..fc7d56c 100644 --- a/inputmethods/multikey/opie-multikey.control +++ b/inputmethods/multikey/opie-multikey.control @@ -1,10 +1,10 @@ Package: opie-multikey Files: plugins/inputmethods/libqmultikey.so* share/multikey/* Priority: optional Section: opie/inputmethods Maintainer: Jake Richardson (jake@asdfnews.org) Architecture: arm -Depends: task-opie-minimal, opie-pickboard, libqtaux2 +Depends: task-opie-minimal, opie-pickboard, libqtaux2, libopiecore2, libopieui2 Description: Multiple language keyboard Keyboard for inputing multiple languages in the Opie environment. Version: $QPE_VERSION$EXTRAVERSION |