mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-10-14 14:31:06 -04:00
moved ownAvatarChanged() and ownStatusChanged() to rsEvents
This commit is contained in:
parent
4b9d060c81
commit
9b881a6214
6 changed files with 38 additions and 17 deletions
|
@ -95,8 +95,8 @@ 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(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
|
||||
//connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int)));
|
||||
|
||||
mEventHandlerId = 0;
|
||||
|
@ -105,10 +105,17 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||
RsQThreadUtils::postToObject([=](){
|
||||
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
||||
|
||||
if(!fe || fe->mEventCode != RsFriendListEventCode::NODE_STATUS_CHANGED)
|
||||
return;
|
||||
if(!fe) return;
|
||||
|
||||
updateOwnStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
||||
switch(fe->mEventCode)
|
||||
{
|
||||
case RsFriendListEventCode::NODE_STATUS_CHANGED: updateOwnStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
||||
break;
|
||||
case RsFriendListEventCode::OWN_STATUS_CHANGED: loadmystatusmessage();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}, this );
|
||||
},mEventHandlerId,RsEventType::FRIEND_LIST);
|
||||
|
|
|
@ -49,8 +49,8 @@ AvatarWidget::AvatarWidget(QWidget *parent) : QLabel(parent), ui(new Ui::AvatarW
|
|||
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()));
|
||||
//connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||
//connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateOwnAvatar()));
|
||||
|
||||
mEventHandlerId = 0;
|
||||
|
||||
|
@ -61,7 +61,19 @@ AvatarWidget::AvatarWidget(QWidget *parent) : QLabel(parent), ui(new Ui::AvatarW
|
|||
const RsFriendListEvent *e = dynamic_cast<const RsFriendListEvent*>(event.get());
|
||||
if(!e)
|
||||
return;
|
||||
updateStatus(QString::fromStdString(e->mSslId.toStdString()),e->mStatus);
|
||||
|
||||
switch(e->mEventCode)
|
||||
{
|
||||
case RsFriendListEventCode::OWN_AVATAR_CHANGED:
|
||||
case RsFriendListEventCode::NODE_AVATAR_CHANGED: updateAvatar(QString::fromStdString(e->mSslId.toStdString()));
|
||||
break;
|
||||
case RsFriendListEventCode::OWN_STATUS_CHANGED:
|
||||
case RsFriendListEventCode::NODE_STATUS_CHANGED: updateStatus(QString::fromStdString(e->mSslId.toStdString()),e->mStatus);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}, this );
|
||||
}, mEventHandlerId, RsEventType::FRIEND_LIST );
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
|
|||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_peer, RsEventType::FRIEND_LIST );
|
||||
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(peerHasNewAvatar(QString)), this, SLOT(forceUpdateDisplay()));
|
||||
// connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(forceUpdateDisplay()));
|
||||
|
||||
mModel = new RsFriendListModel(ui->peerTreeWidget);
|
||||
|
|
|
@ -133,6 +133,7 @@ void NotifyQt::notifyChatMessage(const ChatMessage &msg)
|
|||
emit chatMessageReceived(msg);
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NotifyQt::notifyOwnAvatarChanged()
|
||||
{
|
||||
{
|
||||
|
@ -146,6 +147,7 @@ void NotifyQt::notifyOwnAvatarChanged()
|
|||
#endif
|
||||
emit ownAvatarChanged() ;
|
||||
}
|
||||
#endif
|
||||
|
||||
class SignatureEventData
|
||||
{
|
||||
|
@ -365,7 +367,6 @@ void NotifyQt::notifyPeerStatusChangedSummary()
|
|||
|
||||
emit peerStatusChangedSummary();
|
||||
}
|
||||
#endif
|
||||
|
||||
void NotifyQt::notifyOwnStatusMessageChanged()
|
||||
{
|
||||
|
@ -393,6 +394,7 @@ void NotifyQt::notifyPeerHasNewAvatar(std::string peer_id)
|
|||
#endif
|
||||
emit peerHasNewAvatar(QString::fromStdString(peer_id)) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string& status_string)
|
||||
{
|
||||
|
|
|
@ -71,12 +71,12 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
// virtual void notifyTurtleSearchResult(const RsPeerId &pid, uint32_t search_id, const std::list<TurtleFileInfo>& found_files);
|
||||
//#endif
|
||||
// virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleGxsInfo>& found_groups);
|
||||
virtual void notifyPeerHasNewAvatar(std::string peer_id) ;
|
||||
virtual void notifyOwnAvatarChanged() ;
|
||||
// virtual void notifyPeerHasNewAvatar(std::string peer_id) ;
|
||||
// virtual void notifyOwnAvatarChanged() ;
|
||||
// virtual void notifyChatLobbyEvent(uint64_t /* lobby id */, uint32_t /* event type */, const RsGxsId & /*nickname*/, const std::string& /* any string */) ;
|
||||
// virtual void notifyChatLobbyTimeShift(int time_shift) ;
|
||||
|
||||
virtual void notifyOwnStatusMessageChanged() ;
|
||||
// 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);
|
||||
|
@ -117,9 +117,9 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
void chatStatusChanged(const ChatId&,const QString&) const ;
|
||||
void chatCleared(const ChatId&) const ;
|
||||
void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ;
|
||||
void peerHasNewAvatar(const QString& peer_id) const ;
|
||||
void ownAvatarChanged() const ;
|
||||
void ownStatusMessageChanged() const ;
|
||||
// void peerHasNewAvatar(const QString& peer_id) const ;
|
||||
// void ownAvatarChanged() const ;
|
||||
// void ownStatusMessageChanged() const ;
|
||||
void errorOccurred(int,int,const QString&) const ;
|
||||
void diskFull(int,int) const ;
|
||||
// void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
||||
|
|
|
@ -734,7 +734,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
|||
// QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->friendsDialog->networkDialog ,SLOT(securedUpdateDisplay())) ;
|
||||
|
||||
QObject::connect(notify,SIGNAL(chatStatusChanged(const QString&,const QString&,bool)),w->friendsDialog,SLOT(updatePeerStatusString(const QString&,const QString&,bool)));
|
||||
QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->friendsDialog,SLOT(loadmypersonalstatus()));
|
||||
// QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->friendsDialog,SLOT(loadmypersonalstatus()));
|
||||
|
||||
// QObject::connect(notify,SIGNAL(logInfoChanged(const QString&)) ,w->friendsDialog->networkDialog,SLOT(setLogInfo(QString))) ;
|
||||
QObject::connect(notify,SIGNAL(discInfoChanged()) ,w->friendsDialog->networkView,SLOT(update()),Qt::QueuedConnection) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue