-rw-r--r-- | noncore/apps/opie-console/widget_layer.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp index 3875a6e..0364e66 100644 --- a/noncore/apps/opie-console/widget_layer.cpp +++ b/noncore/apps/opie-console/widget_layer.cpp | |||
@@ -51,35 +51,32 @@ WidgetLayer::~WidgetLayer() | |||
51 | /* --------------------------------- audio ---------------------------------- */ | 51 | /* --------------------------------- audio ---------------------------------- */ |
52 | 52 | ||
53 | void WidgetLayer::bell() | 53 | void WidgetLayer::bell() |
54 | { | 54 | { |
55 | QApplication::beep(); | 55 | QApplication::beep(); |
56 | } | 56 | } |
57 | 57 | ||
58 | bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) | 58 | bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) |
59 | { | 59 | { |
60 | if ( (e->type() == QEvent::Accel || | 60 | if ( (e->type() == QEvent::Accel || |
61 | e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) { | 61 | e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) { |
62 | static_cast<QKeyEvent *>( e )->ignore(); | 62 | static_cast<QKeyEvent *>( e )->ignore(); |
63 | return true; | 63 | return true; |
64 | } | 64 | } |
65 | if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) | 65 | if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) |
66 | return FALSE; // not us | 66 | return FALSE; // not us |
67 | if ( e->type() == QEvent::Wheel) { | ||
68 | QApplication::sendEvent( m_scrollbar, e); | ||
69 | } | ||
70 | 67 | ||
71 | #ifdef FAKE_CTRL_AND_ALT | 68 | #ifdef FAKE_CTRL_AND_ALT |
72 | static bool control = FALSE; | 69 | static bool control = FALSE; |
73 | static bool alt = FALSE; | 70 | static bool alt = FALSE; |
74 | // qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); | 71 | // qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); |
75 | bool dele=FALSE; | 72 | bool dele=FALSE; |
76 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { | 73 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { |
77 | QKeyEvent* ke = (QKeyEvent*)e; | 74 | QKeyEvent* ke = (QKeyEvent*)e; |
78 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); | 75 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); |
79 | switch (ke->key()) { | 76 | switch (ke->key()) { |
80 | case Key_F9: // let this be "Control" | 77 | case Key_F9: // let this be "Control" |
81 | control = keydown; | 78 | control = keydown; |
82 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); | 79 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); |
83 | dele=TRUE; | 80 | dele=TRUE; |
84 | break; | 81 | break; |
85 | case Key_F13: // let this be "Alt" | 82 | case Key_F13: // let this be "Alt" |
@@ -110,40 +107,32 @@ QChar(a,0)); | |||
110 | QKeyEvent* ke = (QKeyEvent*)e; | 107 | QKeyEvent* ke = (QKeyEvent*)e; |
111 | //actSel=0; // Key stroke implies a screen update, so Widget won't | 108 | //actSel=0; // Key stroke implies a screen update, so Widget won't |
112 | // know where the current selection is. | 109 | // know where the current selection is. |
113 | 110 | ||
114 | // qDebug("key pressed is 0x%x",ke->key()); | 111 | // qDebug("key pressed is 0x%x",ke->key()); |
115 | 112 | ||
116 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker | 113 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker |
117 | insertText("\\"); // expose | 114 | insertText("\\"); // expose |
118 | } else | 115 | } else |
119 | emit keyPressed( ke ); // expose | 116 | emit keyPressed( ke ); // expose |
120 | ke->accept(); | 117 | ke->accept(); |
121 | #ifdef FAKE_CTRL_AND_ALT | 118 | #ifdef FAKE_CTRL_AND_ALT |
122 | if ( dele ) delete e; | 119 | if ( dele ) delete e; |
123 | #endif | 120 | #endif |
124 | return true; // stop the event | 121 | return true; // stop the event |
125 | } | 122 | } |
126 | if ( e->type() == QEvent::Enter ) { | ||
127 | QObject::disconnect( (QObject*)cb, SIGNAL(dataChanged()), | ||
128 | this, SLOT(onClearSelection()) ); | ||
129 | } | ||
130 | if ( e->type() == QEvent::Leave ) { | ||
131 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), | ||
132 | this, SLOT(onClearSelection()) ); | ||
133 | } | ||
134 | return QFrame::eventFilter( obj, e ); | 123 | return QFrame::eventFilter( obj, e ); |
135 | } | 124 | } |
136 | 125 | ||
137 | 126 | ||
138 | /* --------------------------------- screen --------------------------------- */ | 127 | /* --------------------------------- screen --------------------------------- */ |
139 | 128 | ||
140 | 129 | ||
141 | void WidgetLayer::propagateSize() | 130 | void WidgetLayer::propagateSize() |
142 | { | 131 | { |
143 | QArray<Character> oldimage = m_image.copy(); | 132 | QArray<Character> oldimage = m_image.copy(); |
144 | int oldlines = m_lines; | 133 | int oldlines = m_lines; |
145 | int oldcolumns = m_columns; | 134 | int oldcolumns = m_columns; |
146 | 135 | ||
147 | makeImage(); | 136 | makeImage(); |
148 | 137 | ||
149 | // copy old image, to reduce flicker | 138 | // copy old image, to reduce flicker |