mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-28 19:40:31 -05:00
using new notification system for connection attempts
This commit is contained in:
parent
d8569d813c
commit
65fa54c206
13 changed files with 127 additions and 131 deletions
|
|
@ -176,6 +176,8 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
|||
ui->filterLineEdit->setPlaceholderText(tr("Search")) ;
|
||||
ui->filterLineEdit->showFilterIcon();
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId );
|
||||
|
||||
mModel = new RsFriendListModel();
|
||||
mProxyModel = new FriendListSortFilterProxyModel(ui->peerTreeWidget->header(),this);
|
||||
|
||||
|
|
@ -236,8 +238,6 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
|||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()) , this, SLOT(forceUpdateDisplay()),Qt::QueuedConnection);
|
||||
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)) , this, SLOT(forceUpdateDisplay()),Qt::QueuedConnection);
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerConnected(const QString&)) , this, SLOT(forceUpdateDisplay()),Qt::QueuedConnection);
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerDisconnected(const QString&)), this, SLOT(forceUpdateDisplay()),Qt::QueuedConnection);
|
||||
|
||||
connect(ui->actionShowOfflineFriends, SIGNAL(triggered(bool)), this, SLOT(setShowUnconnected(bool)));
|
||||
connect(ui->actionShowState, SIGNAL(triggered(bool)), this, SLOT(setShowState(bool)) );
|
||||
|
|
@ -254,6 +254,12 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
|||
|
||||
}
|
||||
|
||||
void NewFriendList::handleEvent(std::shared_ptr<const RsEvent> e)
|
||||
{
|
||||
if(dynamic_cast<const RsConnectionEvent*>(e.get()) != nullptr)
|
||||
forceUpdateDisplay();
|
||||
}
|
||||
|
||||
NewFriendList::~NewFriendList()
|
||||
{
|
||||
delete ui;
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ private slots:
|
|||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
void handleEvent(std::shared_ptr<const RsEvent> e);
|
||||
|
||||
private:
|
||||
Ui::NewFriendList *ui;
|
||||
|
|
@ -117,6 +118,7 @@ private:
|
|||
|
||||
// Settings for peer list display
|
||||
bool mShowState;
|
||||
RsEventsHandlerId_t mEventHandlerId;
|
||||
|
||||
std::set<RsNodeGroupId> openGroups;
|
||||
std::set<RsPgpId> openPeers;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue