author | alwin <alwin> | 2004-03-08 03:05:23 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-08 03:05:23 (UTC) |
commit | a3836842bfabc973f27f2686320f7a207c59b10a (patch) (unidiff) | |
tree | 49c389706af22752a7f9d6c255cd3cb0ce80f211 | |
parent | 25d95c1b4e61445c695177c79049ccf7741e83f7 (diff) | |
download | opie-a3836842bfabc973f27f2686320f7a207c59b10a.zip opie-a3836842bfabc973f27f2686320f7a207c59b10a.tar.gz opie-a3836842bfabc973f27f2686320f7a207c59b10a.tar.bz2 |
different context menus for mail and nntp messages
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index d8b58b6..61e7dc4 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -167,34 +167,41 @@ void OpieMail::slotDeleteMail() | |||
167 | { | 167 | { |
168 | if (!mailView->currentItem()) return; | 168 | if (!mailView->currentItem()) return; |
169 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 169 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
170 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 170 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
171 | { | 171 | { |
172 | mail.Wrapper()->deleteMail( mail ); | 172 | mail.Wrapper()->deleteMail( mail ); |
173 | folderView->refreshCurrent(); | 173 | folderView->refreshCurrent(); |
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 177 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
178 | { | 178 | { |
179 | if (!mailView->currentItem()) return; | ||
180 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | ||
179 | /* just the RIGHT button - or hold on pda */ | 181 | /* just the RIGHT button - or hold on pda */ |
180 | if (button!=2) {return;} | 182 | if (button!=2) {return;} |
181 | qDebug("Event right/hold"); | 183 | qDebug("Event right/hold"); |
182 | if (!item) return; | 184 | if (!item) return; |
183 | QPopupMenu *m = new QPopupMenu(0); | 185 | QPopupMenu *m = new QPopupMenu(0); |
184 | if (m) | 186 | if (m) |
185 | { | 187 | { |
186 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); | 188 | if (mail.Wrapper()->getType()==MAILLIB::A_NNTP) { |
187 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); | 189 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); |
188 | m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); | 190 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
191 | } else { | ||
192 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); | ||
193 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); | ||
194 | m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); | ||
195 | } | ||
189 | m->setFocus(); | 196 | m->setFocus(); |
190 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 197 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
191 | delete m; | 198 | delete m; |
192 | } | 199 | } |
193 | } | 200 | } |
194 | 201 | ||
195 | void OpieMail::slotShowFolders( bool show ) | 202 | void OpieMail::slotShowFolders( bool show ) |
196 | { | 203 | { |
197 | qDebug( "Show Folders" ); | 204 | qDebug( "Show Folders" ); |
198 | if ( show && folderView->isHidden() ) | 205 | if ( show && folderView->isHidden() ) |
199 | { | 206 | { |
200 | qDebug( "-> showing" ); | 207 | qDebug( "-> showing" ); |