mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
Make the FIFO Player a separate window
This way, it can be focused with the render window behind it, instead of having the main window show up and cover the render window. This is useful for adjusting the object range, among other things.
This commit is contained in:
parent
05bd15a928
commit
83f7c41e31
3 changed files with 27 additions and 6 deletions
|
@ -6,9 +6,13 @@
|
|||
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QEvent>
|
||||
#include <QFileDialog>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QIcon>
|
||||
#include <QKeyEvent>
|
||||
#include <QKeySequence>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QSpinBox>
|
||||
|
@ -26,12 +30,13 @@
|
|||
#include "DolphinQt/FIFO/FIFOAnalyzer.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/QueueOnObject.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
FIFOPlayerWindow::FIFOPlayerWindow(QWidget* parent) : QDialog(parent)
|
||||
FIFOPlayerWindow::FIFOPlayerWindow(QWidget* parent) : QWidget(parent)
|
||||
{
|
||||
setWindowTitle(tr("FIFO Player"));
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowIcon(Resources::GetAppIcon());
|
||||
|
||||
CreateWidgets();
|
||||
ConnectWidgets();
|
||||
|
@ -56,6 +61,8 @@ FIFOPlayerWindow::FIFOPlayerWindow(QWidget* parent) : QDialog(parent)
|
|||
OnEmulationStopped();
|
||||
m_emu_state = state;
|
||||
});
|
||||
|
||||
installEventFilter(this);
|
||||
}
|
||||
|
||||
FIFOPlayerWindow::~FIFOPlayerWindow()
|
||||
|
@ -167,7 +174,7 @@ void FIFOPlayerWindow::ConnectWidgets()
|
|||
connect(m_save, &QPushButton::clicked, this, &FIFOPlayerWindow::SaveRecording);
|
||||
connect(m_record, &QPushButton::clicked, this, &FIFOPlayerWindow::StartRecording);
|
||||
connect(m_stop, &QPushButton::clicked, this, &FIFOPlayerWindow::StopRecording);
|
||||
connect(m_button_box, &QDialogButtonBox::rejected, this, &FIFOPlayerWindow::reject);
|
||||
connect(m_button_box, &QDialogButtonBox::rejected, this, &FIFOPlayerWindow::hide);
|
||||
connect(m_early_memory_updates, &QCheckBox::toggled, this,
|
||||
&FIFOPlayerWindow::OnEarlyMemoryUpdatesChanged);
|
||||
connect(m_frame_range_from, qOverload<int>(&QSpinBox::valueChanged), this,
|
||||
|
@ -371,3 +378,15 @@ void FIFOPlayerWindow::UpdateControls()
|
|||
|
||||
m_save->setEnabled(FifoRecorder::GetInstance().IsRecordingDone());
|
||||
}
|
||||
|
||||
bool FIFOPlayerWindow::eventFilter(QObject* object, QEvent* event)
|
||||
{
|
||||
// Close when escape is pressed
|
||||
if (event->type() == QEvent::KeyPress)
|
||||
{
|
||||
if (static_cast<QKeyEvent*>(event)->matches(QKeySequence::Cancel))
|
||||
hide();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue