mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-17 09:34:10 -05:00
moved notifyChatStatus to rsEvents
This commit is contained in:
parent
e6bd8335dc
commit
798775e12b
11 changed files with 101 additions and 58 deletions
|
|
@ -349,22 +349,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||||
// connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateFriends()));
|
// connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateFriends()));
|
||||||
// connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateFriends()));
|
// connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateFriends()));
|
||||||
|
|
||||||
mEventHandlerId = 0;
|
|
||||||
|
|
||||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
|
|
||||||
{
|
|
||||||
RsQThreadUtils::postToObject([=]()
|
|
||||||
{
|
|
||||||
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
|
||||||
|
|
||||||
if(!fe)
|
|
||||||
return;
|
|
||||||
|
|
||||||
updateFriends();
|
|
||||||
}
|
|
||||||
, this );
|
|
||||||
}, mEventHandlerId, RsEventType::FRIEND_LIST );
|
|
||||||
|
|
||||||
loadOwnStatus();
|
loadOwnStatus();
|
||||||
|
|
||||||
/* Set focus to the current page */
|
/* Set focus to the current page */
|
||||||
|
|
@ -383,6 +367,24 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||||
|
|
||||||
mFontSizeHandler.registerFontSize(ui->listWidget, 1.5f);
|
mFontSizeHandler.registerFontSize(ui->listWidget, 1.5f);
|
||||||
|
|
||||||
|
mEventHandlerId_friends = 0;
|
||||||
|
|
||||||
|
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
|
||||||
|
{
|
||||||
|
RsQThreadUtils::postToObject([=]()
|
||||||
|
{
|
||||||
|
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
||||||
|
|
||||||
|
if(!fe)
|
||||||
|
return;
|
||||||
|
|
||||||
|
updateFriends();
|
||||||
|
}
|
||||||
|
, this );
|
||||||
|
}, mEventHandlerId_friends, RsEventType::FRIEND_LIST );
|
||||||
|
|
||||||
|
mEventHandlerId_system = 0;
|
||||||
|
|
||||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
|
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
|
||||||
{
|
{
|
||||||
RsQThreadUtils::postToObject([=](){
|
RsQThreadUtils::postToObject([=](){
|
||||||
|
|
@ -391,19 +393,22 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||||
switch(ev->mEventCode)
|
switch(ev->mEventCode)
|
||||||
{
|
{
|
||||||
case RsSystemErrorEventCode::TIME_SHIFT_PROBLEM:
|
case RsSystemErrorEventCode::TIME_SHIFT_PROBLEM:
|
||||||
std::cerr << "Time shift problem notification. Ignored." << std::endl;
|
std::cerr << "Time shift problem notification. Make sure your machine is on time, because it will break chat rooms." << std::endl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RsSystemErrorEventCode::DISK_SPACE_ERROR:
|
case RsSystemErrorEventCode::DISK_SPACE_ERROR:
|
||||||
displayDiskSpaceWarning(ev->mDiskErrorLocation,ev->mDiskErrorSizeLimit);
|
displayDiskSpaceWarning(ev->mDiskErrorLocation,ev->mDiskErrorSizeLimit);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RsSystemErrorEventCode::GENERAL_ERROR:
|
||||||
|
displayErrorMessage(0,0,QString::fromUtf8(ev->mErrorMsg.c_str()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, this );
|
}, this );
|
||||||
}, mEventHandlerId, RsEventType::SYSTEM_ERROR );
|
}, mEventHandlerId_system, RsEventType::SYSTEM_ERROR );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -415,7 +420,8 @@ MainWindow::~MainWindow()
|
||||||
Settings->setValueToGroup("MainWindow", "SplitterState", ui->splitter->saveState());
|
Settings->setValueToGroup("MainWindow", "SplitterState", ui->splitter->saveState());
|
||||||
Settings->setValueToGroup("MainWindow", "State", saveState());
|
Settings->setValueToGroup("MainWindow", "State", saveState());
|
||||||
|
|
||||||
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
rsEvents->unregisterEventsHandler(mEventHandlerId_friends);
|
||||||
|
rsEvents->unregisterEventsHandler(mEventHandlerId_system);
|
||||||
|
|
||||||
delete statusComboBox;
|
delete statusComboBox;
|
||||||
delete peerstatus;
|
delete peerstatus;
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,8 @@ private:
|
||||||
|
|
||||||
Ui::MainWindow *ui ;
|
Ui::MainWindow *ui ;
|
||||||
|
|
||||||
RsEventsHandlerId_t mEventHandlerId;
|
RsEventsHandlerId_t mEventHandlerId_friends;
|
||||||
|
RsEventsHandlerId_t mEventHandlerId_system;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "gui/elastic/elnode.h"
|
#include "gui/elastic/elnode.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* #define DEBUG_NETWORKVIEW
|
* #define DEBUG_NETWORKVIEW
|
||||||
|
|
@ -60,10 +61,30 @@ NetworkView::NetworkView(QWidget *parent)
|
||||||
connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString)));
|
connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString)));
|
||||||
|
|
||||||
_should_update = true ;
|
_should_update = true ;
|
||||||
|
|
||||||
|
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
|
||||||
|
{
|
||||||
|
RsQThreadUtils::postToObject([=](){
|
||||||
|
auto ev = dynamic_cast<const RsGossipDiscoveryEvent *>(event.get());
|
||||||
|
|
||||||
|
if(!ev) return;
|
||||||
|
|
||||||
|
switch(ev->mGossipDiscoveryEventType)
|
||||||
|
{
|
||||||
|
case RsGossipDiscoveryEventType::DISCOVERY_INFO_RECEIVED: update();
|
||||||
|
[[fallthrough]];
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}, this );
|
||||||
|
}, mEventHandlerId, RsEventType::GOSSIP_DISCOVERY );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkView::~NetworkView()
|
NetworkView::~NetworkView()
|
||||||
{
|
{
|
||||||
|
rsEvents->unregisterEventsHandler(mEventHandlerId);
|
||||||
|
|
||||||
if(mScene != NULL)
|
if(mScene != NULL)
|
||||||
delete mScene ;
|
delete mScene ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
|
|
||||||
#include <retroshare/rstypes.h>
|
#include <retroshare/rstypes.h>
|
||||||
|
#include <retroshare/rsevents.h>
|
||||||
|
|
||||||
#include <retroshare-gui/RsAutoUpdatePage.h>
|
#include <retroshare-gui/RsAutoUpdatePage.h>
|
||||||
#include "ui_NetworkView.h"
|
#include "ui_NetworkView.h"
|
||||||
|
|
@ -65,6 +66,7 @@ class NetworkView : public RsAutoUpdatePage
|
||||||
std::map<RsPgpId,GraphWidget::NodeId> _node_ids ;
|
std::map<RsPgpId,GraphWidget::NodeId> _node_ids ;
|
||||||
|
|
||||||
bool _should_update ;
|
bool _should_update ;
|
||||||
|
RsEventsHandlerId_t mEventHandlerId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
#include "gui/chat/ChatLobbyDialog.h"
|
#include "gui/chat/ChatLobbyDialog.h"
|
||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
#include "util/HandleRichText.h"
|
#include "util/HandleRichText.h"
|
||||||
#include "gui/chat/ChatUserNotify.h"//For BradCast
|
#include "gui/chat/ChatUserNotify.h"//For BradCast
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
|
|
@ -181,15 +182,25 @@ ChatWidget::ChatWidget(QWidget *parent)
|
||||||
RsQThreadUtils::postToObject([=](){
|
RsQThreadUtils::postToObject([=](){
|
||||||
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get());
|
||||||
|
|
||||||
if(!fe || fe->mEventCode != RsFriendListEventCode::NODE_STATUS_CHANGED)
|
if(!fe)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
switch(fe->mEventCode)
|
||||||
|
{
|
||||||
|
case RsFriendListEventCode::NODE_STATUS_CHANGED: updateStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RsFriendListEventCode::NODE_STATE_STRING_CHANGED: updatePeersCustomStateString(ChatId(fe->mSslId),QString::fromUtf8(fe->mStateString.c_str()));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}, this );
|
}, this );
|
||||||
},mEventHandlerId,RsEventType::FRIEND_LIST);
|
},mEventHandlerId,RsEventType::FRIEND_LIST);
|
||||||
|
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
//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(NotifyQt::getInstance(), SIGNAL(chatFontChanged()), this, SLOT(resetFonts()));
|
||||||
|
|
||||||
connect(ui->textBrowser, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
|
connect(ui->textBrowser, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
|
||||||
|
|
@ -390,7 +401,7 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title)
|
||||||
|
|
||||||
// initialize first custom state string
|
// initialize first custom state string
|
||||||
QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(chatId.toPeerId()).c_str());
|
QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(chatId.toPeerId()).c_str());
|
||||||
updatePeersCustomStateString(QString::fromStdString(chatId.toPeerId().toStdString()), customStateString);
|
updatePeersCustomStateString(chatId, customStateString);
|
||||||
} else if (chatType() == CHATTYPE_DISTANT){
|
} else if (chatType() == CHATTYPE_DISTANT){
|
||||||
hist_chat_type = RS_HISTORY_TYPE_DISTANT ;
|
hist_chat_type = RS_HISTORY_TYPE_DISTANT ;
|
||||||
messageCount = Settings->getDistantChatHistoryCount();
|
messageCount = Settings->getDistantChatHistoryCount();
|
||||||
|
|
@ -1925,7 +1936,7 @@ void ChatWidget::updateTitle()
|
||||||
ui->titleLabel->setText(RsHtml::plainText(name) + "@" + RsHtml::plainText(title));
|
ui->titleLabel->setText(RsHtml::plainText(name) + "@" + RsHtml::plainText(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QString& status_string)
|
void ChatWidget::updatePeersCustomStateString(const ChatId& id, const QString& status_string)
|
||||||
{
|
{
|
||||||
if (chatType() != CHATTYPE_PRIVATE )
|
if (chatType() != CHATTYPE_PRIVATE )
|
||||||
{
|
{
|
||||||
|
|
@ -1934,7 +1945,7 @@ void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QStr
|
||||||
|
|
||||||
QString status_text;
|
QString status_text;
|
||||||
|
|
||||||
if (RsPeerId(peer_id.toStdString()) == chatId.toPeerId()) {
|
if (id.toPeerId() == chatId.toPeerId()) {
|
||||||
// the peers status string has changed
|
// the peers status string has changed
|
||||||
if (status_string.isEmpty()) {
|
if (status_string.isEmpty()) {
|
||||||
ui->statusMessageLabel->hide();
|
ui->statusMessageLabel->hide();
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ private slots:
|
||||||
void updateLenOfChatTextEdit();
|
void updateLenOfChatTextEdit();
|
||||||
void sendChat();
|
void sendChat();
|
||||||
|
|
||||||
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
|
void updatePeersCustomStateString(const ChatId& id, const QString& status_string) ;
|
||||||
|
|
||||||
bool fileSave();
|
bool fileSave();
|
||||||
bool fileSaveAs();
|
bool fileSaveAs();
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ PopupChatDialog::PopupChatDialog(QWidget *parent, Qt::WindowFlags flags)
|
||||||
|
|
||||||
connect(ui.avatarFrameButton, SIGNAL(toggled(bool)), this, SLOT(showAvatarFrame(bool)));
|
connect(ui.avatarFrameButton, SIGNAL(toggled(bool)), this, SLOT(showAvatarFrame(bool)));
|
||||||
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
|
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(chatStatusChanged(ChatId,QString)), this, SLOT(chatStatusChanged(ChatId,QString)));
|
//connect(NotifyQt::getInstance(), SIGNAL(chatStatusChanged(ChatId,QString)), this, SLOT(chatStatusChanged(ChatId,QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::init(const ChatId &chat_id, const QString &title)
|
void PopupChatDialog::init(const ChatId &chat_id, const QString &title)
|
||||||
|
|
|
||||||
|
|
@ -855,7 +855,14 @@ void ConnectFriendWizard::accept()
|
||||||
ConnectProgressDialog::showProgress(ssl_id);
|
ConnectProgressDialog::showProgress(ssl_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
NotifyQt::getInstance()->notifyListChange(NOTIFY_LIST_NEIGHBOURS,1) ;
|
//NotifyQt::getInstance()->notifyListChange(NOTIFY_LIST_NEIGHBOURS,1) ;
|
||||||
|
|
||||||
|
auto ev = std::make_shared<RsFriendListEvent>();
|
||||||
|
ev->mEventCode = RsFriendListEventCode::NODE_ADDED;
|
||||||
|
ev->mSslId = peerDetails.id;
|
||||||
|
ev->mPgpId = peerDetails.gpg_id;
|
||||||
|
rsEvents->postEvent(ev);
|
||||||
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,11 +102,13 @@ NotifyQt::NotifyQt() : cDialog(NULL)
|
||||||
_enabled = false ;
|
_enabled = false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TO_REMOVE
|
||||||
// register to allow sending over Qt::QueuedConnection
|
// register to allow sending over Qt::QueuedConnection
|
||||||
qRegisterMetaType<ChatId>("ChatId");
|
qRegisterMetaType<ChatId>("ChatId");
|
||||||
qRegisterMetaType<ChatMessage>("ChatMessage");
|
qRegisterMetaType<ChatMessage>("ChatMessage");
|
||||||
qRegisterMetaType<RsGxsChanges>("RsGxsChanges");
|
qRegisterMetaType<RsGxsChanges>("RsGxsChanges");
|
||||||
qRegisterMetaType<RsGxsId>("RsGxsId");
|
qRegisterMetaType<RsGxsId>("RsGxsId");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TO_REMOVE
|
#ifdef TO_REMOVE
|
||||||
|
|
@ -307,6 +309,7 @@ bool NotifyQt::askForPluginConfirmation(const std::string& plugin_file_name, con
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TO_REMOVE
|
||||||
void NotifyQt::notifyDiscInfoChanged()
|
void NotifyQt::notifyDiscInfoChanged()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -322,7 +325,6 @@ void NotifyQt::notifyDiscInfoChanged()
|
||||||
emit discInfoChanged() ;
|
emit discInfoChanged() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TO_REMOVE
|
|
||||||
void NotifyQt::notifyDiskFull(uint32_t loc,uint32_t size_in_mb)
|
void NotifyQt::notifyDiskFull(uint32_t loc,uint32_t size_in_mb)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -394,7 +396,6 @@ void NotifyQt::notifyPeerHasNewAvatar(std::string peer_id)
|
||||||
#endif
|
#endif
|
||||||
emit peerHasNewAvatar(QString::fromStdString(peer_id)) ;
|
emit peerHasNewAvatar(QString::fromStdString(peer_id)) ;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string& status_string)
|
void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string& status_string)
|
||||||
{
|
{
|
||||||
|
|
@ -410,7 +411,6 @@ void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string&
|
||||||
emit peerHasNewCustomStateString(QString::fromStdString(peer_id), QString::fromUtf8(status_string.c_str())) ;
|
emit peerHasNewCustomStateString(QString::fromStdString(peer_id), QString::fromUtf8(status_string.c_str())) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TO_REMOVE
|
|
||||||
void NotifyQt::notifyChatLobbyTimeShift(int shift)
|
void NotifyQt::notifyChatLobbyTimeShift(int shift)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -453,7 +453,6 @@ void NotifyQt::notifyChatLobbyEvent(uint64_t lobby_id,uint32_t event_type,const
|
||||||
#endif
|
#endif
|
||||||
emit chatLobbyEvent(lobby_id,event_type,nickname,QString::fromUtf8(str.c_str())) ;
|
emit chatLobbyEvent(lobby_id,event_type,nickname,QString::fromUtf8(str.c_str())) ;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void NotifyQt::notifyChatStatus(const ChatId& chat_id,const std::string& status_string)
|
void NotifyQt::notifyChatStatus(const ChatId& chat_id,const std::string& status_string)
|
||||||
{
|
{
|
||||||
|
|
@ -488,7 +487,6 @@ void NotifyQt::notifyChatCleared(const ChatId& chat_id)
|
||||||
// std::cerr << "(EE) missing code to handle GXS turtle search result." << std::endl;
|
// std::cerr << "(EE) missing code to handle GXS turtle search result." << std::endl;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#ifdef TO_REMOVE
|
|
||||||
// Mai 2023: distant turtle search now uses RsEvents.
|
// Mai 2023: distant turtle search now uses RsEvents.
|
||||||
void NotifyQt::notifyTurtleSearchResult(const RsPeerId& pid,uint32_t search_id,const std::list<TurtleFileInfo>& files)
|
void NotifyQt::notifyTurtleSearchResult(const RsPeerId& pid,uint32_t search_id,const std::list<TurtleFileInfo>& files)
|
||||||
{
|
{
|
||||||
|
|
@ -528,6 +526,7 @@ void NotifyQt::notifyHistoryChanged(uint32_t msgId, int type)
|
||||||
emit historyChanged(msgId, type);
|
emit historyChanged(msgId, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TO_REMOVE
|
||||||
void NotifyQt::notifyListChange(int list, int type)
|
void NotifyQt::notifyListChange(int list, int type)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -540,7 +539,6 @@ void NotifyQt::notifyListChange(int list, int type)
|
||||||
#endif
|
#endif
|
||||||
switch(list)
|
switch(list)
|
||||||
{
|
{
|
||||||
#ifdef TO_REMOVE
|
|
||||||
case NOTIFY_LIST_NEIGHBOURS:
|
case NOTIFY_LIST_NEIGHBOURS:
|
||||||
#ifdef NOTIFY_DEBUG
|
#ifdef NOTIFY_DEBUG
|
||||||
std::cerr << "received neighbours changed" << std::endl ;
|
std::cerr << "received neighbours changed" << std::endl ;
|
||||||
|
|
@ -614,7 +612,6 @@ void NotifyQt::notifyListChange(int list, int type)
|
||||||
#endif
|
#endif
|
||||||
emit privateChatChanged(list, type);
|
emit privateChatChanged(list, type);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case NOTIFY_LIST_CHAT_LOBBY_LIST:
|
case NOTIFY_LIST_CHAT_LOBBY_LIST:
|
||||||
#ifdef NOTIFY_DEBUG
|
#ifdef NOTIFY_DEBUG
|
||||||
|
|
@ -622,21 +619,18 @@ void NotifyQt::notifyListChange(int list, int type)
|
||||||
#endif
|
#endif
|
||||||
emit lobbyListChanged();
|
emit lobbyListChanged();
|
||||||
break;
|
break;
|
||||||
#ifdef TO_REMOVE
|
|
||||||
case NOTIFY_LIST_GROUPLIST:
|
case NOTIFY_LIST_GROUPLIST:
|
||||||
#ifdef NOTIFY_DEBUG
|
#ifdef NOTIFY_DEBUG
|
||||||
std::cerr << "received groups changed" << std::endl ;
|
std::cerr << "received groups changed" << std::endl ;
|
||||||
#endif
|
#endif
|
||||||
emit groupsChanged(type);
|
emit groupsChanged(type);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TO_REMOVE
|
|
||||||
void NotifyQt::notifyListPreChange(int list, int /*type*/)
|
void NotifyQt::notifyListPreChange(int list, int /*type*/)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -1233,6 +1227,7 @@ void NotifyQt::addToaster(uint notifyFlags, const std::string& id, const std::st
|
||||||
}
|
}
|
||||||
toaster = new ToasterItem(new ChatToaster(RsPeerId(id), QString::fromUtf8(msg.c_str())));
|
toaster = new ToasterItem(new ChatToaster(RsPeerId(id), QString::fromUtf8(msg.c_str())));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case RS_POPUP_GROUPCHAT:
|
case RS_POPUP_GROUPCHAT:
|
||||||
#ifdef RS_DIRECT_CHAT
|
#ifdef RS_DIRECT_CHAT
|
||||||
if ((popupflags & RS_POPUP_GROUPCHAT) && !_disableAllToaster)
|
if ((popupflags & RS_POPUP_GROUPCHAT) && !_disableAllToaster)
|
||||||
|
|
|
||||||
|
|
@ -58,15 +58,15 @@ class NotifyQt: public QObject, public NotifyClient
|
||||||
|
|
||||||
virtual ~NotifyQt() = default;
|
virtual ~NotifyQt() = default;
|
||||||
|
|
||||||
void setNetworkDialog(NetworkDialog *c) { cDialog = c; }
|
// void setNetworkDialog(NetworkDialog *c) { cDialog = c; }
|
||||||
|
|
||||||
// virtual void notifyListPreChange(int list, int type);
|
// virtual void notifyListPreChange(int list, int type);
|
||||||
virtual void notifyListChange(int list, int type);
|
// virtual void notifyListChange(int list, int type);
|
||||||
// virtual void notifyErrorMsg(int list, int sev, std::string msg);
|
// virtual void notifyErrorMsg(int list, int sev, std::string msg);
|
||||||
// virtual void notifyChatMessage(const ChatMessage& /* msg */);
|
// virtual void notifyChatMessage(const ChatMessage& /* msg */);
|
||||||
virtual void notifyChatStatus(const ChatId &chat_id,const std::string& status_string);
|
// virtual void notifyChatStatus(const ChatId &chat_id,const std::string& status_string);
|
||||||
virtual void notifyChatCleared(const ChatId &chat_id);
|
// virtual void notifyChatCleared(const ChatId &chat_id);
|
||||||
virtual void notifyCustomState(const std::string& peer_id, const std::string& status_string);
|
// virtual void notifyCustomState(const std::string& peer_id, const std::string& status_string);
|
||||||
//#ifdef TO_REMOVE
|
//#ifdef TO_REMOVE
|
||||||
// virtual void notifyTurtleSearchResult(const RsPeerId &pid, uint32_t search_id, const std::list<TurtleFileInfo>& found_files);
|
// virtual void notifyTurtleSearchResult(const RsPeerId &pid, uint32_t search_id, const std::list<TurtleFileInfo>& found_files);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
@ -85,7 +85,7 @@ class NotifyQt: public QObject, public NotifyClient
|
||||||
|
|
||||||
virtual void notifyHistoryChanged(uint32_t msgId, int type);
|
virtual void notifyHistoryChanged(uint32_t msgId, int type);
|
||||||
|
|
||||||
virtual void notifyDiscInfoChanged() ;
|
// virtual void notifyDiscInfoChanged() ;
|
||||||
virtual bool askForPassword(const std::string& title, const std::string& key_details, bool prev_is_bad, std::string& password, bool &cancelled);
|
virtual bool askForPassword(const std::string& title, const std::string& key_details, bool prev_is_bad, std::string& password, bool &cancelled);
|
||||||
virtual bool askForPluginConfirmation(const std::string& plugin_filename, const std::string& plugin_file_hash,bool first_time);
|
virtual bool askForPluginConfirmation(const std::string& plugin_filename, const std::string& plugin_file_hash,bool first_time);
|
||||||
|
|
||||||
|
|
@ -109,25 +109,25 @@ class NotifyQt: public QObject, public NotifyClient
|
||||||
// void filesPostModChanged(bool) const ;
|
// void filesPostModChanged(bool) const ;
|
||||||
// void transfersChanged() const ;
|
// void transfersChanged() const ;
|
||||||
// void friendsChanged() const ;
|
// void friendsChanged() const ;
|
||||||
void lobbyListChanged() const ;
|
// void lobbyListChanged() const ;
|
||||||
// void chatLobbyEvent(qulonglong,int,const RsGxsId&,const QString&) ;
|
// void chatLobbyEvent(qulonglong,int,const RsGxsId&,const QString&) ;
|
||||||
// void neighboursChanged() const ;
|
// void neighboursChanged() const ;
|
||||||
void configChanged() const ;
|
void configChanged() const ;
|
||||||
void logInfoChanged(const QString&) const ;
|
void logInfoChanged(const QString&) const ;
|
||||||
void chatStatusChanged(const ChatId&,const QString&) const ;
|
// void chatStatusChanged(const ChatId&,const QString&) const ;
|
||||||
void chatCleared(const ChatId&) const ;
|
void chatCleared(const ChatId&) const ;
|
||||||
void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ;
|
// void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ;
|
||||||
// void peerHasNewAvatar(const QString& peer_id) const ;
|
// void peerHasNewAvatar(const QString& peer_id) const ;
|
||||||
// void ownAvatarChanged() const ;
|
// void ownAvatarChanged() const ;
|
||||||
// void ownStatusMessageChanged() const ;
|
// void ownStatusMessageChanged() const ;
|
||||||
void errorOccurred(int,int,const QString&) const ;
|
// void errorOccurred(int,int,const QString&) const ;
|
||||||
void diskFull(int,int) const ;
|
// void diskFull(int,int) const ;
|
||||||
// void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
// void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
||||||
// void peerStatusChangedSummary() const;
|
// void peerStatusChangedSummary() const;
|
||||||
void gxsChange(const RsGxsChanges& /* changes */);
|
// void gxsChange(const RsGxsChanges& /* changes */);
|
||||||
// void chatMessageReceived(ChatMessage msg);
|
// void chatMessageReceived(ChatMessage msg);
|
||||||
// void groupsChanged(int type) const ;
|
// void groupsChanged(int type) const ;
|
||||||
void discInfoChanged() const ;
|
// void discInfoChanged() const ;
|
||||||
void historyChanged(uint msgId, int type);
|
void historyChanged(uint msgId, int type);
|
||||||
// void chatLobbyInviteReceived() ;
|
// void chatLobbyInviteReceived() ;
|
||||||
// void deferredSignatureHandlingRequested() ;
|
// void deferredSignatureHandlingRequested() ;
|
||||||
|
|
|
||||||
|
|
@ -734,12 +734,12 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
||||||
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) ));
|
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) ));
|
||||||
// QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->friendsDialog->networkDialog ,SLOT(securedUpdateDisplay())) ;
|
// 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(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(logInfoChanged(const QString&)) ,w->friendsDialog->networkDialog,SLOT(setLogInfo(QString))) ;
|
||||||
QObject::connect(notify,SIGNAL(discInfoChanged()) ,w->friendsDialog->networkView,SLOT(update()),Qt::QueuedConnection) ;
|
// QObject::connect(notify,SIGNAL(discInfoChanged()) ,w->friendsDialog->networkView,SLOT(update()),Qt::QueuedConnection) ;
|
||||||
QObject::connect(notify,SIGNAL(errorOccurred(int,int,const QString&)),w,SLOT(displayErrorMessage(int,int,const QString&))) ;
|
// QObject::connect(notify,SIGNAL(errorOccurred(int,int,const QString&)),w,SLOT(displayErrorMessage(int,int,const QString&))) ;
|
||||||
|
|
||||||
w->installGroupChatNotifier();
|
w->installGroupChatNotifier();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue