openmw/apps/wizard/methodselectionpage.cpp

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

45 lines
1.2 KiB
C++
Raw Normal View History

2013-12-08 21:35:57 +01:00
#include "methodselectionpage.hpp"
2013-12-08 22:58:29 +01:00
#include "mainwizard.hpp"
#include <QDesktopServices>
#include <QUrl>
Wizard::MethodSelectionPage::MethodSelectionPage(QWidget* parent)
: QWizardPage(parent)
2013-12-08 21:35:57 +01:00
{
mWizard = qobject_cast<MainWizard*>(parent);
2013-12-08 21:35:57 +01:00
setupUi(this);
2024-04-23 11:49:33 +04:00
installerIconLabel->setPixmap(QIcon(":system-installer").pixmap(QSize(48, 48)));
folderIconLabel->setPixmap(QIcon(":folder").pixmap(QSize(48, 48)));
buyIconLabel->setPixmap(QIcon(":dollar").pixmap(QSize(48, 48)));
2014-11-23 00:51:57 +01:00
#ifndef OPENMW_USE_UNSHIELD
retailDiscRadioButton->setEnabled(false);
2014-11-23 00:51:57 +01:00
existingLocationRadioButton->setChecked(true);
buyLinkButton->released();
2014-11-23 00:51:57 +01:00
#endif
2022-09-22 21:26:05 +03:00
registerField(QLatin1String("installation.retailDisc"), retailDiscRadioButton);
2022-09-22 21:26:05 +03:00
connect(buyLinkButton, &QCommandLinkButton::released, this, &MethodSelectionPage::handleBuyButton);
2013-12-08 21:35:57 +01:00
}
2013-12-08 22:58:29 +01: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 22:58:29 +01:00
}
void Wizard::MethodSelectionPage::handleBuyButton()
{
QDesktopServices::openUrl(QUrl("https://openmw.org/faq/#do_i_need_morrowind"));
}