-rw-r--r-- | kmicromail/accountview.cpp | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index 6227f6d..cef55ab 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -16,6 +16,8 @@ | |||
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 | ||
21 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
@@ -23,8 +25,12 @@ AccountView::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 | } |
@@ -92,9 +98,13 @@ void AccountView::refresh(QListViewItem *item) | |||
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 | } |
@@ -122,8 +132,6 @@ void AccountView::refreshOutgoing() | |||
122 | } | 132 | } |
123 | } | 133 | } |
124 | 134 | void AccountView::refreshCurrentSelected() | |
125 | void 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; |
@@ -131,4 +139,13 @@ void AccountView::refreshCurrent() | |||
131 | view->refresh(headerlist); | 139 | view->refresh(headerlist); |
132 | emit refreshMailview(headerlist); | 140 | emit refreshMailview(headerlist); |
141 | topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; | ||
142 | } | ||
143 | |||
144 | void 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 | ||