summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-11 19:26:02 (UTC)
committer zautrix <zautrix>2005-03-11 19:26:02 (UTC)
commit1166a4797a91cedd5002a3513d5028c5e86016f0 (patch) (unidiff)
tree8e7443bc887a15dcf3852abd36e6e61f2e6bddad
parent71462ba8ef1803787bba6793f1adb85987eb57df (diff)
downloadkdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.zip
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.gz
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.bz2
better kopi export
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kmicromail/editaccounts.cpp12
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp21
-rw-r--r--korganizer/kolistview.cpp41
-rw-r--r--korganizer/kolistview.h2
5 files changed, 66 insertions, 15 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 246ab3d..2084d0d 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1293,14 +1293,17 @@
1293{ "Summary/Loc.","Titel/Ort" }, 1293{ "Summary/Loc.","Titel/Ort" },
1294{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1294{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1295{ "Week Number","Wochennummer" }, 1295{ "Week Number","Wochennummer" },
1296{ "Import","Importiere" }, 1296{ "Import","Importiere" },
1297{ "Export","Exportiere" }, 1297{ "Export","Exportiere" },
1298{ "Beam","Beame" }, 1298{ "Beam","Beame" },
1299{ "Export selected","Exportiere Selektierte" },
1300{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1301{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1302{ "Journal/Details...","Journale/Details..." },
1299{ "","" }, 1303{ "","" },
1300{ "","" }, 1304{ "","" },
1301{ "","" }, 1305{ "","" },
1302{ "","" }, 1306{ "","" },
1303{ "","" }, 1307{ "","" },
1304{ "","" }, 1308{ "","" },
1305{ "","" }, 1309{ "","" },
1306
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index 49049f6..2c0f2d8 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -344,21 +344,23 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name,
344 344
345void IMAPconfig::slotConnectionToggle( int index ) 345void IMAPconfig::slotConnectionToggle( int index )
346{ 346{
347 if ( index == 2 ) 347 if ( index == 2 )
348 { 348 {
349 portLine->setText( IMAP_SSL_PORT ); 349 portLine->setText( IMAP_SSL_PORT );
350 CommandEdit->hide();
350 } 351 }
351 else if ( index == 3 ) 352 else if ( index == 3 )
352 { 353 {
353 portLine->setText( IMAP_PORT ); 354 portLine->setText( IMAP_PORT );
354 CommandEdit->show(); 355 CommandEdit->show();
355 } 356 }
356 else 357 else
357 { 358 {
358 portLine->setText( IMAP_PORT ); 359 portLine->setText( IMAP_PORT );
360 CommandEdit->hide();
359 } 361 }
360} 362}
361 363
362void IMAPconfig::fillValues() 364void IMAPconfig::fillValues()
363{ 365{
364 accountLine->setText( data->getAccountName() ); 366 accountLine->setText( data->getAccountName() );
@@ -425,21 +427,23 @@ POP3config::POP3config( POP3account *account, QWidget *parent, const char *name,
425void POP3config::slotConnectionToggle( int index ) 427void POP3config::slotConnectionToggle( int index )
426{ 428{
427 // 2 is ssl connection 429 // 2 is ssl connection
428 if ( index == 2 ) 430 if ( index == 2 )
429 { 431 {
430 portLine->setText( POP3_SSL_PORT ); 432 portLine->setText( POP3_SSL_PORT );
433 CommandEdit->hide();
431 } 434 }
432 else if ( index == 3 ) 435 else if ( index == 3 )
433 { 436 {
434 portLine->setText( POP3_PORT ); 437 portLine->setText( POP3_PORT );
435 CommandEdit->show(); 438 CommandEdit->show();
436 } 439 }
437 else 440 else
438 { 441 {
439 portLine->setText( POP3_PORT ); 442 portLine->setText( POP3_PORT );
443 CommandEdit->hide();
440 } 444 }
441} 445}
442 446
443void POP3config::fillValues() 447void POP3config::fillValues()
444{ 448{
445 accountLine->setText( data->getAccountName() ); 449 accountLine->setText( data->getAccountName() );
@@ -517,25 +521,27 @@ void SMTPconfig::chooseSig()
517 if ( !lnk.isEmpty() ) { 521 if ( !lnk.isEmpty() ) {
518 SignaturEdit->setText( lnk ); 522 SignaturEdit->setText( lnk );
519 } 523 }
520} 524}
521void SMTPconfig::slotConnectionToggle( int index ) 525void SMTPconfig::slotConnectionToggle( int index )
522{ 526{
523 // 2 is ssl connection 527 // 3 is ssl connection
524 if ( index == 2 ) 528 if ( index == 3 )
525 { 529 {
526 portLine->setText( SMTP_SSL_PORT ); 530 portLine->setText( SMTP_SSL_PORT );
531 CommandEdit->hide();
527 } 532 }
528 else if ( index == 3 ) 533 else if ( index == 4 )
529 { 534 {
530 portLine->setText( SMTP_PORT ); 535 portLine->setText( SMTP_PORT );
531 CommandEdit->show(); 536 CommandEdit->show();
532 } 537 }
533 else 538 else
534 { 539 {
535 portLine->setText( SMTP_PORT ); 540 portLine->setText( SMTP_PORT );
541 CommandEdit->hide();
536 } 542 }
537} 543}
538 544
539void SMTPconfig::fillValues() 545void SMTPconfig::fillValues()
540{ 546{
541 accountLine->setText( data->getAccountName() ); 547 accountLine->setText( data->getAccountName() );
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index 872a460..845c71c 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -241,20 +241,22 @@ void SMTPwrapper::connect_server()
241 if (err != MAILSMTP_NO_ERROR) { 241 if (err != MAILSMTP_NO_ERROR) {
242 result = 0; 242 result = 0;
243 qDebug("Error init SMTP connection "); 243 qDebug("Error init SMTP connection ");
244 failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); 244 failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err));
245 } 245 }
246 } 246 }
247 if (try_tls) { 247 if (result && try_tls) {
248 qDebug("Smpt: Try tls "); 248 qDebug("Smpt: Try tls ");
249 err = start_smtp_tls(); 249 err = start_smtp_tls();
250 if (err != MAILSMTP_NO_ERROR) { 250 if (err != MAILSMTP_NO_ERROR) {
251 try_tls = false; 251 try_tls = false;
252 qDebug("no tls "); 252 qDebug("no tls ");
253 } else { 253 } else {
254 err = mailesmtp_ehlo(m_smtp); 254 err = mailesmtp_ehlo(m_smtp);
255 if ( err != MAILSMTP_NO_ERROR )
256 result = 0;
255 } 257 }
256 } 258 }
257 //qDebug("mailesmtp_ehlo %d ",err ); 259 //qDebug("mailesmtp_ehlo %d ",err );
258 if (!try_tls && force_tls) { 260 if (!try_tls && force_tls) {
259 result = 0; 261 result = 0;
260 failuretext = i18n("Error init SMTP tls:%1").arg(mailsmtpError(err)); 262 failuretext = i18n("Error init SMTP tls:%1").arg(mailsmtpError(err));
@@ -287,12 +289,16 @@ void SMTPwrapper::connect_server()
287 } else { 289 } else {
288 failuretext = i18n("Authentification failed"); 290 failuretext = i18n("Authentification failed");
289 result = 0; 291 result = 0;
290 } 292 }
291 } 293 }
292 } 294 }
295 if ( result == 0 ) {
296 mailsmtp_free(m_smtp);
297 m_smtp = 0;
298 }
293} 299}
294 300
295void SMTPwrapper::disc_server() 301void SMTPwrapper::disc_server()
296{ 302{
297 if (m_smtp) { 303 if (m_smtp) {
298 mailsmtp_quit( m_smtp ); 304 mailsmtp_quit( m_smtp );
@@ -343,13 +349,17 @@ bool SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
343 sendProgress->setMaxMails(1); 349 sendProgress->setMaxMails(1);
344 result = smtpSend( mimeMail,later); 350 result = smtpSend( mimeMail,later);
345 ; // odebug << "Clean up done" << oendl; 351 ; // odebug << "Clean up done" << oendl;
346 sendProgress->hide(); 352 sendProgress->hide();
347 delete sendProgress; 353 delete sendProgress;
348 sendProgress = 0; 354 sendProgress = 0;
349 mailmime_free( mimeMail ); 355 mailmime_free( mimeMail );
356 if ( m_smtp ) {
357 mailsmtp_free(m_smtp);
358 m_smtp = 0;
359 }
350 } 360 }
351 return result; 361 return result;
352} 362}
353 363
354int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) { 364int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
355 size_t curTok = 0; 365 size_t curTok = 0;
@@ -455,18 +465,23 @@ bool SMTPwrapper::flushOutbox() {
455 sendProgress->setCurrentMails(mailsToRemove.count()); 465 sendProgress->setCurrentMails(mailsToRemove.count());
456 } 466 }
457 if (reset_user_value) { 467 if (reset_user_value) {
458 m_SmtpAccount->setUser(oldUser); 468 m_SmtpAccount->setUser(oldUser);
459 m_SmtpAccount->setPassword(oldPw); 469 m_SmtpAccount->setPassword(oldPw);
460 } 470 }
471
461 KConfig cfg( locateLocal("config", "kopiemailrc" ) ); 472 KConfig cfg( locateLocal("config", "kopiemailrc" ) );
462 cfg.setGroup( "Status" ); 473 cfg.setGroup( "Status" );
463 m_queuedMail = mailsToSend.count(); 474 m_queuedMail = mailsToSend.count();
464 cfg.writeEntry( "outgoing", m_queuedMail ); 475 cfg.writeEntry( "outgoing", m_queuedMail );
465 emit queuedMails( m_queuedMail ); 476 emit queuedMails( m_queuedMail );
466 sendProgress->hide(); 477 sendProgress->hide();
467 delete sendProgress; 478 delete sendProgress;
468 sendProgress = 0; 479 sendProgress = 0;
469 wrap->deleteMails(mbox,mailsToRemove); 480 wrap->deleteMails(mbox,mailsToRemove);
470 delete wrap; 481 delete wrap;
482 if ( m_smtp ) {
483 mailsmtp_free(m_smtp);
484 m_smtp = 0;
485 }
471 return returnValue; 486 return returnValue;
472} 487}
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 710a9f9..f235705 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -262,18 +262,20 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
262 i18n("Deselect all"),this, 262 i18n("Deselect all"),this,
263 SLOT(clearSelection()),true); 263 SLOT(clearSelection()),true);
264 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 264 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
265 i18n("Delete all selected"),this, 265 i18n("Delete all selected"),this,
266 SLOT(deleteAll()),true); 266 SLOT(deleteAll()),true);
267 mPopupMenu->insertSeparator(); 267 mPopupMenu->insertSeparator();
268 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 268 QPopupMenu * exportPO = new QPopupMenu ( this );
269 i18n("Save selected to file..."),this, 269 mPopupMenu->insertItem( i18n("Export selected"), exportPO );
270 SLOT(saveToFile()),true); 270 exportPO->insertItem( i18n("As iCal (ics) file..."),this,
271 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 271 SLOT(saveToFile()));
272 i18n("Save Journal/Description..."),this, 272 exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
273 SLOT(saveDescriptionToFile()),true); 273 SLOT(saveToFileVCS()));
274 exportPO->insertItem( i18n("Journal/Details..."),this,
275 SLOT(saveDescriptionToFile()));
274 // mPopupMenu->insertSeparator(); 276 // mPopupMenu->insertSeparator();
275 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 277 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
276 i18n("Add Categ. to selected..."),this, 278 i18n("Add Categ. to selected..."),this,
277 SLOT(addCat()),true); 279 SLOT(addCat()),true);
278 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 280 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
279 i18n("Set Categ. for selected..."),this, 281 i18n("Set Categ. for selected..."),this,
@@ -603,14 +605,22 @@ void KOListView::saveDescriptionToFile()
603 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); 605 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount );
604 KOPrefs::instance()->mLastSaveFile = fn; 606 KOPrefs::instance()->mLastSaveFile = fn;
605 topLevelWidget()->setCaption(mes); 607 topLevelWidget()->setCaption(mes);
606 } 608 }
607 } 609 }
608} 610}
611void KOListView::saveToFileVCS()
612{
613 writeToFile( false );
614}
609void KOListView::saveToFile() 615void KOListView::saveToFile()
610{ 616{
617 writeToFile( true );
618}
619void KOListView::writeToFile( bool iCal )
620{
611 621
612 int icount = 0; 622 int icount = 0;
613 QPtrList<Incidence> delSel ; 623 QPtrList<Incidence> delSel ;
614 QListViewItem *item = mListView->firstChild (); 624 QListViewItem *item = mListView->firstChild ();
615 while ( item ) { 625 while ( item ) {
616 if ( item->isSelected() ) { 626 if ( item->isSelected() ) {
@@ -619,12 +629,22 @@ void KOListView::saveToFile()
619 } 629 }
620 630
621 item = item->nextSibling(); 631 item = item->nextSibling();
622 } 632 }
623 if ( icount ) { 633 if ( icount ) {
624 QString fn = KOPrefs::instance()->mLastSaveFile; 634 QString fn = KOPrefs::instance()->mLastSaveFile;
635 QString extension;
636 if ( iCal ) {
637 if ( fn.right( 4 ).lower() == ".vcs" ) {
638 fn = fn.left( fn.length() -3) + "ics";
639 }
640 } else {
641 if ( fn.right( 4 ).lower() == ".ics" ) {
642 fn = fn.left( fn.length() -3) + "vcs";
643 }
644 }
625 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 645 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
626 646
627 if ( fn == "" ) 647 if ( fn == "" )
628 return; 648 return;
629 QFileInfo info; 649 QFileInfo info;
630 info.setFile( fn ); 650 info.setFile( fn );
@@ -644,14 +664,19 @@ void KOListView::saveToFile()
644 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 664 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
645 Incidence *incidence = delSel.first(); 665 Incidence *incidence = delSel.first();
646 while ( incidence ) { 666 while ( incidence ) {
647 cal.addIncidence( incidence->clone() ); 667 cal.addIncidence( incidence->clone() );
648 incidence = delSel.next(); 668 incidence = delSel.next();
649 } 669 }
650 ICalFormat format; 670 if ( iCal ) {
651 format.save( &cal, fn ); 671 ICalFormat format;
672 format.save( &cal, fn );
673 } else {
674 VCalFormat format;
675 format.save( &cal, fn );
676 }
652 mes = i18n("KO/Pi:Saved %1").arg(fn ); 677 mes = i18n("KO/Pi:Saved %1").arg(fn );
653 KOPrefs::instance()->mLastSaveFile = fn; 678 KOPrefs::instance()->mLastSaveFile = fn;
654 topLevelWidget()->setCaption(mes); 679 topLevelWidget()->setCaption(mes);
655 } 680 }
656 } 681 }
657} 682}
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index c86449d..0d9c525 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -269,12 +269,13 @@ class KOListView : public KOEventView
269 void clear(); 269 void clear();
270 void beamDone( Ir *ir ); 270 void beamDone( Ir *ir );
271 void showDates(); 271 void showDates();
272 void hideDates(); 272 void hideDates();
273 void deleteAll(); 273 void deleteAll();
274 void saveToFile(); 274 void saveToFile();
275 void saveToFileVCS();
275 void saveDescriptionToFile(); 276 void saveDescriptionToFile();
276 void beamSelected(); 277 void beamSelected();
277 void updateConfig(); 278 void updateConfig();
278 void addCat(); 279 void addCat();
279 void setCat(); 280 void setCat();
280 void setAlarm(); 281 void setAlarm();
@@ -285,12 +286,13 @@ class KOListView : public KOEventView
285 void popupMenu(QListViewItem *item,const QPoint &,int); 286 void popupMenu(QListViewItem *item,const QPoint &,int);
286 287
287 protected slots: 288 protected slots:
288 void processSelectionChange(QListViewItem *); 289 void processSelectionChange(QListViewItem *);
289 290
290 protected: 291 protected:
292 void writeToFile( bool iCal );
291 void addEvents(QPtrList<Event> eventList); 293 void addEvents(QPtrList<Event> eventList);
292 void addIncidence(Incidence *); 294 void addIncidence(Incidence *);
293 KOListViewItem *getItemForEvent(Event *event); 295 KOListViewItem *getItemForEvent(Event *event);
294 296
295 private: 297 private:
296 KOListViewListView *mListView; 298 KOListViewListView *mListView;