This commit removed the refresh button and edited some events for the retro share wire.

This commit is contained in:
PYRET1C 2023-05-09 23:18:34 +05:30
parent 9c950affcf
commit 726c42852c
3 changed files with 20 additions and 19 deletions

View File

@ -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<const RsEvent> event)
const RsWireEvent *e = dynamic_cast<const RsWireEvent*>(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()

View File

@ -164,6 +164,7 @@ private:
std::map<RsGxsGroupId, RsWireGroup> mAllGroups;
std::vector<RsWireGroup> mOwnGroups;
// This function and variable below it handle the events for the wire
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
RsEventsHandlerId_t mEventHandlerId;

View File

@ -100,13 +100,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_refresh">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item>
<widget class="RSComboBox" name="groupChooser"/>
</item>
@ -189,7 +182,6 @@
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -208,8 +200,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>220</width>
<height>444</height>
<width>224</width>
<height>465</height>
</rect>
</property>
<layout class="QVBoxLayout" name="groupsWidget_VL">
@ -387,8 +379,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>521</width>
<height>437</height>
<width>523</width>
<height>462</height>
</rect>
</property>
<property name="styleSheet">