-rw-r--r-- | libopie2/opieui/okeyconfigwidget.cpp | 7 | ||||
-rw-r--r-- | libopie2/opieui/opieui.pro | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.cpp b/libopie2/opieui/okeyconfigwidget.cpp index 8967d77..ef6d713 100644 --- a/libopie2/opieui/okeyconfigwidget.cpp +++ b/libopie2/opieui/okeyconfigwidget.cpp | |||
@@ -1143,102 +1143,103 @@ OKeyChooserConfigDialog::OKeyChooserConfigDialog( QWidget* par, const char* nam, | |||
1143 | lbl->setFocusPolicy( NoFocus ); | 1143 | lbl->setFocusPolicy( NoFocus ); |
1144 | 1144 | ||
1145 | m_lbl = new QLabel( this ); | 1145 | m_lbl = new QLabel( this ); |
1146 | lay->addWidget( m_lbl ); | 1146 | lay->addWidget( m_lbl ); |
1147 | m_lbl->setFocusPolicy( NoFocus ); | 1147 | m_lbl->setFocusPolicy( NoFocus ); |
1148 | 1148 | ||
1149 | m_timer = new QTimer( this ); | 1149 | m_timer = new QTimer( this ); |
1150 | connect(m_timer, SIGNAL(timeout()), | 1150 | connect(m_timer, SIGNAL(timeout()), |
1151 | this, SLOT(slotTimeUp()) ); | 1151 | this, SLOT(slotTimeUp()) ); |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | OKeyChooserConfigDialog::~OKeyChooserConfigDialog() { | 1154 | OKeyChooserConfigDialog::~OKeyChooserConfigDialog() { |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | Opie::Ui::OKeyPair OKeyChooserConfigDialog::keyPair()const{ | 1157 | Opie::Ui::OKeyPair OKeyChooserConfigDialog::keyPair()const{ |
1158 | return m_keyPair; | 1158 | return m_keyPair; |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | void OKeyChooserConfigDialog::keyPressEvent( QKeyEvent* ev ) { | 1161 | void OKeyChooserConfigDialog::keyPressEvent( QKeyEvent* ev ) { |
1162 | QDialog::keyPressEvent( ev ); | 1162 | QDialog::keyPressEvent( ev ); |
1163 | 1163 | ||
1164 | if ( ev->isAutoRepeat() ) | 1164 | if ( ev->isAutoRepeat() ) |
1165 | return; | 1165 | return; |
1166 | 1166 | ||
1167 | int mod, key; | 1167 | int mod, key; |
1168 | Opie::Ui::Private::fixupKeys( key,mod, ev ); | 1168 | Opie::Ui::Private::fixupKeys( key,mod, ev ); |
1169 | 1169 | ||
1170 | /* either we used software keyboard | 1170 | /* either we used software keyboard |
1171 | * or we've true support | 1171 | * or we've true support |
1172 | */ | 1172 | */ |
1173 | if ( !m_virtKey && !ev->key()) { | 1173 | if ( !m_virtKey && !ev->key()) { |
1174 | m_virtKey = true; | 1174 | m_virtKey = true; |
1175 | m_keyPair = OKeyPair( key, mod ); | 1175 | m_keyPair = OKeyPair( key, mod ); |
1176 | }else{ | 1176 | }else{ |
1177 | mod = 0; | 1177 | mod = 0; |
1178 | switch( key ) { | 1178 | switch( key ) { |
1179 | case Qt::Key_Control: | 1179 | case Qt::Key_Control: |
1180 | mod = Qt::ControlButton; | 1180 | mod = Qt::ControlButton; |
1181 | break; | 1181 | break; |
1182 | case Qt::Key_Shift: | 1182 | case Qt::Key_Shift: |
1183 | mod = Qt::ShiftButton; | 1183 | mod = Qt::ShiftButton; |
1184 | break; | 1184 | break; |
1185 | case Qt::Key_Alt: | 1185 | case Qt::Key_Alt: |
1186 | mod = Qt::AltButton; | 1186 | mod = Qt::AltButton; |
1187 | break; | 1187 | break; |
1188 | default: | 1188 | default: |
1189 | break; | 1189 | break; |
1190 | } | 1190 | } |
1191 | if (mod ) | 1191 | if (mod ) { |
1192 | m_mod |= mod; | 1192 | m_mod |= mod; |
1193 | else | 1193 | key = 0; |
1194 | }else | ||
1194 | m_key = key; | 1195 | m_key = key; |
1195 | 1196 | ||
1196 | if ( ( !mod || m_key ) && !m_timer->isActive() ) | 1197 | if ( ( !mod || m_key || key ) && !m_timer->isActive() ) |
1197 | m_timer->start( 150, true ); | 1198 | m_timer->start( 150, true ); |
1198 | 1199 | ||
1199 | m_keyPair = OKeyPair( m_key, m_mod ); | 1200 | m_keyPair = OKeyPair( m_key, m_mod ); |
1200 | } | 1201 | } |
1201 | 1202 | ||
1202 | m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); | 1203 | m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); |
1203 | 1204 | ||
1204 | } | 1205 | } |
1205 | 1206 | ||
1206 | void OKeyChooserConfigDialog::keyReleaseEvent( QKeyEvent* ev ) { | 1207 | void OKeyChooserConfigDialog::keyReleaseEvent( QKeyEvent* ev ) { |
1207 | m_timer->stop(); | 1208 | m_timer->stop(); |
1208 | QDialog::keyPressEvent( ev ); | 1209 | QDialog::keyPressEvent( ev ); |
1209 | 1210 | ||
1210 | if ( ev->isAutoRepeat() ) | 1211 | if ( ev->isAutoRepeat() ) |
1211 | return; | 1212 | return; |
1212 | 1213 | ||
1213 | 1214 | ||
1214 | if ( m_virtKey && !ev->key()) { | 1215 | if ( m_virtKey && !ev->key()) { |
1215 | m_virtKey = false; | 1216 | m_virtKey = false; |
1216 | slotTimeUp(); | 1217 | slotTimeUp(); |
1217 | }else { | 1218 | }else { |
1218 | int mod = 0; | 1219 | int mod = 0; |
1219 | int key = ev->key(); | 1220 | int key = ev->key(); |
1220 | switch( key ) { | 1221 | switch( key ) { |
1221 | case Qt::Key_Control: | 1222 | case Qt::Key_Control: |
1222 | mod = Qt::ControlButton; | 1223 | mod = Qt::ControlButton; |
1223 | break; | 1224 | break; |
1224 | case Qt::Key_Shift: | 1225 | case Qt::Key_Shift: |
1225 | mod = Qt::ShiftButton; | 1226 | mod = Qt::ShiftButton; |
1226 | break; | 1227 | break; |
1227 | case Qt::Key_Alt: | 1228 | case Qt::Key_Alt: |
1228 | mod = Qt::AltButton; | 1229 | mod = Qt::AltButton; |
1229 | break; | 1230 | break; |
1230 | default: | 1231 | default: |
1231 | break; | 1232 | break; |
1232 | } | 1233 | } |
1233 | if (mod ) | 1234 | if (mod ) |
1234 | m_mod &= ~mod; | 1235 | m_mod &= ~mod; |
1235 | else | 1236 | else |
1236 | m_key = key; | 1237 | m_key = key; |
1237 | m_keyPair = OKeyPair( m_key, m_mod ); | 1238 | m_keyPair = OKeyPair( m_key, m_mod ); |
1238 | m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); | 1239 | m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); |
1239 | } | 1240 | } |
1240 | } | 1241 | } |
1241 | 1242 | ||
1242 | 1243 | ||
1243 | void OKeyChooserConfigDialog::slotTimeUp() { | 1244 | void OKeyChooserConfigDialog::slotTimeUp() { |
1244 | m_mod = m_key = 0; | 1245 | m_mod = m_key = 0; |
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 0749f7d..e97e82c 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro | |||
@@ -1,63 +1,65 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = oclickablelabel.h \ | 4 | HEADERS = oclickablelabel.h \ |
5 | odialog.h \ | 5 | odialog.h \ |
6 | ofontselector.h \ | 6 | ofontselector.h \ |
7 | oimageeffect.h \ | 7 | oimageeffect.h \ |
8 | okeyconfigwidget.h \ | ||
8 | olistview.h \ | 9 | olistview.h \ |
9 | opixmapeffect.h \ | 10 | opixmapeffect.h \ |
10 | opopupmenu.h \ | 11 | opopupmenu.h \ |
11 | opixmapprovider.h \ | 12 | opixmapprovider.h \ |
12 | oselector.h \ | 13 | oselector.h \ |
13 | oseparator.h \ | 14 | oseparator.h \ |
14 | otabinfo.h \ | 15 | otabinfo.h \ |
15 | otabbar.h \ | 16 | otabbar.h \ |
16 | otabwidget.h \ | 17 | otabwidget.h \ |
17 | otaskbarapplet.h \ | 18 | otaskbarapplet.h \ |
18 | oticker.h \ | 19 | oticker.h \ |
19 | otimepicker.h \ | 20 | otimepicker.h \ |
20 | oversatileview.h \ | 21 | oversatileview.h \ |
21 | oversatileviewitem.h \ | 22 | oversatileviewitem.h \ |
22 | owait.h | 23 | owait.h |
23 | 24 | ||
24 | SOURCES = oclickablelabel.cpp \ | 25 | SOURCES = oclickablelabel.cpp \ |
25 | odialog.cpp \ | 26 | odialog.cpp \ |
26 | ofontselector.cpp \ | 27 | ofontselector.cpp \ |
27 | oimageeffect.cpp \ | 28 | oimageeffect.cpp \ |
29 | okeyconfigwidget.cpp \ | ||
28 | olistview.cpp \ | 30 | olistview.cpp \ |
29 | opixmapeffect.cpp \ | 31 | opixmapeffect.cpp \ |
30 | opopupmenu.cpp \ | 32 | opopupmenu.cpp \ |
31 | opixmapprovider.cpp \ | 33 | opixmapprovider.cpp \ |
32 | oselector.cpp \ | 34 | oselector.cpp \ |
33 | oseparator.cpp \ | 35 | oseparator.cpp \ |
34 | otabbar.cpp \ | 36 | otabbar.cpp \ |
35 | otabwidget.cpp \ | 37 | otabwidget.cpp \ |
36 | otaskbarapplet.cpp \ | 38 | otaskbarapplet.cpp \ |
37 | oticker.cpp \ | 39 | oticker.cpp \ |
38 | otimepicker.cpp \ | 40 | otimepicker.cpp \ |
39 | oversatileview.cpp \ | 41 | oversatileview.cpp \ |
40 | oversatileviewitem.cpp \ | 42 | oversatileviewitem.cpp \ |
41 | owait.cpp | 43 | owait.cpp |
42 | 44 | ||
43 | include ( big-screen/big-screen.pro ) | 45 | include ( big-screen/big-screen.pro ) |
44 | include ( fileselector/fileselector.pro ) | 46 | include ( fileselector/fileselector.pro ) |
45 | 47 | ||
46 | INTERFACES = otimepickerbase.ui | 48 | INTERFACES = otimepickerbase.ui |
47 | 49 | ||
48 | TARGET = opieui2 | 50 | TARGET = opieui2 |
49 | VERSION = 1.8.5 | 51 | VERSION = 1.8.5 |
50 | 52 | ||
51 | INCLUDEPATH += $(OPIEDIR)/include | 53 | INCLUDEPATH += $(OPIEDIR)/include |
52 | DEPENDPATH += $(OPIEDIR)/include | 54 | DEPENDPATH += $(OPIEDIR)/include |
53 | 55 | ||
54 | LIBS += -lopiecore2 | 56 | LIBS += -lopiecore2 |
55 | 57 | ||
56 | !contains( platform, x11 ) { | 58 | !contains( platform, x11 ) { |
57 | include ( $(OPIEDIR)/include.pro ) | 59 | include ( $(OPIEDIR)/include.pro ) |
58 | } | 60 | } |
59 | 61 | ||
60 | contains( platform, x11 ) { | 62 | contains( platform, x11 ) { |
61 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 63 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
62 | } | 64 | } |
63 | 65 | ||