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