author | drw <drw> | 2005-06-15 22:54:50 (UTC) |
---|---|---|
committer | drw <drw> | 2005-06-15 22:54:50 (UTC) |
commit | 7ff2e7bd4620a574f3ff22a951a5904310cfd920 (patch) (unidiff) | |
tree | 6d8ffd28aadf00901b3ab560464794aded3efc76 /inputmethods/multikey | |
parent | e0205bac48b9d23af9feb48004c24fcf7a5e8200 (diff) | |
download | opie-7ff2e7bd4620a574f3ff22a951a5904310cfd920.zip opie-7ff2e7bd4620a574f3ff22a951a5904310cfd920.tar.gz opie-7ff2e7bd4620a574f3ff22a951a5904310cfd920.tar.bz2 |
Resource -> OResource
-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 @@ | |||
1 | config MULTIKEY | 1 | config MULTIKEY |
2 | boolean "opie-multikey (OnScreen keyboard for multiple languages)" | 2 | boolean "opie-multikey (OnScreen keyboard for multiple languages)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && PICKBOARD && LIBQTAUX && LIBOPIE2UI | 4 | 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,200 +1,203 @@ | |||
1 | /* | 1 | /* |
2 | * TODO | 2 | * TODO |
3 | * make a font selection thing (size too) | 3 | * make a font selection thing (size too) |
4 | * make a keymap editor | 4 | * make a keymap editor |
5 | * make keys translucent | 5 | * make keys translucent |
6 | * make vertical keys possible | 6 | * make vertical keys possible |
7 | * | 7 | * |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <opie2/ofiledialog.h> | ||
12 | #include <opie2/qcolordialog.h> | ||
13 | #include <opie2/oresource.h> | ||
14 | |||
11 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
12 | #include <qpe/config.h> | 16 | #include <qpe/config.h> |
13 | #include <qpe/resource.h> | ||
14 | 17 | ||
15 | #include <qlayout.h> | 18 | #include <qlayout.h> |
16 | #include <qwidget.h> | 19 | #include <qwidget.h> |
17 | #include <qdialog.h> | 20 | #include <qdialog.h> |
18 | #include <qtabwidget.h> | 21 | #include <qtabwidget.h> |
19 | #include <qvbox.h> | 22 | #include <qvbox.h> |
20 | #include <qgrid.h> | 23 | #include <qgrid.h> |
21 | #include <qgroupbox.h> | 24 | #include <qgroupbox.h> |
22 | #include <qlabel.h> | 25 | #include <qlabel.h> |
23 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
24 | #include <qsizepolicy.h> | 27 | #include <qsizepolicy.h> |
25 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
26 | #include <qlistbox.h> | 29 | #include <qlistbox.h> |
27 | #include <qstringlist.h> | 30 | #include <qstringlist.h> |
28 | #include <qtoolbutton.h> | 31 | #include <qtoolbutton.h> |
29 | #include <opie2/ofiledialog.h> | ||
30 | #include <opie2/qcolordialog.h> | ||
31 | #include <qdir.h> | 32 | #include <qdir.h> |
32 | #include <qfileinfo.h> | 33 | #include <qfileinfo.h> |
33 | #include "configdlg.h" | 34 | #include "configdlg.h" |
34 | #include "keyboard.h" | 35 | #include "keyboard.h" |
35 | 36 | ||
36 | using namespace Opie; | 37 | using namespace Opie; |
37 | using namespace Opie::Ui; | 38 | using namespace Opie::Ui; |
38 | // ConfigDlg::ConfigDlg() {{{1 | 39 | // ConfigDlg::ConfigDlg() {{{1 |
39 | ConfigDlg::ConfigDlg () : QDialog () | 40 | ConfigDlg::ConfigDlg () : QDialog () |
40 | { | 41 | { |
41 | setCaption( tr("Multikey Configuration") ); | 42 | setCaption( tr("Multikey Configuration") ); |
42 | Config config ("multikey"); | 43 | Config config ("multikey"); |
43 | config.setGroup("keymaps"); | 44 | config.setGroup("keymaps"); |
44 | QString current_map = config.readEntry("current", 0); | 45 | QString current_map = config.readEntry("current", 0); |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * 'general config' tab | 48 | * 'general config' tab |
48 | */ | 49 | */ |
49 | 50 | ||
50 | QVBoxLayout *base_lay = new QVBoxLayout(this); | 51 | QVBoxLayout *base_lay = new QVBoxLayout(this); |
51 | 52 | ||
52 | QTabWidget *tabs = new QTabWidget(this, "tabs"); | 53 | QTabWidget *tabs = new QTabWidget(this, "tabs"); |
53 | 54 | ||
54 | QWidget *gen_box = new QWidget(tabs, "gen_tab"); | 55 | QWidget *gen_box = new QWidget(tabs, "gen_tab"); |
55 | QVBoxLayout *gen_lay = new QVBoxLayout(gen_box); | 56 | QVBoxLayout *gen_lay = new QVBoxLayout(gen_box); |
56 | gen_lay->setMargin(3); | 57 | gen_lay->setMargin(3); |
57 | QGroupBox *map_group = new QGroupBox (2, Qt::Vertical, tr("Keymap File"), gen_box); | 58 | QGroupBox *map_group = new QGroupBox (2, Qt::Vertical, tr("Keymap File"), gen_box); |
58 | 59 | ||
59 | QHBox *hbox1 = new QHBox(map_group); | 60 | QHBox *hbox1 = new QHBox(map_group); |
60 | keymaps = new QListBox(hbox1); | 61 | keymaps = new QListBox(hbox1); |
61 | keymaps->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 62 | keymaps->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); |
62 | QVBox *vbox1 = new QVBox(hbox1); | 63 | QVBox *vbox1 = new QVBox(hbox1); |
63 | 64 | ||
64 | QToolButton *tb1 = new QToolButton(vbox1, tr("Move Up")); | 65 | QToolButton *tb1 = new QToolButton(vbox1, tr("Move Up")); |
65 | tb1->setPixmap(Resource::loadPixmap("up")); | 66 | tb1->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); |
67 | tb1->setPixmap(Opie::Core::OResource::loadPixmap("up", Opie::Core::OResource::SmallIcon)); | ||
66 | tb1->setAutoRaise(TRUE); | 68 | tb1->setAutoRaise(TRUE); |
67 | tb1->setFocusPolicy(QWidget::NoFocus); | 69 | tb1->setFocusPolicy(QWidget::NoFocus); |
68 | tb1->setToggleButton(FALSE); | 70 | tb1->setToggleButton(FALSE); |
69 | connect(tb1, SIGNAL(clicked()), this, SLOT(moveSelectedUp())); | 71 | connect(tb1, SIGNAL(clicked()), this, SLOT(moveSelectedUp())); |
70 | 72 | ||
71 | QToolButton *tb2 = new QToolButton(vbox1, tr("Move Down")); | 73 | QToolButton *tb2 = new QToolButton(vbox1, tr("Move Down")); |
72 | tb2->setPixmap(Resource::loadPixmap("down")); | 74 | tb2->setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); |
75 | tb2->setPixmap(Opie::Core::OResource::loadPixmap("down", Opie::Core::OResource::SmallIcon)); | ||
73 | tb2->setAutoRaise(TRUE); | 76 | tb2->setAutoRaise(TRUE); |
74 | tb2->setFocusPolicy(QWidget::NoFocus); | 77 | tb2->setFocusPolicy(QWidget::NoFocus); |
75 | tb2->setToggleButton(FALSE); | 78 | tb2->setToggleButton(FALSE); |
76 | connect(tb2, SIGNAL(clicked()), this, SLOT(moveSelectedDown())); | 79 | connect(tb2, SIGNAL(clicked()), this, SLOT(moveSelectedDown())); |
77 | 80 | ||
78 | QString cur(tr("Current Language")); | 81 | QString cur(tr("Current Language")); |
79 | keymaps->insertItem(cur); | 82 | keymaps->insertItem(cur); |
80 | keymaps->setSelected(0, true); | 83 | keymaps->setSelected(0, true); |
81 | 84 | ||
82 | QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); | 85 | QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); |
83 | default_maps = map_dir.entryList(); // so i can access it in other places | 86 | default_maps = map_dir.entryList(); // so i can access it in other places |
84 | custom_maps = config.readListEntry("maps", QChar('|')); | 87 | custom_maps = config.readListEntry("maps", QChar('|')); |
85 | sw_maps = ConfigDlg::loadSw(); | 88 | sw_maps = ConfigDlg::loadSw(); |
86 | 89 | ||
87 | QStringList sw_copy(sw_maps); | 90 | QStringList sw_copy(sw_maps); |
88 | for (uint i = 0; i < sw_copy.count(); i++) { | 91 | for (uint i = 0; i < sw_copy.count(); i++) { |
89 | 92 | ||
90 | QString keymap_map; | 93 | QString keymap_map; |
91 | if (sw_copy[i][0] != '/') { /* share/multikey */ | 94 | if (sw_copy[i][0] != '/') { /* share/multikey */ |
92 | 95 | ||
93 | keymap_map = map_dir.absPath() + "/" + sw_copy[i]; | 96 | keymap_map = map_dir.absPath() + "/" + sw_copy[i]; |
94 | } else { | 97 | } else { |
95 | 98 | ||
96 | if (map_dir.exists(QFileInfo(sw_copy[i]).fileName(), false) | 99 | if (map_dir.exists(QFileInfo(sw_copy[i]).fileName(), false) |
97 | || !QFile::exists(sw_copy[i])) { | 100 | || !QFile::exists(sw_copy[i])) { |
98 | 101 | ||
99 | custom_maps.remove(sw_copy[i]); | 102 | custom_maps.remove(sw_copy[i]); |
100 | sw_maps.remove(sw_copy[i]); | 103 | sw_maps.remove(sw_copy[i]); |
101 | 104 | ||
102 | // remove it from the list too | 105 | // remove it from the list too |
103 | config.writeEntry("maps", custom_maps.join("|")); | 106 | config.writeEntry("maps", custom_maps.join("|")); |
104 | 107 | ||
105 | continue; | 108 | continue; |
106 | } | 109 | } |
107 | keymap_map = sw_copy[i]; | 110 | keymap_map = sw_copy[i]; |
108 | } | 111 | } |
109 | 112 | ||
110 | QFile map(keymap_map); | 113 | QFile map(keymap_map); |
111 | if (map.open(IO_ReadOnly)) { | 114 | if (map.open(IO_ReadOnly)) { |
112 | 115 | ||
113 | QString line; bool found = 0; | 116 | QString line; bool found = 0; |
114 | 117 | ||
115 | map.readLine(line, 1024); | 118 | map.readLine(line, 1024); |
116 | while (!map.atEnd()) { | 119 | while (!map.atEnd()) { |
117 | 120 | ||
118 | if (line.find(QRegExp("^title\\s*=\\s*")) != -1) { | 121 | if (line.find(QRegExp("^title\\s*=\\s*")) != -1) { |
119 | 122 | ||
120 | keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace()); | 123 | keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace()); |
121 | found = 1; | 124 | found = 1; |
122 | break; | 125 | break; |
123 | } | 126 | } |
124 | map.readLine(line, 1024); | 127 | map.readLine(line, 1024); |
125 | } | 128 | } |
126 | if (!found) | 129 | if (!found) |
127 | keymaps->insertItem(keymap_map); | 130 | keymaps->insertItem(keymap_map); |
128 | 131 | ||
129 | map.close(); | 132 | map.close(); |
130 | } | 133 | } |
131 | 134 | ||
132 | if (keymap_map == current_map) { | 135 | if (keymap_map == current_map) { |
133 | keymaps->setSelected(i + 1, true); | 136 | keymaps->setSelected(i + 1, true); |
134 | } | 137 | } |
135 | } | 138 | } |
136 | 139 | ||
137 | // have to "+1" because the "current language" listItem... remember? | 140 | // have to "+1" because the "current language" listItem... remember? |
138 | connect(keymaps, SIGNAL(highlighted(int)), SLOT(setMap(int))); | 141 | connect(keymaps, SIGNAL(highlighted(int)), SLOT(setMap(int))); |
139 | 142 | ||
140 | QGrid *add_remove_grid = new QGrid(2, map_group); | 143 | QGrid *add_remove_grid = new QGrid(2, map_group); |
141 | add_remove_grid->setMargin(3); | 144 | add_remove_grid->setMargin(3); |
142 | add_remove_grid->setSpacing(3); | 145 | add_remove_grid->setSpacing(3); |
143 | 146 | ||
144 | add_button = new QPushButton(tr("Add"), add_remove_grid); | 147 | add_button = new QPushButton(tr("Add"), add_remove_grid); |
145 | add_button->setFlat(TRUE); | 148 | add_button->setFlat(TRUE); |
146 | connect(add_button, SIGNAL(clicked()), SLOT(addMap())); | 149 | connect(add_button, SIGNAL(clicked()), SLOT(addMap())); |
147 | 150 | ||
148 | remove_button = new QPushButton(tr("Remove"), add_remove_grid); | 151 | remove_button = new QPushButton(tr("Remove"), add_remove_grid); |
149 | remove_button->setFlat(TRUE); | 152 | remove_button->setFlat(TRUE); |
150 | if (keymaps->currentItem() == 0 || default_maps.find(QFileInfo(current_map).fileName()) != default_maps.end()) | 153 | if (keymaps->currentItem() == 0 || default_maps.find(QFileInfo(current_map).fileName()) != default_maps.end()) |
151 | remove_button->setDisabled(true); | 154 | remove_button->setDisabled(true); |
152 | connect(remove_button, SIGNAL(clicked()), SLOT(removeMap())); | 155 | connect(remove_button, SIGNAL(clicked()), SLOT(removeMap())); |
153 | 156 | ||
154 | gen_lay->addWidget(map_group); | 157 | gen_lay->addWidget(map_group); |
155 | 158 | ||
156 | // make a box that will contain the buttons on the bottom | 159 | // make a box that will contain the buttons on the bottom |
157 | QGrid *other_grid = new QGrid(2, gen_box); | 160 | QGrid *other_grid = new QGrid(2, gen_box); |
158 | pick_button = new QCheckBox(tr("Pickboard"), other_grid); | 161 | pick_button = new QCheckBox(tr("Pickboard"), other_grid); |
159 | 162 | ||
160 | config.setGroup ("general"); | 163 | config.setGroup ("general"); |
161 | bool pick_open = config.readBoolEntry ("usePickboard", FALSE); // default closed | 164 | bool pick_open = config.readBoolEntry ("usePickboard", FALSE); // default closed |
162 | if (pick_open) { | 165 | if (pick_open) { |
163 | 166 | ||
164 | pick_button->setChecked(true); | 167 | pick_button->setChecked(true); |
165 | } | 168 | } |
166 | 169 | ||
167 | repeat_button = new QCheckBox(tr("Key Repeat"), other_grid); | 170 | repeat_button = new QCheckBox(tr("Key Repeat"), other_grid); |
168 | bool repeat_on = config.readBoolEntry ("useRepeat", TRUE); | 171 | bool repeat_on = config.readBoolEntry ("useRepeat", TRUE); |
169 | 172 | ||
170 | if (repeat_on) { | 173 | if (repeat_on) { |
171 | 174 | ||
172 | repeat_button->setChecked(true); | 175 | repeat_button->setChecked(true); |
173 | } | 176 | } |
174 | 177 | ||
175 | gen_lay->addWidget(other_grid); | 178 | gen_lay->addWidget(other_grid); |
176 | tabs->addTab(gen_box, tr("General Settings")); | 179 | tabs->addTab(gen_box, tr("General Settings")); |
177 | 180 | ||
178 | /* | 181 | /* |
179 | * 'color' tab | 182 | * 'color' tab |
180 | */ | 183 | */ |
181 | 184 | ||
182 | QWidget *color_box = new QWidget(tabs, "color_tab"); | 185 | QWidget *color_box = new QWidget(tabs, "color_tab"); |
183 | 186 | ||
184 | QGridLayout *color_lay = new QGridLayout(color_box); | 187 | QGridLayout *color_lay = new QGridLayout(color_box); |
185 | QGrid *color_grid = new QGrid(2, color_box); | 188 | QGrid *color_grid = new QGrid(2, color_box); |
186 | color_lay->setAlignment(Qt::AlignTop); | 189 | color_lay->setAlignment(Qt::AlignTop); |
187 | color_grid->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); | 190 | color_grid->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); |
188 | color_grid->layout()->setAlignment(Qt::AlignTop); | 191 | color_grid->layout()->setAlignment(Qt::AlignTop); |
189 | color_grid->setMargin(3); | 192 | color_grid->setMargin(3); |
190 | color_grid->setSpacing(3); | 193 | color_grid->setSpacing(3); |
191 | 194 | ||
192 | QLabel *label; | 195 | QLabel *label; |
193 | QStringList color; | 196 | QStringList color; |
194 | config.setGroup("colors"); | 197 | config.setGroup("colors"); |
195 | 198 | ||
196 | label = new QLabel(tr("Key Color"), color_grid); | 199 | label = new QLabel(tr("Key Color"), color_grid); |
197 | keycolor_button = new QPushButton(color_grid); | 200 | keycolor_button = new QPushButton(color_grid); |
198 | connect(keycolor_button, SIGNAL(clicked()), SLOT(keyColorClicked())); | 201 | connect(keycolor_button, SIGNAL(clicked()), SLOT(keyColorClicked())); |
199 | keycolor_button->setFlat(TRUE); | 202 | keycolor_button->setFlat(TRUE); |
200 | color = config.readListEntry("keycolor", QChar(',')); | 203 | color = config.readListEntry("keycolor", QChar(',')); |
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 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt plugin warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS= keyboard.h \ | 3 | HEADERS= keyboard.h \ |
4 | configdlg.h \ | 4 | configdlg.h \ |
5 | keyboardimpl.h | 5 | keyboardimpl.h |
6 | SOURCES= keyboard.cpp \ | 6 | SOURCES= keyboard.cpp \ |
7 | configdlg.cpp \ | 7 | configdlg.cpp \ |
8 | keyboardimpl.cpp | 8 | keyboardimpl.cpp |
9 | TARGET = qmultikey | 9 | TARGET = qmultikey |
10 | DESTDIR = $(OPIEDIR)/plugins/inputmethods | 10 | DESTDIR = $(OPIEDIR)/plugins/inputmethods |
11 | INCLUDEPATH += $(OPIEDIR)/include | 11 | INCLUDEPATH += $(OPIEDIR)/include |
12 | DEPENDPATH += ../../launcher | 12 | DEPENDPATH += ../../launcher |
13 | LIBS += -lqpe -L$(OPIEDIR)/plugins/inputmethods -lqpickboard -lqtaux2 -lopieui2 | 13 | LIBS += -lqpe -L$(OPIEDIR)/plugins/inputmethods -lqpickboard -lqtaux2 -lopiecore2 -lopieui2 |
14 | QMAKE_LFLAGS+= -Wl,-rpath,/opt/QtPalmtop/plugins/inputmethods | 14 | QMAKE_LFLAGS+= -Wl,-rpath,/opt/QtPalmtop/plugins/inputmethods |
15 | VERSION = 1.0.0 | 15 | VERSION = 1.0.0 |
16 | 16 | ||
17 | include( $(OPIEDIR)/include.pro ) | 17 | include( $(OPIEDIR)/include.pro ) |
18 | target.path = $$prefix/plugins/inputmethods | 18 | 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 @@ | |||
1 | Package: opie-multikey | 1 | Package: opie-multikey |
2 | Files: plugins/inputmethods/libqmultikey.so* share/multikey/* | 2 | Files: plugins/inputmethods/libqmultikey.so* share/multikey/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/inputmethods | 4 | Section: opie/inputmethods |
5 | Maintainer: Jake Richardson (jake@asdfnews.org) | 5 | Maintainer: Jake Richardson (jake@asdfnews.org) |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal, opie-pickboard, libqtaux2 | 7 | Depends: task-opie-minimal, opie-pickboard, libqtaux2, libopiecore2, libopieui2 |
8 | Description: Multiple language keyboard | 8 | Description: Multiple language keyboard |
9 | Keyboard for inputing multiple languages in the Opie environment. | 9 | Keyboard for inputing multiple languages in the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |