-rw-r--r-- | microkde/kapplication.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index ad0b78e..98ef2f2 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -47,33 +47,38 @@ void KApplication::showFile(QString caption, QString fn) | |||
47 | { | 47 | { |
48 | QString text; | 48 | QString text; |
49 | QString fileName; | 49 | QString fileName; |
50 | #ifndef DESKTOP_VERSION | 50 | #ifndef DESKTOP_VERSION |
51 | fileName = getenv("QPEDIR"); | 51 | fileName = getenv("QPEDIR"); |
52 | fileName += "/pics/" + fn ; | 52 | fileName += "/pics/" + fn ; |
53 | #else | 53 | #else |
54 | fileName = qApp->applicationDirPath () + "/" + fn; | 54 | fileName = qApp->applicationDirPath () + "/" + fn; |
55 | #endif | 55 | #endif |
56 | QFile file( fileName ); | 56 | QFile file( fileName ); |
57 | if (!file.open( IO_ReadOnly ) ) { | 57 | if (!file.open( IO_ReadOnly ) ) { |
58 | return ; | 58 | return ; |
59 | } | 59 | } |
60 | QTextStream ts( &file ); | 60 | QTextStream ts( &file ); |
61 | text = ts.read(); | 61 | text = ts.read(); |
62 | file.close(); | 62 | file.close(); |
63 | 63 | KApplication::showText( caption, text ); | |
64 | |||
65 | } | ||
66 | |||
67 | void KApplication::showText(QString caption, QString text) | ||
68 | { | ||
64 | QDialog dia( 0, "name", true ); ; | 69 | QDialog dia( 0, "name", true ); ; |
65 | dia.setCaption( caption ); | 70 | dia.setCaption( caption ); |
66 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 71 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
67 | lay->setSpacing( 3 ); | 72 | lay->setSpacing( 3 ); |
68 | lay->setMargin( 3 ); | 73 | lay->setMargin( 3 ); |
69 | QTextBrowser tb ( &dia ); | 74 | QTextBrowser tb ( &dia ); |
70 | lay->addWidget( &tb ); | 75 | lay->addWidget( &tb ); |
71 | tb.setText( text ); | 76 | tb.setText( text ); |
72 | #ifdef DESKTOP_VERSION | 77 | #ifdef DESKTOP_VERSION |
73 | dia.resize( 640, 480); | 78 | dia.resize( 640, 480); |
74 | #else | 79 | #else |
75 | dia.showMaximized(); | 80 | dia.showMaximized(); |
76 | #endif | 81 | #endif |
77 | dia.exec(); | 82 | dia.exec(); |
78 | 83 | ||
79 | } | 84 | } |