-rw-r--r-- | kmicromail/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 4c58909..9a52d1b 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -187,230 +187,230 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
187 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 187 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
188 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 188 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
189 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 189 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
190 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 190 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
191 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 191 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
192 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 192 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
193 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 193 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
194 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 194 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
195 | 195 | ||
196 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, | 196 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, |
197 | SLOT( setInfoFields(QListViewItem*) ) ); | 197 | SLOT( setInfoFields(QListViewItem*) ) ); |
198 | 198 | ||
199 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 199 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
200 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 200 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
201 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 201 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
202 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 202 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
203 | //mailView->setMultiSelection ( true ); | 203 | //mailView->setMultiSelection ( true ); |
204 | mailView->setSelectionMode( QListView::Extended ); | 204 | mailView->setSelectionMode( QListView::Extended ); |
205 | QValueList<int> list; | 205 | QValueList<int> list; |
206 | int fw = 100; | 206 | int fw = 100; |
207 | if ( QApplication::desktop()->width() > 320 ) | 207 | if ( QApplication::desktop()->width() > 320 ) |
208 | fw = 50; | 208 | fw = 50; |
209 | list.append( fw ); | 209 | list.append( fw ); |
210 | list.append( 100 ); | 210 | list.append( 100 ); |
211 | split->setSizes( list ); | 211 | split->setSizes( list ); |
212 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 212 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
213 | mailView->setShowSortIndicator ( true ); | 213 | mailView->setShowSortIndicator ( true ); |
214 | QLabel *spacer = new QLabel( toolBar ); | 214 | QLabel *spacer = new QLabel( toolBar ); |
215 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 215 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
216 | toolBar->setStretchableWidget( spacer ); | 216 | toolBar->setStretchableWidget( spacer ); |
217 | 217 | ||
218 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 218 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
219 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 219 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
220 | if ( QApplication::desktop()->width() > 320 ) | 220 | if ( QApplication::desktop()->width() > 320 ) |
221 | closeMail->addTo(toolBar); | 221 | closeMail->addTo(toolBar); |
222 | closeMail->addTo(mailMenu); | 222 | closeMail->addTo(mailMenu); |
223 | 223 | ||
224 | 224 | ||
225 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 225 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
226 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 226 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
227 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 227 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
228 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 228 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
229 | li->addTo(helpMenu); | 229 | li->addTo(helpMenu); |
230 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 230 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
231 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 231 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
232 | li->addTo(helpMenu); | 232 | li->addTo(helpMenu); |
233 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 233 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
234 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 234 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
235 | li->addTo(helpMenu); | 235 | li->addTo(helpMenu); |
236 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 236 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
237 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 237 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
238 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); | 238 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); |
239 | //menuBar->setMaximumSize( menuBar->sizeHint()); | 239 | //menuBar->setMaximumSize( menuBar->sizeHint()); |
240 | #ifdef DESKTOP_VERSION | 240 | #ifdef DESKTOP_VERSION |
241 | resize ( 640, 480 ); | 241 | resize ( 640, 480 ); |
242 | #endif | 242 | #endif |
243 | } | 243 | } |
244 | 244 | ||
245 | MainWindow::~MainWindow() | 245 | MainWindow::~MainWindow() |
246 | { | 246 | { |
247 | } | 247 | } |
248 | 248 | ||
249 | void MainWindow::setInfoFields(QListViewItem* item ) | 249 | void MainWindow::setInfoFields(QListViewItem* item ) |
250 | { | 250 | { |
251 | if ( item == 0) { | 251 | if ( item == 0) { |
252 | if ( subLE ) subLE->setText(""); | 252 | if ( subLE ) subLE->setText(""); |
253 | if ( fromLE ) fromLE->setText(""); | 253 | if ( fromLE ) fromLE->setText(""); |
254 | if ( toLE ) toLE->setText(""); | 254 | if ( toLE ) toLE->setText(""); |
255 | return; | 255 | return; |
256 | } | 256 | } |
257 | RecMailP mail = ((MailListViewItem*)item)->data(); | 257 | RecMailP mail = ((MailListViewItem*)item)->data(); |
258 | if ( subLE ) subLE->setText(mail->getSubject()); | 258 | if ( subLE ) subLE->setText(mail->getSubject()); |
259 | if ( fromLE ) fromLE->setText(mail->getFrom()); | 259 | if ( fromLE ) fromLE->setText(mail->getFrom()); |
260 | if ( toLE ) toLE->setText(mail->To().join(";" )); | 260 | if ( toLE ) toLE->setText(mail->To().join(";" )); |
261 | if ( subLE ) subLE->setCursorPosition(0); | 261 | if ( subLE ) subLE->setCursorPosition(0); |
262 | if ( fromLE ) fromLE->setCursorPosition(0); | 262 | if ( fromLE ) fromLE->setCursorPosition(0); |
263 | if ( toLE ) toLE->setCursorPosition(0); | 263 | if ( toLE ) toLE->setCursorPosition(0); |
264 | 264 | ||
265 | } | 265 | } |
266 | void MainWindow::slotSetCodec( int codec ) | 266 | void MainWindow::slotSetCodec( int codec ) |
267 | { | 267 | { |
268 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | 268 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); |
269 | //qDebug("codec %d ", codec); | 269 | //qDebug("codec %d ", codec); |
270 | KOPrefs::instance()->mCurrentCodec = codec; | 270 | KOPrefs::instance()->mCurrentCodec = codec; |
271 | KOPrefs::instance()->isDirty = true; | 271 | KOPrefs::instance()->isDirty = true; |
272 | QString name; | 272 | QString name; |
273 | switch ( codec ) { | 273 | switch ( codec ) { |
274 | case 0: | 274 | case 0: |
275 | name = "iso-8859-1"; | 275 | name = "iso-8859-1"; |
276 | break; | 276 | break; |
277 | case 1: | 277 | case 1: |
278 | name = "iso-8859-5"; | 278 | name = "iso-8859-5"; |
279 | break; | 279 | break; |
280 | case 2: | 280 | case 2: |
281 | name = "iso-8859-15"; | 281 | name = "iso-8859-15"; |
282 | break; | 282 | break; |
283 | case 3: | 283 | case 3: |
284 | name = "big-5"; | 284 | name = "big-5"; |
285 | break; | 285 | break; |
286 | case 4: | 286 | case 4: |
287 | name = "utf-8"; | 287 | name = "utf-8"; |
288 | break; | 288 | break; |
289 | case 5: | 289 | case 5: |
290 | name = KOPrefs::instance()->mSendCodec.lower(); | 290 | name = KOPrefs::instance()->mSendCodec.lower(); |
291 | break; | 291 | break; |
292 | } | 292 | } |
293 | KOPrefs::instance()->mCurrentCodeName = name ; | 293 | KOPrefs::instance()->mCurrentCodeName = name ; |
294 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); | 294 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); |
295 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); | 295 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); |
296 | } | 296 | } |
297 | void MainWindow::showLicence() | 297 | void MainWindow::showLicence() |
298 | { | 298 | { |
299 | KApplication::showLicence(); | 299 | KApplication::showLicence(); |
300 | } | 300 | } |
301 | void MainWindow::showAbout() | 301 | void MainWindow::showAbout() |
302 | { | 302 | { |
303 | QString version; | 303 | QString version; |
304 | #include <../version> | 304 | #include <../version> |
305 | 305 | ||
306 | QString cap = "About KOpieMail/Pi"; | 306 | QString cap = "About KOpieMail/Pi"; |
307 | QString text =i18n("KOpieMail/Platform-independent\n") + | 307 | QString text =i18n("KOpieMail/Platform-independent\n") + |
308 | "(OM/Pi) " + version + " - " | 308 | "(OM/Pi) " + version + " - " |
309 | 309 | ||
310 | #ifdef DESKTOP_VERSION | 310 | #ifdef DESKTOP_VERSION |
311 | "Desktop Edition\n" | 311 | "Desktop Edition\n" |
312 | #else | 312 | #else |
313 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" | 313 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" |
314 | #endif | 314 | #endif |
315 | "www.pi-sync.net\n\n" | 315 | "www.pi-sync.info\n\n" |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" | 319 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" |
320 | "KOpieMail/Pi is based on Opie Mail\n" | 320 | "KOpieMail/Pi is based on Opie Mail\n" |
321 | "Copyright (c) Rajko Albrecht and the Opie team\n" | 321 | "Copyright (c) Rajko Albrecht and the Opie team\n" |
322 | "KOpieMail/Pi is licensed under the GPL\n" | 322 | "KOpieMail/Pi is licensed under the GPL\n" |
323 | "\n" | 323 | "\n" |
324 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" | 324 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" |
325 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" | 325 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" |
326 | "libEtPan has its own licence - see LibEtPan licence\n"; | 326 | "libEtPan has its own licence - see LibEtPan licence\n"; |
327 | 327 | ||
328 | KApplication::showText( cap, text ); | 328 | KApplication::showText( cap, text ); |
329 | } | 329 | } |
330 | void MainWindow::showEtpanLicence() | 330 | void MainWindow::showEtpanLicence() |
331 | { | 331 | { |
332 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 332 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
333 | 333 | ||
334 | } | 334 | } |
335 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 335 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
336 | { | 336 | { |
337 | qDebug("appMessage implemented by subclass"); | 337 | qDebug("appMessage implemented by subclass"); |
338 | } | 338 | } |
339 | 339 | ||
340 | void MainWindow::slotAdjustLayout() { | 340 | void MainWindow::slotAdjustLayout() { |
341 | 341 | ||
342 | /* | 342 | /* |
343 | QWidget *d = QApplication::desktop(); | 343 | QWidget *d = QApplication::desktop(); |
344 | 344 | ||
345 | if ( d->width() < d->height() ) { | 345 | if ( d->width() < d->height() ) { |
346 | layout->setDirection( QBoxLayout::TopToBottom ); | 346 | layout->setDirection( QBoxLayout::TopToBottom ); |
347 | } else { | 347 | } else { |
348 | layout->setDirection( QBoxLayout::LeftToRight ); | 348 | layout->setDirection( QBoxLayout::LeftToRight ); |
349 | } | 349 | } |
350 | */ | 350 | */ |
351 | } | 351 | } |
352 | 352 | ||
353 | void MainWindow::slotAdjustColumns() | 353 | void MainWindow::slotAdjustColumns() |
354 | { | 354 | { |
355 | bool hidden = folderView->isHidden(); | 355 | bool hidden = folderView->isHidden(); |
356 | if ( hidden ) folderView->show(); | 356 | if ( hidden ) folderView->show(); |
357 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 357 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
358 | if ( hidden ) folderView->hide(); | 358 | if ( hidden ) folderView->hide(); |
359 | 359 | ||
360 | mailView->setColumnWidth( 0, 10 ); | 360 | mailView->setColumnWidth( 0, 10 ); |
361 | mailView->setColumnWidth( 1, 100 ); | 361 | mailView->setColumnWidth( 1, 100 ); |
362 | mailView->setColumnWidth( 2, 100 ); | 362 | mailView->setColumnWidth( 2, 100 ); |
363 | mailView->setColumnWidth( 3, 50 ); | 363 | mailView->setColumnWidth( 3, 50 ); |
364 | mailView->setColumnWidth( 4, 120 ); | 364 | mailView->setColumnWidth( 4, 120 ); |
365 | if ( KOPrefs::instance()->mShowToField ) | 365 | if ( KOPrefs::instance()->mShowToField ) |
366 | mailView->setColumnWidth( 5, 100 ); | 366 | mailView->setColumnWidth( 5, 100 ); |
367 | } | 367 | } |
368 | 368 | ||
369 | void MainWindow::slotEditSettings() | 369 | void MainWindow::slotEditSettings() |
370 | { | 370 | { |
371 | } | 371 | } |
372 | 372 | ||
373 | void MainWindow::slotShowFolders( bool ) | 373 | void MainWindow::slotShowFolders( bool ) |
374 | { | 374 | { |
375 | qDebug("not implemented: "); | 375 | qDebug("not implemented: "); |
376 | } | 376 | } |
377 | 377 | ||
378 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 378 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
379 | { | 379 | { |
380 | qDebug("not implemented: "); | 380 | qDebug("not implemented: "); |
381 | } | 381 | } |
382 | 382 | ||
383 | void MainWindow::mailLeftClicked(QListViewItem * ) | 383 | void MainWindow::mailLeftClicked(QListViewItem * ) |
384 | { | 384 | { |
385 | qDebug("not implemented: "); | 385 | qDebug("not implemented: "); |
386 | } | 386 | } |
387 | 387 | ||
388 | void MainWindow::displayMail() | 388 | void MainWindow::displayMail() |
389 | { | 389 | { |
390 | qDebug("not implemented: "); | 390 | qDebug("not implemented: "); |
391 | } | 391 | } |
392 | 392 | ||
393 | void MainWindow::slotDeleteMail() | 393 | void MainWindow::slotDeleteMail() |
394 | { | 394 | { |
395 | qDebug("not implemented: "); | 395 | qDebug("not implemented: "); |
396 | } | 396 | } |
397 | 397 | ||
398 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 398 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
399 | { | 399 | { |
400 | qDebug("not implemented: "); | 400 | qDebug("not implemented: "); |
401 | } | 401 | } |
402 | 402 | ||
403 | void MainWindow::slotSendQueued() | 403 | void MainWindow::slotSendQueued() |
404 | { | 404 | { |
405 | qDebug("not implemented: "); | 405 | qDebug("not implemented: "); |
406 | } | 406 | } |
407 | 407 | ||
408 | void MainWindow::slotEditAccounts() | 408 | void MainWindow::slotEditAccounts() |
409 | { | 409 | { |
410 | qDebug("not implemented: "); | 410 | qDebug("not implemented: "); |
411 | } | 411 | } |
412 | 412 | ||
413 | void MainWindow::slotComposeMail() | 413 | void MainWindow::slotComposeMail() |
414 | { | 414 | { |
415 | qDebug("not implemented: "); | 415 | qDebug("not implemented: "); |
416 | } | 416 | } |