From 726c42852c29c7edda428d67b35a086656159a74 Mon Sep 17 00:00:00 2001 From: PYRET1C <88980503+PYRET1C@users.noreply.github.com> Date: Tue, 9 May 2023 23:18:34 +0530 Subject: [PATCH] This commit removed the refresh button and edited some events for the retro share wire. --- retroshare-gui/src/gui/TheWire/WireDialog.cpp | 22 +++++++++++++------ retroshare-gui/src/gui/TheWire/WireDialog.h | 1 + retroshare-gui/src/gui/TheWire/WireDialog.ui | 16 ++++---------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/retroshare-gui/src/gui/TheWire/WireDialog.cpp b/retroshare-gui/src/gui/TheWire/WireDialog.cpp index 13390e782..ea63e933e 100644 --- a/retroshare-gui/src/gui/TheWire/WireDialog.cpp +++ b/retroshare-gui/src/gui/TheWire/WireDialog.cpp @@ -67,7 +67,6 @@ WireDialog::WireDialog(QWidget *parent) connect( ui.toolButton_createAccount, SIGNAL(clicked()), this, SLOT(createGroup())); connect( ui.toolButton_createPulse, SIGNAL(clicked()), this, SLOT(createPulse())); - connect( ui.toolButton_refresh, SIGNAL(clicked()), this, SLOT(refreshGroups())); connect(ui.comboBox_groupSet, SIGNAL(currentIndexChanged(int)), this, SLOT(selectGroupSet(int))); connect(ui.comboBox_filterTime, SIGNAL(currentIndexChanged(int)), this, SLOT(selectFilterTime(int))); @@ -104,29 +103,38 @@ void WireDialog::handleEvent_main_thread(std::shared_ptr event) const RsWireEvent *e = dynamic_cast(event.get()); if(e) + { + +#ifdef GXSWIRE_DEBUG + RsDbg() << " Refreshing the feed if there is a matching event. "<< std::endl; +#endif + + // The following switch statements refresh the wire feed whenever there is a new event switch(e->mWireEventCode) { - case RsWireEventCode::NEW_POST: // [[fallthrough]]; + case RsWireEventCode::NEW_POST: refreshGroups(); break; - case RsWireEventCode::NEW_REPLY: // [[fallthrough]]; + case RsWireEventCode::NEW_REPLY: refreshGroups(); break; - case RsWireEventCode::NEW_LIKE: // [[fallthrough]]; + case RsWireEventCode::NEW_LIKE: refreshGroups(); break; - case RsWireEventCode::NEW_REPUBLISH: // [[fallthrough]]; + case RsWireEventCode::NEW_REPUBLISH: refreshGroups(); break; - case RsWireEventCode::NEW_WIRE: // [[fallthrough]]; + case RsWireEventCode::POST_UPDATED: refreshGroups(); break; - case RsWireEventCode::FOLLOW_STATUS_CHANGED: // [[fallthrough]]; + case RsWireEventCode::FOLLOW_STATUS_CHANGED: refreshGroups(); break; default: break; + } + } } WireDialog::~WireDialog() diff --git a/retroshare-gui/src/gui/TheWire/WireDialog.h b/retroshare-gui/src/gui/TheWire/WireDialog.h index 1ac7faebc..a55369fc0 100644 --- a/retroshare-gui/src/gui/TheWire/WireDialog.h +++ b/retroshare-gui/src/gui/TheWire/WireDialog.h @@ -164,6 +164,7 @@ private: std::map mAllGroups; std::vector mOwnGroups; + // This function and variable below it handle the events for the wire void handleEvent_main_thread(std::shared_ptr event); RsEventsHandlerId_t mEventHandlerId; diff --git a/retroshare-gui/src/gui/TheWire/WireDialog.ui b/retroshare-gui/src/gui/TheWire/WireDialog.ui index 23eb87a78..b794a96e0 100644 --- a/retroshare-gui/src/gui/TheWire/WireDialog.ui +++ b/retroshare-gui/src/gui/TheWire/WireDialog.ui @@ -100,13 +100,6 @@ - - - - Refresh - - - @@ -189,7 +182,6 @@ 10 - 75 true @@ -208,8 +200,8 @@ 0 0 - 220 - 444 + 224 + 465 @@ -387,8 +379,8 @@ 0 0 - 521 - 437 + 523 + 462