feat: Add crash recovery on Windows (#5012)

This commit is contained in:
nerix
2023-12-24 15:38:58 +01:00
committed by GitHub
parent 2cb965d352
commit 25add89b14
29 changed files with 563 additions and 258 deletions
+28
View File
@@ -9,13 +9,37 @@
namespace chatterino {
/// Command line arguments passed to Chatterino.
///
/// All accepted arguments:
///
/// Crash recovery:
/// --crash-recovery
/// --cr-exception-code code
/// --cr-exception-message message
///
/// Native messaging:
/// --parent-window
/// --x-attach-split-to-window=window-id
///
/// -v, --verbose
/// -V, --version
/// -c, --channels=t:channel1;t:channel2;...
/// --safe-mode
///
/// See documentation on `QGuiApplication` for documentation on Qt arguments like -platform.
class Args
{
public:
Args(const QApplication &app);
bool printVersion{};
bool crashRecovery{};
/// Native, platform-specific exception code from crashpad
std::optional<uint32_t> exceptionCode{};
/// Text version of the exception code. Potentially contains more context.
std::optional<QString> exceptionMessage{};
bool shouldRunBrowserExtensionHost{};
// Shows a single chat. Used on windows to embed in another application.
bool isFramelessEmbed{};
@@ -28,8 +52,12 @@ public:
bool verbose{};
bool safeMode{};
QStringList currentArguments() const;
private:
void applyCustomChannelLayout(const QString &argValue);
QStringList currentArguments_;
};
void initArgs(const QApplication &app);