DolphinQt: Handle the Host_UpdateTitle callback.
This commit is contained in:
parent
7c91669ced
commit
f5743f5ee9
|
@ -172,6 +172,7 @@
|
|||
<ClInclude Include="GameList\GameGrid.h" />
|
||||
<ClInclude Include="GameList\GameTracker.h" />
|
||||
<ClInclude Include="GameList\GameTree.h" />
|
||||
<ClInclude Include="Host.h" />
|
||||
<ClInclude Include="Utils\Resources.h" />
|
||||
<ClInclude Include="Utils\Utils.h" />
|
||||
<ClInclude Include="VideoInterface\RenderWidget.h" />
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Host.h" />
|
||||
<ClInclude Include="Utils\Resources.h">
|
||||
<Filter>Utils</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -10,8 +10,15 @@
|
|||
#include "Common/MsgHandler.h"
|
||||
#include "Core/Host.h"
|
||||
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/MainWindow.h"
|
||||
|
||||
HostTitleEvent::HostTitleEvent(const std::string& title)
|
||||
: QEvent((QEvent::Type)HostEvent::TitleEvent),
|
||||
m_title(title)
|
||||
{
|
||||
}
|
||||
|
||||
void Host_Message(int id)
|
||||
{
|
||||
// TODO
|
||||
|
@ -24,7 +31,7 @@ void Host_UpdateMainFrame()
|
|||
|
||||
void Host_UpdateTitle(const std::string& title)
|
||||
{
|
||||
// TODO
|
||||
qApp->postEvent(g_main_window, new HostTitleEvent(title));
|
||||
}
|
||||
|
||||
void* Host_GetRenderHandle()
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2015 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QEvent>
|
||||
#include <string>
|
||||
|
||||
enum HostEvent {
|
||||
TitleEvent = QEvent::User + 1,
|
||||
};
|
||||
|
||||
class HostTitleEvent final : public QEvent
|
||||
{
|
||||
public:
|
||||
HostTitleEvent(const std::string& title);
|
||||
const std::string m_title;
|
||||
};
|
|
@ -17,6 +17,7 @@
|
|||
#include "Core/HW/ProcessorInterface.h"
|
||||
|
||||
#include "DolphinQt/AboutDialog.h"
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/MainWindow.h"
|
||||
#include "DolphinQt/SystemInfo.h"
|
||||
#include "DolphinQt/Utils/Resources.h"
|
||||
|
@ -114,6 +115,17 @@ DMainWindow::~DMainWindow()
|
|||
{
|
||||
}
|
||||
|
||||
bool DMainWindow::event(QEvent* e)
|
||||
{
|
||||
if (e->type() == HostEvent::TitleEvent)
|
||||
{
|
||||
HostTitleEvent* htev = (HostTitleEvent*)e;
|
||||
m_ui->statusbar->showMessage(QString::fromStdString(htev->m_title), 1500);
|
||||
return true;
|
||||
}
|
||||
return QMainWindow::event(e);
|
||||
}
|
||||
|
||||
void DMainWindow::closeEvent(QCloseEvent* ce)
|
||||
{
|
||||
if (!OnStop())
|
||||
|
|
|
@ -54,7 +54,8 @@ private slots:
|
|||
void UpdateIcons();
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent* ce);
|
||||
bool event(QEvent* e) override;
|
||||
void closeEvent(QCloseEvent* ce) override;
|
||||
std::unique_ptr<Ui::DMainWindow> m_ui;
|
||||
DGameTracker* m_game_tracker;
|
||||
|
||||
|
|
Loading…
Reference in New Issue