Add migration wizard, fix migration from custom paste instance
- Very basic wizard just to allow the user to choose whether to keep their old paste settings or use the new default settings. - People who used custom 0x0 instances would just be kept on those settings and won't see the wizard.
This commit is contained in:
42
launcher/ui/setupwizard/PasteWizardPage.cpp
Normal file
42
launcher/ui/setupwizard/PasteWizardPage.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
#include "PasteWizardPage.h"
|
||||
#include "ui_PasteWizardPage.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "net/PasteUpload.h"
|
||||
|
||||
PasteWizardPage::PasteWizardPage(QWidget *parent) :
|
||||
BaseWizardPage(parent),
|
||||
ui(new Ui::PasteWizardPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
PasteWizardPage::~PasteWizardPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PasteWizardPage::initializePage()
|
||||
{
|
||||
}
|
||||
|
||||
bool PasteWizardPage::validatePage()
|
||||
{
|
||||
auto s = APPLICATION->settings();
|
||||
QString prevPasteURL = s->get("PastebinURL").toString();
|
||||
s->reset("PastebinURL");
|
||||
if (ui->previousSettingsRadioButton->isChecked())
|
||||
{
|
||||
bool usingDefaultBase = prevPasteURL == PasteUpload::PasteTypes.at(PasteUpload::PasteType::NullPointer).defaultBase;
|
||||
s->set("PastebinType", PasteUpload::PasteType::NullPointer);
|
||||
if (!usingDefaultBase)
|
||||
s->set("PastebinCustomAPIBase", prevPasteURL);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PasteWizardPage::retranslate()
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
Reference in New Issue
Block a user