mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Qt: Implement NetPlay
This commit is contained in:
@ -34,7 +34,7 @@ static bool CompressCB(const std::string&, float, void*);
|
||||
|
||||
GameList::GameList(QWidget* parent) : QStackedWidget(parent)
|
||||
{
|
||||
m_model = new GameListModel(this);
|
||||
m_model = Settings::Instance().GetGameListModel();
|
||||
m_list_proxy = new ListProxyModel(this);
|
||||
m_list_proxy->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_list_proxy->setSortRole(Qt::InitialSortOrderRole);
|
||||
@ -197,6 +197,18 @@ void GameList::ShowContextMenu(const QPoint&)
|
||||
|
||||
menu->addAction(tr("Open &containing folder"), this, &GameList::OpenContainingFolder);
|
||||
menu->addAction(tr("Delete File..."), this, &GameList::DeleteFile);
|
||||
|
||||
QAction* netplay_host = new QAction(tr("Host with NetPlay"), menu);
|
||||
|
||||
connect(netplay_host, &QAction::triggered, [this, game] { emit NetPlayHost(game); });
|
||||
connect(this, &GameList::EmulationStarted, netplay_host,
|
||||
[netplay_host] { netplay_host->setEnabled(false); });
|
||||
connect(this, &GameList::EmulationStopped, netplay_host,
|
||||
[netplay_host] { netplay_host->setEnabled(true); });
|
||||
netplay_host->setEnabled(!Core::IsRunning());
|
||||
|
||||
menu->addAction(netplay_host);
|
||||
|
||||
menu->exec(QCursor::pos());
|
||||
}
|
||||
|
||||
@ -402,12 +414,16 @@ QString GameList::GetSelectedGame() const
|
||||
return QStringLiteral("");
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
GameListModel* GameList::GetModel() const
|
||||
{
|
||||
return m_model;
|
||||
}
|
||||
|
||||
void GameList::SetPreferredView(bool table)
|
||||
=======
|
||||
void GameList::SetPreferredView(bool list)
|
||||
>>>>>>> af63a1c36d... tmp.
|
||||
{
|
||||
m_prefer_list = list;
|
||||
Settings::Instance().SetPreferredView(list);
|
||||
|
@ -32,6 +32,7 @@ signals:
|
||||
void GameSelected();
|
||||
void EmulationStarted();
|
||||
void EmulationStopped();
|
||||
void NetPlayHost(const QString& game_path);
|
||||
|
||||
private:
|
||||
void ShowContextMenu(const QPoint&);
|
||||
|
Reference in New Issue
Block a user