mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-03 16:16:05 +00:00
Added AchievementsWindow QDialog
AchievementsWindow is the dialog box that will eventually contain the settings and progress data for RetroAchievements on Dolphin. This adds the barebones dialog, and connects it to MainWindow's MenuBar.
This commit is contained in:
parent
da77084d2f
commit
e1e662b86a
8 changed files with 120 additions and 0 deletions
48
Source/Core/DolphinQt/Achievements/AchievementsWindow.cpp
Normal file
48
Source/Core/DolphinQt/Achievements/AchievementsWindow.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
// Copyright 2023 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
#include "DolphinQt/Achievements/AchievementsWindow.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||
|
||||
AchievementsWindow::AchievementsWindow(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
setWindowTitle(tr("Achievements"));
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
CreateMainLayout();
|
||||
ConnectWidgets();
|
||||
}
|
||||
|
||||
void AchievementsWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
update();
|
||||
}
|
||||
|
||||
void AchievementsWindow::CreateMainLayout()
|
||||
{
|
||||
auto* layout = new QVBoxLayout();
|
||||
|
||||
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);
|
||||
|
||||
layout->addWidget(m_button_box);
|
||||
|
||||
WrapInScrollArea(this, layout);
|
||||
}
|
||||
|
||||
void AchievementsWindow::ConnectWidgets()
|
||||
{
|
||||
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
void AchievementsWindow::UpdateData()
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
26
Source/Core/DolphinQt/Achievements/AchievementsWindow.h
Normal file
26
Source/Core/DolphinQt/Achievements/AchievementsWindow.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2023 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
#include <QDialog>
|
||||
|
||||
class QDialogButtonBox;
|
||||
|
||||
class AchievementsWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AchievementsWindow(QWidget* parent);
|
||||
void UpdateData();
|
||||
|
||||
private:
|
||||
void CreateMainLayout();
|
||||
void showEvent(QShowEvent* event);
|
||||
void ConnectWidgets();
|
||||
|
||||
QDialogButtonBox* m_button_box;
|
||||
};
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
Loading…
Add table
Add a link
Reference in a new issue