summaryrefslogtreecommitdiff
Unidiff
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
@@ -1046,53 +1046,51 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data
1046 applyStyle(); 1046 applyStyle();
1047 } 1047 }
1048 else if ( msg == "toggleApplicationMenu()" ) { 1048 else if ( msg == "toggleApplicationMenu()" ) {
1049 QWidget *active = activeWindow ( ); 1049 QWidget *active = activeWindow ( );
1050 1050
1051 if ( active ) { 1051 if ( active ) {
1052 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); 1052 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( );
1053 bool oldactive = man-> isActive ( ); 1053 bool oldactive = man-> isActive ( );
1054 1054
1055 man-> setActive( !man-> isActive() ); 1055 man-> setActive( !man-> isActive() );
1056 1056
1057 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu 1057 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu
1058 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); 1058 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" );
1059 } 1059 }
1060 } 1060 }
1061 } 1061 }
1062 else if ( msg == "setDefaultRotation(int)" ) { 1062 else if ( msg == "setDefaultRotation(int)" ) {
1063 if ( type() == GuiServer ) { 1063 if ( type() == GuiServer ) {
1064 int r; 1064 int r;
1065 stream >> r; 1065 stream >> r;
1066 setDefaultRotation( r ); 1066 setDefaultRotation( r );
1067 } 1067 }
1068 } 1068 }
1069 else if ( msg == "setCurrentRotation(int)" ) { 1069 else if ( msg == "setCurrentRotation(int)" ) {
1070 if ( type() == GuiServer ) { 1070 int r;
1071 int r; 1071 stream >> r;
1072 stream >> r; 1072 setCurrentRotation( r );
1073 setCurrentRotation( r );
1074 }
1075 } 1073 }
1076 else if ( msg == "shutdown()" ) { 1074 else if ( msg == "shutdown()" ) {
1077 if ( type() == GuiServer ) 1075 if ( type() == GuiServer )
1078 shutdown(); 1076 shutdown();
1079 } 1077 }
1080 else if ( msg == "quit()" ) { 1078 else if ( msg == "quit()" ) {
1081 if ( type() != GuiServer ) 1079 if ( type() != GuiServer )
1082 tryQuit(); 1080 tryQuit();
1083 } 1081 }
1084 else if ( msg == "forceQuit()" ) { 1082 else if ( msg == "forceQuit()" ) {
1085 if ( type() != GuiServer ) 1083 if ( type() != GuiServer )
1086 quit(); 1084 quit();
1087 } 1085 }
1088 else if ( msg == "restart()" ) { 1086 else if ( msg == "restart()" ) {
1089 if ( type() == GuiServer ) 1087 if ( type() == GuiServer )
1090 restart(); 1088 restart();
1091 } 1089 }
1092 else if ( msg == "language(QString)" ) { 1090 else if ( msg == "language(QString)" ) {
1093 if ( type() == GuiServer ) { 1091 if ( type() == GuiServer ) {
1094 QString l; 1092 QString l;
1095 stream >> l; 1093 stream >> l;
1096 QString cl = getenv( "LANG" ); 1094 QString cl = getenv( "LANG" );
1097 if ( cl != l ) { 1095 if ( cl != l ) {
1098 if ( l.isNull() ) 1096 if ( l.isNull() )
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 82954d0..4c37ea6 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -144,53 +144,48 @@ inline void QPEApplication::showDialog( QDialog* d, bool nomax )
144 QSize sh = d->sizeHint(); 144 QSize sh = d->sizeHint();
145 int w = QMAX(sh.width(),d->width()); 145 int w = QMAX(sh.width(),d->width());
146 int h = QMAX(sh.height(),d->height()); 146 int h = QMAX(sh.height(),d->height());
147 if ( !nomax 147 if ( !nomax
148 && ( w > qApp->desktop()->width()*3/4 148 && ( w > qApp->desktop()->width()*3/4
149 || h > qApp->desktop()->height()*3/4 ) ) 149 || h > qApp->desktop()->height()*3/4 ) )
150 { 150 {
151 d->showMaximized(); 151 d->showMaximized();
152 } else { 152 } else {
153 d->resize(w,h); 153 d->resize(w,h);
154 d->show(); 154 d->show();
155 } 155 }
156} 156}
157 157
158inline int QPEApplication::execDialog( QDialog* d, bool nomax ) 158inline int QPEApplication::execDialog( QDialog* d, bool nomax )
159{ 159{
160 showDialog(d,nomax); 160 showDialog(d,nomax);
161 return d->exec(); 161 return d->exec();
162} 162}
163 163
164enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ 164enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */
165 165
166inline void QPEApplication::setCurrentRotation( int r ) 166inline void QPEApplication::setCurrentRotation( int r )
167{ 167{
168 if ( qApp->type() != GuiServer ) {
169 QCopEnvelope e( "QPE/System", "setCurrentRotation(int)" );
170 e << r;
171 return;
172 }
173 Transformation e; 168 Transformation e;
174 169
175 switch (r) { 170 switch (r) {
176 case 0: 171 case 0:
177 e = Rot0; 172 e = Rot0;
178 break; 173 break;
179 case 90: 174 case 90:
180 e = Rot90; 175 e = Rot90;
181 break; 176 break;
182 case 180: 177 case 180:
183 e = Rot180; 178 e = Rot180;
184 break; 179 break;
185 case 270: 180 case 270:
186 e = Rot270; 181 e = Rot270;
187 break; 182 break;
188 default: 183 default:
189 return; 184 return;
190 } 185 }
191 186
192 qDebug("calling qApp->desktop()->qwsDisplay()->setTransformation( %d )\n", e); 187 qDebug("calling qApp->desktop()->qwsDisplay()->setTransformation( %d )\n", e);
193 qApp->desktop()->qwsDisplay()->setTransformation( e ); 188 qApp->desktop()->qwsDisplay()->setTransformation( e );
194} 189}
195 190
196 191