| 120 | } |
| 121 | |
| 122 | void ExportToModListDialog::triggerImp() |
| 123 | { |
| 124 | if (m_format == ExportToModList::CUSTOM) { |
| 125 | ui->finalText->setPlainText(ExportToModList::exportToModList(m_mods, ui->templateText->toPlainText())); |
| 126 | return; |
| 127 | } |
| 128 | auto opt = 0; |
| 129 | if (ui->authorsCheckBox->isChecked()) |
| 130 | opt |= ExportToModList::Authors; |
| 131 | if (ui->versionCheckBox->isChecked()) |
| 132 | opt |= ExportToModList::Version; |
| 133 | if (ui->urlCheckBox->isChecked()) |
| 134 | opt |= ExportToModList::Url; |
| 135 | if (ui->filenameCheckBox->isChecked()) |
| 136 | opt |= ExportToModList::FileName; |
| 137 | auto txt = ExportToModList::exportToModList(m_mods, m_format, static_cast<ExportToModList::OptionalData>(opt)); |
| 138 | ui->finalText->setPlainText(txt); |
| 139 | switch (m_format) { |
| 140 | case ExportToModList::CUSTOM: |
| 141 | return; |
| 142 | case ExportToModList::HTML: |
| 143 | ui->resultText->setHtml(StringUtils::htmlListPatch(txt)); |
| 144 | break; |
| 145 | case ExportToModList::MARKDOWN: |
| 146 | ui->resultText->setHtml(StringUtils::htmlListPatch(markdownToHTML(txt))); |
| 147 | break; |
| 148 | case ExportToModList::PLAINTXT: |
| 149 | break; |
| 150 | case ExportToModList::JSON: |
| 151 | break; |
| 152 | case ExportToModList::CSV: |
| 153 | break; |
| 154 | } |
| 155 | auto exampleLine = exampleLines[m_format]; |
| 156 | if (!m_template_changed && ui->templateText->toPlainText() != exampleLine) |
| 157 | ui->templateText->setPlainText(exampleLine); |
| 158 | } |
| 159 | |
| 160 | void ExportToModListDialog::done(int result) |
| 161 | { |
nothing calls this directly
no test coverage detected