mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 07:00:57 -04:00
moved peerStatusChanged() from notify to rsEvents
This commit is contained in:
parent
0ce2dd8486
commit
e6cacc4d34
26 changed files with 281 additions and 187 deletions
|
@ -168,7 +168,7 @@ public:
|
|||
|
||||
/* Color definitions (for standard see default.qss) */
|
||||
QColor mTextColorGroup;
|
||||
QColor mTextColorStatus[RS_STATUS_COUNT];
|
||||
QColor mTextColorStatus[(int)RsStatusValue::RS_STATUS_COUNT];
|
||||
|
||||
void setIdentities(const std::list<RsGroupMetaData>& identities_meta);
|
||||
|
||||
|
|
|
@ -1471,7 +1471,7 @@ MainWindow::retranslateUi()
|
|||
}
|
||||
|
||||
/* set status object to status value */
|
||||
static void setStatusObject(QObject *pObject, int nStatus)
|
||||
static void setStatusObject(QObject *pObject, RsStatusValue nStatus)
|
||||
{
|
||||
QMenu *pMenu = dynamic_cast<QMenu*>(pObject);
|
||||
if (pMenu) {
|
||||
|
@ -1482,7 +1482,7 @@ static void setStatusObject(QObject *pObject, int nStatus)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pAction->data().toInt() == nStatus) {
|
||||
if (pAction->data().toInt() == (int)nStatus) {
|
||||
pAction->setChecked(true);
|
||||
break;
|
||||
}
|
||||
|
@ -1492,7 +1492,7 @@ static void setStatusObject(QObject *pObject, int nStatus)
|
|||
RSComboBox *pComboBox = dynamic_cast<RSComboBox*>(pObject);
|
||||
if (pComboBox) {
|
||||
/* set index of combobox */
|
||||
int nIndex = pComboBox->findData(nStatus, Qt::UserRole);
|
||||
int nIndex = pComboBox->findData((int)nStatus, Qt::UserRole);
|
||||
if (nIndex != -1) {
|
||||
pComboBox->setCurrentIndex(nIndex);
|
||||
}
|
||||
|
@ -1555,20 +1555,20 @@ void MainWindow::initializeStatusObject(QObject *pObject, bool bConnect)
|
|||
/* initialize menu */
|
||||
QActionGroup *pGroup = new QActionGroup(pMenu);
|
||||
|
||||
QAction *pAction = new QAction(QIcon(StatusDefs::imageStatus(RS_STATUS_ONLINE)), StatusDefs::name(RS_STATUS_ONLINE), pMenu);
|
||||
pAction->setData(RS_STATUS_ONLINE);
|
||||
QAction *pAction = new QAction(QIcon(StatusDefs::imageStatus(RsStatusValue::RS_STATUS_ONLINE)), StatusDefs::name(RsStatusValue::RS_STATUS_ONLINE), pMenu);
|
||||
pAction->setData((int)RsStatusValue::RS_STATUS_ONLINE);
|
||||
pAction->setCheckable(true);
|
||||
pMenu->addAction(pAction);
|
||||
pGroup->addAction(pAction);
|
||||
|
||||
pAction = new QAction(QIcon(StatusDefs::imageStatus(RS_STATUS_BUSY)), StatusDefs::name(RS_STATUS_BUSY), pMenu);
|
||||
pAction->setData(RS_STATUS_BUSY);
|
||||
pAction = new QAction(QIcon(StatusDefs::imageStatus(RsStatusValue::RS_STATUS_BUSY)), StatusDefs::name(RsStatusValue::RS_STATUS_BUSY), pMenu);
|
||||
pAction->setData((int)RsStatusValue::RS_STATUS_BUSY);
|
||||
pAction->setCheckable(true);
|
||||
pMenu->addAction(pAction);
|
||||
pGroup->addAction(pAction);
|
||||
|
||||
pAction = new QAction(QIcon(StatusDefs::imageStatus(RS_STATUS_AWAY)), StatusDefs::name(RS_STATUS_AWAY), pMenu);
|
||||
pAction->setData(RS_STATUS_AWAY);
|
||||
pAction = new QAction(QIcon(StatusDefs::imageStatus(RsStatusValue::RS_STATUS_AWAY)), StatusDefs::name(RsStatusValue::RS_STATUS_AWAY), pMenu);
|
||||
pAction->setData((int)RsStatusValue::RS_STATUS_AWAY);
|
||||
pAction->setCheckable(true);
|
||||
pMenu->addAction(pAction);
|
||||
pGroup->addAction(pAction);
|
||||
|
@ -1580,9 +1580,9 @@ void MainWindow::initializeStatusObject(QObject *pObject, bool bConnect)
|
|||
/* initialize combobox */
|
||||
RSComboBox *pComboBox = dynamic_cast<RSComboBox*>(pObject);
|
||||
if (pComboBox) {
|
||||
pComboBox->addItem(QIcon(StatusDefs::imageStatus(RS_STATUS_ONLINE)), StatusDefs::name(RS_STATUS_ONLINE), RS_STATUS_ONLINE);
|
||||
pComboBox->addItem(QIcon(StatusDefs::imageStatus(RS_STATUS_BUSY)), StatusDefs::name(RS_STATUS_BUSY), RS_STATUS_BUSY);
|
||||
pComboBox->addItem(QIcon(StatusDefs::imageStatus(RS_STATUS_AWAY)), StatusDefs::name(RS_STATUS_AWAY), RS_STATUS_AWAY);
|
||||
pComboBox->addItem(QIcon(StatusDefs::imageStatus(RsStatusValue::RS_STATUS_ONLINE)), StatusDefs::name(RsStatusValue::RS_STATUS_ONLINE), (int)RsStatusValue::RS_STATUS_ONLINE);
|
||||
pComboBox->addItem(QIcon(StatusDefs::imageStatus(RsStatusValue::RS_STATUS_BUSY)), StatusDefs::name(RsStatusValue::RS_STATUS_BUSY), (int)RsStatusValue::RS_STATUS_BUSY);
|
||||
pComboBox->addItem(QIcon(StatusDefs::imageStatus(RsStatusValue::RS_STATUS_AWAY)), StatusDefs::name(RsStatusValue::RS_STATUS_AWAY), (int)RsStatusValue::RS_STATUS_AWAY);
|
||||
|
||||
if (bConnect) {
|
||||
connect(pComboBox, SIGNAL(activated(int)), this, SLOT(statusChangedComboBox(int)));
|
||||
|
@ -1610,11 +1610,11 @@ void MainWindow::removeStatusObject(QObject *pObject)
|
|||
}
|
||||
|
||||
/** Save own status Online,Away,Busy **/
|
||||
void MainWindow::setStatus(QObject *pObject, int nStatus)
|
||||
void MainWindow::setStatus(QObject *pObject, RsStatusValue nStatus)
|
||||
{
|
||||
if (isIdle && nStatus == (int) RS_STATUS_ONLINE) {
|
||||
if (isIdle && nStatus == RsStatusValue::RS_STATUS_ONLINE) {
|
||||
/* set idle only when I am online */
|
||||
nStatus = RS_STATUS_INACTIVE;
|
||||
nStatus = RsStatusValue::RS_STATUS_INACTIVE;
|
||||
}
|
||||
|
||||
rsStatus->sendStatus(RsPeerId(), nStatus);
|
||||
|
@ -1634,7 +1634,7 @@ void MainWindow::statusChangedMenu(QAction *pAction)
|
|||
return;
|
||||
}
|
||||
|
||||
setStatus(pAction->parent(), pAction->data().toInt());
|
||||
setStatus(pAction->parent(), RsStatusValue(pAction->data().toInt()));
|
||||
}
|
||||
|
||||
/* new status from combobox in statusbar */
|
||||
|
@ -1645,7 +1645,7 @@ void MainWindow::statusChangedComboBox(int index)
|
|||
}
|
||||
|
||||
/* no object known */
|
||||
setStatus(NULL, statusComboBox->itemData(index, Qt::UserRole).toInt());
|
||||
setStatus(NULL, RsStatusValue(statusComboBox->itemData(index, Qt::UserRole).toInt()));
|
||||
}
|
||||
|
||||
/*new setting*/
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <set>
|
||||
|
||||
#include "retroshare/rsevents.h"
|
||||
#include "retroshare/rsstatus.h"
|
||||
|
||||
#include "gui/common/rwindow.h"
|
||||
#include "gui/common/RSComboBox.h"
|
||||
|
@ -185,7 +186,7 @@ public:
|
|||
/* initialize widget with status informations, status constant stored in data or in Qt::UserRole */
|
||||
void initializeStatusObject(QObject *pObject, bool bConnect);
|
||||
void removeStatusObject(QObject *pObject);
|
||||
void setStatus(QObject *pObject, int nStatus);
|
||||
void setStatus(QObject *pObject, RsStatusValue nStatus);
|
||||
|
||||
RSComboBox *statusComboBoxInstance();
|
||||
PeerStatus *peerstatusInstance();
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "notifyqt.h"
|
||||
#include "connect/ConnectFriendWizard.h"
|
||||
#include "util/PixmapMerging.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "LogoBar.h"
|
||||
#include "util/Widget.h"
|
||||
#include "util/misc.h"
|
||||
|
@ -94,9 +95,23 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||
ui.avatar->setOwnId();
|
||||
|
||||
connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage()));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int)));
|
||||
|
||||
//connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int)));
|
||||
|
||||
mEventHandlerId = 0;
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
RsQThreadUtils::postToObject([=](){
|
||||
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
||||
|
||||
if(!fe || fe->mEventCode != RsFriendListEventCode::NODE_STATUS_CHANGED)
|
||||
return;
|
||||
|
||||
updateOwnStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
||||
|
||||
}, this );
|
||||
},mEventHandlerId,RsEventType::FRIEND_LIST);
|
||||
|
||||
for (std::set<RsPgpId>::iterator peerIt = expandedPeers.begin(); peerIt != expandedPeers.end(); ++peerIt) {
|
||||
ui.friendList->addPeerToExpand(*peerIt);
|
||||
|
@ -159,6 +174,7 @@ MessengerWindow::~MessengerWindow ()
|
|||
{
|
||||
// save settings
|
||||
processSettings(false);
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||
|
||||
MainWindow *pMainWindow = MainWindow::getInstance();
|
||||
if (pMainWindow) {
|
||||
|
@ -214,7 +230,7 @@ void MessengerWindow::savestatusmessage()
|
|||
rsMsgs->setCustomStateString(ui.messagelineEdit->currentText().toUtf8().constData());
|
||||
}
|
||||
|
||||
void MessengerWindow::updateOwnStatus(const QString &peer_id, int status)
|
||||
void MessengerWindow::updateOwnStatus(const QString &peer_id, RsStatusValue status)
|
||||
{
|
||||
// add self nick + own status
|
||||
if (peer_id == QString::fromStdString(rsPeers->getOwnId().toStdString()))
|
||||
|
|
|
@ -52,7 +52,7 @@ private slots:
|
|||
/** Open Shared Manager **/
|
||||
void openShareManager();
|
||||
|
||||
void updateOwnStatus(const QString &peer_id, int status);
|
||||
void updateOwnStatus(const QString &peer_id, RsStatusValue status);
|
||||
|
||||
void savestatusmessage();
|
||||
|
||||
|
@ -68,6 +68,7 @@ private:
|
|||
|
||||
static std::set<RsPgpId> expandedPeers ;
|
||||
static std::set<RsNodeGroupId> expandedGroups ;
|
||||
RsEventsHandlerId_t mEventHandlerId ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -330,7 +330,7 @@ QString ChatDialog::getOwnName() const
|
|||
return "ChatDialog::getOwnName(): invalid id type passed (RsPeerId is required). This is a bug.";
|
||||
}
|
||||
|
||||
void ChatDialog::setPeerStatus(uint32_t status)
|
||||
void ChatDialog::setPeerStatus(RsStatusValue status)
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw)
|
||||
|
@ -346,14 +346,14 @@ void ChatDialog::setPeerStatus(uint32_t status)
|
|||
cw->updateStatus(QString::fromStdString(vpid.toStdString()), status);
|
||||
}
|
||||
}
|
||||
int ChatDialog::getPeerStatus()
|
||||
RsStatusValue ChatDialog::getPeerStatus()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->getPeerStatus();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return RsStatusValue::RS_STATUS_UNKNOWN;
|
||||
}
|
||||
|
||||
QString ChatDialog::getTitle()
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#ifndef CHATDIALOG_H
|
||||
#define CHATDIALOG_H
|
||||
|
||||
#include "retroshare/rsstatus.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
|
@ -58,8 +60,8 @@ public:
|
|||
bool setStyle();
|
||||
const RSStyle *getStyle();
|
||||
|
||||
int getPeerStatus();
|
||||
void setPeerStatus(uint32_t state);
|
||||
RsStatusValue getPeerStatus();
|
||||
void setPeerStatus(RsStatusValue state);
|
||||
|
||||
void focusDialog();
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void ChatTabWidget::tabInfoChanged(ChatDialog *dialog)
|
|||
}
|
||||
} else if (dialog->hasPeerStatus()) {
|
||||
setBlinking(tab, false);
|
||||
setTabIcon(tab, QIcon(StatusDefs::imageIM(dialog->getPeerStatus())));
|
||||
setTabIcon(tab, QIcon(StatusDefs::imageIM((RsStatusValue)dialog->getPeerStatus())));
|
||||
} else {
|
||||
setBlinking(tab, false);
|
||||
setTabIcon(tab, QIcon());
|
||||
|
@ -155,7 +155,7 @@ void ChatTabWidget::getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon)
|
|||
} else {
|
||||
cd = dynamic_cast<ChatDialog*>(currentWidget());
|
||||
if (cd && cd->hasPeerStatus()) {
|
||||
*icon = QIcon(StatusDefs::imageIM(cd->getPeerStatus()));
|
||||
*icon = QIcon(StatusDefs::imageIM((RsStatusValue)cd->getPeerStatus()));
|
||||
} else {
|
||||
*icon = QIcon();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "gui/chat/ChatUserNotify.h"//For BradCast
|
||||
#include "util/DateTime.h"
|
||||
#include "util/imageutil.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "gui/im_history/ImHistoryBrowser.h"
|
||||
|
||||
#include <retroshare/rsstatus.h>
|
||||
|
@ -74,7 +75,7 @@
|
|||
|
||||
ChatWidget::ChatWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, completionPosition(0), newMessages(false), typing(false), peerStatus(0)
|
||||
, completionPosition(0), newMessages(false), typing(false), peerStatus(RsStatusValue::RS_STATUS_UNKNOWN)
|
||||
, sendingBlocked(false), useCMark(false)
|
||||
, lastStatusSendTime(0)
|
||||
, firstShow(true), inChatCharFormatChanged(false), firstSearch(true)
|
||||
|
@ -171,8 +172,23 @@ ChatWidget::ChatWidget(QWidget *parent)
|
|||
|
||||
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
||||
//connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
||||
|
||||
mEventHandlerId = 0;
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
RsQThreadUtils::postToObject([=](){
|
||||
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
||||
|
||||
if(!fe || fe->mEventCode != RsFriendListEventCode::NODE_STATUS_CHANGED)
|
||||
return;
|
||||
|
||||
updateStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
||||
|
||||
}, this );
|
||||
},mEventHandlerId,RsEventType::FRIEND_LIST);
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(chatFontChanged()), this, SLOT(resetFonts()));
|
||||
|
||||
connect(ui->textBrowser, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
|
||||
|
@ -254,6 +270,7 @@ ChatWidget::ChatWidget(QWidget *parent)
|
|||
ChatWidget::~ChatWidget()
|
||||
{
|
||||
processSettings(false);
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||
|
||||
/* Cleanup plugin functions */
|
||||
foreach (ChatWidgetHolder *chatWidgetHolder, mChatWidgetHolder) {
|
||||
|
@ -1788,7 +1805,7 @@ void ChatWidget::setCurrentFileName(const QString &fileName)
|
|||
setWindowModified(false);
|
||||
}
|
||||
|
||||
void ChatWidget::updateStatus(const QString &peer_id, int status)
|
||||
void ChatWidget::updateStatus(const QString &peer_id, RsStatusValue status)
|
||||
{
|
||||
if (! (chatType() == CHATTYPE_PRIVATE || chatType() == CHATTYPE_DISTANT))
|
||||
{
|
||||
|
@ -1842,26 +1859,27 @@ void ChatWidget::updateStatus(const QString &peer_id, int status)
|
|||
bool atEnd = (scrollbar->value() == scrollbar->maximum());
|
||||
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
ui->info_Frame->setVisible(true);
|
||||
ui->infoLabel->setText(peerName + " " + tr("appears to be Offline.") +"\n" + tr("Messages you send will be delivered after Friend is again Online."));
|
||||
break;
|
||||
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
ui->info_Frame->setVisible(true);
|
||||
ui->infoLabel->setText(peerName + " " + tr("is Idle and may not reply"));
|
||||
break;
|
||||
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
ui->info_Frame->setVisible(false);
|
||||
break;
|
||||
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
ui->infoLabel->setText(peerName + " " + tr("is Away and may not reply"));
|
||||
ui->info_Frame->setVisible(true);
|
||||
break;
|
||||
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
ui->infoLabel->setText(peerName + " " + tr("is Busy and may not reply"));
|
||||
ui->info_Frame->setVisible(true);
|
||||
break;
|
||||
|
@ -1869,7 +1887,8 @@ void ChatWidget::updateStatus(const QString &peer_id, int status)
|
|||
|
||||
ui->titleLabel->setText(peerName);
|
||||
ui->titleLabel->setToolTip(tooltip_info);
|
||||
ui->statusLabel->setText(QString("(%1)").arg(StatusDefs::name(status)));
|
||||
#warning inconsistent conversion here
|
||||
ui->statusLabel->setText(QString("(%1)").arg(StatusDefs::name((RsStatusValue)status)));
|
||||
|
||||
peerStatus = status;
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rsfiles.h>
|
||||
#include <retroshare/rsstatus.h>
|
||||
|
||||
#include <QCompleter>
|
||||
#include <QTextCharFormat>
|
||||
|
@ -62,7 +63,7 @@ public:
|
|||
|
||||
// status comes from notifyPeerStatusChanged
|
||||
// see rststaus.h for possible values
|
||||
virtual void updateStatus(int /*status*/) {}
|
||||
virtual void updateStatus(RsStatusValue /*status*/) {}
|
||||
|
||||
protected:
|
||||
ChatWidget *mChatWidget;
|
||||
|
@ -105,7 +106,7 @@ public:
|
|||
void addToolsAction(QAction *action);
|
||||
|
||||
QString getTitle() { return title; }
|
||||
int getPeerStatus() { return peerStatus; }
|
||||
RsStatusValue getPeerStatus() { return peerStatus; }
|
||||
void setName(const QString &name);
|
||||
|
||||
bool setStyle();
|
||||
|
@ -130,7 +131,7 @@ public:
|
|||
const QList<ChatWidgetHolder*> &chatWidgetHolderList() { return mChatWidgetHolder; }
|
||||
|
||||
public slots:
|
||||
void updateStatus(const QString &peer_id, int status);
|
||||
void updateStatus(const QString &peer_id, RsStatusValue status);
|
||||
void setUseCMark(const bool bUseCMark);
|
||||
void updateCMPreview();
|
||||
|
||||
|
@ -144,7 +145,7 @@ private slots:
|
|||
signals:
|
||||
void infoChanged(ChatWidget*);
|
||||
void newMessage(ChatWidget*);
|
||||
void statusChanged(int);
|
||||
void statusChanged(RsStatusValue);
|
||||
void textBrowserAskContextMenu(QMenu* contextMnu, QString anchorForPosition, const QPoint point);
|
||||
|
||||
protected:
|
||||
|
@ -229,7 +230,7 @@ private:
|
|||
|
||||
bool newMessages;
|
||||
bool typing;
|
||||
int peerStatus;
|
||||
RsStatusValue peerStatus;
|
||||
|
||||
bool sendingBlocked;
|
||||
bool useCMark;
|
||||
|
@ -272,6 +273,8 @@ private:
|
|||
ChatLobbyUserNotify* notify;
|
||||
|
||||
Ui::ChatWidget *ui;
|
||||
|
||||
RsEventsHandlerId_t mEventHandlerId ;
|
||||
};
|
||||
|
||||
#endif // CHATWIDGET_H
|
||||
|
|
|
@ -350,7 +350,7 @@ void PopupChatWindow::calculateTitle(ChatDialog *dialog)
|
|||
} else {
|
||||
mBlinkIcon = QIcon();
|
||||
if (cd && cd->hasPeerStatus()) {
|
||||
icon = QIcon(StatusDefs::imageIM(cd->getPeerStatus()));
|
||||
icon = QIcon(StatusDefs::imageIM((RsStatusValue)cd->getPeerStatus()));
|
||||
} else {
|
||||
icon = qApp->windowIcon();
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ void PopupChatWindow::calculateTitle(ChatDialog *dialog)
|
|||
if (cd) {
|
||||
QString title = cd->getTitle();
|
||||
if (cd->hasPeerStatus()) {
|
||||
title += " (" + StatusDefs::name(cd->getPeerStatus()) + ")";
|
||||
title += " (" + StatusDefs::name((RsStatusValue)cd->getPeerStatus()) + ")";
|
||||
}
|
||||
setWindowTitle(title);
|
||||
} else {
|
||||
|
|
|
@ -121,7 +121,7 @@ void PopupDistantChatDialog::updateDisplay()
|
|||
getChatWidget()->blockSending(tr( "Can't send message immediately, "
|
||||
"because there is no tunnel "
|
||||
"available." ));
|
||||
setPeerStatus(RS_STATUS_OFFLINE);
|
||||
setPeerStatus(RsStatusValue::RS_STATUS_OFFLINE);
|
||||
break ;
|
||||
case RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED:
|
||||
std::cerr << "Chat remotely closed. " << std::endl;
|
||||
|
@ -131,7 +131,7 @@ void PopupDistantChatDialog::updateDisplay()
|
|||
getChatWidget()->updateStatusString("%1", tr( "Your partner closed the conversation." ), true );
|
||||
getChatWidget()->blockSending(tr( "Your partner closed the conversation."));
|
||||
|
||||
setPeerStatus(RS_STATUS_OFFLINE) ;
|
||||
setPeerStatus(RsStatusValue::RS_STATUS_OFFLINE) ;
|
||||
break ;
|
||||
|
||||
case RS_DISTANT_CHAT_STATUS_TUNNEL_DN:
|
||||
|
@ -145,7 +145,7 @@ void PopupDistantChatDialog::updateDisplay()
|
|||
_status_label->setToolTip(msg);
|
||||
getChatWidget()->updateStatusString("%1", msg, true);
|
||||
getChatWidget()->blockSending(msg);
|
||||
setPeerStatus(RS_STATUS_OFFLINE);
|
||||
setPeerStatus(RsStatusValue::RS_STATUS_OFFLINE);
|
||||
break;
|
||||
case RS_DISTANT_CHAT_STATUS_CAN_TALK:
|
||||
|
||||
|
@ -153,7 +153,7 @@ void PopupDistantChatDialog::updateDisplay()
|
|||
msg = QObject::tr( "End-to-end encrypted conversation established");
|
||||
_status_label->setToolTip(msg);
|
||||
getChatWidget()->unblockSending();
|
||||
setPeerStatus(RS_STATUS_ONLINE);
|
||||
setPeerStatus(RsStatusValue::RS_STATUS_ONLINE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "gui/notifyqt.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "gui/common/AvatarDefs.h"
|
||||
#include "gui/common/AvatarDialog.h"
|
||||
|
||||
|
@ -39,21 +40,36 @@
|
|||
|
||||
AvatarWidget::AvatarWidget(QWidget *parent) : QLabel(parent), ui(new Ui::AvatarWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
mFlag.isOwnId = false;
|
||||
defaultAvatar = ":/images/no_avatar_background.png";
|
||||
mPeerState = RS_STATUS_OFFLINE ;
|
||||
mFlag.isOwnId = false;
|
||||
defaultAvatar = ":/images/no_avatar_background.png";
|
||||
mPeerState = RsStatusValue::RS_STATUS_OFFLINE ;
|
||||
|
||||
setFrameType(NO_FRAME);
|
||||
setFrameType(NO_FRAME);
|
||||
|
||||
/* connect signals */
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateOwnAvatar()));
|
||||
|
||||
mEventHandlerId = 0;
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
RsQThreadUtils::postToObject([=](){
|
||||
|
||||
const RsFriendListEvent *e = dynamic_cast<const RsFriendListEvent*>(event.get());
|
||||
if(!e)
|
||||
return;
|
||||
updateStatus(QString::fromStdString(e->mSslId.toStdString()),e->mStatus);
|
||||
}, this );
|
||||
}, mEventHandlerId, RsEventType::FRIEND_LIST );
|
||||
|
||||
/* connect signals */
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateOwnAvatar()));
|
||||
}
|
||||
|
||||
AvatarWidget::~AvatarWidget()
|
||||
{
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -68,15 +84,15 @@ QString AvatarWidget::frameState()
|
|||
case STATUS_FRAME:
|
||||
switch (mPeerState)
|
||||
{
|
||||
case RS_STATUS_OFFLINE:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
return "OFFLINE";
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
return "INACTIVE";
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
return "ONLINE";
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
return "AWAY";
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
return "BUSY";
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +123,7 @@ void AvatarWidget::setFrameType(FrameType type)
|
|||
{
|
||||
mFrameType = type;
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
switch (mFrameType) {
|
||||
case NO_FRAME:
|
||||
disconnect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateStatus(const QString&, int)));
|
||||
|
@ -118,6 +135,9 @@ void AvatarWidget::setFrameType(FrameType type)
|
|||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateStatus(const QString&, int)));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//refreshAvatarImage();
|
||||
refreshStatus();
|
||||
|
@ -179,7 +199,7 @@ void AvatarWidget::refreshStatus()
|
|||
}
|
||||
case STATUS_FRAME:
|
||||
{
|
||||
uint32_t status = 0;
|
||||
RsStatusValue status = RsStatusValue::RS_STATUS_UNKNOWN;
|
||||
|
||||
if (mId.isNotSet())
|
||||
return;
|
||||
|
@ -193,7 +213,7 @@ void AvatarWidget::refreshStatus()
|
|||
status = statusInfo.status ;
|
||||
}
|
||||
else if(mId.isDistantChatId())
|
||||
status = RS_STATUS_ONLINE ;
|
||||
status = RsStatusValue::RS_STATUS_ONLINE ;
|
||||
else
|
||||
{
|
||||
std::cerr << "Unhandled chat id type in AvatarWidget::refreshStatus()" << std::endl;
|
||||
|
@ -217,10 +237,10 @@ void AvatarWidget::refreshStatus()
|
|||
{
|
||||
switch (dcpinfo.status)
|
||||
{
|
||||
case RS_DISTANT_CHAT_STATUS_CAN_TALK : status = RS_STATUS_ONLINE ; break;
|
||||
case RS_DISTANT_CHAT_STATUS_CAN_TALK : status = RsStatusValue::RS_STATUS_ONLINE ; break;
|
||||
case RS_DISTANT_CHAT_STATUS_UNKNOWN : // Fall-through
|
||||
case RS_DISTANT_CHAT_STATUS_TUNNEL_DN : // Fall-through
|
||||
case RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED : status = RS_STATUS_OFFLINE;
|
||||
case RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED : status = RsStatusValue::RS_STATUS_OFFLINE;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -238,20 +258,20 @@ void AvatarWidget::refreshStatus()
|
|||
}
|
||||
}
|
||||
|
||||
void AvatarWidget::updateStatus(const QString& peerId, int status)
|
||||
void AvatarWidget::updateStatus(const QString& peerId, RsStatusValue status)
|
||||
{
|
||||
if (mId.isPeerId() && mId.toPeerId() == RsPeerId(peerId.toStdString()))
|
||||
updateStatus(status) ;
|
||||
}
|
||||
|
||||
void AvatarWidget::updateStatus(int status)
|
||||
void AvatarWidget::updateStatus(RsStatusValue status)
|
||||
{
|
||||
if (mFrameType != STATUS_FRAME)
|
||||
return;
|
||||
|
||||
mPeerState = status;
|
||||
|
||||
setEnabled(((uint32_t) status == RS_STATUS_OFFLINE) ? false : true);
|
||||
setEnabled((status == RsStatusValue::RS_STATUS_OFFLINE) ? false : true);
|
||||
RsApplication::refreshStyleSheet(this, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
#include <QLabel>
|
||||
#include <stdint.h>
|
||||
#include <retroshare/rstypes.h>
|
||||
#include <retroshare/rsevents.h>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rsstatus.h>
|
||||
|
||||
namespace Ui {
|
||||
class AvatarWidget;
|
||||
|
@ -57,14 +59,14 @@ protected:
|
|||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
|
||||
private slots:
|
||||
void updateStatus(const QString& peerId, int status);
|
||||
void updateStatus(const QString& peerId, RsStatusValue status);
|
||||
void updateAvatar(const QString& peerId);
|
||||
void updateOwnAvatar();
|
||||
|
||||
private:
|
||||
void refreshAvatarImage() ;
|
||||
void refreshStatus();
|
||||
void updateStatus(int status);
|
||||
void updateStatus(RsStatusValue status);
|
||||
|
||||
QString defaultAvatar;
|
||||
Ui::AvatarWidget *ui;
|
||||
|
@ -77,7 +79,9 @@ private:
|
|||
// bool isGpg : 1;
|
||||
} mFlag;
|
||||
FrameType mFrameType;
|
||||
uint32_t mPeerState;
|
||||
RsStatusValue mPeerState;
|
||||
|
||||
RsEventsHandlerId_t mEventHandlerId;
|
||||
};
|
||||
|
||||
#endif // AVATARWIDGET_H
|
||||
|
|
|
@ -458,7 +458,7 @@ QVariant RsFriendListModel::statusRole(const EntryIndex& fmpe,int /*column*/) co
|
|||
StatusInfo status;
|
||||
rsStatus->getStatus(node->node_info.id, status);
|
||||
|
||||
return QVariant(status.status);
|
||||
return QVariant((int)status.status);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
@ -603,7 +603,7 @@ QVariant RsFriendListModel::onlineRole(const EntryIndex& e, int /*col*/) const
|
|||
|
||||
for(uint32_t i=0;i<prof.child_node_indices.size();++i)
|
||||
if(mLocations[prof.child_node_indices[i]].node_info.state & RS_PEER_STATE_CONNECTED)
|
||||
return QVariant(RS_STATUS_ONLINE);
|
||||
return QVariant((int)RsStatusValue::RS_STATUS_ONLINE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ QVariant RsFriendListModel::onlineRole(const EntryIndex& e, int /*col*/) const
|
|||
{
|
||||
for(uint32_t i=0;i<prof->child_node_indices.size();++i)
|
||||
if(mLocations[prof->child_node_indices[i]].node_info.state & RS_PEER_STATE_CONNECTED)
|
||||
return QVariant(RS_STATUS_ONLINE);
|
||||
return QVariant((int)RsStatusValue::RS_STATUS_ONLINE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -626,12 +626,12 @@ QVariant RsFriendListModel::onlineRole(const EntryIndex& e, int /*col*/) const
|
|||
const HierarchicalNodeInformation *node = getNodeInfo(e);
|
||||
|
||||
if(node && bool(node->node_info.state & RS_PEER_STATE_CONNECTED))
|
||||
return QVariant(RS_STATUS_ONLINE);
|
||||
return QVariant((int)RsStatusValue::RS_STATUS_ONLINE);
|
||||
else
|
||||
return QVariant(RS_STATUS_OFFLINE);
|
||||
return QVariant((int)RsStatusValue::RS_STATUS_OFFLINE);
|
||||
}
|
||||
}
|
||||
return QVariant(RS_STATUS_OFFLINE);
|
||||
return QVariant((int)RsStatusValue::RS_STATUS_OFFLINE);
|
||||
}
|
||||
|
||||
QVariant RsFriendListModel::fontRole(const EntryIndex& e, int col) const
|
||||
|
@ -640,14 +640,14 @@ QVariant RsFriendListModel::fontRole(const EntryIndex& e, int col) const
|
|||
std::cerr << " font role " << e.type << ", (" << (int)e.group_index << ","<< (int)e.profile_index << ","<< (int)e.node_index << ") col="<< col<<": " << std::endl;
|
||||
#endif
|
||||
|
||||
int status = onlineRole(e,col).toInt();
|
||||
auto status = RsStatusValue(onlineRole(e,col).toInt());
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case RS_STATUS_AWAY:
|
||||
case RS_STATUS_BUSY:
|
||||
case RS_STATUS_ONLINE:
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
{
|
||||
QFont font ;
|
||||
QTreeView* myParent = dynamic_cast<QTreeView*>(QAbstractItemModel::parent());
|
||||
|
@ -781,7 +781,7 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const
|
|||
else
|
||||
{
|
||||
return QVariant(QString::fromUtf8(node->node_info.location.c_str())+"\n"
|
||||
+ "(" + StatusDefs::name(statusRole(e,col).toInt()) + ")");
|
||||
+ "(" + StatusDefs::name(RsStatusValue(statusRole(e,col).toInt())) + ")");
|
||||
}
|
||||
else
|
||||
return QVariant(QString::fromUtf8(node->node_info.location.c_str()));
|
||||
|
@ -900,10 +900,10 @@ bool RsFriendListModel::getPeerOnlineStatus(const EntryIndex& e) const
|
|||
return (noded && (noded->node_info.state & RS_PEER_STATE_CONNECTED));
|
||||
}
|
||||
|
||||
const RsFriendListModel::HierarchicalNodeInformation *RsFriendListModel::getBestNodeInformation(const HierarchicalProfileInformation *profileInfo, uint32_t *status) const
|
||||
const RsFriendListModel::HierarchicalNodeInformation *RsFriendListModel::getBestNodeInformation(const HierarchicalProfileInformation *profileInfo, RsStatusValue *status) const
|
||||
{
|
||||
if (status) {
|
||||
*status = RS_STATUS_OFFLINE;
|
||||
*status = RsStatusValue::RS_STATUS_OFFLINE;
|
||||
}
|
||||
|
||||
if (!profileInfo) {
|
||||
|
@ -921,28 +921,28 @@ const RsFriendListModel::HierarchicalNodeInformation *RsFriendListModel::getBest
|
|||
|
||||
int statusIndex = 0;
|
||||
switch (statusInfo.status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
statusIndex = 1;
|
||||
break;
|
||||
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
statusIndex = 2;
|
||||
break;
|
||||
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
statusIndex = 3;
|
||||
break;
|
||||
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
statusIndex = 4;
|
||||
break;
|
||||
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
statusIndex = 5;
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << "FriendListModel: Unknown status " << statusInfo.status << std::endl;
|
||||
std::cerr << "FriendListModel: Unknown status " << (int)statusInfo.status << std::endl;
|
||||
}
|
||||
|
||||
if (bestStatusIndex == 0 || statusIndex > bestStatusIndex) {
|
||||
|
@ -999,7 +999,7 @@ QVariant RsFriendListModel::decorationRole(const EntryIndex& entry,int col) cons
|
|||
QPixmap sslAvatar;
|
||||
bool foundAvatar = false;
|
||||
const HierarchicalProfileInformation *hn = getProfileInfo(entry);
|
||||
uint32_t status = RS_STATUS_OFFLINE;
|
||||
RsStatusValue status = RsStatusValue::RS_STATUS_OFFLINE;
|
||||
const HierarchicalNodeInformation *bestNodeInformation = NULL;
|
||||
|
||||
if (mDisplayStatusIcon) {
|
||||
|
@ -1049,7 +1049,7 @@ QVariant RsFriendListModel::decorationRole(const EntryIndex& entry,int col) cons
|
|||
QPixmap sslAvatar;
|
||||
AvatarDefs::getAvatarFromSslId(RsPeerId(hn->node_info.id.toStdString()), sslAvatar);
|
||||
if (mDisplayStatusIcon) {
|
||||
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(StatusDefs::imageStatus(statusRole(entry, col).toInt()));
|
||||
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(StatusDefs::imageStatus(RsStatusValue(statusRole(entry, col).toInt())));
|
||||
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ public:
|
|||
|
||||
/* Color definitions (for standard see default.qss) */
|
||||
QColor mTextColorGroup;
|
||||
QColor mTextColorStatus[RS_STATUS_COUNT];
|
||||
QColor mTextColorStatus[(int)RsStatusValue::RS_STATUS_COUNT];
|
||||
|
||||
private:
|
||||
const HierarchicalGroupInformation *getGroupInfo (const EntryIndex&) const;
|
||||
|
@ -223,7 +223,7 @@ private:
|
|||
|
||||
uint32_t updateFilterStatus(ForumModelIndex i,int column,const QStringList& strings);
|
||||
|
||||
const HierarchicalNodeInformation *getBestNodeInformation(const HierarchicalProfileInformation *profileInfo, uint32_t *status = NULL) const;
|
||||
const HierarchicalNodeInformation *getBestNodeInformation(const HierarchicalProfileInformation *profileInfo, RsStatusValue *status = NULL) const;
|
||||
|
||||
QStringList mFilterStrings;
|
||||
FilterType mFilterType;
|
||||
|
|
|
@ -255,7 +255,7 @@ static void initSslItem(QTreeWidgetItem *item, const RsPeerDetails &detail, cons
|
|||
QString name = PeerDefs::nameWithLocation(detail);
|
||||
item->setText(COLUMN_NAME, name);
|
||||
|
||||
int state = RS_STATUS_OFFLINE;
|
||||
RsStatusValue state = RsStatusValue::RS_STATUS_OFFLINE;
|
||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
||||
std::list<StatusInfo>::const_iterator it;
|
||||
for (it = statusInfo.begin(); it != statusInfo.end() ; ++it) {
|
||||
|
@ -266,7 +266,7 @@ static void initSslItem(QTreeWidgetItem *item, const RsPeerDetails &detail, cons
|
|||
}
|
||||
}
|
||||
|
||||
if (state != (int) RS_STATUS_OFFLINE) {
|
||||
if (state != RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
item->setData(COLUMN_NAME, Qt::ForegroundRole, textColorOnline);
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ static void initSslItem(QTreeWidgetItem *item, const RsPeerDetails &detail, cons
|
|||
item->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP, 0);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_NAME, name);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, state);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, (int)state);
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::fillList()
|
||||
|
@ -515,17 +515,17 @@ void FriendSelectionWidget::secured_fillList()
|
|||
sslIds.clear();
|
||||
rsPeers->getAssociatedSSLIds(*gpgIt, sslIds);
|
||||
|
||||
int state = RS_STATUS_OFFLINE;
|
||||
RsStatusValue state = RsStatusValue::RS_STATUS_OFFLINE;
|
||||
for (statusIt = statusInfo.begin(); statusIt != statusInfo.end() ; ++statusIt) {
|
||||
if (std::find(sslIds.begin(), sslIds.end(), statusIt->id) != sslIds.end()) {
|
||||
if (statusIt->status != RS_STATUS_OFFLINE) {
|
||||
state = RS_STATUS_ONLINE;
|
||||
if (statusIt->status != RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
state = RsStatusValue::RS_STATUS_ONLINE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state != (int) RS_STATUS_OFFLINE) {
|
||||
if (state != RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
gpgItem->setData(COLUMN_NAME, Qt::ForegroundRole, textColorOnline());
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ void FriendSelectionWidget::secured_fillList()
|
|||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP, 0);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_NAME, name);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_STATE, state);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_STATE, (int)state);
|
||||
|
||||
if (mListModus == MODUS_CHECK) {
|
||||
gpgItem->setCheckState(0, Qt::Unchecked);
|
||||
|
@ -791,13 +791,13 @@ void FriendSelectionWidget::groupsChanged()
|
|||
}
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status)
|
||||
void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, RsStatusValue status)
|
||||
{
|
||||
if(!isVisible())
|
||||
return ;
|
||||
|
||||
QString gpgId;
|
||||
int gpgStatus = RS_STATUS_OFFLINE;
|
||||
RsStatusValue gpgStatus = RsStatusValue::RS_STATUS_OFFLINE;
|
||||
|
||||
if (mShowTypes & (SHOW_GPG | SHOW_NON_FRIEND_GPG)) {
|
||||
/* need gpg id and online state */
|
||||
|
@ -806,7 +806,7 @@ void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status
|
|||
{
|
||||
gpgId = QString::fromStdString(detail.gpg_id.toStdString());
|
||||
|
||||
if (status == (int) RS_STATUS_OFFLINE) {
|
||||
if (status == RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
/* try other nodes */
|
||||
std::list<RsPeerId> sslIds;
|
||||
rsPeers->getAssociatedSSLIds(detail.gpg_id, sslIds);
|
||||
|
@ -817,15 +817,15 @@ void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status
|
|||
|
||||
for (statusIt = statusInfo.begin(); statusIt != statusInfo.end() ; ++statusIt) {
|
||||
if (std::find(sslIds.begin(), sslIds.end(), statusIt->id) != sslIds.end()) {
|
||||
if (statusIt->status != RS_STATUS_OFFLINE) {
|
||||
gpgStatus = RS_STATUS_ONLINE;
|
||||
if (statusIt->status != RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
gpgStatus = RsStatusValue::RS_STATUS_ONLINE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* one node is online */
|
||||
gpgStatus = RS_STATUS_ONLINE;
|
||||
gpgStatus = RsStatusValue::RS_STATUS_ONLINE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -845,7 +845,7 @@ void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status
|
|||
case IDTYPE_GPG:
|
||||
{
|
||||
if (item->data(COLUMN_DATA, ROLE_ID).toString() == gpgId) {
|
||||
if (status != (int) RS_STATUS_OFFLINE) {
|
||||
if (status != RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
item->setData(COLUMN_NAME, Qt::ForegroundRole, textColorOnline());
|
||||
} else {
|
||||
item->setData(COLUMN_NAME, Qt::ForegroundRole, QVariant());
|
||||
|
@ -853,7 +853,7 @@ void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status
|
|||
|
||||
item->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(gpgStatus)));
|
||||
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, gpgStatus);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, (int)gpgStatus);
|
||||
|
||||
bFoundGPG = true;
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status
|
|||
{
|
||||
if (RsPeerId(item->data(COLUMN_DATA, ROLE_ID).toString().toStdString()) == peerid)
|
||||
{
|
||||
if (status != (int) RS_STATUS_OFFLINE) {
|
||||
if (status != RsStatusValue::RS_STATUS_OFFLINE) {
|
||||
item->setData(COLUMN_NAME, Qt::ForegroundRole, textColorOnline());
|
||||
} else {
|
||||
item->setData(COLUMN_NAME, Qt::ForegroundRole, QVariant());
|
||||
|
@ -871,7 +871,7 @@ void FriendSelectionWidget::peerStatusChanged(const RsPeerId& peerid, int status
|
|||
|
||||
item->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(status)));
|
||||
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, status);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, (int)status);
|
||||
|
||||
bFoundSSL = true;
|
||||
}
|
||||
|
@ -1274,7 +1274,7 @@ bool FriendSelectionWidget::isSortByState()
|
|||
|
||||
void FriendSelectionWidget::filterConnected(bool filter)
|
||||
{
|
||||
ui->friendList->filterMinValItems(COLUMN_NAME, filter ? RS_STATUS_AWAY : RS_STATUS_OFFLINE, ROLE_SORT_STATE);
|
||||
ui->friendList->filterMinValItems(COLUMN_NAME, filter ? double(RsStatusValue::RS_STATUS_AWAY) : double(RsStatusValue::RS_STATUS_OFFLINE), ROLE_SORT_STATE);
|
||||
|
||||
mActionFilterConnected->setChecked(filter);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <QDialog>
|
||||
|
||||
#include "retroshare/rsevents.h"
|
||||
#include "retroshare/rsstatus.h"
|
||||
#include <gui/gxs/RsGxsUpdateBroadcastPage.h>
|
||||
#include "util/FontSizeHandler.h"
|
||||
|
||||
|
@ -137,7 +138,7 @@ public slots:
|
|||
void filterConnected(bool filter);
|
||||
|
||||
private slots:
|
||||
void peerStatusChanged(const RsPeerId &peerid, int status);
|
||||
void peerStatusChanged(const RsPeerId &peerid, RsStatusValue status);
|
||||
void filterItems(const QString &text);
|
||||
void contextMenuRequested(const QPoint &pos);
|
||||
void itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||
|
|
|
@ -132,8 +132,8 @@ public:
|
|||
if(is_group_1 ^ is_group_2) // if the two are different, put the group first.
|
||||
return is_group_1 ;
|
||||
|
||||
bool online1 = (left .data(RsFriendListModel::OnlineRole).toInt() != RS_STATUS_OFFLINE);
|
||||
bool online2 = (right.data(RsFriendListModel::OnlineRole).toInt() != RS_STATUS_OFFLINE);
|
||||
bool online1 = (left .data(RsFriendListModel::OnlineRole).toInt() != (int)RsStatusValue::RS_STATUS_OFFLINE);
|
||||
bool online2 = (right.data(RsFriendListModel::OnlineRole).toInt() != (int)RsStatusValue::RS_STATUS_OFFLINE);
|
||||
|
||||
if((online1 != online2) && m_sortByState)
|
||||
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?online1:online2 ; // always put online nodes first
|
||||
|
@ -155,7 +155,7 @@ public:
|
|||
|
||||
// Filter offline friends
|
||||
|
||||
if(!m_showOfflineNodes && (index.data(RsFriendListModel::OnlineRole).toInt() == RS_STATUS_OFFLINE))
|
||||
if(!m_showOfflineNodes && (RsStatusValue(index.data(RsFriendListModel::OnlineRole).toInt()) == RsStatusValue::RS_STATUS_OFFLINE))
|
||||
return false;
|
||||
|
||||
return index.data(RsFriendListModel::FilterRole).toString() == RsFriendListModel::FilterString ;
|
||||
|
@ -204,7 +204,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
|
|||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_gssp, RsEventType::GOSSIP_DISCOVERY );
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(QString)), this, SLOT(forceUpdateDisplay()));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(forceUpdateDisplay()));
|
||||
// connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(forceUpdateDisplay()));
|
||||
|
||||
mModel = new RsFriendListModel(ui->peerTreeWidget);
|
||||
mProxyModel = new FriendListSortFilterProxyModel(ui->peerTreeWidget->header(),this);
|
||||
|
|
|
@ -66,18 +66,18 @@ public:
|
|||
//void updateDisplay() override;
|
||||
|
||||
QColor textColorGroup() const { return mModel->mTextColorGroup; }
|
||||
QColor textColorStatusOffline() const { return mModel->mTextColorStatus[RS_STATUS_OFFLINE ]; }
|
||||
QColor textColorStatusAway() const { return mModel->mTextColorStatus[RS_STATUS_AWAY ]; }
|
||||
QColor textColorStatusBusy() const { return mModel->mTextColorStatus[RS_STATUS_BUSY ]; }
|
||||
QColor textColorStatusOnline() const { return mModel->mTextColorStatus[RS_STATUS_ONLINE ]; }
|
||||
QColor textColorStatusInactive() const { return mModel->mTextColorStatus[RS_STATUS_INACTIVE]; }
|
||||
QColor textColorStatusOffline() const { return mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_OFFLINE ]; }
|
||||
QColor textColorStatusAway() const { return mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_AWAY ]; }
|
||||
QColor textColorStatusBusy() const { return mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_BUSY ]; }
|
||||
QColor textColorStatusOnline() const { return mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_ONLINE ]; }
|
||||
QColor textColorStatusInactive() const { return mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_INACTIVE]; }
|
||||
|
||||
void setTextColorGroup(QColor color) { mModel->mTextColorGroup = color; }
|
||||
void setTextColorStatusOffline(QColor color) { mModel->mTextColorStatus[RS_STATUS_OFFLINE ] = color; }
|
||||
void setTextColorStatusAway(QColor color) { mModel->mTextColorStatus[RS_STATUS_AWAY ] = color; }
|
||||
void setTextColorStatusBusy(QColor color) { mModel->mTextColorStatus[RS_STATUS_BUSY ] = color; }
|
||||
void setTextColorStatusOnline(QColor color) { mModel->mTextColorStatus[RS_STATUS_ONLINE ] = color; }
|
||||
void setTextColorStatusInactive(QColor color) { mModel->mTextColorStatus[RS_STATUS_INACTIVE] = color; }
|
||||
void setTextColorStatusOffline(QColor color) { mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_OFFLINE ] = color; }
|
||||
void setTextColorStatusAway(QColor color) { mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_AWAY ] = color; }
|
||||
void setTextColorStatusBusy(QColor color) { mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_BUSY ] = color; }
|
||||
void setTextColorStatusOnline(QColor color) { mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_ONLINE ] = color; }
|
||||
void setTextColorStatusInactive(QColor color) { mModel->mTextColorStatus[(uint8_t)RsStatusValue::RS_STATUS_INACTIVE] = color; }
|
||||
|
||||
public slots:
|
||||
void filterItems(const QString &text);
|
||||
|
|
|
@ -24,118 +24,124 @@
|
|||
|
||||
#include "StatusDefs.h"
|
||||
|
||||
QString StatusDefs::name(unsigned int status)
|
||||
QString StatusDefs::name(RsStatusValue status)
|
||||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
return qApp->translate("StatusDefs", "Offline");
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
return qApp->translate("StatusDefs", "Away");
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
return qApp->translate("StatusDefs", "Busy");
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
return qApp->translate("StatusDefs", "Online");
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
return qApp->translate("StatusDefs", "Idle");
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::name: Unknown status requested " << status;
|
||||
RsErr() << "StatusDefs::name: Unknown status requested " << (int)status;
|
||||
return "";
|
||||
}
|
||||
|
||||
const char *StatusDefs::imageIM(unsigned int status)
|
||||
const char *StatusDefs::imageIM(RsStatusValue status)
|
||||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
return ":/images/im-user-offline.png";
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
return ":/images/im-user-away.png";
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
return ":/images/im-user-busy.png";
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
return ":/images/im-user.png";
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
return ":/images/im-user-inactive.png";
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::imageIM: Unknown status requested " << status;
|
||||
RsErr() << "StatusDefs::imageIM: Unknown status requested " << (int)status;
|
||||
return "";
|
||||
}
|
||||
|
||||
const char *StatusDefs::imageUser(unsigned int status)
|
||||
const char *StatusDefs::imageUser(RsStatusValue status)
|
||||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
return ":/images/user/identityoffline24.png";
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
return ":/images/user/identity24away.png";
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
return ":/images/user/identity24busy.png";
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
return ":/images/user/identity24.png";
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
return ":/images/user/identity24idle.png";
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::imageUser: Unknown status requested " << status;
|
||||
RsErr() << "StatusDefs::imageUser: Unknown status requested " << (int)status;
|
||||
return "";
|
||||
}
|
||||
|
||||
const char *StatusDefs::imageStatus(unsigned int status)
|
||||
const char *StatusDefs::imageStatus(RsStatusValue status)
|
||||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
return ":/icons/user-offline_64.png";
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
return ":/icons/user-away_64.png";
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
return ":/icons/user-busy_64.png";
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
return ":/icons/user-online_64.png";
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
return ":/icons/user-away-extended_64.png";
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::imageUser: Unknown status requested " << status;
|
||||
RsErr() << "StatusDefs::imageUser: Unknown status requested " << (int)status;
|
||||
return "";
|
||||
}
|
||||
|
||||
QString StatusDefs::tooltip(unsigned int status)
|
||||
QString StatusDefs::tooltip(RsStatusValue status)
|
||||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
return qApp->translate("StatusDefs", "Friend is offline");
|
||||
case RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
return qApp->translate("StatusDefs", "Friend is away");
|
||||
case RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
return qApp->translate("StatusDefs", "Friend is busy");
|
||||
case RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
return qApp->translate("StatusDefs", "Friend is online");
|
||||
case RS_STATUS_INACTIVE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
return qApp->translate("StatusDefs", "Friend is idle");
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::tooltip: Unknown status requested " << status;
|
||||
RsErr() << "StatusDefs::tooltip: Unknown status requested " << (int)status;
|
||||
return "";
|
||||
}
|
||||
|
||||
QFont StatusDefs::font(unsigned int status)
|
||||
QFont StatusDefs::font(RsStatusValue status)
|
||||
{
|
||||
QFont font;
|
||||
|
||||
switch (status) {
|
||||
case RS_STATUS_AWAY:
|
||||
case RS_STATUS_BUSY:
|
||||
case RS_STATUS_ONLINE:
|
||||
case RS_STATUS_INACTIVE:
|
||||
default:
|
||||
case RsStatusValue::RS_STATUS_AWAY:
|
||||
case RsStatusValue::RS_STATUS_BUSY:
|
||||
case RsStatusValue::RS_STATUS_ONLINE:
|
||||
case RsStatusValue::RS_STATUS_INACTIVE:
|
||||
font.setBold(true);
|
||||
return font;
|
||||
case RS_STATUS_OFFLINE:
|
||||
case RsStatusValue::RS_STATUS_OFFLINE:
|
||||
font.setBold(false);
|
||||
return font;
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::font: Unknown status requested " << status;
|
||||
RsErr() << "StatusDefs::font: Unknown status requested " << (int)status;
|
||||
return font;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,18 +24,20 @@
|
|||
#include <QColor>
|
||||
#include <QFont>
|
||||
|
||||
#include "retroshare/rsstatus.h"
|
||||
|
||||
struct RsPeerDetails;
|
||||
|
||||
class StatusDefs
|
||||
{
|
||||
public:
|
||||
static QString name(unsigned int status);
|
||||
static const char* imageIM(unsigned int status);
|
||||
static const char* imageUser(unsigned int status);
|
||||
static const char* imageStatus(unsigned int status);
|
||||
static QString tooltip(unsigned int status);
|
||||
static QString name(RsStatusValue status);
|
||||
static const char* imageIM(RsStatusValue status);
|
||||
static const char* imageUser(RsStatusValue status);
|
||||
static const char* imageStatus(RsStatusValue status);
|
||||
static QString tooltip(RsStatusValue status);
|
||||
|
||||
static QFont font(unsigned int status);
|
||||
static QFont font(RsStatusValue status);
|
||||
|
||||
static QString peerStateString(int peerState);
|
||||
static QString connectStateString(RsPeerDetails &details);
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
#include "util/misc.h"
|
||||
#include "util/DateTime.h"
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "util/QtVersion.h"
|
||||
#include "textformat.h"
|
||||
#include "TagsMenu.h"
|
||||
|
@ -214,7 +215,21 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
|
|||
connect(ui.addBccButton, SIGNAL(clicked()), this, SLOT(addBcc()));
|
||||
connect(ui.addRecommendButton, SIGNAL(clicked()), this, SLOT(addRecommend()));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(peerStatusChanged(QString,int)));
|
||||
//connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(peerStatusChanged(QString,int)));
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
RsQThreadUtils::postToObject([=](){
|
||||
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
||||
|
||||
if(!fe || fe->mEventCode != RsFriendListEventCode::NODE_STATUS_CHANGED)
|
||||
return;
|
||||
|
||||
peerStatusChanged(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
||||
|
||||
}, this );
|
||||
},mEventHandlerId,RsEventType::FRIEND_LIST);
|
||||
|
||||
connect(ui.friendSelectionWidget, SIGNAL(contentChanged()), this, SLOT(buildCompleter()));
|
||||
connect(ui.friendSelectionWidget, SIGNAL(doubleClicked(int,QString)), this, SLOT(addTo()));
|
||||
connect(ui.friendSelectionWidget, SIGNAL(itemSelectionChanged()), this, SLOT(friendSelectionChanged()));
|
||||
|
@ -420,6 +435,7 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
|
|||
|
||||
MessageComposer::~MessageComposer()
|
||||
{
|
||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||
delete(m_compareRole);
|
||||
}
|
||||
|
||||
|
@ -811,7 +827,7 @@ void MessageComposer::buildCompleter()
|
|||
setNewCompleter(ui.recipientWidget, m_completer);
|
||||
}
|
||||
|
||||
void MessageComposer::peerStatusChanged(const QString& peer_id, int status)
|
||||
void MessageComposer::peerStatusChanged(const QString& peer_id, RsStatusValue status)
|
||||
{
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
|
|
|
@ -157,7 +157,7 @@ private slots:
|
|||
void editingRecipientFinished();
|
||||
void contactDetails();
|
||||
|
||||
void peerStatusChanged(const QString& peer_id, int status);
|
||||
void peerStatusChanged(const QString& peer_id, RsStatusValue status);
|
||||
void friendSelectionChanged();
|
||||
|
||||
void tagAboutToShow();
|
||||
|
@ -274,6 +274,7 @@ private:
|
|||
Ui::MessageComposer ui;
|
||||
|
||||
std::list<FileInfo> _recList ;
|
||||
RsEventsHandlerId_t mEventHandlerId;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -333,6 +333,7 @@ void NotifyQt::notifyDiskFull(uint32_t loc,uint32_t size_in_mb)
|
|||
emit diskFull(loc,size_in_mb) ;
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
/* peer has changed the state */
|
||||
void NotifyQt::notifyPeerStatusChanged(const std::string& peer_id, uint32_t state)
|
||||
{
|
||||
|
@ -364,6 +365,7 @@ void NotifyQt::notifyPeerStatusChangedSummary()
|
|||
|
||||
emit peerStatusChangedSummary();
|
||||
}
|
||||
#endif
|
||||
|
||||
void NotifyQt::notifyOwnStatusMessageChanged()
|
||||
{
|
||||
|
|
|
@ -79,9 +79,9 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
virtual void notifyOwnStatusMessageChanged() ;
|
||||
virtual void notifyDiskFull(uint32_t loc,uint32_t size_in_mb) ;
|
||||
/* peer has changed the state */
|
||||
virtual void notifyPeerStatusChanged(const std::string& peer_id, uint32_t state);
|
||||
// virtual void notifyPeerStatusChanged(const std::string& peer_id, uint32_t state);
|
||||
/* one or more peers has changed the states */
|
||||
virtual void notifyPeerStatusChangedSummary();
|
||||
// virtual void notifyPeerStatusChangedSummary();
|
||||
|
||||
virtual void notifyHistoryChanged(uint32_t msgId, int type);
|
||||
|
||||
|
@ -122,8 +122,8 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
void ownStatusMessageChanged() const ;
|
||||
void errorOccurred(int,int,const QString&) const ;
|
||||
void diskFull(int,int) const ;
|
||||
void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
||||
void peerStatusChangedSummary() const;
|
||||
// void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
||||
// void peerStatusChangedSummary() const;
|
||||
void gxsChange(const RsGxsChanges& /* changes */);
|
||||
void chatMessageReceived(ChatMessage msg);
|
||||
// void groupsChanged(int type) const ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue