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>
|
|
|
|
|
2021-04-08 20:57:50 +00:00
|
|
|
#include <QDesktopServices>
|
|
|
|
#include <QUrl>
|
|
|
|
|
2014-04-18 11:17:37 +00:00
|
|
|
Wizard::MethodSelectionPage::MethodSelectionPage(QWidget* parent)
|
|
|
|
: QWizardPage(parent)
|
2013-12-08 20:35:57 +00:00
|
|
|
{
|
2014-04-18 11:17:37 +00:00
|
|
|
mWizard = qobject_cast<MainWizard*>(parent);
|
|
|
|
|
2013-12-08 20:35:57 +00:00
|
|
|
setupUi(this);
|
2013-12-13 12:38:49 +00:00
|
|
|
|
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
|
2017-08-09 05:20:49 +00:00
|
|
|
retailDiscRadioButton->setEnabled(false);
|
2014-11-22 23:51:57 +00:00
|
|
|
existingLocationRadioButton->setChecked(true);
|
2021-04-08 20:57:50 +00:00
|
|
|
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);
|
|
|
|
|
2017-08-09 05:20:49 +00:00
|
|
|
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
|
|
|
|
{
|
2017-08-09 05:20:49 +00:00
|
|
|
if (field(QLatin1String("installation.retailDisc")).toBool() == true)
|
|
|
|
{
|
2014-01-28 12:27:09 +00:00
|
|
|
return MainWizard::Page_InstallationTarget;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return MainWizard::Page_ExistingInstallation;
|
|
|
|
}
|
2013-12-08 21:58:29 +00:00
|
|
|
}
|
2021-04-08 20:57:50 +00:00
|
|
|
|
|
|
|
void Wizard::MethodSelectionPage::handleBuyButton()
|
|
|
|
{
|
|
|
|
QDesktopServices::openUrl(QUrl("https://openmw.org/faq/#do_i_need_morrowind"));
|
|
|
|
}
|