author | zautrix <zautrix> | 2004-08-06 21:32:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-06 21:32:25 (UTC) |
commit | acc0637eb0965d66b96d138d74514acf2cf24792 (patch) (side-by-side diff) | |
tree | 6787abd671406bbdeb2e3387aa39ba4806d84689 | |
parent | 2087f0a25354897ff9b987093e1c6716d7bd967b (diff) | |
download | kdepimpi-acc0637eb0965d66b96d138d74514acf2cf24792.zip kdepimpi-acc0637eb0965d66b96d138d74514acf2cf24792.tar.gz kdepimpi-acc0637eb0965d66b96d138d74514acf2cf24792.tar.bz2 |
more licence stuff
-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 @@ +libEtPan! -- a mail stuff library + +Copyright (C) 2001, 2002 - DINH Viet Hoa +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the libEtPan! project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index aa51a37..24196b4 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -4,8 +4,9 @@ #include <qtimer.h> #include <qlayout.h> #include <kdialog.h> #include <kiconloader.h> +#include <kapplication.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #endif @@ -149,14 +150,40 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this); connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); closeMail->addTo(toolBar); closeMail->addTo(mailMenu); + + + QPopupMenu* helpMenu = new QPopupMenu( menuBar ); + menuBar->insertItem( tr( "Help" ), helpMenu ); + QAction* li = new QAction(tr("About"), QPixmap(), 0, 0, this); + connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); + li->addTo(helpMenu); + li = new QAction(tr("Licence"),QPixmap(), 0, 0, this); + connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); + li->addTo(helpMenu); + li = new QAction(tr("LibEtPan Licence"), QPixmap(), 0, 0, this); + connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); + li->addTo(helpMenu); } MainWindow::~MainWindow() { } +void MainWindow::showLicence() +{ + KApplication::showLicence(); +} +void MainWindow::showAbout() +{ + qDebug("MainWindow::showAbout() "); +} +void MainWindow::showEtpanLicence() +{ + KApplication::showFile( "LibEtPan licence", "kdepim/kmicromail/COPYRIGHTlibetpan" ); + +} void MainWindow::appMessage(const QCString &, const QByteArray &) { qDebug("appMessage implemented by subclass"); } diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 0cb252c..d6dc6cc 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h @@ -39,8 +39,11 @@ protected slots: virtual void mailHold(int, QListViewItem *,const QPoint&,int); virtual void slotAdjustLayout(); virtual void slotEditSettings(); virtual void mailLeftClicked( QListViewItem * ); + void showLicence(); + void showAbout(); + void showEtpanLicence(); protected: QToolBar *toolBar; StatusWidget *statusWidget; diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f0de71e..ad0b78e 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -39,37 +39,41 @@ int KApplication::execDialog( QDialog* d ) return d->exec(); } 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 @@ -17,8 +17,9 @@ class KApplication */ static QString randomString(int length); static int execDialog( QDialog* ); static void showLicence(); + static void showFile(QString caption, QString file); }; #endif |