Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
Show First 20 Lines • Show All 667 Lines • ▼ Show 20 Lines | if (fAutoStart) { | ||||
// Get the current executable path | // Get the current executable path | ||||
TCHAR pszExePath[MAX_PATH]; | TCHAR pszExePath[MAX_PATH]; | ||||
GetModuleFileName(nullptr, pszExePath, sizeof(pszExePath)); | GetModuleFileName(nullptr, pszExePath, sizeof(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(strprintf( | ||||
" -testnet=%d -regtest=%d", GetBoolArg("-testnet", false), | " -testnet=%d -regtest=%d", gArgs.GetBoolArg("-testnet", false), | ||||
GetBoolArg("-regtest", false))); | gArgs.GetBoolArg("-regtest", false))); | ||||
#ifdef UNICODE | #ifdef UNICODE | ||||
boost::scoped_array<TCHAR> args(new TCHAR[strArgs.length() + 1]); | boost::scoped_array<TCHAR> args(new TCHAR[strArgs.length() + 1]); | ||||
// Convert the QString to TCHAR* | // Convert the QString to TCHAR* | ||||
strArgs.toWCharArray(args.get()); | strArgs.toWCharArray(args.get()); | ||||
// Add missing '\0'-termination to string | // Add missing '\0'-termination to string | ||||
args[strArgs.length()] = '\0'; | args[strArgs.length()] = '\0'; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | else { | ||||
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 -testnet=%d -regtest=%d\n", | ||||
GetBoolArg("-testnet", false), | gArgs.GetBoolArg("-testnet", false), | ||||
GetBoolArg("-regtest", 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 247 Lines • Show Last 20 Lines |