1 #include "methodselectionpage.hpp"
2 #include "mainwizard.hpp"
3 
4 #include <QUrl>
5 #include <QDesktopServices>
6 
MethodSelectionPage(QWidget * parent)7 Wizard::MethodSelectionPage::MethodSelectionPage(QWidget *parent) :
8     QWizardPage(parent)
9 {
10     mWizard = qobject_cast<MainWizard*>(parent);
11 
12     setupUi(this);
13 
14 #ifndef OPENMW_USE_UNSHIELD
15     retailDiscRadioButton->setEnabled(false);
16     existingLocationRadioButton->setChecked(true);
17     buyLinkButton->released();
18 #endif
19 
20     registerField(QLatin1String("installation.retailDisc"), retailDiscRadioButton);
21 
22     connect(buyLinkButton, SIGNAL(released()), this, SLOT(handleBuyButton()));
23 }
24 
nextId() const25 int Wizard::MethodSelectionPage::nextId() const
26 {
27     if (field(QLatin1String("installation.retailDisc")).toBool() == true) {
28         return MainWizard::Page_InstallationTarget;
29     } else {
30         return MainWizard::Page_ExistingInstallation;
31     }
32 }
33 
handleBuyButton()34 void Wizard::MethodSelectionPage::handleBuyButton()
35 {
36     QDesktopServices::openUrl(QUrl("https://openmw.org/faq/#do_i_need_morrowind"));
37 }
38