summaryrefslogtreecommitdiff
path: root/library
Unidiff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 10c6c40..c875ff2 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1117,27 +1117,24 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e )
1117 else if ( ke->simpleData.keycode == Qt::Key_Escape && 1117 else if ( ke->simpleData.keycode == Qt::Key_Escape &&
1118 ke->simpleData.is_press ) { 1118 ke->simpleData.is_press ) {
1119 // Escape key closes app if focus on toplevel 1119 // Escape key closes app if focus on toplevel
1120 QWidget * active = activeWindow(); 1120 QWidget * active = activeWindow();
1121 if ( active && active->testWFlags( WType_TopLevel ) && 1121 if ( active && active->testWFlags( WType_TopLevel ) &&
1122 ( int ) active->winId() == ke->simpleData.window && 1122 ( int ) active->winId() == ke->simpleData.window &&
1123 !active->testWFlags( WStyle_Dialog | WStyle_Customize | WType_Popup | WType_Desktop ) ) { 1123 !active->testWFlags( WStyle_Dialog | WStyle_Customize | WType_Popup | WType_Desktop ) ) {
1124 if ( active->inherits( "QDialog" ) ) { 1124 if ( active->inherits( "QDialog" ) ) {
1125 HackDialog * d = ( HackDialog * ) active; 1125 HackDialog * d = ( HackDialog * ) active;
1126 d->rejectIt(); 1126 d->rejectIt();
1127 return TRUE; 1127 return TRUE;
1128 } 1128 }
1129 else if ( strcmp( argv() [ 0 ], "embeddedkonsole" ) != 0 ) {
1130 active->close();
1131 }
1132 } 1129 }
1133 } 1130 }
1134 else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) { 1131 else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) {
1135 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... )) 1132 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... ))
1136 // but we cannot access libopie function within libqpe :( 1133 // but we cannot access libopie function within libqpe :(
1137 1134
1138 QWidget * active = activeWindow ( ); 1135 QWidget * active = activeWindow ( );
1139 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) { 1136 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) {
1140 if ( d-> kbgrabbed ) { // we grabbed the keyboard 1137 if ( d-> kbgrabbed ) { // we grabbed the keyboard
1141 QChar ch ( ke-> simpleData.unicode ); 1138 QChar ch ( ke-> simpleData.unicode );
1142 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease, 1139 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease,
1143 ke-> simpleData.keycode, 1140 ke-> simpleData.keycode,
@@ -2142,25 +2139,25 @@ int QPEApplication::exec()
2142#endif 2139#endif
2143 processEvents(); 2140 processEvents();
2144 return 0; 2141 return 0;
2145} 2142}
2146 2143
2147/*! 2144/*!
2148 \internal 2145 \internal
2149 External request for application to quit. Quits if possible without 2146 External request for application to quit. Quits if possible without
2150 loosing state. 2147 loosing state.
2151*/ 2148*/
2152void QPEApplication::tryQuit() 2149void QPEApplication::tryQuit()
2153{ 2150{
2154 if ( activeModalWidget() || strcmp( argv() [ 0 ], "embeddedkonsole" ) == 0 ) 2151 if ( activeModalWidget() )
2155 return ; // Inside modal loop or konsole. Too hard to save state. 2152 return ; // Inside modal loop or konsole. Too hard to save state.
2156#ifndef QT_NO_COP 2153#ifndef QT_NO_COP
2157 2154
2158 { 2155 {
2159 QCopEnvelope e( "QPE/System", "closing(QString)" ); 2156 QCopEnvelope e( "QPE/System", "closing(QString)" );
2160 e << d->appName; 2157 e << d->appName;
2161 } 2158 }
2162#endif 2159#endif
2163 if ( d->keep_running ) 2160 if ( d->keep_running )
2164 d->store_widget_rect(d->qpe_main_widget, d->appName); 2161 d->store_widget_rect(d->qpe_main_widget, d->appName);
2165 processEvents(); 2162 processEvents();
2166 2163