summaryrefslogtreecommitdiffabout
path: root/microkde/kapplication.cpp
Unidiff
Diffstat (limited to 'microkde/kapplication.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kapplication.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index 1b3e689..f0de71e 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -1,7 +1,14 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <stdio.h>
2 3
3#include "kapplication.h" 4#include "kapplication.h"
4#include <qapplication.h> 5#include <qapplication.h>
6#include <qstring.h>
7#include <qfile.h>
8#include <qtextstream.h>
9#include <qdialog.h>
10#include <qlayout.h>
11#include <qtextbrowser.h>
5 12
6int KApplication::random() 13int KApplication::random()
7{ 14{
@@ -31,3 +38,38 @@ QString KApplication::randomString(int length)
31 d->showMaximized(); 38 d->showMaximized();
32 return d->exec(); 39 return d->exec();
33} 40}
41void KApplication::showLicence()
42{
43 QString fileName ;
44 QString text;
45#ifndef DESKTOP_VERSION
46 fileName = getenv("QPEDIR");
47 fileName += "/pics/kdepim/LICENCE.TXT" ;
48#else
49 fileName = qApp->applicationDirPath () + "/kdepim/LICENCE.TXT";
50#endif
51 QFile file( fileName );
52 qDebug("Licence file name %s ",fileName.latin1() );
53 if (!file.open( IO_ReadOnly ) ) {
54 return ;
55 }
56 QTextStream ts( &file );
57 text = ts.read();
58 file.close();
59
60 QDialog dia( 0, "name", true ); ;
61 dia.setCaption( "KDE-Pim/Pi licence" );
62 QVBoxLayout* lay = new QVBoxLayout( &dia );
63 lay->setSpacing( 3 );
64 lay->setMargin( 3 );
65 QTextBrowser tb ( &dia );
66 lay->addWidget( &tb );
67 tb.setText( text );
68#ifdef DESKTOP_VERSION
69 dia.resize( 640, 480);
70#else
71 dia.showMaximized();
72#endif
73 dia.exec();
74
75}