Fixed trigger function

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-22 16:49:19 +03:00
parent f7d502c68c
commit b84dc8551a
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
2 changed files with 8 additions and 7 deletions

View File

@ -42,16 +42,16 @@ ExportModsToStringDialog::ExportModsToStringDialog(InstancePtr instance, QWidget
mcInstance->loaderModList()->update(); mcInstance->loaderModList()->update();
connect(mcInstance->loaderModList().get(), &ModFolderModel::updateFinished, this, [this, mcInstance]() { connect(mcInstance->loaderModList().get(), &ModFolderModel::updateFinished, this, [this, mcInstance]() {
m_allMods = mcInstance->loaderModList()->allMods(); m_allMods = mcInstance->loaderModList()->allMods();
trigger(); triggerImp();
}); });
} }
connect(ui->formatComboBox, &QComboBox::currentIndexChanged, this, &ExportModsToStringDialog::formatChanged); connect(ui->formatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ExportModsToStringDialog::formatChanged);
connect(ui->authorsCheckBox, &QCheckBox::stateChanged, this, &ExportModsToStringDialog::trigger); connect(ui->authorsCheckBox, &QCheckBox::stateChanged, this, &ExportModsToStringDialog::trigger);
connect(ui->versionCheckBox, &QCheckBox::stateChanged, this, &ExportModsToStringDialog::trigger); connect(ui->versionCheckBox, &QCheckBox::stateChanged, this, &ExportModsToStringDialog::trigger);
connect(ui->urlCheckBox, &QCheckBox::stateChanged, this, &ExportModsToStringDialog::trigger); connect(ui->urlCheckBox, &QCheckBox::stateChanged, this, &ExportModsToStringDialog::trigger);
connect(ui->templateText, &QTextEdit::textChanged, this, &ExportModsToStringDialog::trigger); connect(ui->templateText, &QTextEdit::textChanged, this, &ExportModsToStringDialog::triggerImp);
connect(ui->copyButton, &QPushButton::clicked, this, [this]() { connect(ui->copyButton, &QPushButton::clicked, this, [this](bool) {
this->ui->finalText->selectAll(); this->ui->finalText->selectAll();
this->ui->finalText->copy(); this->ui->finalText->copy();
}); });
@ -81,10 +81,10 @@ void ExportModsToStringDialog::formatChanged(int index)
break; break;
} }
} }
trigger(); triggerImp();
} }
void ExportModsToStringDialog::trigger() void ExportModsToStringDialog::triggerImp()
{ {
ExportToString::Formats format; ExportToString::Formats format;
switch (ui->formatComboBox->currentIndex()) { switch (ui->formatComboBox->currentIndex()) {

View File

@ -36,7 +36,8 @@ class ExportModsToStringDialog : public QDialog {
protected slots: protected slots:
void formatChanged(int index); void formatChanged(int index);
void trigger(); void triggerImp();
void trigger(int) { triggerImp(); };
private: private:
QList<Mod*> m_allMods; QList<Mod*> m_allMods;