Removed font start option
This commit is contained in:
parent
0f4b0971d8
commit
a45d80b8d7
7 changed files with 3 additions and 130 deletions
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
bool _debug = false;
|
||||
|
||||
wstring updaterName, updaterDir, updateTo, exeName, customWorkingDir, customKeyFile, mainFont, semiboldFont, monospacedFont;
|
||||
wstring updaterName, updaterDir, updateTo, exeName, customWorkingDir, customKeyFile;
|
||||
|
||||
bool equal(const wstring &a, const wstring &b) {
|
||||
return !_wcsicmp(a.c_str(), b.c_str());
|
||||
|
|
@ -339,7 +339,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
|
|||
LPWSTR *args;
|
||||
int argsCount;
|
||||
|
||||
bool needupdate = false, autostart = false, debug = false, writeprotected = false, startintray = false, testmode = false, externalupdater = false, semiboldisbold = false;
|
||||
bool needupdate = false, autostart = false, debug = false, writeprotected = false, startintray = false, testmode = false, externalupdater = false;
|
||||
args = CommandLineToArgvW(GetCommandLine(), &argsCount);
|
||||
if (args) {
|
||||
for (int i = 1; i < argsCount; ++i) {
|
||||
|
|
@ -381,14 +381,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
|
|||
break;
|
||||
}
|
||||
}
|
||||
} else if (equal(args[i], L"-mainfont") && ++i < argsCount) {
|
||||
mainFont = args[i];
|
||||
} else if (equal(args[i], L"-semiboldfont") && ++i < argsCount) {
|
||||
semiboldFont = args[i];
|
||||
} else if (equal(args[i], L"-semiboldisbold")) {
|
||||
semiboldisbold = true;
|
||||
} else if (equal(args[i], L"-monospacefont") && ++i < argsCount) {
|
||||
monospacedFont = args[i];
|
||||
}
|
||||
}
|
||||
if (exeName.empty()) {
|
||||
|
|
@ -442,16 +434,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
|
|||
if (!customKeyFile.empty()) {
|
||||
targs += L" -key \"" + customKeyFile + L"\"";
|
||||
}
|
||||
if (!mainFont.empty()) {
|
||||
targs += L" -mainfont \"" + mainFont + L"\"";
|
||||
}
|
||||
if (!semiboldFont.empty()) {
|
||||
targs += L" -semiboldfont \"" + semiboldFont + L"\"";
|
||||
}
|
||||
if (semiboldisbold) targs += L" -semiboldisbold";
|
||||
if (!monospacedFont.empty()) {
|
||||
targs += L" -monospacefont \"" + monospacedFont + L"\"";
|
||||
}
|
||||
writeLog(L"Result arguments: " + targs);
|
||||
|
||||
bool executed = false;
|
||||
|
|
|
|||
|
|
@ -46,9 +46,6 @@ string updaterName;
|
|||
string workDir;
|
||||
string exeName;
|
||||
string exePath;
|
||||
string mainFont;
|
||||
string semiboldFont;
|
||||
string monospacedFont;
|
||||
|
||||
FILE *_logFile = 0;
|
||||
void openLog() {
|
||||
|
|
@ -344,7 +341,6 @@ int main(int argc, char *argv[]) {
|
|||
bool testmode = false;
|
||||
bool externalupdater = false;
|
||||
bool customWorkingDir = false;
|
||||
bool semiboldIsBold = false;
|
||||
|
||||
char *key = 0;
|
||||
char *workdir = 0;
|
||||
|
|
@ -373,14 +369,6 @@ int main(int argc, char *argv[]) {
|
|||
exeName = argv[i];
|
||||
} else if (equal(argv[i], "-exepath") && ++i < argc) {
|
||||
exePath = argv[i];
|
||||
} else if (equal(argv[i], "-mainfont") && ++i < argc) {
|
||||
mainFont = argv[i];
|
||||
} else if (equal(argv[i], "-semiboldfont") && ++i < argc) {
|
||||
semiboldFont = argv[i];
|
||||
} else if (equal(argv[i], "-semiboldisbold")) {
|
||||
semiboldIsBold = true;
|
||||
} else if (equal(argv[i], "-monospacefont") && ++i < argc) {
|
||||
monospacedFont = argv[i];
|
||||
}
|
||||
}
|
||||
if (exeName.empty() || exeName.find('/') != string::npos) {
|
||||
|
|
@ -477,19 +465,6 @@ int main(int argc, char *argv[]) {
|
|||
push("-workdir");
|
||||
push(workdir);
|
||||
}
|
||||
if (!mainFont.empty()) {
|
||||
push("-mainfont");
|
||||
push(mainFont);
|
||||
}
|
||||
if (!semiboldFont.empty()) {
|
||||
push("-semiboldfont");
|
||||
push(semiboldFont);
|
||||
}
|
||||
if (semiboldIsBold) push("-semiboldisbold");
|
||||
if (!monospacedFont.empty()) {
|
||||
push("-monospacefont");
|
||||
push(monospacedFont);
|
||||
}
|
||||
|
||||
auto args = vector<char*>();
|
||||
for (auto &arg : values) {
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
NSString *appName = @"Telegram.app";
|
||||
NSString *appDir = nil;
|
||||
NSString *workDir = nil;
|
||||
NSString *mainFont = nil;
|
||||
NSString *semiboldFont = nil;
|
||||
NSString *monospacedFont = nil;
|
||||
|
||||
#ifdef _DEBUG
|
||||
BOOL _debug = YES;
|
||||
|
|
@ -93,7 +90,7 @@ int main(int argc, const char * argv[]) {
|
|||
|
||||
openLog();
|
||||
pid_t procId = 0;
|
||||
BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO, externalUpdater = NO, semiboldIsBold = NO;
|
||||
BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO, externalUpdater = NO;
|
||||
BOOL customWorkingDir = NO;
|
||||
NSString *key = nil;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
|
|
@ -125,20 +122,6 @@ int main(int argc, const char * argv[]) {
|
|||
customWorkingDir = YES;
|
||||
} else if ([@"-key" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
|
||||
if (++i < argc) key = [NSString stringWithUTF8String:argv[i]];
|
||||
} else if ([@"-mainfont" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
|
||||
if (++i < argc) {
|
||||
mainFont = [NSString stringWithUTF8String:argv[i]];
|
||||
}
|
||||
} else if ([@"-semiboldfont" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
|
||||
if (++i < argc) {
|
||||
semiboldFont = [NSString stringWithUTF8String:argv[i]];
|
||||
}
|
||||
} else if ([@"-semiboldisbold" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
|
||||
semiboldIsBold = YES;
|
||||
} else if ([@"-monospacefont" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
|
||||
if (++i < argc) {
|
||||
monospacedFont = [NSString stringWithUTF8String:argv[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!workDir) {
|
||||
|
|
@ -282,19 +265,6 @@ int main(int argc, const char * argv[]) {
|
|||
[args addObject:@"-workdir"];
|
||||
[args addObject:workDir];
|
||||
}
|
||||
if (mainFont) {
|
||||
[args addObject:@"-mainfont"];
|
||||
[args addObject:mainFont];
|
||||
}
|
||||
if (semiboldFont) {
|
||||
[args addObject:@"-semiboldfont"];
|
||||
[args addObject:semiboldFont];
|
||||
}
|
||||
if (semiboldIsBold) [args addObject:@"-semiboldisbold"];
|
||||
if (monospacedFont) {
|
||||
[args addObject:@"-monospacefont"];
|
||||
[args addObject:monospacedFont];
|
||||
}
|
||||
writeLog([[NSArray arrayWithObjects:@"Running application '", appPath, @"' with args '", [args componentsJoinedByString:@"' '"], @"'..", nil] componentsJoinedByString:@""]);
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
|
|
|
|||
|
|
@ -392,10 +392,6 @@ void Launcher::processArguments() {
|
|||
{ "-workdir" , KeyFormat::OneValue },
|
||||
{ "--" , KeyFormat::OneValue },
|
||||
{ "-scale" , KeyFormat::OneValue },
|
||||
{ "-mainfont" , KeyFormat::OneValue },
|
||||
{ "-semiboldfont" , KeyFormat::OneValue },
|
||||
{ "-semiboldisbold" , KeyFormat::NoValues },
|
||||
{ "-monospacefont" , KeyFormat::OneValue },
|
||||
};
|
||||
auto parseResult = QMap<QByteArray, QStringList>();
|
||||
auto parsingKey = QByteArray();
|
||||
|
|
@ -453,11 +449,6 @@ void Launcher::processArguments() {
|
|||
? style::kScaleAuto
|
||||
: value;
|
||||
}
|
||||
|
||||
gMainFont = parseResult.value("-mainfont", {}).join(QString());
|
||||
gSemiboldFont = parseResult.value("-semiboldfont", {}).join(QString());
|
||||
gSemiboldFontIsBold = parseResult.contains("-semiboldisbold");
|
||||
gMonospaceFont = parseResult.value("-monospacefont", {}).join(QString());
|
||||
}
|
||||
|
||||
int Launcher::executeApplication() {
|
||||
|
|
|
|||
|
|
@ -75,21 +75,6 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
|
|||
argumentsList.push("-externalupdater");
|
||||
}
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
if (!cMainFont().isEmpty()) {
|
||||
argumentsList.push("-mainfont");
|
||||
argumentsList.push(QFile::encodeName(cMainFont()));
|
||||
}
|
||||
if (!cSemiboldFont().isEmpty()) {
|
||||
argumentsList.push("-semiboldfont");
|
||||
argumentsList.push(QFile::encodeName(cSemiboldFont()));
|
||||
}
|
||||
if (cSemiboldFontIsBold()) {
|
||||
argumentsList.push("-semiboldisbold");
|
||||
}
|
||||
if (!cMonospaceFont().isEmpty()) {
|
||||
argumentsList.push("-monospacefont");
|
||||
argumentsList.push(QFile::encodeName(cMonospaceFont()));
|
||||
}
|
||||
if (cDataFile() != qsl("data")) {
|
||||
argumentsList.push("-key");
|
||||
argumentsList.push(QFile::encodeName(cDataFile()));
|
||||
|
|
|
|||
|
|
@ -67,21 +67,6 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
|
|||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
if (Core::UpdaterDisabled()) [args addObject:@"-externalupdater"];
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
if (!cMainFont().isEmpty()) {
|
||||
[args addObject:@"-mainfont"];
|
||||
[args addObject:Q2NSString(cMainFont())];
|
||||
}
|
||||
if (!cSemiboldFont().isEmpty()) {
|
||||
[args addObject:@"-semiboldfont"];
|
||||
[args addObject:Q2NSString(cSemiboldFont())];
|
||||
}
|
||||
if (cSemiboldFontIsBold()) {
|
||||
argumentsList.push(qsl("-semiboldisbold"));
|
||||
}
|
||||
if (!cMonospaceFont().isEmpty()) {
|
||||
[args addObject:@"-monospacefont"];
|
||||
[args addObject:Q2NSString(cMonospaceFont())];
|
||||
}
|
||||
if (cDataFile() != qsl("data")) {
|
||||
[args addObject:@"-key"];
|
||||
[args addObject:Q2NSString(cDataFile())];
|
||||
|
|
|
|||
|
|
@ -80,21 +80,6 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
|
|||
pushArgument(qsl("-workdir"));
|
||||
pushArgument('"' + cWorkingDir() + '"');
|
||||
}
|
||||
if (!cMainFont().isEmpty()) {
|
||||
pushArgument(qsl("-mainfont"));
|
||||
pushArgument('"' + cMainFont() + '"');
|
||||
}
|
||||
if (!cSemiboldFont().isEmpty()) {
|
||||
pushArgument(qsl("-semiboldfont"));
|
||||
pushArgument('"' + cSemiboldFont() + '"');
|
||||
}
|
||||
if (cSemiboldFontIsBold()) {
|
||||
pushArgument(qsl("-semiboldisbold"));
|
||||
}
|
||||
if (!cMonospaceFont().isEmpty()) {
|
||||
pushArgument(qsl("-monospacefont"));
|
||||
pushArgument('"' + cMonospaceFont() + '"');
|
||||
}
|
||||
if (cDataFile() != qsl("data")) {
|
||||
pushArgument(qsl("-key"));
|
||||
pushArgument('"' + cDataFile() + '"');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue