Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | if (fAutoStart) { | ||||
if (SUCCEEDED(hres)) { | if (SUCCEEDED(hres)) { | ||||
// Get the current executable path | // Get the current executable path | ||||
WCHAR pszExePath[MAX_PATH]; | WCHAR pszExePath[MAX_PATH]; | ||||
GetModuleFileNameW(nullptr, pszExePath, ARRAYSIZE(pszExePath)); | GetModuleFileNameW(nullptr, pszExePath, ARRAYSIZE(pszExePath)); | ||||
// Start client minimized | // Start client minimized | ||||
QString strArgs = "-min"; | QString strArgs = "-min"; | ||||
// Set -testnet /-regtest options | // Set -testnet /-regtest options | ||||
strArgs += QString::fromStdString(strprintf( | strArgs += QString::fromStdString( | ||||
" -testnet=%d -regtest=%d", gArgs.GetBoolArg("-testnet", false), | strprintf(" -chain=%s", gArgs.GetChainName())); | ||||
gArgs.GetBoolArg("-regtest", false))); | |||||
// Set the path to the shortcut target | // Set the path to the shortcut target | ||||
psl->SetPath(pszExePath); | psl->SetPath(pszExePath); | ||||
PathRemoveFileSpecW(pszExePath); | PathRemoveFileSpecW(pszExePath); | ||||
psl->SetWorkingDirectory(pszExePath); | psl->SetWorkingDirectory(pszExePath); | ||||
psl->SetShowCmd(SW_SHOWMINNOACTIVE); | psl->SetShowCmd(SW_SHOWMINNOACTIVE); | ||||
psl->SetArguments(strArgs.toStdWString().c_str()); | psl->SetArguments(strArgs.toStdWString().c_str()); | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | if (!fAutoStart) { | ||||
optionFile << "[Desktop Entry]\n"; | optionFile << "[Desktop Entry]\n"; | ||||
optionFile << "Type=Application\n"; | optionFile << "Type=Application\n"; | ||||
if (chain == CBaseChainParams::MAIN) { | if (chain == CBaseChainParams::MAIN) { | ||||
optionFile << "Name=Bitcoin\n"; | optionFile << "Name=Bitcoin\n"; | ||||
} else { | } else { | ||||
optionFile << strprintf("Name=Bitcoin (%s)\n", chain); | optionFile << strprintf("Name=Bitcoin (%s)\n", chain); | ||||
} | } | ||||
optionFile << "Exec=" << pszExePath | optionFile << "Exec=" << pszExePath | ||||
<< strprintf(" -min -testnet=%d -regtest=%d\n", | << strprintf(" -min -chain=%s\n", chain); | ||||
gArgs.GetBoolArg("-testnet", false), | |||||
gArgs.GetBoolArg("-regtest", false)); | |||||
optionFile << "Terminal=false\n"; | optionFile << "Terminal=false\n"; | ||||
optionFile << "Hidden=false\n"; | optionFile << "Hidden=false\n"; | ||||
optionFile.close(); | optionFile.close(); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
#elif defined(Q_OS_MAC) | #elif defined(Q_OS_MAC) | ||||
▲ Show 20 Lines • Show All 256 Lines • Show Last 20 Lines |