Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
Show First 20 Lines • Show All 599 Lines • ▼ Show 20 Lines | TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer( | ||||
tableView->horizontalHeader()->setMinimumSectionSize( | tableView->horizontalHeader()->setMinimumSectionSize( | ||||
allColumnsMinimumWidth); | allColumnsMinimumWidth); | ||||
setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive); | setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive); | ||||
setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive); | setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive); | ||||
} | } | ||||
#ifdef WIN32 | #ifdef WIN32 | ||||
static fs::path StartupShortcutPath() { | static fs::path StartupShortcutPath() { | ||||
std::string chain = ChainNameFromCommandLine(); | std::string chain = gArgs.GetChainName(); | ||||
if (chain == CBaseChainParams::MAIN) | if (chain == CBaseChainParams::MAIN) | ||||
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk"; | return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk"; | ||||
// Remove this special case when CBaseChainParams::TESTNET = "testnet4" | // Remove this special case when CBaseChainParams::TESTNET = "testnet4" | ||||
if (chain == CBaseChainParams::TESTNET) | if (chain == CBaseChainParams::TESTNET) | ||||
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (testnet).lnk"; | return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (testnet).lnk"; | ||||
return GetSpecialFolderPath(CSIDL_STARTUP) / | return GetSpecialFolderPath(CSIDL_STARTUP) / | ||||
strprintf("Bitcoin (%s).lnk", chain); | strprintf("Bitcoin (%s).lnk", chain); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | static fs::path GetAutostartDir() { | ||||
char *pszConfigHome = getenv("XDG_CONFIG_HOME"); | char *pszConfigHome = getenv("XDG_CONFIG_HOME"); | ||||
if (pszConfigHome) return fs::path(pszConfigHome) / "autostart"; | if (pszConfigHome) return fs::path(pszConfigHome) / "autostart"; | ||||
char *pszHome = getenv("HOME"); | char *pszHome = getenv("HOME"); | ||||
if (pszHome) return fs::path(pszHome) / ".config" / "autostart"; | if (pszHome) return fs::path(pszHome) / ".config" / "autostart"; | ||||
return fs::path(); | return fs::path(); | ||||
} | } | ||||
static fs::path GetAutostartFilePath() { | static fs::path GetAutostartFilePath() { | ||||
std::string chain = ChainNameFromCommandLine(); | std::string chain = gArgs.GetChainName(); | ||||
if (chain == CBaseChainParams::MAIN) | if (chain == CBaseChainParams::MAIN) | ||||
return GetAutostartDir() / "bitcoin.desktop"; | return GetAutostartDir() / "bitcoin.desktop"; | ||||
return GetAutostartDir() / strprintf("bitcoin-%s.lnk", chain); | return GetAutostartDir() / strprintf("bitcoin-%s.lnk", chain); | ||||
} | } | ||||
bool GetStartOnSystemStartup() { | bool GetStartOnSystemStartup() { | ||||
fs::ifstream optionFile(GetAutostartFilePath()); | fs::ifstream optionFile(GetAutostartFilePath()); | ||||
if (!optionFile.good()) return false; | if (!optionFile.good()) return false; | ||||
Show All 20 Lines | else { | ||||
-1) | -1) | ||||
return false; | return false; | ||||
fs::create_directories(GetAutostartDir()); | fs::create_directories(GetAutostartDir()); | ||||
fs::ofstream optionFile(GetAutostartFilePath(), | fs::ofstream optionFile(GetAutostartFilePath(), | ||||
std::ios_base::out | std::ios_base::trunc); | std::ios_base::out | std::ios_base::trunc); | ||||
if (!optionFile.good()) return false; | if (!optionFile.good()) return false; | ||||
std::string chain = ChainNameFromCommandLine(); | std::string chain = gArgs.GetChainName(); | ||||
// 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 (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 | ||||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |