mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-16 14:20:03 +00:00
386bf5c861
Displayed username along with nickname (when they are not identical); Requested and displayed user's avatar; Made the dialog bigger for extended names. Added a few functions to web_backend (GetImage, GetPlain) to support getting data in multiple content-types. Added a no_avatar icon for users without avatars.
70 lines
1.6 KiB
C++
70 lines
1.6 KiB
C++
// Copyright 2017 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <QDialog>
|
|
#include <QSortFilterProxyModel>
|
|
#include <QStandardItemModel>
|
|
#include <QVariant>
|
|
#include "citra_qt/multiplayer/chat_room.h"
|
|
#include "citra_qt/multiplayer/validation.h"
|
|
#include "network/network.h"
|
|
|
|
namespace Ui {
|
|
class HostRoom;
|
|
}
|
|
|
|
namespace Core {
|
|
class AnnounceMultiplayerSession;
|
|
}
|
|
|
|
class ConnectionError;
|
|
class ComboBoxProxyModel;
|
|
|
|
class ChatMessage;
|
|
|
|
namespace Network::VerifyUser {
|
|
class Backend;
|
|
};
|
|
|
|
class HostRoomWindow : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
|
std::shared_ptr<Core::AnnounceMultiplayerSession> session);
|
|
~HostRoomWindow();
|
|
|
|
void RetranslateUi();
|
|
|
|
private:
|
|
void Host();
|
|
std::unique_ptr<Network::VerifyUser::Backend> CreateVerifyBackend(bool use_validation) const;
|
|
|
|
std::weak_ptr<Core::AnnounceMultiplayerSession> announce_multiplayer_session;
|
|
QStandardItemModel* game_list;
|
|
ComboBoxProxyModel* proxy;
|
|
std::unique_ptr<Ui::HostRoom> ui;
|
|
Validation validation;
|
|
};
|
|
|
|
/**
|
|
* Proxy Model for the game list combo box so we can reuse the game list model while still
|
|
* displaying the fields slightly differently
|
|
*/
|
|
class ComboBoxProxyModel : public QSortFilterProxyModel {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
int columnCount(const QModelIndex& idx) const override {
|
|
return 1;
|
|
}
|
|
|
|
QVariant data(const QModelIndex& idx, int role) const override;
|
|
|
|
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
|
|
};
|