Support new SIG/SLOT for TabAccount

This commit is contained in:
ZeldaZach 2024-12-01 20:25:49 -05:00
parent e14b4f55ab
commit 4138e53ac4
No known key found for this signature in database

View file

@ -30,29 +30,22 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
userInfoBox = new UserInfoBox(client, true); userInfoBox = new UserInfoBox(client, true);
userInfoBox->updateInfo(userInfo); userInfoBox->updateInfo(userInfo);
connect(allUsersList, SIGNAL(openMessageDialog(const QString &, bool)), this, connect(allUsersList, &UserList::openMessageDialog, this, &TabUserLists::openMessageDialog);
SIGNAL(openMessageDialog(const QString &, bool))); connect(buddyList, &UserList::openMessageDialog, this, &TabUserLists::openMessageDialog);
connect(buddyList, SIGNAL(openMessageDialog(const QString &, bool)), this, connect(ignoreList, &UserList::openMessageDialog, this, &TabUserLists::openMessageDialog);
SIGNAL(openMessageDialog(const QString &, bool)));
connect(ignoreList, SIGNAL(openMessageDialog(const QString &, bool)), this,
SIGNAL(openMessageDialog(const QString &, bool)));
connect(client, SIGNAL(userJoinedEventReceived(const Event_UserJoined &)), this, connect(client, &AbstractClient::userJoinedEventReceived, this, &TabUserLists::processUserJoinedEvent);
SLOT(processUserJoinedEvent(const Event_UserJoined &))); connect(client, &AbstractClient::userLeftEventReceived, this, &TabUserLists::processUserLeftEvent);
connect(client, SIGNAL(userLeftEventReceived(const Event_UserLeft &)), this, connect(client, &AbstractClient::buddyListReceived, this, &TabUserLists::buddyListReceived);
SLOT(processUserLeftEvent(const Event_UserLeft &))); connect(client, &AbstractClient::ignoreListReceived, this, &TabUserLists::ignoreListReceived);
connect(client, SIGNAL(buddyListReceived(const QList<ServerInfo_User> &)), this, connect(client, &AbstractClient::addToListEventReceived, this, &TabUserLists::processAddToListEvent);
SLOT(buddyListReceived(const QList<ServerInfo_User> &))); connect(client, &AbstractClient::removeFromListEventReceived, this, &TabUserLists::processRemoveFromListEvent);
connect(client, SIGNAL(ignoreListReceived(const QList<ServerInfo_User> &)), this,
SLOT(ignoreListReceived(const QList<ServerInfo_User> &)));
connect(client, SIGNAL(addToListEventReceived(const Event_AddToList &)), this,
SLOT(processAddToListEvent(const Event_AddToList &)));
connect(client, SIGNAL(removeFromListEventReceived(const Event_RemoveFromList &)), this,
SLOT(processRemoveFromListEvent(const Event_RemoveFromList &)));
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers()); PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, connect(pend,
SLOT(processListUsersResponse(const Response &))); static_cast<void (PendingCommand::*)(const Response &, const CommandContainer &, const QVariant &)>(
&PendingCommand::finished),
this, &TabUserLists::processListUsersResponse);
client->sendCommand(pend); client->sendCommand(pend);
QVBoxLayout *vbox = new QVBoxLayout; QVBoxLayout *vbox = new QVBoxLayout;
@ -63,9 +56,9 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
addBuddyEdit = new LineEditUnfocusable; addBuddyEdit = new LineEditUnfocusable;
addBuddyEdit->setMaxLength(MAX_NAME_LENGTH); addBuddyEdit->setMaxLength(MAX_NAME_LENGTH);
addBuddyEdit->setPlaceholderText(tr("Add to Buddy List")); addBuddyEdit->setPlaceholderText(tr("Add to Buddy List"));
connect(addBuddyEdit, SIGNAL(returnPressed()), this, SLOT(addToBuddyList())); connect(addBuddyEdit, &LineEditUnfocusable::returnPressed, this, &TabUserLists::addToBuddyList);
QPushButton *addBuddyButton = new QPushButton("Add"); QPushButton *addBuddyButton = new QPushButton("Add");
connect(addBuddyButton, SIGNAL(clicked()), this, SLOT(addToBuddyList())); connect(addBuddyButton, &QPushButton::clicked, this, &TabUserLists::addToBuddyList);
addToBuddyList->addWidget(addBuddyEdit); addToBuddyList->addWidget(addBuddyEdit);
addToBuddyList->addWidget(addBuddyButton); addToBuddyList->addWidget(addBuddyButton);
@ -73,9 +66,9 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
addIgnoreEdit = new LineEditUnfocusable; addIgnoreEdit = new LineEditUnfocusable;
addIgnoreEdit->setMaxLength(MAX_NAME_LENGTH); addIgnoreEdit->setMaxLength(MAX_NAME_LENGTH);
addIgnoreEdit->setPlaceholderText(tr("Add to Ignore List")); addIgnoreEdit->setPlaceholderText(tr("Add to Ignore List"));
connect(addIgnoreEdit, SIGNAL(returnPressed()), this, SLOT(addToIgnoreList())); connect(addIgnoreEdit, &LineEditUnfocusable::returnPressed, this, &TabUserLists::addToIgnoreList);
QPushButton *addIgnoreButton = new QPushButton("Add"); QPushButton *addIgnoreButton = new QPushButton("Add");
connect(addIgnoreButton, SIGNAL(clicked()), this, SLOT(addToIgnoreList())); connect(addIgnoreButton, &QPushButton::clicked, this, &TabUserLists::addToIgnoreList);
addToIgnoreList->addWidget(addIgnoreEdit); addToIgnoreList->addWidget(addIgnoreEdit);
addToIgnoreList->addWidget(addIgnoreButton); addToIgnoreList->addWidget(addIgnoreButton);