From dbe0890974be320f475256b8d3719fef2456f8fa Mon Sep 17 00:00:00 2001 From: chrisparker126 Date: Sun, 6 Feb 2011 20:41:15 +0000 Subject: [PATCH] restored channel key restore created new action for delete channel history git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4017 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ChannelFeed.cpp | 9 +++++---- retroshare-gui/src/gui/chat/PopupChatDialog.cpp | 6 ++++++ retroshare-gui/src/gui/chat/PopupChatDialog.h | 1 + retroshare-gui/src/gui/chat/PopupChatDialog.ui | 12 ++++++++++++ .../src/gui/im_history/IMHistoryKeeper.cpp | 2 ++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/ChannelFeed.cpp b/retroshare-gui/src/gui/ChannelFeed.cpp index 6e911d6f2..c5b483d97 100644 --- a/retroshare-gui/src/gui/ChannelFeed.cpp +++ b/retroshare-gui/src/gui/ChannelFeed.cpp @@ -150,8 +150,8 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point ) QAction *channeldetailsAct = new QAction(QIcon(":/images/info16.png"), tr( "Show Channel Details" ), &contextMnu); connect( channeldetailsAct , SIGNAL( triggered() ), this, SLOT( showChannelDetails() ) ); - //QAction *restoreKeysAct = new QAction(QIcon(":/images/settings16.png"), tr("Restore Publish Rights for Channel" ), &contextMnu); - //connect( restoreKeysAct , SIGNAL( triggered() ), this, SLOT( restoreChannelKeys() ) ); + QAction *restoreKeysAct = new QAction(QIcon(":/images/settings16.png"), tr("Restore Publish Rights for Channel" ), &contextMnu); + connect( restoreKeysAct , SIGNAL( triggered() ), this, SLOT( restoreChannelKeys() ) ); QAction *editChannelDetailAct = new QAction(QIcon(":/images/edit_16.png"), tr("Edit Channel Details"), &contextMnu); connect( editChannelDetailAct, SIGNAL( triggered() ), this, SLOT( editChannelDetail() ) ); @@ -171,16 +171,17 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point ) contextMnu.addSeparator(); contextMnu.addAction( channeldetailsAct ); contextMnu.addAction( shareKeyAct ); + contextMnu.addAction( restoreKeysAct ); } else if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) { contextMnu.addAction( unsubscribechannelAct ); contextMnu.addSeparator(); contextMnu.addAction( channeldetailsAct ); - // contextMnu.addAction( restoreKeysAct ); + contextMnu.addAction( restoreKeysAct ); } else { contextMnu.addAction( subscribechannelAct ); contextMnu.addSeparator(); contextMnu.addAction( channeldetailsAct ); - // contextMnu.addAction( restoreKeysAct ); + contextMnu.addAction( restoreKeysAct ); } contextMnu.exec(QCursor::pos()); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 168621698..07c597185 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -150,6 +150,7 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi QMenu * toolmenu = new QMenu(); toolmenu->addAction(ui.actionClear_Chat); + toolmenu->addAction(ui.actionClear_Chat_History); toolmenu->addAction(ui.actionSave_Chat_History); toolmenu->addAction(ui.actionClearOfflineMessages); toolmenu->addAction(ui.actionMessageHistory); @@ -826,6 +827,11 @@ void PopupChatDialog::addSmiley() //============================================================================ void PopupChatDialog::on_actionClear_Chat_triggered() +{ + ui.textBrowser->clear(); +} + +void PopupChatDialog::on_actionClear_Chat_History_triggered() { ui.textBrowser->clear(); historyKeeper.clearHistory(); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index fb584273d..0a1cf33de 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -107,6 +107,7 @@ private slots: void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ; void on_actionClear_Chat_triggered(); + void on_actionClear_Chat_History_triggered(); bool fileSave(); bool fileSaveAs(); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.ui b/retroshare-gui/src/gui/chat/PopupChatDialog.ui index c3934cbcf..03d190028 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.ui +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.ui @@ -886,6 +886,18 @@ background: white;} Browse History + + + + :/images/edit-clear-history.png:/images/edit-clear-history.png + + + Clear Chat History + + + deletes all stored and displayed chat history + + diff --git a/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp b/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp index b96118384..c1c6684cf 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp @@ -256,6 +256,8 @@ void IMHistoryKeeper::clearHistory(){ if(!wri.remove(hfName)) std::cerr << "\nFailed to remove history file" << std::endl; + clear(); + } //=============================================================================