mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 01:17:16 -05:00
added proper initializing of existing moderators
This commit is contained in:
parent
65e3684c46
commit
4c076b60aa
@ -288,9 +288,15 @@ void FriendSelectionWidget::secured_fillList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::set<RsGxsId> gxsIdsSelected;
|
std::set<RsGxsId> gxsIdsSelected;
|
||||||
|
|
||||||
if (mShowTypes & SHOW_GXS)
|
if (mShowTypes & SHOW_GXS)
|
||||||
|
{
|
||||||
selectedIds<RsGxsId,IDTYPE_GXS>(gxsIdsSelected,true);
|
selectedIds<RsGxsId,IDTYPE_GXS>(gxsIdsSelected,true);
|
||||||
|
|
||||||
|
if(!ui->friendList->topLevelItemCount()) // if not loaded yet, use the existing list.
|
||||||
|
gxsIdsSelected = mPreSelectedGxsIds;
|
||||||
|
}
|
||||||
|
|
||||||
std::set<RsGxsId> gxsIdsSelected2;
|
std::set<RsGxsId> gxsIdsSelected2;
|
||||||
if (mShowTypes & SHOW_CONTACTS)
|
if (mShowTypes & SHOW_CONTACTS)
|
||||||
selectedIds<RsGxsId,IDTYPE_GXS>(gxsIdsSelected2,true);
|
selectedIds<RsGxsId,IDTYPE_GXS>(gxsIdsSelected2,true);
|
||||||
@ -683,6 +689,11 @@ void FriendSelectionWidget::requestGXSIdList()
|
|||||||
mIdQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, IDDIALOG_IDLIST);
|
mIdQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, IDDIALOG_IDLIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<> void FriendSelectionWidget::setSelectedIds<RsGxsId,FriendSelectionWidget::IDTYPE_GXS>(const std::set<RsGxsId>& ids, bool add)
|
||||||
|
{
|
||||||
|
mPreSelectedGxsIds = ids ;
|
||||||
|
requestGXSIdList();
|
||||||
|
}
|
||||||
|
|
||||||
void FriendSelectionWidget::groupsChanged(int /*type*/)
|
void FriendSelectionWidget::groupsChanged(int /*type*/)
|
||||||
{
|
{
|
||||||
|
@ -174,6 +174,8 @@ private:
|
|||||||
std::vector<RsGxsGroupId> gxsIds ;
|
std::vector<RsGxsGroupId> gxsIds ;
|
||||||
TokenQueue *mIdQueue ;
|
TokenQueue *mIdQueue ;
|
||||||
QList<QAction*> mContextMenuActions;
|
QList<QAction*> mContextMenuActions;
|
||||||
|
|
||||||
|
std::set<RsGxsId> mPreSelectedGxsIds; // because loading of GxsIds is asynchroneous we keep selected Ids from the client in a list here and use it to initialize after loading them.
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(FriendSelectionWidget::ShowTypes)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(FriendSelectionWidget::ShowTypes)
|
||||||
|
@ -864,6 +864,11 @@ void GxsGroupDialog::getSelectedModerators(std::set<RsGxsId>& ids)
|
|||||||
ui.adminsList->selectedIds<RsGxsId,FriendSelectionWidget::IDTYPE_GXS>(ids, true);
|
ui.adminsList->selectedIds<RsGxsId,FriendSelectionWidget::IDTYPE_GXS>(ids, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsGroupDialog::setSelectedModerators(const std::set<RsGxsId>& ids)
|
||||||
|
{
|
||||||
|
ui.adminsList->setSelectedIds<RsGxsId,FriendSelectionWidget::IDTYPE_GXS>(ids, false);
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************************
|
/***********************************************************************************
|
||||||
Share Lists.
|
Share Lists.
|
||||||
***********************************************************************************/
|
***********************************************************************************/
|
||||||
|
@ -233,6 +233,7 @@ protected:
|
|||||||
* Returns the set of ids that hve been selected as moderators.
|
* Returns the set of ids that hve been selected as moderators.
|
||||||
*/
|
*/
|
||||||
void getSelectedModerators(std::set<RsGxsId>& ids);
|
void getSelectedModerators(std::set<RsGxsId>& ids);
|
||||||
|
void setSelectedModerators(const std::set<RsGxsId>& ids);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* actions to take.... */
|
/* actions to take.... */
|
||||||
|
Loading…
Reference in New Issue
Block a user