mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-27 18:36:15 -04:00
Merge branch 'RetroShare:master' into macos-guide
This commit is contained in:
commit
d3513ffed0
@ -25,6 +25,7 @@
|
|||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
#include "gui/common/FilesDefs.h"
|
#include "gui/common/FilesDefs.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
|
|
||||||
#include "PulseAddDialog.h"
|
#include "PulseAddDialog.h"
|
||||||
|
|
||||||
@ -98,11 +99,31 @@ void PulseAddDialog::setGroup(RsWireGroup &group)
|
|||||||
// set ReplyWith Group.
|
// set ReplyWith Group.
|
||||||
void PulseAddDialog::setGroup(const RsGxsGroupId &grpId)
|
void PulseAddDialog::setGroup(const RsGxsGroupId &grpId)
|
||||||
{
|
{
|
||||||
/* fetch in the background */
|
if(grpId.isNull()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RsThread::async([this,grpId](){
|
||||||
|
|
||||||
RsWireGroupSPtr pGroup;
|
RsWireGroupSPtr pGroup;
|
||||||
rsWire->getWireGroup(grpId, pGroup);
|
if(!rsWire->getWireGroup(grpId,pGroup))
|
||||||
|
{
|
||||||
|
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve wire group info for wire id: " << grpId << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RsQThreadUtils::postToObject( [pGroup,this]()
|
||||||
|
{
|
||||||
|
/* Here it goes any code you want to be executed on the Qt Gui
|
||||||
|
* thread, for example to update the data model with new information
|
||||||
|
* after a blocking call to RetroShare API complete, note that
|
||||||
|
* Qt::QueuedConnection is important!
|
||||||
|
*/
|
||||||
|
|
||||||
setGroup(*pGroup);
|
setGroup(*pGroup);
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseAddDialog::cleanup()
|
void PulseAddDialog::cleanup()
|
||||||
@ -236,20 +257,24 @@ void PulseAddDialog::setReplyTo(const RsWirePulse &pulse, RsWirePulseSPtr pPulse
|
|||||||
|
|
||||||
void PulseAddDialog::setReplyTo(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId, uint32_t replyType)
|
void PulseAddDialog::setReplyTo(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId, uint32_t replyType)
|
||||||
{
|
{
|
||||||
|
if(grpId.isNull()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* fetch in the background */
|
/* fetch in the background */
|
||||||
|
|
||||||
|
RsThread::async([this,grpId,msgId,replyType](){
|
||||||
|
|
||||||
RsWireGroupSPtr pGroup;
|
RsWireGroupSPtr pGroup;
|
||||||
|
RsWirePulseSPtr pPulse;
|
||||||
if(!rsWire->getWireGroup(grpId,pGroup))
|
if(!rsWire->getWireGroup(grpId,pGroup))
|
||||||
{
|
{
|
||||||
std::cerr << "PulseAddDialog::setRplyTo() failed to fetch group";
|
std::cerr << __PRETTY_FUNCTION__ << "PulseAddDialog::setRplyTo() failed to fetch group id: " << grpId << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsWirePulseSPtr pPulse;
|
|
||||||
if (!rsWire->getWirePulse(grpId, msgId, pPulse))
|
if (!rsWire->getWirePulse(grpId, msgId, pPulse))
|
||||||
{
|
{
|
||||||
std::cerr << "PulseAddDialog::setRplyTo() failed to fetch pulse";
|
std::cerr << "PulseAddDialog::setRplyTo() failed to fetch pulse of group id: " << grpId << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +284,19 @@ void PulseAddDialog::setReplyTo(const RsGxsGroupId &grpId, const RsGxsMessageId
|
|||||||
pPulse->mGroupPtr = pGroup;
|
pPulse->mGroupPtr = pGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsQThreadUtils::postToObject( [pGroup,this,pPulse,replyType]()
|
||||||
|
{
|
||||||
|
/* Here it goes any code you want to be executed on the Qt Gui
|
||||||
|
* thread, for example to update the data model with new information
|
||||||
|
* after a blocking call to RetroShare API complete, note that
|
||||||
|
* Qt::QueuedConnection is important!
|
||||||
|
*/
|
||||||
|
|
||||||
setReplyTo(*pPulse, pPulse, pGroup->mMeta.mGroupName, replyType);
|
setReplyTo(*pPulse, pPulse, pGroup->mMeta.mGroupName, replyType);
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseAddDialog::addURL()
|
void PulseAddDialog::addURL()
|
||||||
@ -319,7 +356,8 @@ void PulseAddDialog::postOriginalPulse()
|
|||||||
pPulse->mImage3 = mImage3;
|
pPulse->mImage3 = mImage3;
|
||||||
pPulse->mImage4 = mImage4;
|
pPulse->mImage4 = mImage4;
|
||||||
|
|
||||||
// this should be in async thread, so doesn't block UI thread.
|
RsThread::async([this,pPulse](){
|
||||||
|
|
||||||
if (!rsWire->createOriginalPulse(mGroup.mMeta.mGroupId, pPulse))
|
if (!rsWire->createOriginalPulse(mGroup.mMeta.mGroupId, pPulse))
|
||||||
{
|
{
|
||||||
std::cerr << "PulseAddDialog::postOriginalPulse() FAILED";
|
std::cerr << "PulseAddDialog::postOriginalPulse() FAILED";
|
||||||
@ -327,8 +365,20 @@ void PulseAddDialog::postOriginalPulse()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsQThreadUtils::postToObject( [this]()
|
||||||
|
{
|
||||||
|
/* Here it goes any code you want to be executed on the Qt Gui
|
||||||
|
* thread, for example to update the data model with new information
|
||||||
|
* after a blocking call to RetroShare API complete, note that
|
||||||
|
* Qt::QueuedConnection is important!
|
||||||
|
*/
|
||||||
|
|
||||||
clearDialog();
|
clearDialog();
|
||||||
hide();
|
hide();
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t PulseAddDialog::toPulseSentiment(int index)
|
uint32_t PulseAddDialog::toPulseSentiment(int index)
|
||||||
@ -380,7 +430,8 @@ void PulseAddDialog::postReplyPulse()
|
|||||||
pPulse->mImage4 = mReplyToPulse.mImage4;
|
pPulse->mImage4 = mReplyToPulse.mImage4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should be in async thread, so doesn't block UI thread.
|
RsThread::async([this, pPulse](){
|
||||||
|
|
||||||
if (!rsWire->createReplyPulse(mReplyToPulse.mMeta.mGroupId,
|
if (!rsWire->createReplyPulse(mReplyToPulse.mMeta.mGroupId,
|
||||||
mReplyToPulse.mMeta.mOrigMsgId,
|
mReplyToPulse.mMeta.mOrigMsgId,
|
||||||
mGroup.mMeta.mGroupId,
|
mGroup.mMeta.mGroupId,
|
||||||
@ -392,8 +443,20 @@ void PulseAddDialog::postReplyPulse()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsQThreadUtils::postToObject( [this]()
|
||||||
|
{
|
||||||
|
/* Here it goes any code you want to be executed on the Qt Gui
|
||||||
|
* thread, for example to update the data model with new information
|
||||||
|
* after a blocking call to RetroShare API complete, note that
|
||||||
|
* Qt::QueuedConnection is important!
|
||||||
|
*/
|
||||||
|
|
||||||
clearDialog();
|
clearDialog();
|
||||||
hide();
|
hide();
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseAddDialog::clearDialog()
|
void PulseAddDialog::clearDialog()
|
||||||
|
@ -140,6 +140,7 @@ WireDialog::~WireDialog()
|
|||||||
processSettings(false);
|
processSettings(false);
|
||||||
|
|
||||||
clearTwitterView();
|
clearTwitterView();
|
||||||
|
std::cerr << "WireDialog::~WireDialog()" << std::endl;
|
||||||
delete(mWireQueue);
|
delete(mWireQueue);
|
||||||
|
|
||||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||||
@ -688,6 +689,7 @@ void WireDialog::PVHrate(const RsGxsId &authorId)
|
|||||||
void WireDialog::postTestTwitterView()
|
void WireDialog::postTestTwitterView()
|
||||||
{
|
{
|
||||||
clearTwitterView();
|
clearTwitterView();
|
||||||
|
std::cerr << "WireDialog::postTestTwitterView()" << std::endl;
|
||||||
|
|
||||||
addTwitterView(new PulseTopLevel(NULL,RsWirePulseSPtr()));
|
addTwitterView(new PulseTopLevel(NULL,RsWirePulseSPtr()));
|
||||||
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
|
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
|
||||||
@ -844,6 +846,7 @@ void WireDialog::requestPulseFocus(const RsGxsGroupId groupId, const RsGxsMessag
|
|||||||
void WireDialog::showPulseFocus(const RsGxsGroupId groupId, const RsGxsMessageId msgId)
|
void WireDialog::showPulseFocus(const RsGxsGroupId groupId, const RsGxsMessageId msgId)
|
||||||
{
|
{
|
||||||
clearTwitterView();
|
clearTwitterView();
|
||||||
|
std::cerr << "WireDialog::showPulseFocus()" << std::endl;
|
||||||
|
|
||||||
// background thread for loading.
|
// background thread for loading.
|
||||||
RsThread::async([this, groupId, msgId]()
|
RsThread::async([this, groupId, msgId]()
|
||||||
@ -873,6 +876,8 @@ void WireDialog::showPulseFocus(const RsGxsGroupId groupId, const RsGxsMessageId
|
|||||||
void WireDialog::postPulseFocus(RsWirePulseSPtr pPulse)
|
void WireDialog::postPulseFocus(RsWirePulseSPtr pPulse)
|
||||||
{
|
{
|
||||||
clearTwitterView();
|
clearTwitterView();
|
||||||
|
std::cerr << "WireDialog::postPulseFocus()" << std::endl;
|
||||||
|
|
||||||
if (!pPulse)
|
if (!pPulse)
|
||||||
{
|
{
|
||||||
std::cerr << "WireDialog::postPulseFocus() Invalid pulse";
|
std::cerr << "WireDialog::postPulseFocus() Invalid pulse";
|
||||||
@ -945,7 +950,7 @@ void WireDialog::requestGroupFocus(const RsGxsGroupId groupId)
|
|||||||
void WireDialog::showGroupFocus(const RsGxsGroupId groupId)
|
void WireDialog::showGroupFocus(const RsGxsGroupId groupId)
|
||||||
{
|
{
|
||||||
clearTwitterView();
|
clearTwitterView();
|
||||||
|
std::cerr << "WireDialog::showGroupFocus()" << std::endl;
|
||||||
// background thread for loading.
|
// background thread for loading.
|
||||||
RsThread::async([this, groupId]()
|
RsThread::async([this, groupId]()
|
||||||
{
|
{
|
||||||
@ -1022,6 +1027,7 @@ void WireDialog::requestGroupsPulses(const std::list<RsGxsGroupId>& groupIds)
|
|||||||
void WireDialog::showGroupsPulses(const std::list<RsGxsGroupId>& groupIds)
|
void WireDialog::showGroupsPulses(const std::list<RsGxsGroupId>& groupIds)
|
||||||
{
|
{
|
||||||
clearTwitterView();
|
clearTwitterView();
|
||||||
|
std::cerr << "WireDialog::showGroupPulses()" << std::endl;
|
||||||
|
|
||||||
// background thread for loading.
|
// background thread for loading.
|
||||||
RsThread::async([this, groupIds]()
|
RsThread::async([this, groupIds]()
|
||||||
|
@ -146,8 +146,48 @@ QString ChatLobbyUserNotify::getNotifyMessage(bool plural)
|
|||||||
|
|
||||||
void ChatLobbyUserNotify::iconClicked()
|
void ChatLobbyUserNotify::iconClicked()
|
||||||
{
|
{
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
std::list<ChatLobbyId> lobbies;
|
||||||
|
rsMsgs->getChatLobbyList(lobbies);
|
||||||
|
bool doUpdate=false;
|
||||||
|
|
||||||
|
for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();)
|
||||||
|
{
|
||||||
|
bool bFound=false;
|
||||||
|
QString strLobbyName=tr("Unknown Lobby");
|
||||||
|
QIcon icoLobby=QIcon();
|
||||||
|
std::list<ChatLobbyId>::const_iterator lobbyIt;
|
||||||
|
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) {
|
||||||
|
ChatLobbyId clId = *lobbyIt;
|
||||||
|
if (clId==itCL->first) {
|
||||||
|
ChatLobbyInfo clInfo;
|
||||||
|
if (rsMsgs->getChatLobbyInfo(clId,clInfo))
|
||||||
|
strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ;
|
||||||
|
bFound=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bFound)
|
||||||
|
{
|
||||||
|
MainWindow::showWindow(MainWindow::ChatLobby);
|
||||||
|
ChatLobbyWidget *chatLobbyWidget = dynamic_cast<ChatLobbyWidget*>(MainWindow::getPage(MainWindow::ChatLobby));
|
||||||
|
if (chatLobbyWidget) chatLobbyWidget->showLobbyAnchor(itCL->first,strLobbyName);
|
||||||
|
++itCL ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lobby_map::iterator ittmp(itCL);
|
||||||
|
++ittmp ;
|
||||||
|
_listMsg.erase(itCL);
|
||||||
|
itCL=ittmp ;
|
||||||
|
doUpdate=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
/// Tray icon Menu ///
|
/// Tray icon Menu ///
|
||||||
QMenu* trayMenu = new QMenu(MainWindow::getInstance());
|
QMenu* trayMenu = createMenu();
|
||||||
std::list<ChatLobbyId> lobbies;
|
std::list<ChatLobbyId> lobbies;
|
||||||
rsMsgs->getChatLobbyList(lobbies);
|
rsMsgs->getChatLobbyList(lobbies);
|
||||||
bool doUpdate=false;
|
bool doUpdate=false;
|
||||||
@ -186,27 +226,25 @@ void ChatLobbyUserNotify::iconClicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notifyCombined()) {
|
|
||||||
QSystemTrayIcon* trayIcon=getTrayIcon();
|
|
||||||
if (trayIcon!=NULL) trayIcon->setContextMenu(trayMenu);
|
|
||||||
} else {
|
|
||||||
QAction* action=getNotifyIcon();
|
|
||||||
if (action!=NULL) {
|
|
||||||
action->setMenu(trayMenu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString strName=tr("Remove All");
|
QString strName=tr("Remove All");
|
||||||
QAction *pAction = new QAction( QIcon(), strName, trayMenu);
|
QAction *pAction = new QAction( QIcon(), strName, trayMenu);
|
||||||
ActionTag actionTag={0x0, "", true};
|
ActionTag actionTag={0x0, "", true};
|
||||||
pAction->setData(qVariantFromValue(actionTag));
|
pAction->setData(qVariantFromValue(actionTag));
|
||||||
connect(trayMenu, SIGNAL(triggered(QAction*)), this, SLOT(subMenuClicked(QAction*)));
|
|
||||||
connect(trayMenu, SIGNAL(hovered(QAction*)), this, SLOT(subMenuHovered(QAction*)));
|
|
||||||
trayMenu->addAction(pAction);
|
trayMenu->addAction(pAction);
|
||||||
|
|
||||||
trayMenu->exec(QCursor::pos());
|
trayMenu->exec(QCursor::pos());
|
||||||
|
delete(trayMenu);
|
||||||
if (doUpdate) updateIcon();
|
if (doUpdate) updateIcon();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu* ChatLobbyUserNotify::createMenu()
|
||||||
|
{
|
||||||
|
QMenu* menu = new QMenu(MainWindow::getInstance());
|
||||||
|
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(subMenuClicked(QAction*)));
|
||||||
|
connect(menu, SIGNAL(hovered(QAction*)), this, SLOT(subMenuHovered(QAction*)));
|
||||||
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString strLobbyName, ChatLobbyId id)
|
void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString strLobbyName, ChatLobbyId id)
|
||||||
@ -217,11 +255,7 @@ void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString
|
|||||||
|
|
||||||
unsigned int msgCount=msgMap.size();
|
unsigned int msgCount=msgMap.size();
|
||||||
|
|
||||||
if(!parentMenu) parentMenu = new QMenu(MainWindow::getInstance());
|
|
||||||
QMenu *lobbyMenu = parentMenu->addMenu(icoLobby, strLobbyName);
|
QMenu *lobbyMenu = parentMenu->addMenu(icoLobby, strLobbyName);
|
||||||
connect(lobbyMenu, SIGNAL(triggered(QAction*)), this, SLOT(subMenuClicked(QAction*)));
|
|
||||||
connect(lobbyMenu, SIGNAL(hovered(QAction*)), this, SLOT(subMenuHovered(QAction*)));
|
|
||||||
|
|
||||||
lobbyMenu->setToolTip(getNotifyMessage(msgCount>1).arg(msgCount));
|
lobbyMenu->setToolTip(getNotifyMessage(msgCount>1).arg(msgCount));
|
||||||
|
|
||||||
for (msg_map::iterator itMsg=msgMap.begin(); itMsg!=msgMap.end(); ++itMsg) {
|
for (msg_map::iterator itMsg=msgMap.begin(); itMsg!=msgMap.end(); ++itMsg) {
|
||||||
@ -243,7 +277,6 @@ void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString
|
|||||||
ActionTag actionTag={itCL->first, "", true};
|
ActionTag actionTag={itCL->first, "", true};
|
||||||
pAction->setData(qVariantFromValue(actionTag));
|
pAction->setData(qVariantFromValue(actionTag));
|
||||||
lobbyMenu->addAction(pAction);
|
lobbyMenu->addAction(pAction);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLobbyUserNotify::iconHovered()
|
void ChatLobbyUserNotify::iconHovered()
|
||||||
@ -251,7 +284,6 @@ void ChatLobbyUserNotify::iconHovered()
|
|||||||
iconClicked();
|
iconClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg)
|
void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
ChatLobbyUserNotify(QObject *parent = 0);
|
ChatLobbyUserNotify(QObject *parent = 0);
|
||||||
|
|
||||||
virtual bool hasSetting(QString *name, QString *group);
|
virtual bool hasSetting(QString *name, QString *group);
|
||||||
|
QMenu* createMenu();
|
||||||
void makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString strLobbyName, ChatLobbyId id);
|
void makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString strLobbyName, ChatLobbyId id);
|
||||||
void chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg);
|
void chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg);
|
||||||
void chatLobbyCleared(ChatLobbyId lobby_id, QString anchor, bool onlyUnread=false);
|
void chatLobbyCleared(ChatLobbyId lobby_id, QString anchor, bool onlyUnread=false);
|
||||||
|
@ -76,7 +76,7 @@ bool ChatUserNotify::hasSetting(QString *name, QString *group)
|
|||||||
|
|
||||||
QIcon ChatUserNotify::getIcon()
|
QIcon ChatUserNotify::getIcon()
|
||||||
{
|
{
|
||||||
return FilesDefs::getIconFromQtResourcePath(":/images/chat.png");
|
return FilesDefs::getIconFromQtResourcePath(":/images/orange-bubble-64.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon ChatUserNotify::getMainIcon(bool hasNew)
|
QIcon ChatUserNotify::getMainIcon(bool hasNew)
|
||||||
|
@ -982,11 +982,12 @@ void ChatWidget::on_notifyButton_clicked()
|
|||||||
if(!notify) return;
|
if(!notify) return;
|
||||||
if (chatType() != CHATTYPE_LOBBY) return;
|
if (chatType() != CHATTYPE_LOBBY) return;
|
||||||
|
|
||||||
QMenu* menu = new QMenu(MainWindow::getInstance());
|
QMenu* menu = notify->createMenu();
|
||||||
QIcon icoLobby=(ui->notifyButton->icon());
|
QIcon icoLobby=(ui->notifyButton->icon());
|
||||||
|
|
||||||
notify->makeSubMenu(menu, icoLobby, title, chatId.toLobbyId());
|
notify->makeSubMenu(menu, icoLobby, title, chatId.toLobbyId());
|
||||||
menu->exec(ui->notifyButton->mapToGlobal(QPoint(0,ui->notifyButton->geometry().height())));
|
menu->exec(ui->notifyButton->mapToGlobal(QPoint(0,ui->notifyButton->geometry().height())));
|
||||||
|
delete(menu);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ uint32_t RsFriendListModel::EntryIndex::parentRow(uint32_t nb_groups) const
|
|||||||
|
|
||||||
QModelIndex RsFriendListModel::index(int row, int column, const QModelIndex& parent) const
|
QModelIndex RsFriendListModel::index(int row, int column, const QModelIndex& parent) const
|
||||||
{
|
{
|
||||||
if(row < 0 || column < 0 || column >= COLUMN_THREAD_NB_COLUMNS)
|
if(row < 0 || column < 0 || column >= columnCount(parent) || row >= rowCount(parent))
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
if(parent.internalId() == 0)
|
if(parent.internalId() == 0)
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include "GxsCommentTreeWidget.h"
|
#include "GxsCommentTreeWidget.h"
|
||||||
|
|
||||||
#include "gui/common/FilesDefs.h"
|
#include "gui/common/FilesDefs.h"
|
||||||
|
#include "gui/Identity/IdDialog.h"
|
||||||
|
#include "gui/MainWindow.h"
|
||||||
#include "gui/common/RSElidedItemDelegate.h"
|
#include "gui/common/RSElidedItemDelegate.h"
|
||||||
#include "gui/common/RSTreeWidgetItem.h"
|
#include "gui/common/RSTreeWidgetItem.h"
|
||||||
#include "gui/gxs/GxsCreateCommentDialog.h"
|
#include "gui/gxs/GxsCreateCommentDialog.h"
|
||||||
@ -346,6 +348,10 @@ void GxsCommentTreeWidget::customPopUpMenu(const QPoint& point)
|
|||||||
action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown()));
|
action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown()));
|
||||||
action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull());
|
action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull());
|
||||||
|
|
||||||
|
contextMnu.addSeparator();
|
||||||
|
|
||||||
|
action = contextMnu.addAction(tr("Show Author"), this, SLOT(showAuthor()));
|
||||||
|
action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull());
|
||||||
|
|
||||||
if (!mCurrentCommentMsgId.isNull())
|
if (!mCurrentCommentMsgId.isNull())
|
||||||
{
|
{
|
||||||
@ -464,6 +470,19 @@ void GxsCommentTreeWidget::replyToComment()
|
|||||||
pcc.exec();
|
pcc.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GxsCommentTreeWidget::showAuthor()
|
||||||
|
{
|
||||||
|
/* window will destroy itself! */
|
||||||
|
IdDialog *idDialog = dynamic_cast<IdDialog*>(MainWindow::getPage(MainWindow::People));
|
||||||
|
|
||||||
|
if (!idDialog)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
MainWindow::showWindow(MainWindow::People);
|
||||||
|
idDialog->navigate(RsGxsId(mCurrentCommentAuthorId));
|
||||||
|
}
|
||||||
|
|
||||||
void GxsCommentTreeWidget::copyComment()
|
void GxsCommentTreeWidget::copyComment()
|
||||||
{
|
{
|
||||||
QString txt = dynamic_cast<QAction*>(sender())->data().toString();
|
QString txt = dynamic_cast<QAction*>(sender())->data().toString();
|
||||||
|
@ -72,6 +72,7 @@ public slots:
|
|||||||
|
|
||||||
void makeComment();
|
void makeComment();
|
||||||
void replyToComment();
|
void replyToComment();
|
||||||
|
void showAuthor();
|
||||||
|
|
||||||
void copyComment();
|
void copyComment();
|
||||||
|
|
||||||
|
@ -10,6 +10,11 @@ project(retroshare-service)
|
|||||||
|
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
include_directories("/usr/local/include")
|
||||||
|
LINK_DIRECTORIES("/usr/local/lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(
|
set(
|
||||||
RS_BIN_INSTALL_DIR
|
RS_BIN_INSTALL_DIR
|
||||||
"${CMAKE_INSTALL_PREFIX}/bin"
|
"${CMAKE_INSTALL_PREFIX}/bin"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user