MultiMC5/launcher/ui/dialogs/CreateShortcutDialog.h
arthomnix 7938585abb NOISSUE shortcut creation: add version blacklist for joining server on launch
These versions are known to crash when joining a server on launch (see MC-145102 and MC-228828)
2022-07-03 15:47:54 +01:00

65 lines
1.4 KiB
C++

/*
* Copyright 2022 arthomnix
*
* This source is subject to the Microsoft Public License (MS-PL).
* Please see the COPYING.md file for more information.
*/
#pragma once
#include <QDialog>
#include "minecraft/auth/MinecraftAccount.h"
#include "BaseInstance.h"
#ifdef Q_OS_WIN
#include <windows.h>
#endif
const QString JOIN_SERVER_DISALLOWED_VERSIONS(
"(19w0[89][a-z])"
"|(19w1[0-9][a-z])"
"|(1.14.?[1-4]?-pre[0-9])"
"|(1.14.?[1-4]?)"
"|(19w[34][0-9][a-z])"
"|(1.15.?[0-9]?-pre[0-9])"
"|(1.15.?[0-9]?)"
"|(20w[01][0-9][a-z])"
"|(20w20a)"
"|(21w[12][0-9][a-z])"
"|(1.17-pre[0-9])"
"|(1.17-rc[0-9])"
"|(1.17)"
);
namespace Ui
{
class CreateShortcutDialog;
}
class CreateShortcutDialog : public QDialog
{
Q_OBJECT
public:
explicit CreateShortcutDialog(QWidget *parent = nullptr, InstancePtr instance = nullptr);
~CreateShortcutDialog() override;
private
slots:
void on_shortcutPathBrowse_clicked();
void updateDialogState();
void accept() override;
private:
Ui::CreateShortcutDialog *ui;
InstancePtr m_instance;
QString getLaunchCommand();
QString getLaunchArgs();
void createShortcut();
#ifdef Q_OS_WIN
void createWindowsLink(LPCSTR target, LPCSTR workingDir, LPCSTR args, LPCSTR filename, LPCSTR desc, LPCSTR iconPath);
#endif
};