1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/apps/wizard/methodselectionpage.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
C++
Raw Normal View History

2013-12-08 20:35:57 +00:00
#include "methodselectionpage.hpp"
2013-12-08 21:58:29 +00:00
#include "mainwizard.hpp"
2024-05-01 04:30:20 +00:00
#include <components/misc/scalableicon.hpp>
#include <QDesktopServices>
#include <QUrl>
Wizard::MethodSelectionPage::MethodSelectionPage(QWidget* parent)
: QWizardPage(parent)
2013-12-08 20:35:57 +00:00
{
mWizard = qobject_cast<MainWizard*>(parent);
2013-12-08 20:35:57 +00:00
setupUi(this);
2024-05-01 04:30:20 +00:00
installerIcon->setIcon(Misc::ScalableIcon::load(":system-installer"));
folderIcon->setIcon(Misc::ScalableIcon::load(":folder"));
buyLinkButton->setIcon(Misc::ScalableIcon::load(":dollar"));
2024-04-23 07:49:33 +00:00
2014-11-22 23:51:57 +00:00
#ifndef OPENMW_USE_UNSHIELD
retailDiscRadioButton->setEnabled(false);
2014-11-22 23:51:57 +00:00
existingLocationRadioButton->setChecked(true);
buyLinkButton->released();
2014-11-22 23:51:57 +00:00
#endif
2022-09-22 18:26:05 +00:00
2024-05-12 07:45:02 +00:00
QFont font = existingLocationRadioButton->font();
font.setBold(true);
existingLocationRadioButton->setFont(font);
retailDiscRadioButton->setFont(font);
registerField(QLatin1String("installation.retailDisc"), retailDiscRadioButton);
2022-09-22 18:26:05 +00:00
2024-05-01 04:30:20 +00:00
connect(buyLinkButton, &QPushButton::released, this, &MethodSelectionPage::handleBuyButton);
2013-12-08 20:35:57 +00:00
}
2013-12-08 21:58:29 +00:00
int Wizard::MethodSelectionPage::nextId() const
{
if (field(QLatin1String("installation.retailDisc")).toBool() == true)
{
return MainWizard::Page_InstallationTarget;
}
else
{
return MainWizard::Page_ExistingInstallation;
}
2013-12-08 21:58:29 +00:00
}
void Wizard::MethodSelectionPage::handleBuyButton()
{
QDesktopServices::openUrl(QUrl("https://openmw.org/faq/#do_i_need_morrowind"));
}