| 51 | #include <BuildConfig.h> |
| 52 | |
| 53 | QString GuiUtil::fetchFlameKey(QWidget *parentWidget) |
| 54 | { |
| 55 | if (BuildConfig.FLAME_API_KEY_API_URL.isEmpty()) |
| 56 | return ""; |
| 57 | |
| 58 | ProgressDialog prog(parentWidget); |
| 59 | auto flameKeyTask = std::make_unique<FetchFlameAPIKey>(); |
| 60 | prog.execWithTask(flameKeyTask.get()); |
| 61 | |
| 62 | if (!flameKeyTask->wasSuccessful()) |
| 63 | { |
| 64 | auto message = QObject::tr("Fetching the Curseforge API key failed. Reason: %1").arg(flameKeyTask->failReason()); |
| 65 | if (!(APPLICATION->capabilities() & Application::SupportsFlame)) |
| 66 | { |
| 67 | message += "\n\n" + QObject::tr("Downloading Curseforge modpacks will not work unless you manually set a valid Curseforge Core API key in the settings."); |
| 68 | } |
| 69 | |
| 70 | CustomMessageBox::selectable(parentWidget, |
| 71 | QObject::tr("Failed to fetch Curseforge API key."), |
| 72 | message, QMessageBox::Critical)->exec(); |
| 73 | } |
| 74 | |
| 75 | return flameKeyTask->m_result; |
| 76 | } |
| 77 | |
| 78 | QString GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget) |
| 79 | { |
nothing calls this directly
no test coverage detected