-rw-r--r-- | kmicromail/mainwindow.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index aa51a37..24196b4 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,19 +1,20 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
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 |
10 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
11 | #endif | 12 | #endif |
12 | #include "defines.h" | 13 | #include "defines.h" |
13 | #include "mainwindow.h" | 14 | #include "mainwindow.h" |
14 | #include <KDGanttMinimizeSplitter.h> | 15 | #include <KDGanttMinimizeSplitter.h> |
15 | 16 | ||
16 | 17 | ||
17 | #include <kabc/stdaddressbook.h> | 18 | #include <kabc/stdaddressbook.h> |
18 | 19 | ||
19 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 20 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
@@ -141,30 +142,56 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
141 | list.append( 100 ); | 142 | list.append( 100 ); |
142 | split->setSizes( list ); | 143 | split->setSizes( list ); |
143 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 144 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
144 | mailView->setShowSortIndicator ( true ); | 145 | mailView->setShowSortIndicator ( true ); |
145 | QLabel *spacer = new QLabel( toolBar ); | 146 | QLabel *spacer = new QLabel( toolBar ); |
146 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 147 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
147 | toolBar->setStretchableWidget( spacer ); | 148 | toolBar->setStretchableWidget( spacer ); |
148 | 149 | ||
149 | QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this); | 150 | QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this); |
150 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 151 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
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 | ||
155 | MainWindow::~MainWindow() | 169 | MainWindow::~MainWindow() |
156 | { | 170 | { |
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 | { |
161 | qDebug("appMessage implemented by subclass"); | 188 | qDebug("appMessage implemented by subclass"); |
162 | } | 189 | } |
163 | 190 | ||
164 | void MainWindow::slotAdjustLayout() { | 191 | void MainWindow::slotAdjustLayout() { |
165 | 192 | ||
166 | /* | 193 | /* |
167 | QWidget *d = QApplication::desktop(); | 194 | QWidget *d = QApplication::desktop(); |
168 | 195 | ||
169 | if ( d->width() < d->height() ) { | 196 | if ( d->width() < d->height() ) { |
170 | layout->setDirection( QBoxLayout::TopToBottom ); | 197 | layout->setDirection( QBoxLayout::TopToBottom ); |