mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 07:59:29 -05:00
moved UserNotify to MainPage level, and added RsEvent handling code in Posted
This commit is contained in:
parent
9c65836503
commit
fb9282f588
@ -122,6 +122,10 @@ enum class RsChannelEventCode: uint8_t
|
|||||||
|
|
||||||
/// subscription for channel mChannelGroupId changed.
|
/// subscription for channel mChannelGroupId changed.
|
||||||
SUBSCRIBE_STATUS_CHANGED = 0x06,
|
SUBSCRIBE_STATUS_CHANGED = 0x06,
|
||||||
|
|
||||||
|
/// existing message has been read or set to unread
|
||||||
|
READ_STATUS_CHANGED = 0x07,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RsGxsChannelEvent: RsEvent
|
struct RsGxsChannelEvent: RsEvent
|
||||||
|
@ -72,7 +72,10 @@ enum class RsPostedEventCode: uint8_t
|
|||||||
{
|
{
|
||||||
UNKNOWN = 0x00,
|
UNKNOWN = 0x00,
|
||||||
NEW_POSTED_GROUP = 0x01,
|
NEW_POSTED_GROUP = 0x01,
|
||||||
NEW_MESSAGE = 0x02
|
NEW_MESSAGE = 0x02,
|
||||||
|
SUBSCRIBE_STATUS_CHANGED = 0x03,
|
||||||
|
UPDATED_POSTED_GROUP = 0x04,
|
||||||
|
UPDATED_MESSAGE = 0x05,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -369,8 +369,8 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
if(!unprocessedGroups.empty())
|
if(!unprocessedGroups.empty())
|
||||||
request_SpecificSubscribedGroups(unprocessedGroups);
|
request_SpecificSubscribedGroups(unprocessedGroups);
|
||||||
|
|
||||||
// the call below deletes changes and its content.
|
// // the call below deletes changes and its content.
|
||||||
RsGxsIfaceHelper::receiveChanges(changes);
|
// RsGxsIfaceHelper::receiveChanges(changes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void p3GxsChannels::service_tick()
|
void p3GxsChannels::service_tick()
|
||||||
@ -1764,8 +1764,17 @@ void p3GxsChannels::setMessageReadStatus( uint32_t& token,
|
|||||||
if (read) status = 0;
|
if (read) status = 0;
|
||||||
|
|
||||||
setMsgStatusFlags(token, msgId, status, mask);
|
setMsgStatusFlags(token, msgId, status, mask);
|
||||||
}
|
|
||||||
|
|
||||||
|
if (rsEvents)
|
||||||
|
{
|
||||||
|
auto ev = std::make_shared<RsGxsChannelEvent>();
|
||||||
|
|
||||||
|
ev->mChannelMsgId = msgId.second;
|
||||||
|
ev->mChannelGroupId = msgId.first;
|
||||||
|
ev->mChannelEventCode = RsChannelEventCode::READ_STATUS_CHANGED;
|
||||||
|
rsEvents->postEvent(ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
|
@ -91,8 +91,8 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
|
|
||||||
for(it = changes.begin(); it != changes.end(); ++it)
|
for(it = changes.begin(); it != changes.end(); ++it)
|
||||||
{
|
{
|
||||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
|
||||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||||
|
|
||||||
if (msgChange)
|
if (msgChange)
|
||||||
{
|
{
|
||||||
#ifdef POSTBASE_DEBUG
|
#ifdef POSTBASE_DEBUG
|
||||||
@ -124,30 +124,53 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsGxsGroupChange *grpChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
||||||
|
|
||||||
/* pass on Group Changes to GUI */
|
/* pass on Group Changes to GUI */
|
||||||
if (groupChange)
|
if (grpChange && rsEvents)
|
||||||
{
|
{
|
||||||
#ifdef POSTBASE_DEBUG
|
#ifdef POSTBASE_DEBUG
|
||||||
std::cerr << "p3PostBase::notifyChanges() Found Group Change Notification";
|
std::cerr << "p3PostBase::notifyChanges() Found Group Change Notification";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
|
switch(grpChange->getType())
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case RsGxsNotify::TYPE_PROCESSED: // happens when the group is subscribed
|
||||||
|
{
|
||||||
|
std::list<RsGxsGroupId> &grpList = grpChange->mGrpIdList;
|
||||||
|
std::list<RsGxsGroupId>::iterator git;
|
||||||
|
for (git = grpList.begin(); git != grpList.end(); ++git)
|
||||||
|
{
|
||||||
|
auto ev = std::make_shared<RsGxsPostedEvent>();
|
||||||
|
ev->mPostedGroupId = *git;
|
||||||
|
ev->mPostedEventCode = RsPostedEventCode::SUBSCRIBE_STATUS_CHANGED;
|
||||||
|
rsEvents->postEvent(ev);
|
||||||
|
}
|
||||||
|
|
||||||
for(auto git = groupList.begin(); git != groupList.end(); ++git)
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RsGxsNotify::TYPE_PUBLISHED:
|
||||||
|
case RsGxsNotify::TYPE_RECEIVED_NEW:
|
||||||
|
{
|
||||||
|
/* group received */
|
||||||
|
const std::list<RsGxsGroupId>& grpList = grpChange->mGrpIdList;
|
||||||
|
|
||||||
|
for (auto git = grpList.begin(); git != grpList.end(); ++git)
|
||||||
{
|
{
|
||||||
#ifdef POSTBASE_DEBUG
|
#ifdef POSTBASE_DEBUG
|
||||||
std::cerr << "p3PostBase::notifyChanges() Incoming Group: " << *git;
|
std::cerr << "p3PostBase::notifyChanges() Incoming Group: " << *git;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rsEvents && groupChange->getType() == RsGxsNotify::TYPE_RECEIVED_NEW)
|
|
||||||
{
|
|
||||||
auto ev = std::make_shared<RsGxsPostedEvent>();
|
auto ev = std::make_shared<RsGxsPostedEvent>();
|
||||||
ev->mPostedGroupId = *git;
|
ev->mPostedGroupId = *git;
|
||||||
ev->mPostedEventCode = RsPostedEventCode::NEW_POSTED_GROUP;
|
ev->mPostedEventCode = RsPostedEventCode::NEW_POSTED_GROUP;
|
||||||
rsEvents->postEvent(ev);
|
rsEvents->postEvent(ev);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ FeedReaderDialog::~FeedReaderDialog()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *FeedReaderDialog::getUserNotify(QObject *parent)
|
UserNotify *FeedReaderDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new FeedReaderUserNotify(this, mFeedReader, mNotify, parent);
|
return new FeedReaderUserNotify(this, mFeedReader, mNotify, parent);
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,10 @@ public:
|
|||||||
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
||||||
~FeedReaderDialog();
|
~FeedReaderDialog();
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
|
||||||
|
|
||||||
static QIcon iconFromFeed(const FeedInfo &feedInfo);
|
static QIcon iconFromFeed(const FeedInfo &feedInfo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
virtual void showEvent(QShowEvent *event);
|
virtual void showEvent(QShowEvent *event);
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
|
||||||
|
@ -226,12 +226,11 @@ ChatLobbyWidget::~ChatLobbyWidget()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *ChatLobbyWidget::getUserNotify(QObject *parent)
|
UserNotify *ChatLobbyWidget::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
if (!myChatLobbyUserNotify){
|
|
||||||
myChatLobbyUserNotify = new ChatLobbyUserNotify(parent);
|
myChatLobbyUserNotify = new ChatLobbyUserNotify(parent);
|
||||||
connect(myChatLobbyUserNotify, SIGNAL(countChanged(ChatLobbyId, unsigned int)), this, SLOT(updateNotify(ChatLobbyId, unsigned int)));
|
connect(myChatLobbyUserNotify, SIGNAL(countChanged(ChatLobbyId, unsigned int)), this, SLOT(updateNotify(ChatLobbyId, unsigned int)));
|
||||||
}
|
|
||||||
return myChatLobbyUserNotify;
|
return myChatLobbyUserNotify;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Chats") ; } //MainPage
|
virtual QString pageName() const { return tr("Chats") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent); //MainPage
|
virtual UserNotify *createUserNotify(QObject *parent) override; //MainPage
|
||||||
|
|
||||||
virtual void updateDisplay();
|
virtual void updateDisplay();
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ private:
|
|||||||
QAction* showTopicAct;
|
QAction* showTopicAct;
|
||||||
int getNumColVisible();
|
int getNumColVisible();
|
||||||
|
|
||||||
ChatLobbyUserNotify* myChatLobbyUserNotify;
|
ChatLobbyUserNotify* myChatLobbyUserNotify; // local copy that avoids dynamic casts
|
||||||
|
|
||||||
QAbstractButton* myInviteYesButton;
|
QAbstractButton* myInviteYesButton;
|
||||||
GxsIdChooser* myInviteIdChooser;
|
GxsIdChooser* myInviteIdChooser;
|
||||||
|
@ -1114,7 +1114,7 @@ void TransfersDialog::activatePage(TransfersDialog::Page page)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *TransfersDialog::getUserNotify(QObject *parent)
|
UserNotify *TransfersDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new TransferUserNotify(parent);
|
return new TransferUserNotify(parent);
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Files") ; } //MainPage
|
virtual QString pageName() const { return tr("Files") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
|
|
||||||
void activatePage(TransfersDialog::Page page) ;
|
void activatePage(TransfersDialog::Page page) ;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ void FriendsDialog::activatePage(FriendsDialog::Page page)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *FriendsDialog::getUserNotify(QObject *parent)
|
UserNotify *FriendsDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new ChatUserNotify(parent);
|
return new ChatUserNotify(parent);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Network") ; } //MainPage
|
virtual QString pageName() const { return tr("Network") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
|
|
||||||
static bool isGroupChatActive();
|
static bool isGroupChatActive();
|
||||||
static void groupChatActivate();
|
static void groupChatActivate();
|
||||||
|
@ -31,6 +31,15 @@ MainPage::MainPage(QWidget *parent , Qt::WindowFlags flags ) : QWidget(parent, f
|
|||||||
mIcon = QIcon();
|
mIcon = QIcon();
|
||||||
mName = "";
|
mName = "";
|
||||||
mHelp = "";
|
mHelp = "";
|
||||||
|
mUserNotify = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserNotify *MainPage::getUserNotify()
|
||||||
|
{
|
||||||
|
if(!mUserNotify)
|
||||||
|
mUserNotify = createUserNotify(this);
|
||||||
|
|
||||||
|
return mUserNotify;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainPage::registerHelpButton(QToolButton *button, const QString& help_html_text, const QString &code_name)
|
void MainPage::registerHelpButton(QToolButton *button, const QString& help_html_text, const QString &code_name)
|
||||||
|
@ -469,7 +469,7 @@ void MainWindow::initStackedPage()
|
|||||||
//List All notify before Setting was created
|
//List All notify before Setting was created
|
||||||
QList<QPair<MainPage*, QPair<QAction*, QListWidgetItem*> > >::iterator notifyIt;
|
QList<QPair<MainPage*, QPair<QAction*, QListWidgetItem*> > >::iterator notifyIt;
|
||||||
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
|
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
|
||||||
UserNotify *userNotify = notifyIt->first->getUserNotify(this);
|
UserNotify *userNotify = notifyIt->first->getUserNotify();
|
||||||
if (userNotify) {
|
if (userNotify) {
|
||||||
userNotify->initialize(ui->toolBarPage, notifyIt->second.first, notifyIt->second.second);
|
userNotify->initialize(ui->toolBarPage, notifyIt->second.first, notifyIt->second.second);
|
||||||
connect(userNotify, SIGNAL(countChanged()), this, SLOT(updateTrayCombine()));
|
connect(userNotify, SIGNAL(countChanged()), this, SLOT(updateTrayCombine()));
|
||||||
|
@ -141,7 +141,7 @@ NewsFeed::~NewsFeed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *NewsFeed::getUserNotify(QObject *parent)
|
UserNotify *NewsFeed::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new NewsFeedUserNotify(this, parent);
|
return new NewsFeedUserNotify(this, parent);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Log") ; } //MainPage
|
virtual QString pageName() const { return tr("Log") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
|
|
||||||
/* FeedHolder Functions (for FeedItem functionality) */
|
/* FeedHolder Functions (for FeedItem functionality) */
|
||||||
virtual QScrollArea *getScrollArea();
|
virtual QScrollArea *getScrollArea();
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "gui/gxs/GxsGroupShareKey.h"
|
#include "gui/gxs/GxsGroupShareKey.h"
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/common/GroupTreeWidget.h"
|
#include "gui/common/GroupTreeWidget.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
|
|
||||||
#include <retroshare/rsposted.h>
|
#include <retroshare/rsposted.h>
|
||||||
|
|
||||||
@ -43,13 +44,41 @@ public:
|
|||||||
PostedDialog::PostedDialog(QWidget *parent)
|
PostedDialog::PostedDialog(QWidget *parent)
|
||||||
: GxsGroupFrameDialog(rsPosted, parent)
|
: GxsGroupFrameDialog(rsPosted, parent)
|
||||||
{
|
{
|
||||||
|
mEventHandlerId = 0;
|
||||||
|
// Needs to be asynced because this function is likely to be called by another thread!
|
||||||
|
|
||||||
|
rsEvents->registerEventsHandler(RsEventType::GXS_POSTED, [this](std::shared_ptr<const RsEvent> event) { RsQThreadUtils::postToObject( [=]() { handleEvent_main_thread(event); }, this ); }, mEventHandlerId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PostedDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
|
||||||
|
{
|
||||||
|
if(event->mType == RsEventType::GXS_POSTED)
|
||||||
|
{
|
||||||
|
const RsGxsPostedEvent *e = dynamic_cast<const RsGxsPostedEvent*>(event.get());
|
||||||
|
if(!e) return;
|
||||||
|
|
||||||
|
switch(e->mPostedEventCode)
|
||||||
|
{
|
||||||
|
case RsPostedEventCode::NEW_MESSAGE:
|
||||||
|
case RsPostedEventCode::NEW_POSTED_GROUP: // [[fallthrough]];
|
||||||
|
case RsPostedEventCode::UPDATED_MESSAGE: // [[fallthrough]];
|
||||||
|
updateDisplay(false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RsPostedEventCode::SUBSCRIBE_STATUS_CHANGED: // [[fallthrough]];
|
||||||
|
updateDisplay(true);
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PostedDialog::~PostedDialog()
|
PostedDialog::~PostedDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *PostedDialog::getUserNotify(QObject *parent)
|
UserNotify *PostedDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new PostedUserNotify(rsPosted, parent);
|
return new PostedUserNotify(rsPosted, parent);
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,8 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Links") ; } //MainPage
|
virtual QString pageName() const { return tr("Links") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
virtual QString getHelpString() const ;
|
virtual QString getHelpString() const ;
|
||||||
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_POSTED; }
|
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_POSTED; }
|
||||||
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Posted; }
|
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Posted; }
|
||||||
@ -61,6 +60,9 @@ private:
|
|||||||
virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId);
|
virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId);
|
||||||
virtual uint32_t requestGroupSummaryType() { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data
|
virtual uint32_t requestGroupSummaryType() { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data
|
||||||
virtual void loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata* &userdata);
|
virtual void loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata* &userdata);
|
||||||
|
|
||||||
|
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
|
||||||
|
RsEventsHandlerId_t mEventHandlerId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "PostedListWidget.h"
|
#include "PostedListWidget.h"
|
||||||
#include "ui_PostedListWidget.h"
|
#include "ui_PostedListWidget.h"
|
||||||
|
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
#include "PostedCreatePostDialog.h"
|
#include "PostedCreatePostDialog.h"
|
||||||
#include "PostedItem.h"
|
#include "PostedItem.h"
|
||||||
@ -94,7 +95,6 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent
|
|||||||
/* Initialize GUI */
|
/* Initialize GUI */
|
||||||
setGroupId(postedId);
|
setGroupId(postedId);
|
||||||
}
|
}
|
||||||
|
|
||||||
PostedListWidget::~PostedListWidget()
|
PostedListWidget::~PostedListWidget()
|
||||||
{
|
{
|
||||||
// save settings
|
// save settings
|
||||||
|
@ -1173,6 +1173,8 @@ void GxsGroupFrameDialog::loadGroupStatistics(const uint32_t &token)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui->groupTreeWidget->setUnreadCount(item, mCountChildMsgs ? (stats.mNumThreadMsgsUnread + stats.mNumChildMsgsUnread) : stats.mNumThreadMsgsUnread);
|
ui->groupTreeWidget->setUnreadCount(item, mCountChildMsgs ? (stats.mNumThreadMsgsUnread + stats.mNumChildMsgsUnread) : stats.mNumThreadMsgsUnread);
|
||||||
|
|
||||||
|
getUserNotify()->updateIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************** **** **** **** ***********************/
|
/*********************** **** **** **** ***********************/
|
||||||
|
@ -96,6 +96,8 @@ protected:
|
|||||||
virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata);
|
virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata);
|
||||||
virtual void checkRequestGroup(const RsGxsGroupId& /* grpId */) {} // overload this one in order to retrieve full group data when the group is browsed
|
virtual void checkRequestGroup(const RsGxsGroupId& /* grpId */) {} // overload this one in order to retrieve full group data when the group is browsed
|
||||||
|
|
||||||
|
void updateMessageSummaryList(RsGxsGroupId groupId);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void todo();
|
void todo();
|
||||||
|
|
||||||
@ -153,7 +155,6 @@ private:
|
|||||||
|
|
||||||
void initUi();
|
void initUi();
|
||||||
|
|
||||||
void updateMessageSummaryList(RsGxsGroupId groupId);
|
|
||||||
void updateSearchResults();
|
void updateSearchResults();
|
||||||
|
|
||||||
void openGroupInNewTab(const RsGxsGroupId &groupId);
|
void openGroupInNewTab(const RsGxsGroupId &groupId);
|
||||||
|
@ -64,7 +64,11 @@ void GxsChannelDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> ev
|
|||||||
|
|
||||||
switch(e->mChannelEventCode)
|
switch(e->mChannelEventCode)
|
||||||
{
|
{
|
||||||
case RsChannelEventCode::SUBSCRIBE_STATUS_CHANGED: updateDisplay(true);
|
case RsChannelEventCode::READ_STATUS_CHANGED:
|
||||||
|
updateMessageSummaryList(e->mChannelGroupId);
|
||||||
|
break;
|
||||||
|
case RsChannelEventCode::SUBSCRIBE_STATUS_CHANGED:
|
||||||
|
updateDisplay(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -92,7 +96,7 @@ QString GxsChannelDialog::getHelpString() const
|
|||||||
return hlp_str ;
|
return hlp_str ;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *GxsChannelDialog::getUserNotify(QObject *parent)
|
UserNotify *GxsChannelDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new GxsChannelUserNotify(rsGxsChannels, parent);
|
return new GxsChannelUserNotify(rsGxsChannels, parent);
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,6 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Channels") ; } //MainPage
|
virtual QString pageName() const { return tr("Channels") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
|
||||||
|
|
||||||
void shareOnChannel(const RsGxsGroupId& channel_id, const QList<RetroShareLink>& file_link) ;
|
void shareOnChannel(const RsGxsGroupId& channel_id, const QList<RetroShareLink>& file_link) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -54,6 +52,7 @@ protected:
|
|||||||
virtual TurtleRequestId distantSearch(const QString& search_string) ;
|
virtual TurtleRequestId distantSearch(const QString& search_string) ;
|
||||||
virtual void checkRequestGroup(const RsGxsGroupId& grpId) ;
|
virtual void checkRequestGroup(const RsGxsGroupId& grpId) ;
|
||||||
|
|
||||||
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
private slots:
|
private slots:
|
||||||
void toggleAutoDownload();
|
void toggleAutoDownload();
|
||||||
void setDefaultDirectory();
|
void setDefaultDirectory();
|
||||||
|
@ -102,7 +102,7 @@ void GxsForumsDialog::shareInMessage(const RsGxsGroupId& forum_id,const QList<Re
|
|||||||
msgDialog->show();
|
msgDialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *GxsForumsDialog::getUserNotify(QObject *parent)
|
UserNotify *GxsForumsDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new GxsForumUserNotify(rsGxsForums, parent);
|
return new GxsForumUserNotify(rsGxsForums, parent);
|
||||||
}
|
}
|
||||||
|
@ -37,11 +37,11 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Forums") ; } //MainPage
|
virtual QString pageName() const { return tr("Forums") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
|
||||||
|
|
||||||
void shareInMessage(const RsGxsGroupId& forum_id, const QList<RetroShareLink>& file_link) ;
|
void shareInMessage(const RsGxsGroupId& forum_id, const QList<RetroShareLink>& file_link) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
|
|
||||||
virtual QString getHelpString() const ;
|
virtual QString getHelpString() const ;
|
||||||
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; }
|
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; }
|
||||||
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Forum; }
|
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Forum; }
|
||||||
|
@ -325,7 +325,7 @@ MessagesDialog::~MessagesDialog()
|
|||||||
processSettings(false);
|
processSettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
UserNotify *MessagesDialog::getUserNotify(QObject *parent)
|
UserNotify *MessagesDialog::createUserNotify(QObject *parent)
|
||||||
{
|
{
|
||||||
return new MessageUserNotify(parent);
|
return new MessageUserNotify(parent);
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,6 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Mail") ; } //MainPage
|
virtual QString pageName() const { return tr("Mail") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //MainPage
|
virtual QString helpText() const { return ""; } //MainPage
|
||||||
|
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
|
||||||
|
|
||||||
// replaced by shortcut
|
// replaced by shortcut
|
||||||
// virtual void keyPressEvent(QKeyEvent *) ;
|
// virtual void keyPressEvent(QKeyEvent *) ;
|
||||||
|
|
||||||
@ -64,6 +62,7 @@ signals:
|
|||||||
void messagesLoaded();
|
void messagesLoaded();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
int getSelectedMessages(QList<QString>& mid);
|
int getSelectedMessages(QList<QString>& mid);
|
||||||
|
|
||||||
|
@ -55,14 +55,19 @@ public:
|
|||||||
void setHelpText(QString help) { mHelp = help; }
|
void setHelpText(QString help) { mHelp = help; }
|
||||||
|
|
||||||
virtual void retranslateUi() {}
|
virtual void retranslateUi() {}
|
||||||
virtual UserNotify *getUserNotify(QObject */*parent*/) { return NULL; }
|
|
||||||
|
// Override this if needed.
|
||||||
|
virtual UserNotify *createUserNotify(QObject */*parent*/) { return NULL; }
|
||||||
|
|
||||||
// Call this to add some help info to the page. The way the info is
|
// Call this to add some help info to the page. The way the info is
|
||||||
// shown is handled by showHelp() below;
|
// shown is handled by showHelp() below;
|
||||||
//
|
//
|
||||||
void registerHelpButton(QToolButton *button, const QString& help_html_text, const QString &code_name) ;
|
void registerHelpButton(QToolButton *button, const QString& help_html_text, const QString &code_name) ;
|
||||||
|
|
||||||
|
UserNotify *getUserNotify() ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void showEvent(QShowEvent *);
|
virtual void showEvent(QShowEvent *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -71,6 +76,8 @@ private:
|
|||||||
QString mName;
|
QString mName;
|
||||||
QString mHelp;
|
QString mHelp;
|
||||||
QString mHelpCodeName;
|
QString mHelpCodeName;
|
||||||
|
|
||||||
|
UserNotify *mUserNotify;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user