author | zautrix <zautrix> | 2004-08-06 22:09:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-06 22:09:46 (UTC) |
commit | 72e30db97aa4984aace0d40a1d55762e4745937d (patch) (side-by-side diff) | |
tree | db5d5ea0748d2fa6ba63c317649567f07750f9aa /microkde | |
parent | acc0637eb0965d66b96d138d74514acf2cf24792 (diff) | |
download | kdepimpi-72e30db97aa4984aace0d40a1d55762e4745937d.zip kdepimpi-72e30db97aa4984aace0d40a1d55762e4745937d.tar.gz kdepimpi-72e30db97aa4984aace0d40a1d55762e4745937d.tar.bz2 |
More licence stuff
-rw-r--r-- | microkde/kapplication.cpp | 5 | ||||
-rw-r--r-- | microkde/kapplication.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index ad0b78e..98ef2f2 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -39,41 +39,46 @@ int KApplication::execDialog( QDialog* d ) return d->exec(); } void KApplication::showLicence() { KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" ); } void KApplication::showFile(QString caption, QString fn) { QString text; QString fileName; #ifndef DESKTOP_VERSION fileName = getenv("QPEDIR"); fileName += "/pics/" + fn ; #else fileName = qApp->applicationDirPath () + "/" + fn; #endif QFile file( fileName ); if (!file.open( IO_ReadOnly ) ) { return ; } QTextStream ts( &file ); text = ts.read(); file.close(); + KApplication::showText( caption, text ); +} + +void KApplication::showText(QString caption, QString text) +{ QDialog dia( 0, "name", true ); ; dia.setCaption( caption ); QVBoxLayout* lay = new QVBoxLayout( &dia ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QTextBrowser tb ( &dia ); lay->addWidget( &tb ); tb.setText( text ); #ifdef DESKTOP_VERSION dia.resize( 640, 480); #else dia.showMaximized(); #endif dia.exec(); } diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 5ae5c00..79cdb33 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h @@ -1,25 +1,26 @@ #ifndef MINIKDE_KAPPLICATION_H #define MINIKDE_KAPPLICATION_H #include "qstring.h" #include <qdialog.h> class KApplication { public: static int random(); //US /** * Generates a random string. It operates in the range [A-Za-z0-9] * @param length Generate a string of this length. * @return the random string */ static QString randomString(int length); static int execDialog( QDialog* ); static void showLicence(); static void showFile(QString caption, QString file); + static void showText(QString caption, QString text); }; #endif |