aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/migration_dialog.cpp
diff options
context:
space:
mode:
authorswurl <swurl@swurl.xyz>2025-05-10 15:40:15 +0000
committercrueter <crueter@noreply.localhost>2025-05-10 15:40:15 +0000
commit28d2b0638022531f315afb11e2ede8da9ca595be (patch)
treef2d7d65b619c4aae2de7470fb223f3aea96487c5 /src/yuzu/migration_dialog.cpp
parent09c72e9f98354e89ea8b49a882db8dae47dc3149 (diff)
Options for Data Migration (#95)
Copy, move, or link Co-authored-by: KeatonTheBot <onikeaton@gmail.com> Signed-off-by: swurl <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/95 Co-authored-by: swurl <swurl@swurl.xyz> Co-committed-by: swurl <swurl@swurl.xyz>
Diffstat (limited to 'src/yuzu/migration_dialog.cpp')
-rw-r--r--src/yuzu/migration_dialog.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/yuzu/migration_dialog.cpp b/src/yuzu/migration_dialog.cpp
new file mode 100644
index 0000000000..d4a6e9cd3c
--- /dev/null
+++ b/src/yuzu/migration_dialog.cpp
@@ -0,0 +1,63 @@
+#include "migration_dialog.h"
+
+#include <QApplication>
+#include <QCheckBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QStyle>
+
+MigrationDialog::MigrationDialog(
+ QWidget *parent)
+ : QDialog(parent)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this);
+
+ m_text = new QLabel(this);
+ m_boxes = new QVBoxLayout;
+ m_buttons = new QHBoxLayout;
+
+ layout->addWidget(m_text, 1);
+ layout->addLayout(m_boxes, 1);
+ layout->addLayout(m_buttons, 1);
+}
+
+MigrationDialog::~MigrationDialog() {
+ m_boxes->deleteLater();
+ m_buttons->deleteLater();
+}
+
+void MigrationDialog::setText(
+ const QString &text)
+{
+ m_text->setText(text);
+}
+
+void MigrationDialog::addBox(
+ QWidget *box)
+{
+ m_boxes->addWidget(box);
+
+}
+
+QAbstractButton *MigrationDialog::addButton(
+ const QString &text, const bool reject)
+{
+ QAbstractButton *button = new QPushButton(this);
+ button->setText(text);
+ m_buttons->addWidget(button, 1);
+
+ connect(button, &QAbstractButton::clicked, this, [this, button, reject]() {
+ if (reject) {
+ this->reject();
+ } else {
+ m_clickedButton = button;
+ this->accept();
+ }
+ });
+ return button;
+}
+
+QAbstractButton *MigrationDialog::clickedButton() const
+{
+ return m_clickedButton;
+}