mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-15 12:32:37 -04:00
Sort participants list in the chat lobby case insensitive.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5186 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
55b6211e7e
commit
50bc57b0fe
4 changed files with 124 additions and 4 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "gui/MainWindow.h"
|
||||
#include "gui/FriendsDialog.h"
|
||||
#include <gui/common/html.h>
|
||||
#include "gui/common/RSListWidgetItem.h"
|
||||
|
||||
#include <retroshare/rsnotify.h>
|
||||
|
||||
|
@ -47,8 +48,6 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WF
|
|||
|
||||
// Mute a Participant
|
||||
connect(ui.participantsList, SIGNAL(itemClicked(QListWidgetItem *)), SLOT(changePartipationState(QListWidgetItem *)));
|
||||
|
||||
ui.participantsList->sortItems(Qt::AscendingOrder);
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::init(const std::string &peerId, const QString &title)
|
||||
|
@ -205,12 +204,13 @@ void ChatLobbyDialog::addIncomingChatMsg(const ChatInfo& info)
|
|||
void ChatLobbyDialog::updateParticipantsList()
|
||||
{
|
||||
ui.participantsList->clear();
|
||||
ui.participantsList->setSortingEnabled(false);
|
||||
|
||||
std::list<ChatLobbyInfo> linfos;
|
||||
rsMsgs->getChatLobbyList(linfos);
|
||||
|
||||
std::list<ChatLobbyInfo>::const_iterator it(linfos.begin());
|
||||
|
||||
|
||||
// Set it to the current ChatLobby
|
||||
for (; it!=linfos.end() && (*it).lobby_id != lobbyId; ++it);
|
||||
|
||||
|
@ -219,7 +219,7 @@ void ChatLobbyDialog::updateParticipantsList()
|
|||
QString participant = QString::fromUtf8( (it2->first).c_str() );
|
||||
|
||||
// TE: Add Wigdet to participantsList with Checkbox, to mute Participant
|
||||
QListWidgetItem *widgetitem = new QListWidgetItem(ui.participantsList);
|
||||
QListWidgetItem *widgetitem = new RSListWidgetItem;
|
||||
|
||||
if (isParticipantMuted(participant)) {
|
||||
widgetitem->setCheckState(Qt::Unchecked);
|
||||
|
@ -232,6 +232,9 @@ void ChatLobbyDialog::updateParticipantsList()
|
|||
ui.participantsList->addItem(widgetitem);
|
||||
}
|
||||
}
|
||||
|
||||
ui.participantsList->setSortingEnabled(true);
|
||||
ui.participantsList->sortItems(Qt::AscendingOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue