summaryrefslogtreecommitdiffabout
path: root/kmicromail/accountview.cpp
authorzautrix <zautrix>2005-08-22 18:52:57 (UTC)
committer zautrix <zautrix>2005-08-22 18:52:57 (UTC)
commitcb425b4c2d027d49f964368e94a52d3ba5e6aa31 (patch) (side-by-side diff)
treeb867e4c565aab6965059306bac24dd3ab5ca3750 /kmicromail/accountview.cpp
parente011ace92e07174effca53b7dde20b9a5b695af0 (diff)
downloadkdepimpi-cb425b4c2d027d49f964368e94a52d3ba5e6aa31.zip
kdepimpi-cb425b4c2d027d49f964368e94a52d3ba5e6aa31.tar.gz
kdepimpi-cb425b4c2d027d49f964368e94a52d3ba5e6aa31.tar.bz2
ompi fixes
Diffstat (limited to 'kmicromail/accountview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/accountview.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index 6227f6d..cef55ab 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -12,20 +12,26 @@
#include <qpe/qpeapplication.h>
/* QT */
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qcheckbox.h>
+#include <qtimer.h>
#include <qspinbox.h>
#include <klocale.h>
+#include <kmessagebox.h>
using namespace Opie::Core;
AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
: QListView( parent, name, flags )
{
- connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
+ //connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
+ // SLOT( refresh(QListViewItem*) ) );
+ connect( this, SIGNAL( clicked(QListViewItem*) ),
+ SLOT( refresh(QListViewItem*) ) );
+ connect( this, SIGNAL( returnPressed(QListViewItem*) ),
SLOT( refresh(QListViewItem*) ) );
connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) );
setSorting(0);
}
@@ -88,17 +94,21 @@ void AccountView::populate( QList<Account> list )
}
void AccountView::refresh(QListViewItem *item)
{
if ( item )
{
+ int result = KMessageBox::warningContinueCancel(this,
+ i18n("Refresh\n%1\n?").arg( item->text(0) ),
+ i18n("Refresh"),i18n("Refresh"),i18n("Cancel"),
+ true);
+ if (result != KMessageBox::Continue) return;
m_currentItem = item;
- QValueList<RecMailP> headerlist;
- AccountViewItem *view = static_cast<AccountViewItem *>(item);
- view->refresh(headerlist);
- emit refreshMailview(headerlist);
+ topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ;
+ QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) );
+
}
}
void AccountView::refreshOutgoing()
{
m_currentItem = currentItem();
if ( !m_currentItem ) return;
@@ -118,21 +128,28 @@ void AccountView::refreshOutgoing()
//qDebug("name *%s* ",bName.lower().latin1() );
if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) {
refreshCurrent();
// qDebug("refresh ");
}
}
-
-void AccountView::refreshCurrent()
+void AccountView::refreshCurrentSelected()
{
- m_currentItem = currentItem();
if ( !m_currentItem ) return;
QValueList<RecMailP> headerlist;
AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem);
view->refresh(headerlist);
emit refreshMailview(headerlist);
+ topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ;
+}
+
+void AccountView::refreshCurrent()
+{
+ m_currentItem = currentItem();
+ if ( !m_currentItem ) return;
+ topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ;
+ QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) );
}
void AccountView::refreshAll()
{
}