From bacf1f5a80ec6cd285f93aacd91d214d482fe191 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 5 Sep 2010 20:50:34 +0000 Subject: [PATCH] Added remove, copy to clipboard and resend of messages in History Browser. Clear history in PeersDialog don't remove messages from the History Keeper. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3447 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/PeersDialog.cpp | 3 +- .../src/gui/im_history/IMHistoryItem.cpp | 4 +- .../src/gui/im_history/IMHistoryItem.h | 3 +- .../src/gui/im_history/IMHistoryKeeper.cpp | 67 +++++- .../src/gui/im_history/IMHistoryKeeper.h | 11 + .../src/gui/im_history/IMHistoryReader.cpp | 48 +++-- .../src/gui/im_history/IMHistoryReader.h | 5 +- .../src/gui/im_history/IMHistoryWriter.cpp | 1 + .../src/gui/im_history/ImHistoryBrowser.cpp | 190 +++++++++++++++++- .../src/gui/im_history/ImHistoryBrowser.h | 19 +- .../src/gui/im_history/ImHistoryBrowser.ui | 72 ++++++- retroshare-gui/src/gui/images.qrc | 1 + retroshare-gui/src/gui/images/copy.png | Bin 0 -> 590 bytes 13 files changed, 379 insertions(+), 45 deletions(-) create mode 100644 retroshare-gui/src/gui/images/copy.png diff --git a/retroshare-gui/src/gui/PeersDialog.cpp b/retroshare-gui/src/gui/PeersDialog.cpp index a1d4ab257..a270d402d 100644 --- a/retroshare-gui/src/gui/PeersDialog.cpp +++ b/retroshare-gui/src/gui/PeersDialog.cpp @@ -1385,7 +1385,6 @@ void PeersDialog::setChatInfo(QString info, QColor color) void PeersDialog::on_actionClearChat_triggered() { ui.msgText->clear(); - historyKeeper.clear(); } void PeersDialog::displayInfoChatMenu(const QPoint& pos) @@ -1756,6 +1755,6 @@ void PeersDialog::statusColumn() void PeersDialog::on_actionMessageHistory_triggered() { - ImHistoryBrowser imBrowser(false, historyKeeper, this); + ImHistoryBrowser imBrowser(false, historyKeeper, ui.lineEdit, this); imBrowser.exec(); } diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItem.cpp b/retroshare-gui/src/gui/im_history/IMHistoryItem.cpp index c38d4ebf0..0d2216ec7 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItem.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryItem.cpp @@ -25,12 +25,14 @@ IMHistoryItem::IMHistoryItem() { + hiid = 0; } //============================================================================ -IMHistoryItem::IMHistoryItem(bool incomingIn, std::string &idIn, const QString &nameIn, const QDateTime &sendTimeIn, const QString &messageTextIn) +IMHistoryItem::IMHistoryItem(int hiidIn, bool incomingIn, std::string &idIn, const QString &nameIn, const QDateTime &sendTimeIn, const QString &messageTextIn) { + hiid = hiidIn; incoming = incomingIn; id = idIn; name = nameIn; diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItem.h b/retroshare-gui/src/gui/im_history/IMHistoryItem.h index ff16fda03..f5a809727 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItem.h +++ b/retroshare-gui/src/gui/im_history/IMHistoryItem.h @@ -30,8 +30,9 @@ class IMHistoryItem public: IMHistoryItem(); - IMHistoryItem(bool incoming, std::string &id, const QString &name, const QDateTime &sendTime, const QString &messageText); + IMHistoryItem(int hiid, bool incoming, std::string &id, const QString &name, const QDateTime &sendTime, const QString &messageText); + int hiid; bool incoming; std::string id; QString name; diff --git a/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp b/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp index 9277ecb9d..a23553ad1 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryKeeper.cpp @@ -44,6 +44,8 @@ IMHistoryKeeper::IMHistoryKeeper() saveTimer->connect(saveTimer, SIGNAL(timeout()), this, SLOT(saveHistory())); saveTimer->setInterval(10000); saveTimer->start(); + + lasthiid = 0; }; //============================================================================= @@ -57,6 +59,8 @@ IMHistoryKeeper::~IMHistoryKeeper() void IMHistoryKeeper::init(QString historyFileName) { + lasthiid = 0; + hfName = historyFileName; loadHistoryFile(); } @@ -65,7 +69,7 @@ void IMHistoryKeeper::init(QString historyFileName) void IMHistoryKeeper::addMessage(bool incoming, std::string &id, const QString &name, const QDateTime &sendTime, const QString &messageText) { - IMHistoryItem item(incoming, id, name, sendTime, messageText); + IMHistoryItem item(++lasthiid, incoming, id, name, sendTime, messageText); hitems.append(item); @@ -96,8 +100,8 @@ bool IMHistoryKeeper::loadHistoryFile() return false; } - IMHistoryReader hreader; - if (!hreader.read(hitems, hfName)) { + IMHistoryReader hreader; + if (!hreader.read(hitems, hfName, lasthiid)) { lastErrorMessage = hreader.errorMessage(); return false; } @@ -145,16 +149,73 @@ bool IMHistoryKeeper::getMessages(QList &historyItems, const int //============================================================================= +bool IMHistoryKeeper::getMessage(int hiid, IMHistoryItem &item) +{ + QList::iterator it; + for (it = hitems.begin(); it != hitems.end(); it++) { + if (it->hiid == hiid) { + item = *it; + return true; + } + } + + return false; +} + +//============================================================================= + void IMHistoryKeeper::clear() { hitems.clear(); historyChanged = true; + lasthiid = 0; + emit historyClear(); } //============================================================================= +void IMHistoryKeeper::removeMessage(int hiid) +{ + QList::iterator it; + for (it = hitems.begin(); it != hitems.end(); it++) { + if (it->hiid == hiid) { + emit historyRemove(*it); + hitems.erase(it); + historyChanged = true; + break; + } + } +} + +//============================================================================= + +void IMHistoryKeeper::removeMessages(QList &hiids) +{ + bool changed = false; + + QList::iterator it = hitems.begin(); + while (it != hitems.end()) { + if (qFind(hiids, it->hiid) != hiids.end()) { + emit historyRemove(*it); + + hitems.erase(it); + + changed = true; + + continue; + } + it++; + } + + if (changed) { + historyChanged = true; + } +} + +//============================================================================= + void IMHistoryKeeper::saveHistory() { if (historyChanged && hfName.isEmpty() == false) { diff --git a/retroshare-gui/src/gui/im_history/IMHistoryKeeper.h b/retroshare-gui/src/gui/im_history/IMHistoryKeeper.h index cb2ccd4bf..bb5fcf9c9 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryKeeper.h +++ b/retroshare-gui/src/gui/im_history/IMHistoryKeeper.h @@ -71,6 +71,9 @@ public: //! Fills given list with items bool getMessages(QList &historyItems, const int messagesCount); + //! Get message + bool getMessage(int hiid, IMHistoryItem &item); + //! Adds new message to the history //! Adds new message to the history, but the message will be saved to @@ -80,6 +83,12 @@ public: //! Clear the history void clear(); + //! Remove item + void removeMessage(int hiid); + + //! Remove items + void removeMessages(QList &hiids); + private: bool loadHistoryFile(); @@ -88,12 +97,14 @@ private: bool historyChanged; QString lastErrorMessage; QTimer *saveTimer; + int lasthiid; private slots: void saveHistory(); signals: void historyAdd(IMHistoryItem item) const; + void historyRemove(IMHistoryItem item) const; void historyClear() const; }; diff --git a/retroshare-gui/src/gui/im_history/IMHistoryReader.cpp b/retroshare-gui/src/gui/im_history/IMHistoryReader.cpp index a2885ab51..6f6b4c3e5 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryReader.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryReader.cpp @@ -35,12 +35,11 @@ IMHistoryReader::IMHistoryReader() //============================================================================= -bool IMHistoryReader::read(QList& resultList, - const QString fileName) +bool IMHistoryReader::read(QList& resultList, const QString fileName, int &lasthiid) { errMess = "No error"; - QList result; + resultList.clear(); //==== check for file and open it QFile fl(fileName); @@ -64,7 +63,7 @@ bool IMHistoryReader::read(QList& resultList, readNext(); if (isStartElement()) { if (name() == "history_file" && attributes().value("format_version") == "1.0") { - readHistory(result); + readHistory(resultList, lasthiid); break; } else { errMess = "The file is not a history file with format version 1.0"; @@ -75,13 +74,11 @@ bool IMHistoryReader::read(QList& resultList, if (error()) { errMess = errorString(); - } else { - resultList.clear(); - - QList::const_iterator hii;//history items iterator - for (hii = result.constBegin(); hii != result.constEnd(); ++hii) { - resultList << *hii; - } +// } else { +// QList::const_iterator hii;//history items iterator +// for (hii = result.constBegin(); hii != result.constEnd(); ++hii) { +// resultList << *hii; +// } } return !error(); @@ -118,13 +115,16 @@ void IMHistoryReader::readUnknownElement() //============================================================================= -void IMHistoryReader::readHistory(QList &historyItems) +void IMHistoryReader::readHistory(QList &historyItems, int &lasthiid) { Q_ASSERT(isStartElement()); // qDebug()<< " " << "node with message " << name() ; historyItems.clear(); + lasthiid = 0; + + bool recalculate = false; while (!atEnd()) { readNext(); @@ -136,13 +136,29 @@ void IMHistoryReader::readHistory(QList &historyItems) if ( name() == "message") { IMHistoryItem item; readMessage(item); + if (item.hiid == 0) { + recalculate = true; + } else { + if (item.hiid > lasthiid) { + lasthiid = item.hiid; + } + } historyItems.append(item); - } - else { + } else { readUnknownElement(); } } } + + if (recalculate) { + // calculate hiid + QList::iterator item = historyItems.begin(); + for (item = historyItems.begin(); item != historyItems.end(); item++) { + if (item->hiid == 0) { + item->hiid = ++lasthiid; + } + } + } } //============================================================================= @@ -154,6 +170,7 @@ void IMHistoryReader::readMessage(IMHistoryItem &historyItem) if (isStartElement() && (name() == "message")) { //=== process attributes + historyItem.hiid = attributes().value("hiid").toString().toInt(); historyItem.incoming = (attributes().value("incoming").toString().toInt() == 1); historyItem.id = attributes().value("id").toString().toStdString(); historyItem.name = attributes().value("name").toString(); @@ -180,6 +197,3 @@ void IMHistoryReader::readMessage(IMHistoryItem &historyItem) } } -//============================================================================= -//============================================================================= -//============================================================================= diff --git a/retroshare-gui/src/gui/im_history/IMHistoryReader.h b/retroshare-gui/src/gui/im_history/IMHistoryReader.h index 80e809520..509c301a4 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryReader.h +++ b/retroshare-gui/src/gui/im_history/IMHistoryReader.h @@ -34,14 +34,13 @@ class IMHistoryReader : public QXmlStreamReader public: IMHistoryReader(); - bool read(QList& resultList, - const QString fileName ); + bool read(QList& resultList, const QString fileName, int &lasthiid); QString errorMessage(); private: void readUnknownElement(); - void readHistory(QList &historyItems); + void readHistory(QList &historyItems, int &lasthiid); void readMessage(IMHistoryItem &historyItem); QString errMess; diff --git a/retroshare-gui/src/gui/im_history/IMHistoryWriter.cpp b/retroshare-gui/src/gui/im_history/IMHistoryWriter.cpp index 59be07fb4..07063957d 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryWriter.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryWriter.cpp @@ -59,6 +59,7 @@ bool IMHistoryWriter::write(QList& itemList, const QString fileNa foreach(IMHistoryItem item, itemList) { writeStartElement("message"); + writeAttribute("hiid", QString::number(item.hiid)); writeAttribute("incoming", QString::number(item.incoming ? 1 : 0)); writeAttribute("id", QString::fromStdString(item.id)); writeAttribute("name", item.name); diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index 42ff84331..5080e2527 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -24,6 +24,9 @@ #include #include #include +#include +#include +#include #include "ImHistoryBrowser.h" #include "IMHistoryItemDelegate.h" @@ -32,24 +35,33 @@ #include "rshare.h" #include "gui/settings/rsharesettings.h" -#define ROLE_PLAINTEXT Qt::UserRole +#define ROLE_HIID Qt::UserRole +#define ROLE_PLAINTEXT Qt::UserRole + 1 /** Default constructor */ -ImHistoryBrowser::ImHistoryBrowser(bool isPrivateChatIn, IMHistoryKeeper &histKeeper, QWidget *parent, Qt::WFlags flags) +ImHistoryBrowser::ImHistoryBrowser(bool isPrivateChatIn, IMHistoryKeeper &histKeeper, QTextEdit *edit, QWidget *parent, Qt::WFlags flags) : QDialog(parent, flags), historyKeeper(histKeeper) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); isPrivateChat = isPrivateChatIn; + textEdit = edit; connect(&historyKeeper, SIGNAL(historyAdd(IMHistoryItem)), this, SLOT(historyAdd(IMHistoryItem))); + connect(&historyKeeper, SIGNAL(historyRemove(IMHistoryItem)), this, SLOT(historyRemove(IMHistoryItem))); connect(&historyKeeper, SIGNAL(historyClear()), this, SLOT(historyClear())); - connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); + connect(ui.clearFilterButton, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); - ui.clearButton->hide(); + connect(ui.copyButton, SIGNAL(clicked()), SLOT(copyMessage())); + connect(ui.removeButton, SIGNAL(clicked()), SLOT(removeMessages())); + + connect(ui.listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged())); + connect(ui.listWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); + + ui.clearFilterButton->hide(); // embed smileys ? if (isPrivateChat) { @@ -73,6 +85,12 @@ ImHistoryBrowser::ImHistoryBrowser(bool isPrivateChatIn, IMHistoryKeeper &histKe if (geometry.isEmpty() == false) { restoreGeometry(geometry); } + + // dummy call for set butons + itemSelectionChanged(); + + ui.listWidget->installEventFilter(this); + } ImHistoryBrowser::~ImHistoryBrowser() @@ -80,6 +98,22 @@ ImHistoryBrowser::~ImHistoryBrowser() Settings->setValueToGroup("HistorieBrowser", "Geometry", saveGeometry()); } +bool ImHistoryBrowser::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == ui.listWidget) { + if (event->type() == QEvent::KeyPress) { + QKeyEvent *keyEvent = static_cast(event); + if (keyEvent && keyEvent->key() == Qt::Key_Delete) { + // Delete pressed + removeMessages(); + return true; // eat event + } + } + } + // pass the event on to the parent class + return QDialog::eventFilter(obj, event); +} + void ImHistoryBrowser::historyAdd(IMHistoryItem item) { QListWidgetItem *itemWidget = addItem(item); @@ -88,6 +122,18 @@ void ImHistoryBrowser::historyAdd(IMHistoryItem item) } } +void ImHistoryBrowser::historyRemove(IMHistoryItem item) +{ + int count = ui.listWidget->count(); + for (int i = 0; i < count; i++) { + QListWidgetItem *itemWidget = ui.listWidget->item(i); + if (itemWidget->data(ROLE_HIID).toString().toInt() == item.hiid) { + delete(ui.listWidget->takeItem(i)); + break; + } + } +} + void ImHistoryBrowser::historyClear() { ui.listWidget->clear(); @@ -112,6 +158,7 @@ QListWidgetItem *ImHistoryBrowser::addItem(IMHistoryItem &item) QListWidgetItem *itemWidget = new QListWidgetItem; itemWidget->setData(Qt::DisplayRole, qVariantFromValue(IMHistoryItemPainter(formatMsg))); + itemWidget->setData(ROLE_HIID, item.hiid); /* calculate plain text */ QTextDocument doc; @@ -127,9 +174,9 @@ void ImHistoryBrowser::filterRegExpChanged() QString text = ui.filterPatternLineEdit->text(); if (text.isEmpty()) { - ui.clearButton->hide(); + ui.clearFilterButton->hide(); } else { - ui.clearButton->show(); + ui.clearFilterButton->show(); } filterItems(); @@ -145,7 +192,6 @@ void ImHistoryBrowser::filterItems(QListWidgetItem *item) { QString text = ui.filterPatternLineEdit->text(); - QRegExp regExp(text); if (item == NULL) { int count = ui.listWidget->count(); for (int i = 0; i < count; i++) { @@ -153,7 +199,7 @@ void ImHistoryBrowser::filterItems(QListWidgetItem *item) if (text.isEmpty()) { item->setHidden(false); } else { - if (item->data(ROLE_PLAINTEXT).toString().contains(regExp)) { + if (item->data(ROLE_PLAINTEXT).toString().contains(text, Qt::CaseInsensitive)) { item->setHidden(false); } else { item->setHidden(true); @@ -164,7 +210,7 @@ void ImHistoryBrowser::filterItems(QListWidgetItem *item) if (text.isEmpty()) { item->setHidden(false); } else { - if (item->data(ROLE_PLAINTEXT).toString().contains(regExp)) { + if (item->data(ROLE_PLAINTEXT).toString().contains(text, Qt::CaseInsensitive)) { item->setHidden(false); } else { item->setHidden(true); @@ -172,3 +218,129 @@ void ImHistoryBrowser::filterItems(QListWidgetItem *item) } } } + +void ImHistoryBrowser::getSelectedItems(QList &items) +{ + QList itemWidgets = ui.listWidget->selectedItems(); + + QList::iterator it; + for (it = itemWidgets.begin(); it != itemWidgets.end(); it++) { + QListWidgetItem *item = *it; + if (item->isHidden()) { + continue; + } + items.append(item->data(ROLE_HIID).toString().toInt()); + } +} + +void ImHistoryBrowser::itemSelectionChanged() +{ + QList hiids; + getSelectedItems(hiids); + + if (hiids.size()) { + // activate buttons + ui.copyButton->setEnabled(true); + ui.removeButton->setEnabled(true); + } else { + // deactivate buttons + ui.copyButton->setDisabled(true); + ui.removeButton->setDisabled(true); + } +} + +void ImHistoryBrowser::customContextMenuRequested(QPoint pos) +{ + QList hiids; + getSelectedItems(hiids); + + QListWidgetItem *currentItem = ui.listWidget->currentItem(); + + QMenu contextMnu(this); + + QAction *selectAll = new QAction(tr("Mark all"), &contextMnu); + QAction *copyMessage = new QAction(tr("Copy"), &contextMnu); + QAction *removeMessages = new QAction(tr("Delete"), &contextMnu); + QAction *clearHistory = new QAction(tr("Clear history"), &contextMnu); + + QAction *sendItem = NULL; + if (textEdit) { + sendItem = new QAction(tr("Send"), &contextMnu); + if (currentItem) { + connect(sendItem, SIGNAL(triggered()), this, SLOT(sendMessage())); + } else { + sendItem->setDisabled(true); + } + } + + if (hiids.size()) { + connect(selectAll, SIGNAL(triggered()), ui.listWidget, SLOT(selectAll())); + connect(copyMessage, SIGNAL(triggered()), this, SLOT(copyMessage())); + connect(removeMessages, SIGNAL(triggered()), this, SLOT(removeMessages())); + connect(clearHistory, SIGNAL(triggered()), this, SLOT(clearHistory())); + } else { + selectAll->setDisabled(true); + copyMessage->setDisabled(true); + removeMessages->setDisabled(true); + clearHistory->setDisabled(true); + } + + contextMnu.addAction(selectAll); + contextMnu.addSeparator(); + contextMnu.addAction(copyMessage); + contextMnu.addAction(removeMessages); + contextMnu.addAction(clearHistory); + if (sendItem) { + contextMnu.addSeparator(); + contextMnu.addAction(sendItem); + } + + contextMnu.exec(QCursor::pos()); +} + +void ImHistoryBrowser::copyMessage() +{ + QListWidgetItem *currentItem = ui.listWidget->currentItem(); + if (currentItem) { + int hiid = currentItem->data(ROLE_HIID).toString().toInt(); + IMHistoryItem item; + if (historyKeeper.getMessage(hiid, item)) { + QTextDocument doc; + doc.setHtml(item.messageText); + QApplication::clipboard()->setText(doc.toPlainText()); + } + } +} + +void ImHistoryBrowser::removeMessages() +{ + QList hiids; + getSelectedItems(hiids); + + historyKeeper.removeMessages(hiids); +} + +void ImHistoryBrowser::clearHistory() +{ + historyKeeper.clear(); +} + +void ImHistoryBrowser::sendMessage() +{ + if (textEdit) { + QListWidgetItem *currentItem = ui.listWidget->currentItem(); + if (currentItem) { + int hiid = currentItem->data(ROLE_HIID).toString().toInt(); + IMHistoryItem item; + if (historyKeeper.getMessage(hiid, item)) { + textEdit->clear(); + textEdit->setText(item.messageText); + textEdit->setFocus(); + QTextCursor cursor = textEdit->textCursor(); + cursor.movePosition(QTextCursor::End); + textEdit->setTextCursor(cursor); + close(); + } + } + } +} diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h index ec77d3426..c21a49b6c 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h @@ -30,28 +30,45 @@ #include "ui_ImHistoryBrowser.h" +class QTextEdit; + class ImHistoryBrowser : public QDialog { Q_OBJECT public: /** Default constructor */ - ImHistoryBrowser(bool isPrivateChat, IMHistoryKeeper &histKeeper, QWidget *parent = 0, Qt::WFlags flags = 0); + ImHistoryBrowser(bool isPrivateChat, IMHistoryKeeper &histKeeper, QTextEdit *edit, QWidget *parent = 0, Qt::WFlags flags = 0); /** Default destructor */ virtual ~ImHistoryBrowser(); +protected: + bool eventFilter(QObject *obj, QEvent *ev); + private slots: void historyAdd(IMHistoryItem item); + void historyRemove(IMHistoryItem item); void historyClear(); void filterRegExpChanged(); void clearFilter(); + void itemSelectionChanged(); + void customContextMenuRequested(QPoint pos); + + void copyMessage(); + void removeMessages(); + void clearHistory(); + void sendMessage(); + private: QListWidgetItem *addItem(IMHistoryItem &item); void filterItems(QListWidgetItem *item = NULL); + void getSelectedItems(QList &items); + bool isPrivateChat; + QTextEdit *textEdit; bool embedSmileys; IMHistoryKeeper &historyKeeper; ChatStyle style; diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui index 9061a9a12..f7298c878 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui @@ -14,7 +14,7 @@ Message History - + :/images/rstray3.png:/images/rstray3.png @@ -23,7 +23,7 @@ - + @@ -36,7 +36,7 @@ - :/images/find-16.png + :/images/find-16.png @@ -44,7 +44,7 @@ - + 16 @@ -97,16 +97,72 @@ border-image: url(:/images/closepressed.png) + + + + Qt::CustomContextMenu + + + QAbstractItemView::ExtendedSelection + + + - + + + + + Qt::NoFocus + + + Copy + + + + :/images/copy.png:/images/copy.png + + + Qt::ToolButtonTextBesideIcon + + + + + + + Qt::NoFocus + + + Remove + + + + :/images/delete.png:/images/delete.png + + + Qt::ToolButtonTextBesideIcon + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - + buttonBox diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index f5793799f..c8a33e9aa 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -107,6 +107,7 @@ images/console-small-hover.png images/console-small-up.png images/contact_new128.png + images/copy.png images/delete.png images/deleteall.png images/deletemail-pressed.png diff --git a/retroshare-gui/src/gui/images/copy.png b/retroshare-gui/src/gui/images/copy.png new file mode 100644 index 0000000000000000000000000000000000000000..9f5661aeccee380831cc6dbf2580ead860e21630 GIT binary patch literal 590 zcmV-U0 zMG?gkQRpQ|d+?)ao2E%OE!M^~-AY2T+3f7>IJ4`?5C2w7@L8 ziBSeo;Z_D61j{oqrT605mjF1{2=XCO<>7q|PKPZX)D|h~;QK6E+e60ZXtd{E@3}Qi z$ndz%yAP}fTO}5Q;L)IpbuD|q%&L(Yi}noM2{s|`zLa?P!A6M5YvS=A45mb>1B<*F zE%32%ltNHqFyZWDz?JI$G3pezXoEG?`j40Vv!dk%e?EvR#4LwI|%7A{8%y{ z4ot%|S&jcef5#E>{9}%XPd3A>x=l2yLY@sT^2n(j zFicl0o8yV!kXS$SCgyVnD!K(-r`W!219tD+h;$;4R8qsWOZye_^z8zVoZ00VcqdIv zYVc#R+9Vw6jD}=9hZ~nW6!PTtJdbp>phEvOPsEqt$MVc&olCD^`s)Jvu68Qq@sL`y znZ3#T*Os{U=GG7-Rx(pUQY|>+I~WxUZEYcJZfrneG=u)@hZG|2qg`a@>g5txLw+o; z%5T3GiulA46-d8h`8qo&W#<07*qoM6N<$f