author | zautrix <zautrix> | 2005-04-01 09:50:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 09:50:16 (UTC) |
commit | f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772 (patch) (unidiff) | |
tree | 15edcb7a2b053eae5c5391191f71ba5c5c015211 /microkde/kapplication.cpp | |
parent | b76ad1e7e329051a47e28c9d132ce3fcd0b25c5c (diff) | |
download | kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.zip kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.tar.gz kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.tar.bz2 |
fixes
-rw-r--r-- | microkde/kapplication.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f05b91b..80a83e0 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -33,32 +33,47 @@ QString KApplication::randomString(int length) | |||
33 | } | 33 | } |
34 | return str; | 34 | return str; |
35 | } | 35 | } |
36 | int KApplication::execDialog( QDialog* d ) | 36 | int KApplication::execDialog( QDialog* d ) |
37 | { | 37 | { |
38 | if (QApplication::desktop()->width() <= 640 ) | 38 | if (QApplication::desktop()->width() <= 640 ) |
39 | d->showMaximized(); | 39 | d->showMaximized(); |
40 | else | 40 | else |
41 | ;//d->resize( 800, 600 ); | 41 | ;//d->resize( 800, 600 ); |
42 | return d->exec(); | 42 | return d->exec(); |
43 | } | 43 | } |
44 | void KApplication::showLicence() | 44 | void KApplication::showLicence() |
45 | { | 45 | { |
46 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); | 46 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); |
47 | } | 47 | } |
48 | 48 | ||
49 | void KApplication::testCoords( int* x, int* y, int* wid, int * hei ) | ||
50 | { | ||
51 | int dWid = QApplication::desktop()->width() ; | ||
52 | int dHei = QApplication::desktop()->height(); | ||
53 | if ( *x + *wid > dWid ) { | ||
54 | *x = 0; | ||
55 | if ( *wid > dWid ) | ||
56 | *wid = dWid; | ||
57 | } | ||
58 | if ( *y + *hei > dHei ) { | ||
59 | *y = 0; | ||
60 | if ( *hei > dHei ) | ||
61 | *hei = dHei; | ||
62 | } | ||
63 | } | ||
49 | void KApplication::showFile(QString caption, QString fn) | 64 | void KApplication::showFile(QString caption, QString fn) |
50 | { | 65 | { |
51 | QString text; | 66 | QString text; |
52 | QString fileName; | 67 | QString fileName; |
53 | #ifndef DESKTOP_VERSION | 68 | #ifndef DESKTOP_VERSION |
54 | fileName = getenv("QPEDIR"); | 69 | fileName = getenv("QPEDIR"); |
55 | fileName += "/pics/" + fn ; | 70 | fileName += "/pics/" + fn ; |
56 | #else | 71 | #else |
57 | fileName = qApp->applicationDirPath () + "/" + fn; | 72 | fileName = qApp->applicationDirPath () + "/" + fn; |
58 | #endif | 73 | #endif |
59 | QFile file( fileName ); | 74 | QFile file( fileName ); |
60 | if (!file.open( IO_ReadOnly ) ) { | 75 | if (!file.open( IO_ReadOnly ) ) { |
61 | return ; | 76 | return ; |
62 | } | 77 | } |
63 | QTextStream ts( &file ); | 78 | QTextStream ts( &file ); |
64 | text = ts.read(); | 79 | text = ts.read(); |