2022-05-17 05:00:06 +01:00
|
|
|
#include "PasteWizardPage.h"
|
|
|
|
#include "ui_PasteWizardPage.h"
|
|
|
|
|
|
|
|
#include "Application.h"
|
|
|
|
#include "net/PasteUpload.h"
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
PasteWizardPage::PasteWizardPage(QWidget* parent) : BaseWizardPage(parent), ui(new Ui::PasteWizardPage)
|
2022-05-17 05:00:06 +01:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
PasteWizardPage::~PasteWizardPage()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
void PasteWizardPage::initializePage() {}
|
2022-05-17 05:00:06 +01:00
|
|
|
|
|
|
|
bool PasteWizardPage::validatePage()
|
|
|
|
{
|
|
|
|
auto s = APPLICATION->settings();
|
|
|
|
QString prevPasteURL = s->get("PastebinURL").toString();
|
|
|
|
s->reset("PastebinURL");
|
2023-08-02 17:35:35 +01:00
|
|
|
if (ui->previousSettingsRadioButton->isChecked()) {
|
2022-05-17 05:00:06 +01:00
|
|
|
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);
|
|
|
|
}
|