-rw-r--r-- | bin/kdepim/kmicromail/COPYRIGHTlibetpan | 28 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 27 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 3 | ||||
-rw-r--r-- | microkde/kapplication.cpp | 52 | ||||
-rw-r--r-- | microkde/kapplication.h | 1 |
5 files changed, 87 insertions, 24 deletions
diff --git a/bin/kdepim/kmicromail/COPYRIGHTlibetpan b/bin/kdepim/kmicromail/COPYRIGHTlibetpan new file mode 100644 index 0000000..a8b98f9 --- a/dev/null +++ b/bin/kdepim/kmicromail/COPYRIGHTlibetpan | |||
@@ -0,0 +1,28 @@ | |||
1 | libEtPan! -- a mail stuff library | ||
2 | |||
3 | Copyright (C) 2001, 2002 - DINH Viet Hoa | ||
4 | All rights reserved. | ||
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions | ||
8 | are met: | ||
9 | 1. Redistributions of source code must retain the above copyright | ||
10 | notice, this list of conditions and the following disclaimer. | ||
11 | 2. Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | 3. Neither the name of the libEtPan! project nor the names of its | ||
15 | contributors may be used to endorse or promote products derived | ||
16 | from this software without specific prior written permission. | ||
17 | |||
18 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
28 | SUCH DAMAGE. | ||
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index aa51a37..24196b4 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -6,4 +6,5 @@ | |||
6 | #include <kdialog.h> | 6 | #include <kdialog.h> |
7 | #include <kiconloader.h> | 7 | #include <kiconloader.h> |
8 | #include <kapplication.h> | ||
8 | 9 | ||
9 | #ifndef DESKTOP_VERSION | 10 | #ifndef DESKTOP_VERSION |
@@ -151,4 +152,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
151 | closeMail->addTo(toolBar); | 152 | closeMail->addTo(toolBar); |
152 | closeMail->addTo(mailMenu); | 153 | closeMail->addTo(mailMenu); |
154 | |||
155 | |||
156 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | ||
157 | menuBar->insertItem( tr( "Help" ), helpMenu ); | ||
158 | QAction* li = new QAction(tr("About"), QPixmap(), 0, 0, this); | ||
159 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | ||
160 | li->addTo(helpMenu); | ||
161 | li = new QAction(tr("Licence"),QPixmap(), 0, 0, this); | ||
162 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | ||
163 | li->addTo(helpMenu); | ||
164 | li = new QAction(tr("LibEtPan Licence"), QPixmap(), 0, 0, this); | ||
165 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | ||
166 | li->addTo(helpMenu); | ||
153 | } | 167 | } |
154 | 168 | ||
@@ -157,4 +171,17 @@ MainWindow::~MainWindow() | |||
157 | } | 171 | } |
158 | 172 | ||
173 | void MainWindow::showLicence() | ||
174 | { | ||
175 | KApplication::showLicence(); | ||
176 | } | ||
177 | void MainWindow::showAbout() | ||
178 | { | ||
179 | qDebug("MainWindow::showAbout() "); | ||
180 | } | ||
181 | void MainWindow::showEtpanLicence() | ||
182 | { | ||
183 | KApplication::showFile( "LibEtPan licence", "kdepim/kmicromail/COPYRIGHTlibetpan" ); | ||
184 | |||
185 | } | ||
159 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 186 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
160 | { | 187 | { |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 0cb252c..d6dc6cc 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -41,4 +41,7 @@ protected slots: | |||
41 | virtual void slotEditSettings(); | 41 | virtual void slotEditSettings(); |
42 | virtual void mailLeftClicked( QListViewItem * ); | 42 | virtual void mailLeftClicked( QListViewItem * ); |
43 | void showLicence(); | ||
44 | void showAbout(); | ||
45 | void showEtpanLicence(); | ||
43 | 46 | ||
44 | protected: | 47 | protected: |
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f0de71e..ad0b78e 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -41,35 +41,39 @@ int KApplication::execDialog( QDialog* d ) | |||
41 | void KApplication::showLicence() | 41 | void KApplication::showLicence() |
42 | { | 42 | { |
43 | QString fileName ; | 43 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" ); |
44 | QString text; | 44 | } |
45 | |||
46 | void KApplication::showFile(QString caption, QString fn) | ||
47 | { | ||
48 | QString text; | ||
49 | QString fileName; | ||
45 | #ifndef DESKTOP_VERSION | 50 | #ifndef DESKTOP_VERSION |
46 | fileName = getenv("QPEDIR"); | 51 | fileName = getenv("QPEDIR"); |
47 | fileName += "/pics/kdepim/LICENCE.TXT" ; | 52 | fileName += "/pics/" + fn ; |
48 | #else | 53 | #else |
49 | fileName = qApp->applicationDirPath () + "/kdepim/LICENCE.TXT"; | 54 | fileName = qApp->applicationDirPath () + "/" + fn; |
50 | #endif | 55 | #endif |
51 | QFile file( fileName ); | 56 | QFile file( fileName ); |
52 | qDebug("Licence file name %s ",fileName.latin1() ); | 57 | if (!file.open( IO_ReadOnly ) ) { |
53 | if (!file.open( IO_ReadOnly ) ) { | 58 | return ; |
54 | return ; | 59 | } |
55 | } | 60 | QTextStream ts( &file ); |
56 | QTextStream ts( &file ); | 61 | text = ts.read(); |
57 | text = ts.read(); | 62 | file.close(); |
58 | file.close(); | 63 | |
59 | 64 | QDialog dia( 0, "name", true ); ; | |
60 | QDialog dia( 0, "name", true ); ; | 65 | dia.setCaption( caption ); |
61 | dia.setCaption( "KDE-Pim/Pi licence" ); | 66 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
62 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 67 | lay->setSpacing( 3 ); |
63 | lay->setSpacing( 3 ); | 68 | lay->setMargin( 3 ); |
64 | lay->setMargin( 3 ); | 69 | QTextBrowser tb ( &dia ); |
65 | QTextBrowser tb ( &dia ); | 70 | lay->addWidget( &tb ); |
66 | lay->addWidget( &tb ); | 71 | tb.setText( text ); |
67 | tb.setText( text ); | ||
68 | #ifdef DESKTOP_VERSION | 72 | #ifdef DESKTOP_VERSION |
69 | dia.resize( 640, 480); | 73 | dia.resize( 640, 480); |
70 | #else | 74 | #else |
71 | dia.showMaximized(); | 75 | dia.showMaximized(); |
72 | #endif | 76 | #endif |
73 | dia.exec(); | 77 | dia.exec(); |
74 | 78 | ||
75 | } | 79 | } |
diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 9515c60..5ae5c00 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h | |||
@@ -19,4 +19,5 @@ class KApplication | |||
19 | static int execDialog( QDialog* ); | 19 | static int execDialog( QDialog* ); |
20 | static void showLicence(); | 20 | static void showLicence(); |
21 | static void showFile(QString caption, QString file); | ||
21 | }; | 22 | }; |
22 | 23 | ||