summaryrefslogtreecommitdiff
authorsimon <simon>2003-03-26 10:02:13 (UTC)
committer simon <simon>2003-03-26 10:02:13 (UTC)
commitff08ba81efbc0e2dcb3907f576ff4f078f2b7438 (patch) (side-by-side diff)
tree645738d443f9eb5220b1ca1d2e922572aeec8e17
parentb7a2238dad7f8f44c3354168d8e2685705616c78 (diff)
downloadopie-ff08ba81efbc0e2dcb3907f576ff4f078f2b7438.zip
opie-ff08ba81efbc0e2dcb3907f576ff4f078f2b7438.tar.gz
opie-ff08ba81efbc0e2dcb3907f576ff4f078f2b7438.tar.bz2
- Kommando zurueck :)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp8
-rw-r--r--library/qpeapplication.h5
2 files changed, 3 insertions, 10 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index f5bf0c5..7463074 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1022,101 +1022,99 @@ void QPEApplication::applyStyle()
}
// Font
QString ff = config.readEntry( "FontFamily", font().family() );
int fs = config.readNumEntry( "FontSize", font().pointSize() );
// don't set a custom font
if ( nostyle & Opie::Force_Font ) {
ff = "Helvetica";
fs = 10;
}
setFont ( QFont ( ff, fs ), true );
// revert to global blocking policy ...
Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
Opie::force_appearance &= ~nostyle;
}
void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
{
#ifdef Q_WS_QWS
QDataStream stream( data, IO_ReadOnly );
if ( msg == "applyStyle()" ) {
applyStyle();
}
else if ( msg == "toggleApplicationMenu()" ) {
QWidget *active = activeWindow ( );
if ( active ) {
QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( );
bool oldactive = man-> isActive ( );
man-> setActive( !man-> isActive() );
if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu
QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" );
}
}
}
else if ( msg == "setDefaultRotation(int)" ) {
if ( type() == GuiServer ) {
int r;
stream >> r;
setDefaultRotation( r );
}
}
else if ( msg == "setCurrentRotation(int)" ) {
- if ( type() == GuiServer ) {
- int r;
- stream >> r;
- setCurrentRotation( r );
- }
+ int r;
+ stream >> r;
+ setCurrentRotation( r );
}
else if ( msg == "shutdown()" ) {
if ( type() == GuiServer )
shutdown();
}
else if ( msg == "quit()" ) {
if ( type() != GuiServer )
tryQuit();
}
else if ( msg == "forceQuit()" ) {
if ( type() != GuiServer )
quit();
}
else if ( msg == "restart()" ) {
if ( type() == GuiServer )
restart();
}
else if ( msg == "language(QString)" ) {
if ( type() == GuiServer ) {
QString l;
stream >> l;
QString cl = getenv( "LANG" );
if ( cl != l ) {
if ( l.isNull() )
unsetenv( "LANG" );
else
setenv( "LANG", l.latin1(), 1 );
restart();
}
}
}
else if ( msg == "timeChange(QString)" ) {
QString t;
stream >> t;
if ( t.isNull() )
unsetenv( "TZ" );
else
setenv( "TZ", t.latin1(), 1 );
// emit the signal so everyone else knows...
emit timeChanged();
}
else if ( msg == "execute(QString)" ) {
if ( type() == GuiServer ) {
QString t;
stream >> t;
Global::execute( t );
}
}
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 82954d0..4c37ea6 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -120,78 +120,73 @@ protected:
bool eventFilter( QObject *, QEvent * );
void timerEvent( QTimerEvent * );
bool raiseAppropriateWindow();
virtual void tryQuit();
virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!)
private:
void mapToDefaultAction( QWSKeyEvent *ke, int defKey );
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QCopChannel *sysChannel;
QCopChannel *pidChannel;
#endif
QPEApplicationData *d;
bool reserved_sh;
};
inline void QPEApplication::showDialog( QDialog* d, bool nomax )
{
QSize sh = d->sizeHint();
int w = QMAX(sh.width(),d->width());
int h = QMAX(sh.height(),d->height());
if ( !nomax
&& ( w > qApp->desktop()->width()*3/4
|| h > qApp->desktop()->height()*3/4 ) )
{
d->showMaximized();
} else {
d->resize(w,h);
d->show();
}
}
inline int QPEApplication::execDialog( QDialog* d, bool nomax )
{
showDialog(d,nomax);
return d->exec();
}
enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */
inline void QPEApplication::setCurrentRotation( int r )
{
- if ( qApp->type() != GuiServer ) {
- QCopEnvelope e( "QPE/System", "setCurrentRotation(int)" );
- e << r;
- return;
- }
Transformation e;
switch (r) {
case 0:
e = Rot0;
break;
case 90:
e = Rot90;
break;
case 180:
e = Rot180;
break;
case 270:
e = Rot270;
break;
default:
return;
}
qDebug("calling qApp->desktop()->qwsDisplay()->setTransformation( %d )\n", e);
qApp->desktop()->qwsDisplay()->setTransformation( e );
}
#endif