author | zautrix <zautrix> | 2004-08-06 21:32:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-06 21:32:25 (UTC) |
commit | acc0637eb0965d66b96d138d74514acf2cf24792 (patch) (unidiff) | |
tree | 6787abd671406bbdeb2e3387aa39ba4806d84689 /kmicromail | |
parent | 2087f0a25354897ff9b987093e1c6716d7bd967b (diff) | |
download | kdepimpi-acc0637eb0965d66b96d138d74514acf2cf24792.zip kdepimpi-acc0637eb0965d66b96d138d74514acf2cf24792.tar.gz kdepimpi-acc0637eb0965d66b96d138d74514acf2cf24792.tar.bz2 |
more licence stuff
-rw-r--r-- | kmicromail/mainwindow.cpp | 27 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 3 |
2 files changed, 30 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,31 +1,32 @@ | |||
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 ) |
20 | : QMainWindow( parent, name ) //, flags ) | 21 | : QMainWindow( parent, name ) //, flags ) |
21 | { | 22 | { |
22 | setCaption( tr( "OpieMail/Pi" ) ); | 23 | setCaption( tr( "OpieMail/Pi" ) ); |
23 | setToolBarsMovable( false ); | 24 | setToolBarsMovable( false ); |
24 | KABC::StdAddressBook::self(); | 25 | KABC::StdAddressBook::self(); |
25 | toolBar = new QToolBar( this ); | 26 | toolBar = new QToolBar( this ); |
26 | menuBar = new QMenuBar( toolBar ); | 27 | menuBar = new QMenuBar( toolBar ); |
27 | mailMenu = new QPopupMenu( menuBar ); | 28 | mailMenu = new QPopupMenu( menuBar ); |
28 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 29 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
29 | settingsMenu = new QPopupMenu( menuBar ); | 30 | settingsMenu = new QPopupMenu( menuBar ); |
30 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 31 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
31 | 32 | ||
@@ -129,54 +130,80 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
129 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 130 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
130 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 131 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
131 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 132 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
132 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 133 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
133 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 134 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
134 | //mailView->setMultiSelection ( true ); | 135 | //mailView->setMultiSelection ( true ); |
135 | mailView->setSelectionMode( QListView::Extended ); | 136 | mailView->setSelectionMode( QListView::Extended ); |
136 | QValueList<int> list; | 137 | QValueList<int> list; |
137 | int fw = 100; | 138 | int fw = 100; |
138 | if ( QApplication::desktop()->width() > 320 ) | 139 | if ( QApplication::desktop()->width() > 320 ) |
139 | fw = 50; | 140 | fw = 50; |
140 | list.append( fw ); | 141 | list.append( fw ); |
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 ); |
171 | } else { | 198 | } else { |
172 | layout->setDirection( QBoxLayout::LeftToRight ); | 199 | layout->setDirection( QBoxLayout::LeftToRight ); |
173 | } | 200 | } |
174 | */ | 201 | */ |
175 | } | 202 | } |
176 | 203 | ||
177 | void MainWindow::slotAdjustColumns() | 204 | void MainWindow::slotAdjustColumns() |
178 | { | 205 | { |
179 | bool hidden = folderView->isHidden(); | 206 | bool hidden = folderView->isHidden(); |
180 | if ( hidden ) folderView->show(); | 207 | if ( hidden ) folderView->show(); |
181 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 208 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
182 | if ( hidden ) folderView->hide(); | 209 | if ( hidden ) folderView->hide(); |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 0cb252c..d6dc6cc 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -19,38 +19,41 @@ class RecMail; | |||
19 | class MainWindow : public QMainWindow | 19 | class MainWindow : public QMainWindow |
20 | { | 20 | { |
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | 22 | ||
23 | public: | 23 | public: |
24 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 24 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
25 | virtual ~MainWindow(); | 25 | virtual ~MainWindow(); |
26 | 26 | ||
27 | public slots: | 27 | public slots: |
28 | virtual void slotAdjustColumns(); | 28 | virtual void slotAdjustColumns(); |
29 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 29 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
30 | virtual void slotComposeMail(); | 30 | virtual void slotComposeMail(); |
31 | 31 | ||
32 | protected slots: | 32 | protected slots: |
33 | virtual void slotSendQueued(); | 33 | virtual void slotSendQueued(); |
34 | virtual void slotEditAccounts(); | 34 | virtual void slotEditAccounts(); |
35 | virtual void slotShowFolders( bool show ); | 35 | virtual void slotShowFolders( bool show ); |
36 | virtual void refreshMailView(const QValueList<RecMailP>&); | 36 | virtual void refreshMailView(const QValueList<RecMailP>&); |
37 | virtual void displayMail(); | 37 | virtual void displayMail(); |
38 | virtual void slotDeleteMail(); | 38 | virtual void slotDeleteMail(); |
39 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 39 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
40 | virtual void slotAdjustLayout(); | 40 | virtual void slotAdjustLayout(); |
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: |
45 | QToolBar *toolBar; | 48 | QToolBar *toolBar; |
46 | StatusWidget *statusWidget; | 49 | StatusWidget *statusWidget; |
47 | QMenuBar *menuBar; | 50 | QMenuBar *menuBar; |
48 | QPopupMenu *mailMenu, *settingsMenu; | 51 | QPopupMenu *mailMenu, *settingsMenu; |
49 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 52 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
50 | *editSettings, *editAccounts, *syncFolders; | 53 | *editSettings, *editAccounts, *syncFolders; |
51 | AccountView *folderView; | 54 | AccountView *folderView; |
52 | QListView *mailView; | 55 | QListView *mailView; |
53 | //QBoxLayout *layout; | 56 | //QBoxLayout *layout; |
54 | }; | 57 | }; |
55 | 58 | ||
56 | #endif | 59 | #endif |