mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 03:52:39 -04:00
Check for empty recipient and empty subject in MessageComposer.
Added context menu for empty trash in MessagesDialog. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3720 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
64709b8ae0
commit
89ca27ef66
7 changed files with 115 additions and 49 deletions
|
@ -239,6 +239,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||
|
||||
connect( ui.messagestreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messageslistWidgetCostumPopupMenu( QPoint ) ) );
|
||||
connect( ui.msgList, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( msgfilelistWidgetCostumPopupMenu( QPoint ) ) );
|
||||
connect( ui.listWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( folderlistWidgetCostumPopupMenu( QPoint ) ) );
|
||||
connect( ui.messagestreeView, SIGNAL(clicked ( const QModelIndex &) ) , this, SLOT( clicked( const QModelIndex & ) ) );
|
||||
connect( ui.messagestreeView, SIGNAL(doubleClicked ( const QModelIndex& ) ) , this, SLOT( doubleClicked( const QModelIndex & ) ) );
|
||||
connect( ui.listWidget, SIGNAL( currentRowChanged ( int) ), this, SLOT( changeBox ( int) ) );
|
||||
|
@ -720,6 +721,20 @@ void MessagesDialog::msgfilelistWidgetCostumPopupMenu( QPoint point )
|
|||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void MessagesDialog::folderlistWidgetCostumPopupMenu(QPoint point)
|
||||
{
|
||||
if (ui.listWidget->currentRow() != ROW_TRASHBOX) {
|
||||
/* Context menu only neede for trash box */
|
||||
return;
|
||||
}
|
||||
|
||||
QMenu contextMnu(this);
|
||||
|
||||
contextMnu.addAction(tr("Empty trash"), this, SLOT(emptyTrash()));
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void MessagesDialog::newmessage()
|
||||
{
|
||||
MessageComposer *nMsgDialog = new MessageComposer();
|
||||
|
@ -1829,7 +1844,6 @@ void MessagesDialog::removemessage()
|
|||
QString mid = pItem->data(ROLE_MSGID).toString();
|
||||
if (bDelete) {
|
||||
rsMsgs->MessageDelete(mid.toStdString());
|
||||
|
||||
} else {
|
||||
rsMsgs->MessageToTrash(mid.toStdString(), true);
|
||||
}
|
||||
|
@ -2295,3 +2309,20 @@ void MessagesDialog::linkActivated(QString link)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessagesDialog::emptyTrash()
|
||||
{
|
||||
LockUpdate Lock (this, true);
|
||||
|
||||
std::list<MsgInfoSummary> msgList;
|
||||
rsMsgs->getMessageSummaries(msgList);
|
||||
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
for (it = msgList.begin(); it != msgList.end(); it++) {
|
||||
if (it->msgflags & RS_MSG_TRASH) {
|
||||
rsMsgs->MessageDelete(it->msgId);
|
||||
}
|
||||
}
|
||||
|
||||
// LockUpdate -> insertMessages();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue