From acc0637eb0965d66b96d138d74514acf2cf24792 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 06 Aug 2004 21:32:25 +0000 Subject: more licence stuff --- (limited to 'microkde') diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f0de71e..ad0b78e 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -40,36 +40,40 @@ int KApplication::execDialog( QDialog* d ) } void KApplication::showLicence() { - QString fileName ; - QString text; + 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/kdepim/LICENCE.TXT" ; + fileName += "/pics/" + fn ; #else - fileName = qApp->applicationDirPath () + "/kdepim/LICENCE.TXT"; + fileName = qApp->applicationDirPath () + "/" + fn; #endif - QFile file( fileName ); - qDebug("Licence file name %s ",fileName.latin1() ); - if (!file.open( IO_ReadOnly ) ) { - return ; - } - QTextStream ts( &file ); - text = ts.read(); - file.close(); - - QDialog dia( 0, "name", true ); ; - dia.setCaption( "KDE-Pim/Pi licence" ); - QVBoxLayout* lay = new QVBoxLayout( &dia ); - lay->setSpacing( 3 ); - lay->setMargin( 3 ); - QTextBrowser tb ( &dia ); - lay->addWidget( &tb ); - tb.setText( text ); + QFile file( fileName ); + if (!file.open( IO_ReadOnly ) ) { + return ; + } + QTextStream ts( &file ); + text = ts.read(); + file.close(); + + 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); + dia.resize( 640, 480); #else - dia.showMaximized(); + dia.showMaximized(); #endif - dia.exec(); + dia.exec(); } diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 9515c60..5ae5c00 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h @@ -18,6 +18,7 @@ class KApplication static QString randomString(int length); static int execDialog( QDialog* ); static void showLicence(); + static void showFile(QString caption, QString file); }; -- cgit v0.9.0.2