Diffstat (limited to 'inputmethods/dasher/QtDasherPlugin.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/QtDasherPlugin.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inputmethods/dasher/QtDasherPlugin.cc b/inputmethods/dasher/QtDasherPlugin.cc index cf4fc2c..f491769 100644 --- a/inputmethods/dasher/QtDasherPlugin.cc +++ b/inputmethods/dasher/QtDasherPlugin.cc | |||
@@ -1,79 +1,79 @@ | |||
1 | #include "QtDasherPlugin.h" | 1 | #include "QtDasherPlugin.h" |
2 | 2 | ||
3 | #include <qpe/global.h> | 3 | #include <qpe/global.h> |
4 | 4 | ||
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | #include <qbitmap.h> | 7 | #include <qbitmap.h> |
8 | #include <qlayout.h> | 8 | #include <qlayout.h> |
9 | #include <qvbox.h> | 9 | #include <qvbox.h> |
10 | #include <qdialog.h> | 10 | #include <qdialog.h> |
11 | #include <qscrollview.h> | 11 | #include <qscrollview.h> |
12 | #include <qpopupmenu.h> | 12 | #include <qpopupmenu.h> |
13 | #include <qhbuttongroup.h> | 13 | #include <qhbuttongroup.h> |
14 | #include <qpushbutton.h> | 14 | #include <qpushbutton.h> |
15 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
16 | #include <qwindowsystem_qws.h> | 16 | #include <qwindowsystem_qws.h> |
17 | 17 | ||
18 | QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QFrame(parent,name,f) | 18 | QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QFrame(parent,name,f) |
19 | { | 19 | { |
20 | (new QHBoxLayout(this))->setAutoAdd(TRUE); | 20 | (new QHBoxLayout(this))->setAutoAdd(TRUE); |
21 | interface = new CDasherInterface; | 21 | interface = new CDasherInterface; |
22 | interface->SetSystemLocation("/opt/QtPalmtop/share/dasher/"); | 22 | interface->SetSystemLocation("/opt/QtPalmtop/share/dasher/"); |
23 | interface->Unpause(0); | 23 | interface->Unpause(0); |
24 | interface->Start(); | 24 | interface->Start(); |
25 | d = new QtDasherScreen(240,100,interface,this,this); | 25 | d = new QtDasherScreen(240,100,interface,this,this); |
26 | interface->ChangeMaxBitRate(2.5); | 26 | interface->ChangeMaxBitRate(2.5); |
27 | d->show(); | 27 | d->show(); |
28 | utf8_codec = new QUtf8Codec; | 28 | utf8_codec = new QUtf8Codec; |
29 | } | 29 | } |
30 | 30 | ||
31 | QSize QtDasherPlugin::sizeHint() const | 31 | QSize QtDasherPlugin::sizeHint() const |
32 | { | 32 | { |
33 | return QSize(240,100); | 33 | return QSize(240,100); |
34 | } | 34 | } |
35 | 35 | ||
36 | QtDasherPlugin::~QtDasherPlugin() | 36 | QtDasherPlugin::~QtDasherPlugin() |
37 | { | 37 | { |
38 | delete d; | 38 | delete d; |
39 | } | 39 | } |
40 | 40 | ||
41 | void QtDasherPlugin::resetState() | 41 | void QtDasherPlugin::resetState() |
42 | { | 42 | { |
43 | flushcount=0; | 43 | flushcount=0; |
44 | interface->Start(); | 44 | interface->Start(); |
45 | interface->Redraw(); | 45 | interface->Redraw(); |
46 | } | 46 | } |
47 | 47 | ||
48 | void QtDasherPlugin::unflush() | 48 | void QtDasherPlugin::unflush() |
49 | { | 49 | { |
50 | if (flushcount==0) | 50 | if (flushcount==0) |
51 | return; | 51 | return; |
52 | for (flushcount; flushcount>0; flushcount--) { | 52 | for (; flushcount>0; flushcount--) { |
53 | deletetext(); | 53 | deletetext(); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | 56 | ||
57 | void QtDasherPlugin::output(int Symbol) | 57 | void QtDasherPlugin::output(int Symbol) |
58 | { | 58 | { |
59 | std::string label = interface->GetEditText(Symbol); | 59 | std::string label = interface->GetEditText(Symbol); |
60 | QString unicodestring = utf8_codec->toUnicode(label.c_str()); | 60 | QString unicodestring = utf8_codec->toUnicode(label.c_str()); |
61 | for (int i=0; i<int(unicodestring.length()); i++) { | 61 | for (int i=0; i<int(unicodestring.length()); i++) { |
62 | emit key( unicodestring[i].unicode(), 0, 0, true, false ); | 62 | emit key( unicodestring[i].unicode(), 0, 0, true, false ); |
63 | emit key( unicodestring[i].unicode(), 0, 0, false, false ); | 63 | emit key( unicodestring[i].unicode(), 0, 0, false, false ); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | void QtDasherPlugin::deletetext() | 67 | void QtDasherPlugin::deletetext() |
68 | { | 68 | { |
69 | emit key( 0, Qt::Key_Backspace, 0, true, false); | 69 | emit key( 0, Qt::Key_Backspace, 0, true, false); |
70 | emit key( 0, Qt::Key_Backspace, 0, false, false); | 70 | emit key( 0, Qt::Key_Backspace, 0, false, false); |
71 | } | 71 | } |
72 | 72 | ||
73 | void QtDasherPlugin::flush(int Symbol) | 73 | void QtDasherPlugin::flush(int Symbol) |
74 | { | 74 | { |
75 | if (Symbol==0) | 75 | if (Symbol==0) |
76 | return; | 76 | return; |
77 | output(Symbol); | 77 | output(Symbol); |
78 | flushcount++; | 78 | flushcount++; |
79 | } | 79 | } |