author | zautrix <zautrix> | 2004-09-10 19:57:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-10 19:57:55 (UTC) |
commit | cebdd6de7481514ad5ea0517f7a2e8f4db422be5 (patch) (unidiff) | |
tree | 0b29859b5bbfdcb702724c3b0c721f22b0d0e666 /kmicromail/libmailwrapper/imapwrapper.cpp | |
parent | 157120031b77a3d9f10d780a66b6441dac1399fa (diff) | |
download | kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.zip kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.tar.gz kdepimpi-cebdd6de7481514ad5ea0517f7a2e8f4db422be5.tar.bz2 |
Added status info when deleting mails
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 021633b..be825ef 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -11,2 +11,5 @@ | |||
11 | using namespace Opie::Core; | 11 | using namespace Opie::Core; |
12 | int IMAPwrapper::mMax = 0; | ||
13 | int IMAPwrapper::mCurrent = 0; | ||
14 | |||
12 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 15 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
@@ -17,2 +20,4 @@ IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | |||
17 | m_Lastmbox = ""; | 20 | m_Lastmbox = ""; |
21 | mCurrent = 0; | ||
22 | mMax = 0; | ||
18 | } | 23 | } |
@@ -42,6 +47,26 @@ void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | |||
42 | { | 47 | { |
48 | //qDebug("imap progress %d of %d ",current,maximum ); | ||
49 | //Global::statusMessage(tr("Downloading message %1 of %2").arg( current).arg(maximum)); | ||
50 | //qApp->processEvents() | ||
51 | static int last = 0; | ||
52 | if ( last != current ) | ||
53 | IMAPwrapper::progress(); | ||
54 | last = current; | ||
55 | } | ||
56 | void IMAPwrapper::progress( QString m ) | ||
57 | { | ||
58 | |||
59 | static QString mProgrMess; | ||
60 | if ( m != QString::null ) { | ||
61 | mProgrMess = m; | ||
62 | mCurrent = 0; | ||
63 | return; | ||
64 | } | ||
65 | QString mess; | ||
66 | //qDebug("progress "); | ||
67 | if ( mMax ) mess = mProgrMess +tr(" message %1 of %2").arg( mCurrent++).arg(mMax); | ||
68 | else mess = mProgrMess +tr(" message %1").arg( mCurrent++); | ||
69 | Global::statusMessage(mess); | ||
43 | qApp->processEvents(); | 70 | qApp->processEvents(); |
44 | qDebug("imap progress %d of %d ",current,maximum ); | ||
45 | } | 71 | } |
46 | |||
47 | bool IMAPwrapper::start_tls(bool force_tls) | 72 | bool IMAPwrapper::start_tls(bool force_tls) |
@@ -467,4 +492,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
467 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); | 492 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); |
468 | //odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl; | 493 | qDebug("time %s ",da.toString().latin1() ); |
469 | //odebug << da.toString() << oendl; | ||
470 | #endif | 494 | #endif |
@@ -888,21 +912,10 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | |||
888 | 912 | ||
889 | QProgressBar bar( count,0 ); | 913 | |
890 | bar.setCaption (("Removing mails - close to abort!") ); | 914 | mMax = count; |
891 | int w = 300; | 915 | //progress( tr("Delete")); |
892 | if ( QApplication::desktop()->width() < 320 ) | 916 | QWidget wid; |
893 | w = 220; | 917 | wid.show(); |
894 | int h = bar.sizeHint().height() ; | ||
895 | int dw = QApplication::desktop()->width(); | ||
896 | int dh = QApplication::desktop()->height(); | ||
897 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
898 | bar.show(); | ||
899 | int modulo = (count/10)+1; | ||
900 | int incCounter = 0; | ||
901 | |||
902 | while (iii < count ) { | 918 | while (iii < count ) { |
903 | if ( ! bar.isVisible() ) | 919 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
904 | return ; | 920 | wid.raise(); |
905 | if ( incCounter % modulo == 0 ) | ||
906 | bar.setProgress( incCounter ); | ||
907 | ++incCounter; | ||
908 | qApp->processEvents(); | 921 | qApp->processEvents(); |
@@ -1201,3 +1214,5 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | |||
1201 | { | 1214 | { |
1202 | if (targetWrapper != this || maxSizeInKb > 0 ) { | 1215 | if (targetWrapper != this || maxSizeInKb > 0 ) { |
1216 | mMax = 0; | ||
1217 | progress( tr("Copy")); | ||
1203 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); | 1218 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); |
@@ -1216,2 +1231,3 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | |||
1216 | } | 1231 | } |
1232 | Global::statusMessage( tr("Copying mails on server...") ); | ||
1217 | int last = m_imap->imap_selection_info->sel_exists; | 1233 | int last = m_imap->imap_selection_info->sel_exists; |