tdesktop/Telegram/SourceFiles/core/launcher.h

74 lines
1.4 KiB
C
Raw Normal View History

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "core/base_integration.h"
namespace Core {
extern const char kOptionFractionalScalingEnabled[];
extern const char kOptionFreeType[];
class Launcher {
public:
Launcher(int argc, char *argv[]);
static std::unique_ptr<Launcher> Create(int argc, char *argv[]);
virtual int exec();
QString argumentsString() const;
bool customWorkingDir() const;
uint64 installationTag() const;
bool checkPortableVersionFolder();
void workingFolderReady();
void writeDebugModeSetting();
void writeInstallBetaVersionsSetting();
virtual ~Launcher() = default;
protected:
enum class UpdaterLaunch {
PerformUpdate,
JustRelaunch,
};
private:
void prepareSettings();
2021-04-20 12:40:54 +00:00
void initQtMessageLogging();
void processArguments();
QStringList readArguments(int argc, char *argv[]) const;
2018-09-21 16:28:46 +00:00
virtual std::optional<QStringList> readArgumentsHook(
int argc,
char *argv[]) const {
2018-09-21 16:28:46 +00:00
return std::nullopt;
}
void init();
virtual void initHook() {
}
virtual void initHighDpi();
virtual bool launchUpdater(UpdaterLaunch action) = 0;
int executeApplication();
int _argc;
char **_argv;
QStringList _arguments;
BaseIntegration _baseIntegration;
bool _customWorkingDir = false;
};
} // namespace Core