Merge pull request #6908

c53d48a BIP70: Chainparams: DRY: Make qt/guiutil.cpp fit BIP70 chain name strings (Jorge Timón)
This commit is contained in:
Wladimir J. van der Laan 2015-11-09 14:15:22 +01:00
commit f24880b132
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -581,12 +581,12 @@ TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* t
#ifdef WIN32 #ifdef WIN32
boost::filesystem::path static StartupShortcutPath() boost::filesystem::path static StartupShortcutPath()
{ {
if (GetBoolArg("-testnet", false)) std::string chain = ChainNameFromCommandLine();
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (testnet).lnk"; if (chain == CBaseChainParams::MAIN)
else if (GetBoolArg("-regtest", false))
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (regtest).lnk";
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk"; return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk";
if (chain == CBaseChainParams::TESTNET) // Remove this special case when CBaseChainParams::TESTNET = "testnet4"
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (testnet).lnk";
return GetSpecialFolderPath(CSIDL_STARTUP) / strprintf("Bitcoin (%s).lnk", chain);
} }
bool GetStartOnSystemStartup() bool GetStartOnSystemStartup()
@ -719,15 +719,14 @@ bool SetStartOnSystemStartup(bool fAutoStart)
boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc); boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc);
if (!optionFile.good()) if (!optionFile.good())
return false; return false;
std::string chain = ChainNameFromCommandLine();
// Write a bitcoin.desktop file to the autostart directory: // Write a bitcoin.desktop file to the autostart directory:
optionFile << "[Desktop Entry]\n"; optionFile << "[Desktop Entry]\n";
optionFile << "Type=Application\n"; optionFile << "Type=Application\n";
if (GetBoolArg("-testnet", false)) if (chain == CBaseChainParams::MAIN)
optionFile << "Name=Bitcoin (testnet)\n";
else if (GetBoolArg("-regtest", false))
optionFile << "Name=Bitcoin (regtest)\n";
else
optionFile << "Name=Bitcoin\n"; optionFile << "Name=Bitcoin\n";
else
optionFile << strprintf("Name=Bitcoin (%s)\n", chain);
optionFile << "Exec=" << pszExePath << strprintf(" -min -testnet=%d -regtest=%d\n", GetBoolArg("-testnet", false), GetBoolArg("-regtest", false)); optionFile << "Exec=" << pszExePath << strprintf(" -min -testnet=%d -regtest=%d\n", GetBoolArg("-testnet", false), GetBoolArg("-regtest", false));
optionFile << "Terminal=false\n"; optionFile << "Terminal=false\n";
optionFile << "Hidden=false\n"; optionFile << "Hidden=false\n";