author | llornkcor <llornkcor> | 2005-08-09 07:50:02 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-08-09 07:50:02 (UTC) |
commit | 65fefea850384673d282e19ebecd7840cb697354 (patch) (unidiff) | |
tree | 9c4bd98abe5d5f61a1c5d002f0189eaadf93903e | |
parent | 3ba74fc183b06760b60f1ad45ca4bfa0e47b3ecc (diff) | |
download | opie-65fefea850384673d282e19ebecd7840cb697354.zip opie-65fefea850384673d282e19ebecd7840cb697354.tar.gz opie-65fefea850384673d282e19ebecd7840cb697354.tar.bz2 |
default should be maximized
-rw-r--r-- | library/qpeapplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 19e99f2..286c6ef 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -174,103 +174,103 @@ public: | |||
174 | QString decorationName; | 174 | QString decorationName; |
175 | 175 | ||
176 | void enqueueQCop( const QCString &ch, const QCString &msg, | 176 | void enqueueQCop( const QCString &ch, const QCString &msg, |
177 | const QByteArray &data ) | 177 | const QByteArray &data ) |
178 | { | 178 | { |
179 | qcopq.enqueue( new QCopRec( ch, msg, data ) ); | 179 | qcopq.enqueue( new QCopRec( ch, msg, data ) ); |
180 | } | 180 | } |
181 | void sendQCopQ() | 181 | void sendQCopQ() |
182 | { | 182 | { |
183 | if (!qcopQok ) | 183 | if (!qcopQok ) |
184 | return; | 184 | return; |
185 | 185 | ||
186 | QCopRec * r; | 186 | QCopRec * r; |
187 | 187 | ||
188 | while((r=qcopq.dequeue())) { | 188 | while((r=qcopq.dequeue())) { |
189 | // remove from queue before sending... | 189 | // remove from queue before sending... |
190 | // event loop can come around again before getting | 190 | // event loop can come around again before getting |
191 | // back from sendLocally | 191 | // back from sendLocally |
192 | #ifndef QT_NO_COP | 192 | #ifndef QT_NO_COP |
193 | QCopChannel::sendLocally( r->channel, r->message, r->data ); | 193 | QCopChannel::sendLocally( r->channel, r->message, r->data ); |
194 | #endif | 194 | #endif |
195 | 195 | ||
196 | delete r; | 196 | delete r; |
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName) { | 200 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName) { |
201 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) | 201 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) |
202 | { | 202 | { |
203 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); | 203 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); |
204 | } | 204 | } |
205 | QPoint p; | 205 | QPoint p; |
206 | QSize s; | 206 | QSize s; |
207 | bool max; | 207 | bool max; |
208 | 208 | ||
209 | if ( mw->isVisible() ) { | 209 | if ( mw->isVisible() ) { |
210 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 210 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
211 | mw->resize(s); | 211 | mw->resize(s); |
212 | mw->move(p); | 212 | mw->move(p); |
213 | } | 213 | } |
214 | mw->raise(); | 214 | mw->raise(); |
215 | } else { | 215 | } else { |
216 | 216 | ||
217 | if ( mw->layout() && mw->inherits("QDialog") ) { | 217 | if ( mw->layout() && mw->inherits("QDialog") ) { |
218 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 218 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
219 | mw->resize(s); | 219 | mw->resize(s); |
220 | mw->move(p); | 220 | mw->move(p); |
221 | 221 | ||
222 | if ( max && !nomaximize ) { | 222 | if ( max && !nomaximize ) { |
223 | mw->showMaximized(); | 223 | mw->showMaximized(); |
224 | } else { | 224 | } else { |
225 | mw->show(); | 225 | mw->show(); |
226 | } | 226 | } |
227 | } else { | 227 | } else { |
228 | QPEApplication::showDialog((QDialog*)mw,nomaximize); | 228 | QPEApplication::showDialog((QDialog*)mw, !nomaximize); |
229 | } | 229 | } |
230 | } else { | 230 | } else { |
231 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 231 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
232 | mw->resize(s); | 232 | mw->resize(s); |
233 | mw->move(p); | 233 | mw->move(p); |
234 | } else { //no stored rectangle, make an estimation | 234 | } else { //no stored rectangle, make an estimation |
235 | int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2; | 235 | int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2; |
236 | int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2; | 236 | int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2; |
237 | mw->move( QMAX(x,0), QMAX(y,0) ); | 237 | mw->move( QMAX(x,0), QMAX(y,0) ); |
238 | #ifdef Q_WS_QWS | 238 | #ifdef Q_WS_QWS |
239 | if ( !nomaximize ) | 239 | if ( !nomaximize ) |
240 | mw->showMaximized(); | 240 | mw->showMaximized(); |
241 | #endif | 241 | #endif |
242 | } | 242 | } |
243 | if ( max && !nomaximize ) | 243 | if ( max && !nomaximize ) |
244 | mw->showMaximized(); | 244 | mw->showMaximized(); |
245 | else | 245 | else |
246 | mw->show(); | 246 | mw->show(); |
247 | } | 247 | } |
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) | 251 | static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) |
252 | { | 252 | { |
253 | #ifndef OPIE_NO_WINDOWED | 253 | #ifndef OPIE_NO_WINDOWED |
254 | maximized = TRUE; | 254 | maximized = TRUE; |
255 | // 350 is the trigger in qwsdefaultdecoration for providing a resize button | 255 | // 350 is the trigger in qwsdefaultdecoration for providing a resize button |
256 | if ( qApp->desktop()->width() <= 350 ) | 256 | if ( qApp->desktop()->width() <= 350 ) |
257 | return FALSE; | 257 | return FALSE; |
258 | 258 | ||
259 | Config cfg( "qpe" ); | 259 | Config cfg( "qpe" ); |
260 | cfg.setGroup("ApplicationPositions"); | 260 | cfg.setGroup("ApplicationPositions"); |
261 | QString str = cfg.readEntry( app, QString::null ); | 261 | QString str = cfg.readEntry( app, QString::null ); |
262 | QStringList l = QStringList::split(",", str); | 262 | QStringList l = QStringList::split(",", str); |
263 | 263 | ||
264 | if ( l.count() == 5) { | 264 | if ( l.count() == 5) { |
265 | p.setX( l[0].toInt() ); | 265 | p.setX( l[0].toInt() ); |
266 | p.setY( l[1].toInt() ); | 266 | p.setY( l[1].toInt() ); |
267 | 267 | ||
268 | s.setWidth( l[2].toInt() ); | 268 | s.setWidth( l[2].toInt() ); |
269 | s.setHeight( l[3].toInt() ); | 269 | s.setHeight( l[3].toInt() ); |
270 | 270 | ||
271 | maximized = l[4].toInt(); | 271 | maximized = l[4].toInt(); |
272 | 272 | ||
273 | return TRUE; | 273 | return TRUE; |
274 | } | 274 | } |
275 | #endif | 275 | #endif |
276 | return FALSE; | 276 | return FALSE; |