mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 18:06:26 -07:00
* [Client] Send game invites from the user context menu via a private message The user context menu gains an "Invite to Game" submenu listing the inviteable games in the room (the inviter's own games, honoring the buddy-only setting). Picking one opens a private message to the target user with a cockatrice://joingame link naming the game, so the target gets a clickable invite instead of a raw URL. Multi-game rooms offer a picker; a single inviteable game sends directly. Sending a message to an offline user no longer swallows the draft — it reports that the user is offline and keeps the typed text. Took 1 minute * [Client] Add invite-to-game dialog to the game window Took 15 seconds * [Client] Open the invite dialog taller by default without enforcing a minimum size * Move button to bottom Took 3 minutes * Address comments. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
46 lines
1,007 B
C++
46 lines
1,007 B
C++
/**
|
|
* @file dlg_invite_to_game.h
|
|
* @ingroup RoomDialogs
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef DLG_INVITE_TO_GAME_H
|
|
#define DLG_INVITE_TO_GAME_H
|
|
|
|
#include <QDialog>
|
|
#include <QStringList>
|
|
|
|
class QLineEdit;
|
|
class QPushButton;
|
|
class TabSupervisor;
|
|
class UserListWidget;
|
|
|
|
class DlgInviteToGame : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
DlgInviteToGame(TabSupervisor *_tabSupervisor,
|
|
const QString &_inviteUrl,
|
|
bool _onlyBuddies,
|
|
const QStringList &_excludeUserNames,
|
|
QWidget *parent = nullptr);
|
|
|
|
private slots:
|
|
void searchTextChanged(const QString &text);
|
|
void inviteCurrentUser(const QString &userName);
|
|
|
|
private:
|
|
TabSupervisor *tabSupervisor;
|
|
QString inviteUrl;
|
|
bool onlyBuddies;
|
|
QStringList excludeUserNames;
|
|
QString currentUserName;
|
|
QLineEdit *searchEdit;
|
|
UserListWidget *userList;
|
|
QPushButton *inviteButton;
|
|
QPushButton *cancelButton;
|
|
|
|
void retranslateUi();
|
|
};
|
|
|
|
#endif
|