summaryrefslogtreecommitdiffabout
path: root/kmicromail
Unidiff
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/accountview.cpp39
-rw-r--r--kmicromail/accountview.h1
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp6
3 files changed, 31 insertions, 15 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index 6227f6d..cef55ab 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -14,19 +14,25 @@
14/* QT */ 14/* QT */
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <qpopupmenu.h> 16#include <qpopupmenu.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qtimer.h>
18#include <qspinbox.h> 19#include <qspinbox.h>
19#include <klocale.h> 20#include <klocale.h>
21#include <kmessagebox.h>
20 22
21using namespace Opie::Core; 23using namespace Opie::Core;
22AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 24AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
23 : QListView( parent, name, flags ) 25 : QListView( parent, name, flags )
24{ 26{
25 connect( this, SIGNAL( selectionChanged(QListViewItem*) ), 27 //connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
26 SLOT( refresh(QListViewItem*) ) ); 28 // SLOT( refresh(QListViewItem*) ) );
27 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 29 connect( this, SIGNAL( clicked(QListViewItem*) ),
28 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); 30 SLOT( refresh(QListViewItem*) ) );
31 connect( this, SIGNAL( returnPressed(QListViewItem*) ),
32 SLOT( refresh(QListViewItem*) ) );
33 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
34 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) );
29 setSorting(0); 35 setSorting(0);
30} 36}
31 37
32AccountView::~AccountView() 38AccountView::~AccountView()
@@ -90,13 +96,17 @@ void AccountView::populate( QList<Account> list )
90void AccountView::refresh(QListViewItem *item) 96void AccountView::refresh(QListViewItem *item)
91{ 97{
92 if ( item ) 98 if ( item )
93 { 99 {
100 int result = KMessageBox::warningContinueCancel(this,
101 i18n("Refresh\n%1\n?").arg( item->text(0) ),
102 i18n("Refresh"),i18n("Refresh"),i18n("Cancel"),
103 true);
104 if (result != KMessageBox::Continue) return;
94 m_currentItem = item; 105 m_currentItem = item;
95 QValueList<RecMailP> headerlist; 106 topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ;
96 AccountViewItem *view = static_cast<AccountViewItem *>(item); 107 QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) );
97 view->refresh(headerlist); 108
98 emit refreshMailview(headerlist);
99 } 109 }
100} 110}
101void AccountView::refreshOutgoing() 111void AccountView::refreshOutgoing()
102{ 112{
@@ -120,17 +130,24 @@ void AccountView::refreshOutgoing()
120 refreshCurrent(); 130 refreshCurrent();
121 // qDebug("refresh "); 131 // qDebug("refresh ");
122 } 132 }
123} 133}
124 134void AccountView::refreshCurrentSelected()
125void AccountView::refreshCurrent()
126{ 135{
127 m_currentItem = currentItem();
128 if ( !m_currentItem ) return; 136 if ( !m_currentItem ) return;
129 QValueList<RecMailP> headerlist; 137 QValueList<RecMailP> headerlist;
130 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); 138 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem);
131 view->refresh(headerlist); 139 view->refresh(headerlist);
132 emit refreshMailview(headerlist); 140 emit refreshMailview(headerlist);
141 topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ;
142}
143
144void AccountView::refreshCurrent()
145{
146 m_currentItem = currentItem();
147 if ( !m_currentItem ) return;
148 topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ;
149 QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) );
133} 150}
134 151
135void AccountView::refreshAll() 152void AccountView::refreshAll()
136{ 153{
diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h
index e403cb8..33f3479 100644
--- a/kmicromail/accountview.h
+++ b/kmicromail/accountview.h
@@ -29,8 +29,9 @@ public:
29public slots: 29public slots:
30 virtual void refreshAll(); 30 virtual void refreshAll();
31 virtual void refresh(QListViewItem *item); 31 virtual void refresh(QListViewItem *item);
32 virtual void refreshCurrent(); 32 virtual void refreshCurrent();
33 virtual void refreshCurrentSelected();
33 virtual void refreshOutgoing(); 34 virtual void refreshOutgoing();
34 virtual void slotHold(int, QListViewItem *,const QPoint&,int); 35 virtual void slotHold(int, QListViewItem *,const QPoint&,int);
35 virtual void slotContextMenu(int id); 36 virtual void slotContextMenu(int id);
36 void setupFolderselect(Selectstore*sels); 37 void setupFolderselect(Selectstore*sels);
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 09e52b8..4f0c849 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -46,9 +46,8 @@ int IMAPwrapper::selectMbox(const QString&mbox)
46} 46}
47 47
48void IMAPwrapper::imap_progress( size_t current, size_t maximum ) 48void IMAPwrapper::imap_progress( size_t current, size_t maximum )
49{ 49{
50 qApp->processEvents();
51 return; 50 return;
52 //qDebug("imap progress %d of %d ",current,maximum ); 51 //qDebug("imap progress %d of %d ",current,maximum );
53 //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum)); 52 //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum));
54 //qApp->processEvents() 53 //qApp->processEvents()
@@ -157,9 +156,8 @@ void IMAPwrapper::login(bool tryTLS) // = true)
157 } else { 156 } else {
158 user = account->getUser(); 157 user = account->getUser();
159 pass = account->getPassword(); 158 pass = account->getPassword();
160 } 159 }
161
162 m_imap = mailimap_new( 20, &imap_progress ); 160 m_imap = mailimap_new( 20, &imap_progress );
163 161
164 /* connect */ 162 /* connect */
165 bool ssl = false; 163 bool ssl = false;
@@ -173,11 +171,11 @@ void IMAPwrapper::login(bool tryTLS) // = true)
173 force_tls = true; 171 force_tls = true;
174 } 172 }
175 173
176 if ( ssl ) { 174 if ( ssl ) {
177 qDebug("using ssl "); 175 //qDebug("using ssl ");
178 err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); 176 err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port );
179 qDebug("back "); 177 //qDebug("back ");
180 } else { 178 } else {
181 err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); 179 err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port );
182 } 180 }
183 181