summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--x11/libqpe-x11/qpe/qpeapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp
index 75a8189..49115d8 100644
--- a/x11/libqpe-x11/qpe/qpeapplication.cpp
+++ b/x11/libqpe-x11/qpe/qpeapplication.cpp
@@ -643,146 +643,146 @@ bool QPEApplication::eventFilter( QObject* o, QEvent* e ) {
;
}
}
else if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
QKeyEvent *ke = (QKeyEvent *)e;
if ( ke->key() == Key_Enter ) {
if ( o->isA( "QRadioButton" ) || o->isA( "QCheckBox" ) ) {
postEvent( o, new QKeyEvent( e->type(), Key_Space, ' ',
ke->state(), " ", ke->isAutoRepeat(), ke->count() ) );
return TRUE;
}
}
}
return FALSE;
}
// Quit stuff
void QPEApplication::restart() {
}
void QPEApplication::shutdown() {
}
void QPEApplication::tryQuit() {
qWarning("TryQuit!!");
if ( activeModalWidget() || strcmp( argv() [ 0 ], "embeddedkonsole" ) == 0 )
return ; // Inside modal loop or konsole. Too hard to save state.
{
QCopEnvelope e( "QPE/System", "closing(QString)" );
e << d->appName;
}
processEvents();
quit();
}
void QPEApplication::hideOrQuit() {
qWarning("hide or close");
processEvents();
qWarning("past processing");
// If we are a preloaded application we don't actually quit, so emit
// a System message indicating we're quasi-closing.
if ( d->preloaded && d->qpe_main_widget )
{
qWarning("hiding");
QCopEnvelope e("QPE/System", "fastAppHiding(QString)" );
e << d->appName;
d->qpe_main_widget->hide();
}
else
quit();
}
/*!
\internal
*/
void QPEApplication::prepareForTermination( bool willrestart )
{
if ( willrestart ) {
// Draw a big wait icon, the image can be altered in later revisions
// QWidget *d = QApplication::desktop();
QImage img = Resource::loadImage( "launcher/new_wait" );
QPixmap pix;
pix.convertFromImage( img.smoothScale( 1 * img.width(), 1 * img.height() ) );
QLabel *lblWait = new QLabel( 0, "wait hack!", QWidget::WStyle_Customize |
QWidget::WStyle_NoBorder | QWidget::WStyle_Tool );
lblWait->setPixmap( pix );
lblWait->setAlignment( QWidget::AlignCenter );
lblWait->show();
lblWait->showMaximized();
}
#ifndef SINGLE_APP
{ QCopEnvelope envelope( "QPE/System", "forceQuit()" );
}
processEvents(); // ensure the message goes out.
sleep( 1 ); // You have 1 second to comply.
#endif
}
int QPEApplication::x11ClientMessage(QWidget* w, XEvent* event, bool b ) {
qWarning("X11 ClientMessage %d %d", event->type, ClientMessage);
if ( event->type == ClientMessage ) {
if ( (event->xclient.message_type == d->wm_protocols) &&
(event->xclient.data.l[0] == d->wm_context_accept ) ) {
qWarning("accepted!!!");
/*
* I'm not sure if we should use activeWidget
* or activeModalWidget
* a QDialog could be not modal too
*/
if ( w->inherits("QDialog" ) ) {
qWarning("inherits QDialog!!!");
QDialog* dia = (QDialog*)w;
/*
* call it directly or via QTimer::singleShot?
*/
- QTimer::singleShot(0, dia, SLOT(reject() ) );
+ QTimer::singleShot(0, dia, SLOT(accept() ) );
return 0;
}
}
}
return QApplication::x11ClientMessage(w, event, b );
}
#define KeyPress XKeyPress
#define KeyRelease XKeyRelease
#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
// The libraries with the skiff package (and possibly others) have
// completely useless implementations of builtin new and delete that
// use about 50% of your CPU. Here we revert to the simple libc
// functions.
void* operator new[]( size_t size )
{
return malloc( size );
}
void* operator new( size_t size )
{
return malloc( size );
}
void operator delete[]( void* p )
{
free( p );
}
void operator delete[]( void* p, size_t /*size*/ )
{
free( p );
}
void operator delete( void* p )
{
free( p );
}
void operator delete( void* p, size_t /*size*/ )
{
free( p );
}
#endif