mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
e1e662b86a
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.
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
// 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
|