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 | |
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 @@ | |||
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 | |||
@@ -1,238 +1,265 @@ | |||
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 | ||
32 | addToolBar( toolBar ); | 33 | addToolBar( toolBar ); |
33 | toolBar->setHorizontalStretchable( true ); | 34 | toolBar->setHorizontalStretchable( true ); |
34 | 35 | ||
35 | 36 | ||
36 | 37 | ||
37 | composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), | 38 | composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), |
38 | 0, 0, this ); | 39 | 0, 0, this ); |
39 | composeMail->addTo( toolBar ); | 40 | composeMail->addTo( toolBar ); |
40 | composeMail->addTo( mailMenu ); | 41 | composeMail->addTo( mailMenu ); |
41 | 42 | ||
42 | sendQueued = new QAction( tr( "Send queued mails" ), SmallIcon("sendqueued") , | 43 | sendQueued = new QAction( tr( "Send queued mails" ), SmallIcon("sendqueued") , |
43 | 0, 0, this ); | 44 | 0, 0, this ); |
44 | sendQueued->addTo( toolBar ); | 45 | sendQueued->addTo( toolBar ); |
45 | sendQueued->addTo( mailMenu ); | 46 | sendQueued->addTo( mailMenu ); |
46 | 47 | ||
47 | /* | 48 | /* |
48 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 49 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
49 | 0, 0, this ); | 50 | 0, 0, this ); |
50 | syncFolders->addTo( toolBar ); | 51 | syncFolders->addTo( toolBar ); |
51 | syncFolders->addTo( mailMenu ); | 52 | syncFolders->addTo( mailMenu ); |
52 | */ | 53 | */ |
53 | 54 | ||
54 | showFolders = new QAction( tr( "Show/Hide folders" ), SmallIcon("showfolders") , | 55 | showFolders = new QAction( tr( "Show/Hide folders" ), SmallIcon("showfolders") , |
55 | 0, 0, this, 0, true ); | 56 | 0, 0, this, 0, true ); |
56 | showFolders->addTo( toolBar ); | 57 | showFolders->addTo( toolBar ); |
57 | showFolders->addTo( mailMenu ); | 58 | showFolders->addTo( mailMenu ); |
58 | showFolders->setOn( true ); | 59 | showFolders->setOn( true ); |
59 | connect(showFolders, SIGNAL( toggled(bool) ), | 60 | connect(showFolders, SIGNAL( toggled(bool) ), |
60 | SLOT( slotShowFolders(bool) ) ); | 61 | SLOT( slotShowFolders(bool) ) ); |
61 | 62 | ||
62 | /* | 63 | /* |
63 | searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), | 64 | searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), |
64 | 0, 0, this ); | 65 | 0, 0, this ); |
65 | searchMails->addTo( toolBar ); | 66 | searchMails->addTo( toolBar ); |
66 | searchMails->addTo( mailMenu ); | 67 | searchMails->addTo( mailMenu ); |
67 | */ | 68 | */ |
68 | 69 | ||
69 | deleteMails = new QAction(tr("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 70 | deleteMails = new QAction(tr("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
70 | deleteMails->addTo( toolBar ); | 71 | deleteMails->addTo( toolBar ); |
71 | deleteMails->addTo( mailMenu ); | 72 | deleteMails->addTo( mailMenu ); |
72 | connect( deleteMails, SIGNAL( activated() ), | 73 | connect( deleteMails, SIGNAL( activated() ), |
73 | SLOT( slotDeleteMail() ) ); | 74 | SLOT( slotDeleteMail() ) ); |
74 | 75 | ||
75 | editSettings = new QAction( tr( "Edit settings" ), SmallIcon("SettingsIcon") , | 76 | editSettings = new QAction( tr( "Edit settings" ), SmallIcon("SettingsIcon") , |
76 | 0, 0, this ); | 77 | 0, 0, this ); |
77 | editSettings->addTo( settingsMenu ); | 78 | editSettings->addTo( settingsMenu ); |
78 | connect( editSettings, SIGNAL( activated() ), | 79 | connect( editSettings, SIGNAL( activated() ), |
79 | SLOT( slotEditSettings() ) ); | 80 | SLOT( slotEditSettings() ) ); |
80 | editAccounts = new QAction( tr( "Configure accounts" ), SmallIcon("editaccounts") , | 81 | editAccounts = new QAction( tr( "Configure accounts" ), SmallIcon("editaccounts") , |
81 | 0, 0, this ); | 82 | 0, 0, this ); |
82 | editAccounts->addTo( settingsMenu ); | 83 | editAccounts->addTo( settingsMenu ); |
83 | 84 | ||
84 | //setCentralWidget( view ); | 85 | //setCentralWidget( view ); |
85 | 86 | ||
86 | QVBox* wrapperBox = new QVBox( this ); | 87 | QVBox* wrapperBox = new QVBox( this ); |
87 | setCentralWidget( wrapperBox ); | 88 | setCentralWidget( wrapperBox ); |
88 | 89 | ||
89 | // QWidget *view = new QWidget( wrapperBox ); | 90 | // QWidget *view = new QWidget( wrapperBox ); |
90 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); | 91 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); |
91 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 92 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
92 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 93 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
93 | 94 | ||
94 | folderView = new AccountView( split ); | 95 | folderView = new AccountView( split ); |
95 | folderView->header()->hide(); | 96 | folderView->header()->hide(); |
96 | folderView->setRootIsDecorated( false ); | 97 | folderView->setRootIsDecorated( false ); |
97 | folderView->addColumn( tr( "Mailbox" ) ); | 98 | folderView->addColumn( tr( "Mailbox" ) ); |
98 | 99 | ||
99 | //layout->addWidget( folderView ); | 100 | //layout->addWidget( folderView ); |
100 | 101 | ||
101 | mailView = new QListView( split ); | 102 | mailView = new QListView( split ); |
102 | mailView->addColumn( tr( " " ) ); | 103 | mailView->addColumn( tr( " " ) ); |
103 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 104 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
104 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 105 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
105 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 106 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
106 | mailView->addColumn( tr( "Date" ),QListView::Manual); | 107 | mailView->addColumn( tr( "Date" ),QListView::Manual); |
107 | mailView->setAllColumnsShowFocus(true); | 108 | mailView->setAllColumnsShowFocus(true); |
108 | //mailView->setSorting(-1); | 109 | //mailView->setSorting(-1); |
109 | mailView->setRootIsDecorated( false ); | 110 | mailView->setRootIsDecorated( false ); |
110 | statusWidget = new StatusWidget( wrapperBox ); | 111 | statusWidget = new StatusWidget( wrapperBox ); |
111 | statusWidget->hide(); | 112 | statusWidget->hide(); |
112 | 113 | ||
113 | //layout->addWidget( mailView ); | 114 | //layout->addWidget( mailView ); |
114 | //layout->setStretchFactor( folderView, 1 ); | 115 | //layout->setStretchFactor( folderView, 1 ); |
115 | //layout->setStretchFactor( mailView, 2 ); | 116 | //layout->setStretchFactor( mailView, 2 ); |
116 | 117 | ||
117 | slotAdjustLayout(); | 118 | slotAdjustLayout(); |
118 | #ifndef DESKTOP_VERSION | 119 | #ifndef DESKTOP_VERSION |
119 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 120 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
120 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 121 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
121 | #endif | 122 | #endif |
122 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 123 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
123 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 124 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
124 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 125 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
125 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 126 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
126 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 127 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
127 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 128 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
128 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 129 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
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(); |
183 | 210 | ||
184 | mailView->setColumnWidth( 0, 10 ); | 211 | mailView->setColumnWidth( 0, 10 ); |
185 | mailView->setColumnWidth( 1, 100 ); | 212 | mailView->setColumnWidth( 1, 100 ); |
186 | mailView->setColumnWidth( 2, 100 ); | 213 | mailView->setColumnWidth( 2, 100 ); |
187 | mailView->setColumnWidth( 3, 50 ); | 214 | mailView->setColumnWidth( 3, 50 ); |
188 | mailView->setColumnWidth( 4, 120 ); | 215 | mailView->setColumnWidth( 4, 120 ); |
189 | } | 216 | } |
190 | 217 | ||
191 | void MainWindow::slotEditSettings() | 218 | void MainWindow::slotEditSettings() |
192 | { | 219 | { |
193 | } | 220 | } |
194 | 221 | ||
195 | void MainWindow::slotShowFolders( bool ) | 222 | void MainWindow::slotShowFolders( bool ) |
196 | { | 223 | { |
197 | qDebug("not implemented: "); | 224 | qDebug("not implemented: "); |
198 | } | 225 | } |
199 | 226 | ||
200 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 227 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
201 | { | 228 | { |
202 | qDebug("not implemented: "); | 229 | qDebug("not implemented: "); |
203 | } | 230 | } |
204 | 231 | ||
205 | void MainWindow::mailLeftClicked(QListViewItem * ) | 232 | void MainWindow::mailLeftClicked(QListViewItem * ) |
206 | { | 233 | { |
207 | qDebug("not implemented: "); | 234 | qDebug("not implemented: "); |
208 | } | 235 | } |
209 | 236 | ||
210 | void MainWindow::displayMail() | 237 | void MainWindow::displayMail() |
211 | { | 238 | { |
212 | qDebug("not implemented: "); | 239 | qDebug("not implemented: "); |
213 | } | 240 | } |
214 | 241 | ||
215 | void MainWindow::slotDeleteMail() | 242 | void MainWindow::slotDeleteMail() |
216 | { | 243 | { |
217 | qDebug("not implemented: "); | 244 | qDebug("not implemented: "); |
218 | } | 245 | } |
219 | 246 | ||
220 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 247 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
221 | { | 248 | { |
222 | qDebug("not implemented: "); | 249 | qDebug("not implemented: "); |
223 | } | 250 | } |
224 | 251 | ||
225 | void MainWindow::slotSendQueued() | 252 | void MainWindow::slotSendQueued() |
226 | { | 253 | { |
227 | qDebug("not implemented: "); | 254 | qDebug("not implemented: "); |
228 | } | 255 | } |
229 | 256 | ||
230 | void MainWindow::slotEditAccounts() | 257 | void MainWindow::slotEditAccounts() |
231 | { | 258 | { |
232 | qDebug("not implemented: "); | 259 | qDebug("not implemented: "); |
233 | } | 260 | } |
234 | 261 | ||
235 | void MainWindow::slotComposeMail() | 262 | void MainWindow::slotComposeMail() |
236 | { | 263 | { |
237 | qDebug("not implemented: "); | 264 | qDebug("not implemented: "); |
238 | } | 265 | } |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 0cb252c..d6dc6cc 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -1,56 +1,59 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qaction.h> | 6 | #include <qaction.h> |
7 | 7 | ||
8 | #include <qtoolbar.h> | 8 | #include <qtoolbar.h> |
9 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
10 | 10 | ||
11 | #include "accountview.h" | 11 | #include "accountview.h" |
12 | #include "statuswidget.h" | 12 | #include "statuswidget.h" |
13 | 13 | ||
14 | #include <libmailwrapper/mailtypes.h> | 14 | #include <libmailwrapper/mailtypes.h> |
15 | #include <opie2/osmartpointer.h> | 15 | #include <opie2/osmartpointer.h> |
16 | 16 | ||
17 | class RecMail; | 17 | class RecMail; |
18 | 18 | ||
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 |
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f0de71e..ad0b78e 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -1,75 +1,79 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | 3 | ||
4 | #include "kapplication.h" | 4 | #include "kapplication.h" |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qtextstream.h> | 8 | #include <qtextstream.h> |
9 | #include <qdialog.h> | 9 | #include <qdialog.h> |
10 | #include <qlayout.h> | 10 | #include <qlayout.h> |
11 | #include <qtextbrowser.h> | 11 | #include <qtextbrowser.h> |
12 | 12 | ||
13 | int KApplication::random() | 13 | int KApplication::random() |
14 | { | 14 | { |
15 | return rand(); | 15 | return rand(); |
16 | } | 16 | } |
17 | 17 | ||
18 | //US | 18 | //US |
19 | QString KApplication::randomString(int length) | 19 | QString KApplication::randomString(int length) |
20 | { | 20 | { |
21 | if (length <=0 ) return QString::null; | 21 | if (length <=0 ) return QString::null; |
22 | 22 | ||
23 | QString str; | 23 | QString str; |
24 | while (length--) | 24 | while (length--) |
25 | { | 25 | { |
26 | int r=random() % 62; | 26 | int r=random() % 62; |
27 | r+=48; | 27 | r+=48; |
28 | if (r>57) r+=7; | 28 | if (r>57) r+=7; |
29 | if (r>90) r+=6; | 29 | if (r>90) r+=6; |
30 | str += char(r); | 30 | str += char(r); |
31 | // so what if I work backwards? | 31 | // so what if I work backwards? |
32 | } | 32 | } |
33 | return str; | 33 | return str; |
34 | } | 34 | } |
35 | int KApplication::execDialog( QDialog* d ) | 35 | int KApplication::execDialog( QDialog* d ) |
36 | { | 36 | { |
37 | if (QApplication::desktop()->width() <= 640 ) | 37 | if (QApplication::desktop()->width() <= 640 ) |
38 | d->showMaximized(); | 38 | d->showMaximized(); |
39 | return d->exec(); | 39 | return d->exec(); |
40 | } | 40 | } |
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 | |||
@@ -1,24 +1,25 @@ | |||
1 | #ifndef MINIKDE_KAPPLICATION_H | 1 | #ifndef MINIKDE_KAPPLICATION_H |
2 | #define MINIKDE_KAPPLICATION_H | 2 | #define MINIKDE_KAPPLICATION_H |
3 | 3 | ||
4 | #include "qstring.h" | 4 | #include "qstring.h" |
5 | #include <qdialog.h> | 5 | #include <qdialog.h> |
6 | 6 | ||
7 | class KApplication | 7 | class KApplication |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | static int random(); | 10 | static int random(); |
11 | 11 | ||
12 | //US | 12 | //US |
13 | /** | 13 | /** |
14 | * Generates a random string. It operates in the range [A-Za-z0-9] | 14 | * Generates a random string. It operates in the range [A-Za-z0-9] |
15 | * @param length Generate a string of this length. | 15 | * @param length Generate a string of this length. |
16 | * @return the random string | 16 | * @return the random string |
17 | */ | 17 | */ |
18 | static QString randomString(int length); | 18 | static QString randomString(int length); |
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 | ||
23 | 24 | ||
24 | #endif | 25 | #endif |