author | zautrix <zautrix> | 2004-09-16 20:39:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-16 20:39:34 (UTC) |
commit | b44edfb21be0eee91c4f47401e3fe6ff37e4c16c (patch) (unidiff) | |
tree | a17655e0e679f67498d9fee6f6a532e9c0f0e9e5 | |
parent | b6bfa63deb15a2600d46a8c68c231f068da1444a (diff) | |
download | kdepimpi-b44edfb21be0eee91c4f47401e3fe6ff37e4c16c.zip kdepimpi-b44edfb21be0eee91c4f47401e3fe6ff37e4c16c.tar.gz kdepimpi-b44edfb21be0eee91c4f47401e3fe6ff37e4c16c.tar.bz2 |
better newsgroup handling
-rw-r--r-- | kmicromail/accountitem.cpp | 21 | ||||
-rw-r--r-- | kmicromail/editaccounts.cpp | 70 | ||||
-rw-r--r-- | kmicromail/editaccounts.h | 3 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 7 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 1 | ||||
-rw-r--r-- | kmicromail/nntpconfigui.ui | 126 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 8 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 1 |
8 files changed, 186 insertions, 51 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 12d047a..7795055 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -83,32 +83,32 @@ RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) | |||
83 | { | 83 | { |
84 | 84 | ||
85 | return wrapper->fetchBody( mail ); | 85 | return wrapper->fetchBody( mail ); |
86 | } | 86 | } |
87 | 87 | ||
88 | QPopupMenu * POP3viewItem::getContextMenu() | 88 | QPopupMenu * POP3viewItem::getContextMenu() |
89 | { | 89 | { |
90 | QPopupMenu *m = new QPopupMenu(0); | 90 | QPopupMenu *m = new QPopupMenu(0); |
91 | if (m) | 91 | if (m) |
92 | { | 92 | { |
93 | if (!account->getOffline()) | 93 | if (!account->getOffline()) |
94 | { | 94 | { |
95 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | ||
95 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 96 | m->insertItem(QObject::tr("Disconnect",contextName),0); |
96 | m->insertItem(QObject::tr("Set offline",contextName),1); | 97 | m->insertItem(QObject::tr("Set offline",contextName),1); |
97 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | ||
98 | } | 98 | } |
99 | else | 99 | else |
100 | { | 100 | { |
101 | m->insertItem(QObject::tr("Set online",contextName),1); | ||
102 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 101 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
102 | m->insertItem(QObject::tr("Set online",contextName),1); | ||
103 | } | 103 | } |
104 | } | 104 | } |
105 | return m; | 105 | return m; |
106 | } | 106 | } |
107 | 107 | ||
108 | void POP3viewItem::disconnect() | 108 | void POP3viewItem::disconnect() |
109 | { | 109 | { |
110 | QListViewItem *child = firstChild(); | 110 | QListViewItem *child = firstChild(); |
111 | while ( child ) | 111 | while ( child ) |
112 | { | 112 | { |
113 | QListViewItem *tmp = child; | 113 | QListViewItem *tmp = child; |
114 | child = child->nextSibling(); | 114 | child = child->nextSibling(); |
@@ -178,24 +178,25 @@ void POP3folderItem::refresh(QValueList<RecMailP>&target) | |||
178 | } | 178 | } |
179 | 179 | ||
180 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) | 180 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) |
181 | { | 181 | { |
182 | return pop3->getWrapper()->fetchBody(aMail); | 182 | return pop3->getWrapper()->fetchBody(aMail); |
183 | } | 183 | } |
184 | 184 | ||
185 | QPopupMenu * POP3folderItem::getContextMenu() | 185 | QPopupMenu * POP3folderItem::getContextMenu() |
186 | { | 186 | { |
187 | QPopupMenu *m = new QPopupMenu(0); | 187 | QPopupMenu *m = new QPopupMenu(0); |
188 | if (m) | 188 | if (m) |
189 | { | 189 | { |
190 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | ||
190 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 191 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
191 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 192 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
192 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); | 193 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); |
193 | } | 194 | } |
194 | return m; | 195 | return m; |
195 | } | 196 | } |
196 | 197 | ||
197 | void POP3folderItem::downloadMails() | 198 | void POP3folderItem::downloadMails() |
198 | { | 199 | { |
199 | AccountView*bl = pop3->accountView(); | 200 | AccountView*bl = pop3->accountView(); |
200 | if (!bl) return; | 201 | if (!bl) return; |
201 | bl->downloadMails(folder,pop3->getWrapper()); | 202 | bl->downloadMails(folder,pop3->getWrapper()); |
@@ -208,24 +209,27 @@ void POP3folderItem::contextMenuSelected(int which) | |||
208 | { | 209 | { |
209 | case 0: | 210 | case 0: |
210 | /* must be 'cause pop3 lists are cached */ | 211 | /* must be 'cause pop3 lists are cached */ |
211 | pop3->getWrapper()->logout(); | 212 | pop3->getWrapper()->logout(); |
212 | view->refreshCurrent(); | 213 | view->refreshCurrent(); |
213 | break; | 214 | break; |
214 | case 1: | 215 | case 1: |
215 | deleteAllMail(pop3->getWrapper(),folder); | 216 | deleteAllMail(pop3->getWrapper(),folder); |
216 | break; | 217 | break; |
217 | case 2: | 218 | case 2: |
218 | downloadMails(); | 219 | downloadMails(); |
219 | break; | 220 | break; |
221 | case GET_NEW_MAILS: // daunlood | ||
222 | view->downloadMailsInbox(getFolder() ,pop3->getWrapper()); | ||
223 | break; | ||
220 | default: | 224 | default: |
221 | break; | 225 | break; |
222 | } | 226 | } |
223 | } | 227 | } |
224 | 228 | ||
225 | /** | 229 | /** |
226 | * NNTP Account stuff | 230 | * NNTP Account stuff |
227 | */ | 231 | */ |
228 | NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent ) | 232 | NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent ) |
229 | : AccountViewItem( parent ) | 233 | : AccountViewItem( parent ) |
230 | { | 234 | { |
231 | account = a; | 235 | account = a; |
@@ -504,37 +508,36 @@ void IMAPviewItem::refreshFolders(bool force) | |||
504 | } | 508 | } |
505 | } | 509 | } |
506 | delete folders; | 510 | delete folders; |
507 | } | 511 | } |
508 | 512 | ||
509 | QPopupMenu * IMAPviewItem::getContextMenu() | 513 | QPopupMenu * IMAPviewItem::getContextMenu() |
510 | { | 514 | { |
511 | QPopupMenu *m = new QPopupMenu(0); | 515 | QPopupMenu *m = new QPopupMenu(0); |
512 | if (m) | 516 | if (m) |
513 | { | 517 | { |
514 | if (!account->getOffline()) | 518 | if (!account->getOffline()) |
515 | { | 519 | { |
520 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | ||
516 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 521 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
517 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 522 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
518 | m->insertSeparator(); | 523 | m->insertSeparator(); |
519 | m->insertItem(QObject::tr("Disconnect",contextName),2); | 524 | m->insertItem(QObject::tr("Disconnect",contextName),2); |
520 | m->insertItem(QObject::tr("Set offline",contextName),3); | 525 | m->insertItem(QObject::tr("Set offline",contextName),3); |
521 | m->insertSeparator(); | 526 | m->insertSeparator(); |
522 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | ||
523 | } | 527 | } |
524 | else | 528 | else |
525 | { | 529 | { |
526 | m->insertItem(QObject::tr("Set online",contextName),3); | ||
527 | m->insertSeparator(); | ||
528 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 530 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
531 | m->insertItem(QObject::tr("Set online",contextName),3); | ||
529 | } | 532 | } |
530 | } | 533 | } |
531 | return m; | 534 | return m; |
532 | } | 535 | } |
533 | 536 | ||
534 | void IMAPviewItem::createNewFolder() | 537 | void IMAPviewItem::createNewFolder() |
535 | { | 538 | { |
536 | Newmdirdlg ndirdlg; | 539 | Newmdirdlg ndirdlg; |
537 | 540 | ||
538 | ndirdlg.showMaximized(); | 541 | ndirdlg.showMaximized(); |
539 | if ( ndirdlg.exec() ) | 542 | if ( ndirdlg.exec() ) |
540 | { | 543 | { |
@@ -660,24 +663,25 @@ void IMAPfolderItem::refresh(QValueList<RecMailP>&target) | |||
660 | RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) | 663 | RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) |
661 | { | 664 | { |
662 | return imap->getWrapper()->fetchBody(aMail); | 665 | return imap->getWrapper()->fetchBody(aMail); |
663 | } | 666 | } |
664 | 667 | ||
665 | QPopupMenu * IMAPfolderItem::getContextMenu() | 668 | QPopupMenu * IMAPfolderItem::getContextMenu() |
666 | { | 669 | { |
667 | QPopupMenu *m = new QPopupMenu(0); | 670 | QPopupMenu *m = new QPopupMenu(0); |
668 | if (m) | 671 | if (m) |
669 | { | 672 | { |
670 | if (folder->may_select()) | 673 | if (folder->may_select()) |
671 | { | 674 | { |
675 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | ||
672 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 676 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
673 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); | 677 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); |
674 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 678 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
675 | } | 679 | } |
676 | if (folder->no_inferior()==false) | 680 | if (folder->no_inferior()==false) |
677 | { | 681 | { |
678 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); | 682 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); |
679 | } | 683 | } |
680 | if (folder->getDisplayName().lower()!="inbox") | 684 | if (folder->getDisplayName().lower()!="inbox") |
681 | { | 685 | { |
682 | m->insertItem(QObject::tr("Delete folder",contextName),3); | 686 | m->insertItem(QObject::tr("Delete folder",contextName),3); |
683 | } | 687 | } |
@@ -744,24 +748,31 @@ void IMAPfolderItem::contextMenuSelected(int id) | |||
744 | case 1: | 748 | case 1: |
745 | deleteAllMail(imap->getWrapper(),folder); | 749 | deleteAllMail(imap->getWrapper(),folder); |
746 | break; | 750 | break; |
747 | case 2: | 751 | case 2: |
748 | createNewFolder(); | 752 | createNewFolder(); |
749 | break; | 753 | break; |
750 | case 3: | 754 | case 3: |
751 | deleteFolder(); | 755 | deleteFolder(); |
752 | break; | 756 | break; |
753 | case 4: | 757 | case 4: |
754 | downloadMails(); | 758 | downloadMails(); |
755 | break; | 759 | break; |
760 | case GET_NEW_MAILS: // daunlood | ||
761 | { | ||
762 | AccountView*bl = accountView(); | ||
763 | if (!bl) return; | ||
764 | bl->downloadMailsInbox(getFolder(),imap->getWrapper()); | ||
765 | } | ||
766 | break; | ||
756 | default: | 767 | default: |
757 | break; | 768 | break; |
758 | } | 769 | } |
759 | } | 770 | } |
760 | 771 | ||
761 | /** | 772 | /** |
762 | * MH Account stuff | 773 | * MH Account stuff |
763 | */ | 774 | */ |
764 | /* MH is a little bit different - the top folder can contains messages other than in IMAP and | 775 | /* MH is a little bit different - the top folder can contains messages other than in IMAP and |
765 | POP3 and MBOX */ | 776 | POP3 and MBOX */ |
766 | MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) | 777 | MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) |
767 | : AccountViewItem( parent ) | 778 | : AccountViewItem( parent ) |
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index d43d23b..733e38a 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -529,44 +529,81 @@ void SMTPconfig::accept() | |||
529 | /** | 529 | /** |
530 | * NNTPconfig | 530 | * NNTPconfig |
531 | */ | 531 | */ |
532 | 532 | ||
533 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 533 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
534 | : NNTPconfigUI( parent, name, modal, flags ) | 534 | : NNTPconfigUI( parent, name, modal, flags ) |
535 | { | 535 | { |
536 | data = account; | 536 | data = account; |
537 | 537 | ||
538 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 538 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
539 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 539 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
540 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); | 540 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); |
541 | connect( ShowSubcribed, SIGNAL( clicked() ), this, SLOT( slotShowSub() ) ); | ||
542 | connect( FilterButton, SIGNAL( clicked() ), this, SLOT( slotShowFilter() ) ); | ||
541 | fillValues(); | 543 | fillValues(); |
542 | 544 | ||
543 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); | 545 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); |
544 | } | 546 | } |
545 | 547 | ||
548 | void NNTPconfig::slotShowSub() | ||
549 | { | ||
550 | save(); | ||
551 | data->save(); | ||
552 | ListViewGroups->clear(); | ||
553 | for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { | ||
554 | QCheckListItem *item; | ||
555 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); | ||
556 | item->setOn( true ); | ||
557 | } | ||
558 | topLevelWidget()->setCaption( tr("%1 groups subscribed").arg( subscribedGroups.count())); | ||
559 | } | ||
560 | void NNTPconfig::slotShowFilter() | ||
561 | { | ||
562 | save(); | ||
563 | data->save(); | ||
564 | ListViewGroups->clear(); | ||
565 | int count = 0; | ||
566 | for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { | ||
567 | QCheckListItem *item; | ||
568 | if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) { | ||
569 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); | ||
570 | ++count; | ||
571 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { | ||
572 | item->setOn( true ); | ||
573 | } | ||
574 | } | ||
575 | } | ||
576 | topLevelWidget()->setCaption( tr("Filter found %1 groups").arg( count)); | ||
577 | } | ||
546 | void NNTPconfig::slotGetNG() { | 578 | void NNTPconfig::slotGetNG() { |
547 | save(); | 579 | save(); |
548 | data->save(); | 580 | data->save(); |
581 | topLevelWidget()->setCaption( tr("Fetching group list...")); | ||
582 | qApp->processEvents(); | ||
549 | NNTPwrapper* tmp = new NNTPwrapper( data ); | 583 | NNTPwrapper* tmp = new NNTPwrapper( data ); |
550 | QStringList list = tmp->listAllNewsgroups(); | 584 | allGroups = tmp->listAllNewsgroups(); |
585 | topLevelWidget()->setCaption( tr("Downloaded %1 group names").arg( allGroups.count())); | ||
551 | 586 | ||
552 | ListViewGroups->clear(); | 587 | ListViewGroups->clear(); |
553 | 588 | ||
554 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 589 | for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { |
555 | QCheckListItem *item; | 590 | QCheckListItem *item; |
556 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); | 591 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); |
557 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { | 592 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { |
558 | item->setOn( true ); | 593 | item->setOn( true ); |
559 | } | 594 | |
595 | } | ||
560 | } | 596 | } |
597 | delete tmp; | ||
561 | } | 598 | } |
562 | 599 | ||
563 | void NNTPconfig::slotSSL( bool enabled ) | 600 | void NNTPconfig::slotSSL( bool enabled ) |
564 | { | 601 | { |
565 | if ( enabled ) | 602 | if ( enabled ) |
566 | { | 603 | { |
567 | portLine->setText( NNTP_SSL_PORT ); | 604 | portLine->setText( NNTP_SSL_PORT ); |
568 | } | 605 | } |
569 | else | 606 | else |
570 | { | 607 | { |
571 | portLine->setText( NNTP_PORT ); | 608 | portLine->setText( NNTP_PORT ); |
572 | } | 609 | } |
@@ -591,31 +628,34 @@ void NNTPconfig::fillValues() | |||
591 | } | 628 | } |
592 | 629 | ||
593 | void NNTPconfig::save() | 630 | void NNTPconfig::save() |
594 | { | 631 | { |
595 | data->setAccountName( accountLine->text() ); | 632 | data->setAccountName( accountLine->text() ); |
596 | data->setServer( serverLine->text() ); | 633 | data->setServer( serverLine->text() ); |
597 | data->setPort( portLine->text() ); | 634 | data->setPort( portLine->text() ); |
598 | data->setSSL( sslBox->isChecked() ); | 635 | data->setSSL( sslBox->isChecked() ); |
599 | data->setLogin( loginBox->isChecked() ); | 636 | data->setLogin( loginBox->isChecked() ); |
600 | data->setUser( userLine->text() ); | 637 | data->setUser( userLine->text() ); |
601 | data->setPassword( passLine->text() ); | 638 | data->setPassword( passLine->text() ); |
602 | 639 | ||
603 | QListViewItemIterator list_it( ListViewGroups ); | 640 | QListViewItemIterator list_it( ListViewGroups ); |
604 | 641 | ||
605 | QStringList groupList; | 642 | for ( ; list_it.current(); ++list_it ) { |
606 | for ( ; list_it.current(); ++list_it ) { | ||
607 | 643 | ||
608 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { | 644 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { |
609 | groupList.append( list_it.current()->text(0) ); | 645 | if ( subscribedGroups.contains( list_it.current()->text(0) ) < 1 ) |
610 | } | 646 | subscribedGroups.append( list_it.current()->text(0) ); |
647 | } else { | ||
648 | if ( subscribedGroups.contains( list_it.current()->text(0) ) >= 1 ) | ||
649 | subscribedGroups.remove( list_it.current()->text(0) ); | ||
650 | } | ||
611 | 651 | ||
612 | } | 652 | } |
613 | data->setGroups( groupList ); | 653 | data->setGroups( subscribedGroups ); |
614 | } | 654 | } |
615 | 655 | ||
616 | void NNTPconfig::accept() | 656 | void NNTPconfig::accept() |
617 | { | 657 | { |
618 | save(); | 658 | save(); |
619 | QDialog::accept(); | 659 | QDialog::accept(); |
620 | } | 660 | } |
621 | 661 | ||
diff --git a/kmicromail/editaccounts.h b/kmicromail/editaccounts.h index a9eb19f..6cf842e 100644 --- a/kmicromail/editaccounts.h +++ b/kmicromail/editaccounts.h | |||
@@ -132,22 +132,25 @@ class NNTPconfig : public NNTPconfigUI | |||
132 | Q_OBJECT | 132 | Q_OBJECT |
133 | 133 | ||
134 | public: | 134 | public: |
135 | NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); | 135 | NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); |
136 | 136 | ||
137 | public slots: | 137 | public slots: |
138 | void fillValues(); | 138 | void fillValues(); |
139 | 139 | ||
140 | protected slots: | 140 | protected slots: |
141 | void slotSSL( bool enabled ); | 141 | void slotSSL( bool enabled ); |
142 | void accept(); | 142 | void accept(); |
143 | void slotGetNG(); | 143 | void slotGetNG(); |
144 | void slotShowSub(); | ||
145 | void slotShowFilter(); | ||
144 | 146 | ||
145 | private: | 147 | private: |
146 | QStringList subscribedGroups; | 148 | QStringList subscribedGroups; |
149 | QStringList allGroups; | ||
147 | void save(); | 150 | void save(); |
148 | NNTPaccount *data; | 151 | NNTPaccount *data; |
149 | clist* list; | 152 | clist* list; |
150 | 153 | ||
151 | }; | 154 | }; |
152 | 155 | ||
153 | #endif | 156 | #endif |
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index d130317..2a67e39 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -25,26 +25,31 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
25 | setCaption( tr( "KOpieMail/Pi" ) ); | 25 | setCaption( tr( "KOpieMail/Pi" ) ); |
26 | setToolBarsMovable( false ); | 26 | setToolBarsMovable( false ); |
27 | //KABC::StdAddressBook::self(); | 27 | //KABC::StdAddressBook::self(); |
28 | toolBar = new QToolBar( this ); | 28 | toolBar = new QToolBar( this ); |
29 | menuBar = new QPEMenuBar( toolBar ); | 29 | menuBar = new QPEMenuBar( toolBar ); |
30 | mailMenu = new QPopupMenu( menuBar ); | 30 | mailMenu = new QPopupMenu( menuBar ); |
31 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 31 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
32 | settingsMenu = new QPopupMenu( menuBar ); | 32 | settingsMenu = new QPopupMenu( menuBar ); |
33 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 33 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
34 | 34 | ||
35 | addToolBar( toolBar ); | 35 | addToolBar( toolBar ); |
36 | toolBar->setHorizontalStretchable( true ); | 36 | toolBar->setHorizontalStretchable( true ); |
37 | QAction* getMail = new QAction( tr( "Get all new mails" ), SmallIcon("add"), | ||
38 | 0, 0, this ); | ||
39 | connect(getMail, SIGNAL( activated() ), | ||
40 | SLOT( slotGetAllMail() ) ); | ||
41 | getMail->addTo( mailMenu ); | ||
37 | 42 | ||
38 | QAction* getMail = new QAction( tr( "Get new mail" ), SmallIcon("add"), | 43 | getMail = new QAction( tr( "Get new messages" ), SmallIcon("add"), |
39 | 0, 0, this ); | 44 | 0, 0, this ); |
40 | getMail->addTo( toolBar ); | 45 | getMail->addTo( toolBar ); |
41 | getMail->addTo( mailMenu ); | 46 | getMail->addTo( mailMenu ); |
42 | connect(getMail, SIGNAL( activated() ), | 47 | connect(getMail, SIGNAL( activated() ), |
43 | SLOT( slotGetMail() ) ); | 48 | SLOT( slotGetMail() ) ); |
44 | 49 | ||
45 | composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), | 50 | composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), |
46 | 0, 0, this ); | 51 | 0, 0, this ); |
47 | composeMail->addTo( toolBar ); | 52 | composeMail->addTo( toolBar ); |
48 | composeMail->addTo( mailMenu ); | 53 | composeMail->addTo( mailMenu ); |
49 | 54 | ||
50 | sendQueued = new QAction( tr( "Send queued mails" ), SmallIcon("sendqueued") , | 55 | sendQueued = new QAction( tr( "Send queued mails" ), SmallIcon("sendqueued") , |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index ff0ff20..35b9c8c 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -33,24 +33,25 @@ public: | |||
33 | public slots: | 33 | public slots: |
34 | virtual void slotAdjustColumns(); | 34 | virtual void slotAdjustColumns(); |
35 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 35 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
36 | virtual void slotComposeMail(); | 36 | virtual void slotComposeMail(); |
37 | 37 | ||
38 | protected slots: | 38 | protected slots: |
39 | virtual void slotSendQueued(); | 39 | virtual void slotSendQueued(); |
40 | virtual void slotEditAccounts(); | 40 | virtual void slotEditAccounts(); |
41 | virtual void slotShowFolders( bool show ); | 41 | virtual void slotShowFolders( bool show ); |
42 | virtual void refreshMailView(const QValueList<RecMailP>&); | 42 | virtual void refreshMailView(const QValueList<RecMailP>&); |
43 | virtual void displayMail(); | 43 | virtual void displayMail(); |
44 | virtual void slotGetMail() = 0; | 44 | virtual void slotGetMail() = 0; |
45 | virtual void slotGetAllMail() = 0; | ||
45 | virtual void slotDeleteMail(); | 46 | virtual void slotDeleteMail(); |
46 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 47 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
47 | virtual void slotAdjustLayout(); | 48 | virtual void slotAdjustLayout(); |
48 | virtual void slotEditSettings(); | 49 | virtual void slotEditSettings(); |
49 | virtual void mailLeftClicked( QListViewItem * ); | 50 | virtual void mailLeftClicked( QListViewItem * ); |
50 | void showLicence(); | 51 | void showLicence(); |
51 | void showAbout(); | 52 | void showAbout(); |
52 | void showEtpanLicence(); | 53 | void showEtpanLicence(); |
53 | 54 | ||
54 | protected: | 55 | protected: |
55 | QToolBar *toolBar; | 56 | QToolBar *toolBar; |
56 | StatusWidget *statusWidget; | 57 | StatusWidget *statusWidget; |
diff --git a/kmicromail/nntpconfigui.ui b/kmicromail/nntpconfigui.ui index 25d564e..16ff6fc 100644 --- a/kmicromail/nntpconfigui.ui +++ b/kmicromail/nntpconfigui.ui | |||
@@ -2,42 +2,42 @@ | |||
2 | <class>NNTPconfigUI</class> | 2 | <class>NNTPconfigUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>NNTPconfigUI</cstring> | 7 | <cstring>NNTPconfigUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>409</width> | 14 | <width>268</width> |
15 | <height>520</height> | 15 | <height>347</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Configure NNTP</string> | 20 | <string>Configure NNTP</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>2</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget2</cstring> | 41 | <cstring>TabWidget2</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
@@ -280,61 +280,127 @@ | |||
280 | <class>QWidget</class> | 280 | <class>QWidget</class> |
281 | <property stdset="1"> | 281 | <property stdset="1"> |
282 | <name>name</name> | 282 | <name>name</name> |
283 | <cstring>tab</cstring> | 283 | <cstring>tab</cstring> |
284 | </property> | 284 | </property> |
285 | <attribute> | 285 | <attribute> |
286 | <name>title</name> | 286 | <name>title</name> |
287 | <string>Groups</string> | 287 | <string>Groups</string> |
288 | </attribute> | 288 | </attribute> |
289 | <vbox> | 289 | <vbox> |
290 | <property stdset="1"> | 290 | <property stdset="1"> |
291 | <name>margin</name> | 291 | <name>margin</name> |
292 | <number>3</number> | 292 | <number>2</number> |
293 | </property> | 293 | </property> |
294 | <property stdset="1"> | 294 | <property stdset="1"> |
295 | <name>spacing</name> | 295 | <name>spacing</name> |
296 | <number>3</number> | 296 | <number>3</number> |
297 | </property> | 297 | </property> |
298 | <widget> | 298 | <widget> |
299 | <class>QListView</class> | 299 | <class>QLayoutWidget</class> |
300 | <column> | ||
301 | <property> | ||
302 | <name>text</name> | ||
303 | <string>Newsgroup</string> | ||
304 | </property> | ||
305 | <property> | ||
306 | <name>clickable</name> | ||
307 | <bool>true</bool> | ||
308 | </property> | ||
309 | <property> | ||
310 | <name>resizeable</name> | ||
311 | <bool>true</bool> | ||
312 | </property> | ||
313 | </column> | ||
314 | <property stdset="1"> | ||
315 | <name>name</name> | ||
316 | <cstring>ListViewGroups</cstring> | ||
317 | </property> | ||
318 | </widget> | ||
319 | <widget> | ||
320 | <class>QPushButton</class> | ||
321 | <property stdset="1"> | 300 | <property stdset="1"> |
322 | <name>name</name> | 301 | <name>name</name> |
323 | <cstring>GetNGButton</cstring> | 302 | <cstring>Layout10</cstring> |
324 | </property> | 303 | </property> |
325 | <property stdset="1"> | 304 | <property> |
326 | <name>text</name> | 305 | <name>layoutSpacing</name> |
327 | <string>Get newsgroup list from server</string> | ||
328 | </property> | 306 | </property> |
307 | <vbox> | ||
308 | <property stdset="1"> | ||
309 | <name>margin</name> | ||
310 | <number>0</number> | ||
311 | </property> | ||
312 | <property stdset="1"> | ||
313 | <name>spacing</name> | ||
314 | <number>3</number> | ||
315 | </property> | ||
316 | <widget> | ||
317 | <class>QListView</class> | ||
318 | <column> | ||
319 | <property> | ||
320 | <name>text</name> | ||
321 | <string>Newsgroup</string> | ||
322 | </property> | ||
323 | <property> | ||
324 | <name>clickable</name> | ||
325 | <bool>true</bool> | ||
326 | </property> | ||
327 | <property> | ||
328 | <name>resizeable</name> | ||
329 | <bool>true</bool> | ||
330 | </property> | ||
331 | </column> | ||
332 | <property stdset="1"> | ||
333 | <name>name</name> | ||
334 | <cstring>ListViewGroups</cstring> | ||
335 | </property> | ||
336 | </widget> | ||
337 | <widget> | ||
338 | <class>QPushButton</class> | ||
339 | <property stdset="1"> | ||
340 | <name>name</name> | ||
341 | <cstring>GetNGButton</cstring> | ||
342 | </property> | ||
343 | <property stdset="1"> | ||
344 | <name>text</name> | ||
345 | <string>Get newsgroup list from server</string> | ||
346 | </property> | ||
347 | </widget> | ||
348 | <widget> | ||
349 | <class>QLayoutWidget</class> | ||
350 | <property stdset="1"> | ||
351 | <name>name</name> | ||
352 | <cstring>Layout9</cstring> | ||
353 | </property> | ||
354 | <hbox> | ||
355 | <property stdset="1"> | ||
356 | <name>margin</name> | ||
357 | <number>0</number> | ||
358 | </property> | ||
359 | <property stdset="1"> | ||
360 | <name>spacing</name> | ||
361 | <number>6</number> | ||
362 | </property> | ||
363 | <widget> | ||
364 | <class>QPushButton</class> | ||
365 | <property stdset="1"> | ||
366 | <name>name</name> | ||
367 | <cstring>FilterButton</cstring> | ||
368 | </property> | ||
369 | <property stdset="1"> | ||
370 | <name>text</name> | ||
371 | <string>Filter:</string> | ||
372 | </property> | ||
373 | </widget> | ||
374 | <widget> | ||
375 | <class>QLineEdit</class> | ||
376 | <property stdset="1"> | ||
377 | <name>name</name> | ||
378 | <cstring>GroupFilter</cstring> | ||
379 | </property> | ||
380 | </widget> | ||
381 | <widget> | ||
382 | <class>QPushButton</class> | ||
383 | <property stdset="1"> | ||
384 | <name>name</name> | ||
385 | <cstring>ShowSubcribed</cstring> | ||
386 | </property> | ||
387 | <property stdset="1"> | ||
388 | <name>text</name> | ||
389 | <string>Show subscribed</string> | ||
390 | </property> | ||
391 | </widget> | ||
392 | </hbox> | ||
393 | </widget> | ||
394 | </vbox> | ||
329 | </widget> | 395 | </widget> |
330 | </vbox> | 396 | </vbox> |
331 | </widget> | 397 | </widget> |
332 | </widget> | 398 | </widget> |
333 | </vbox> | 399 | </vbox> |
334 | </widget> | 400 | </widget> |
335 | <tabstops> | 401 | <tabstops> |
336 | <tabstop>accountLine</tabstop> | 402 | <tabstop>accountLine</tabstop> |
337 | <tabstop>serverLine</tabstop> | 403 | <tabstop>serverLine</tabstop> |
338 | <tabstop>portLine</tabstop> | 404 | <tabstop>portLine</tabstop> |
339 | <tabstop>sslBox</tabstop> | 405 | <tabstop>sslBox</tabstop> |
340 | <tabstop>loginBox</tabstop> | 406 | <tabstop>loginBox</tabstop> |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 4e7c6be..7ccfb65 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -244,24 +244,32 @@ void OpieMail::displayMail() | |||
244 | readMail.showMaximized(); | 244 | readMail.showMaximized(); |
245 | readMail.exec(); | 245 | readMail.exec(); |
246 | 246 | ||
247 | if ( readMail.deleted ) | 247 | if ( readMail.deleted ) |
248 | { | 248 | { |
249 | folderView->refreshCurrent(); | 249 | folderView->refreshCurrent(); |
250 | } | 250 | } |
251 | else | 251 | else |
252 | { | 252 | { |
253 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 253 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
254 | } | 254 | } |
255 | } | 255 | } |
256 | void OpieMail::slotGetAllMail() | ||
257 | { | ||
258 | QListViewItem * item = folderView->firstChild(); | ||
259 | while ( item ){ | ||
260 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | ||
261 | item = item->nextSibling (); | ||
262 | } | ||
263 | } | ||
256 | void OpieMail::slotGetMail() | 264 | void OpieMail::slotGetMail() |
257 | { | 265 | { |
258 | QListViewItem * item = folderView->currentItem(); | 266 | QListViewItem * item = folderView->currentItem(); |
259 | if ( ! item ) return; | 267 | if ( ! item ) return; |
260 | while ( item->parent () ) | 268 | while ( item->parent () ) |
261 | item = item->parent (); | 269 | item = item->parent (); |
262 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 270 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
263 | } | 271 | } |
264 | void OpieMail::slotDeleteMail() | 272 | void OpieMail::slotDeleteMail() |
265 | { | 273 | { |
266 | if (!mailView->currentItem()) return; | 274 | if (!mailView->currentItem()) return; |
267 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 275 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index 47264e4..9de95f8 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h | |||
@@ -23,24 +23,25 @@ public slots: | |||
23 | virtual void slotComposeMail(); | 23 | virtual void slotComposeMail(); |
24 | virtual void slotExtAppHandler(); | 24 | virtual void slotExtAppHandler(); |
25 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 25 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
26 | virtual void message(const QCString &msg, const QByteArray &data); | 26 | virtual void message(const QCString &msg, const QByteArray &data); |
27 | protected slots: | 27 | protected slots: |
28 | virtual void slotSendQueued(); | 28 | virtual void slotSendQueued(); |
29 | virtual void slotSearchMails(); | 29 | virtual void slotSearchMails(); |
30 | virtual void slotEditSettings(); | 30 | virtual void slotEditSettings(); |
31 | virtual void slotEditAccounts(); | 31 | virtual void slotEditAccounts(); |
32 | virtual void displayMail(); | 32 | virtual void displayMail(); |
33 | virtual void slotDeleteMail(); | 33 | virtual void slotDeleteMail(); |
34 | virtual void slotGetMail(); | 34 | virtual void slotGetMail(); |
35 | virtual void slotGetAllMail(); | ||
35 | virtual void slotDeleteAllMail(); | 36 | virtual void slotDeleteAllMail(); |
36 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 37 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
37 | virtual void slotShowFolders( bool show ); | 38 | virtual void slotShowFolders( bool show ); |
38 | virtual void refreshMailView(const QValueList<RecMailP>&); | 39 | virtual void refreshMailView(const QValueList<RecMailP>&); |
39 | virtual void mailLeftClicked( QListViewItem * ); | 40 | virtual void mailLeftClicked( QListViewItem * ); |
40 | virtual void slotMoveCopyMail(); | 41 | virtual void slotMoveCopyMail(); |
41 | virtual void slotMoveCopyAllMail(); | 42 | virtual void slotMoveCopyAllMail(); |
42 | virtual void reEditMail(); | 43 | virtual void reEditMail(); |
43 | void clearSelection(); | 44 | void clearSelection(); |
44 | 45 | ||
45 | private: | 46 | private: |
46 | QString mPendingEmail; | 47 | QString mPendingEmail; |