-rw-r--r-- | library/qpeapplication.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 23606db..2515f1b 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
@@ -24,2 +24,3 @@ | |||
24 | #include <qapplication.h> | 24 | #include <qapplication.h> |
25 | #include <qdialog.h> | ||
25 | #if defined(_WS_QWS_) && !defined(Q_WS_QWS) | 26 | #if defined(_WS_QWS_) && !defined(Q_WS_QWS) |
@@ -76,2 +77,4 @@ public: | |||
76 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); | 77 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); |
78 | static void showDialog( QDialog*, bool nomax=FALSE ); | ||
79 | static int execDialog( QDialog*, bool nomax=FALSE ); | ||
77 | 80 | ||
@@ -80,2 +83,4 @@ public: | |||
80 | 83 | ||
84 | bool keyboardGrabbed() const; | ||
85 | |||
81 | int exec(); | 86 | int exec(); |
@@ -86,4 +91,4 @@ signals: | |||
86 | void clockChanged( bool pm ); | 91 | void clockChanged( bool pm ); |
87 | void volumeChanged( bool muted ); | ||
88 | void micChanged( bool muted ); | 92 | void micChanged( bool muted ); |
93 | void volumeChanged( bool muted ); | ||
89 | void appMessage( const QCString& msg, const QByteArray& data); | 94 | void appMessage( const QCString& msg, const QByteArray& data); |
@@ -108,3 +113,2 @@ protected: | |||
108 | void timerEvent( QTimerEvent * ); | 113 | void timerEvent( QTimerEvent * ); |
109 | bool keyboardGrabbed() const; | ||
110 | bool raiseAppropriateWindow(); | 114 | bool raiseAppropriateWindow(); |
@@ -127,2 +131,24 @@ private: | |||
127 | 131 | ||
132 | inline void QPEApplication::showDialog( QDialog* d, bool nomax ) | ||
133 | { | ||
134 | QSize sh = d->sizeHint(); | ||
135 | int w = QMAX(sh.width(),d->width()); | ||
136 | int h = QMAX(sh.height(),d->height()); | ||
137 | if ( !nomax | ||
138 | && ( w > qApp->desktop()->width()*3/4 | ||
139 | || h > qApp->desktop()->height()*3/4 ) ) | ||
140 | { | ||
141 | d->showMaximized(); | ||
142 | } else { | ||
143 | d->resize(w,h); | ||
144 | d->show(); | ||
145 | } | ||
146 | } | ||
147 | |||
148 | inline int QPEApplication::execDialog( QDialog* d, bool nomax ) | ||
149 | { | ||
150 | showDialog(d,nomax); | ||
151 | return d->exec(); | ||
152 | } | ||
153 | |||
128 | 154 | ||