Skip to content

about:version:help clean up add Bitcoin branding #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ static bool AppInit(int argc, char* argv[])

// Process help and version before taking care about datadir
if (HelpRequested(args) || args.IsArgSet("-version")) {
std::string strUsage = PACKAGE_NAME " version " + FormatFullVersion() + "\n";
std::string strUsage = PACKAGE_NAME " " + FormatFullVersion() + "\n" + LicenseInfo() +"\n" + CopyrightInfo() + "\n";

if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo()) + "\n";
} else {
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n";
strUsage += "\n" + args.GetHelpMessage();
if (!args.IsArgSet("-version")) {
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n"
"\n";
strUsage += args.GetHelpMessage();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved conflict.


tfm::format(std::cout, "%s", strUsage);
Expand Down
5 changes: 5 additions & 0 deletions src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ static std::string FormatVersion(int nVersion)
return strprintf("%d.%d.%d", nVersion / 10000, (nVersion / 100) % 100, nVersion % 100);
}

std::string FormatVersion()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returns a terse string for reusability.
REF: e0ff8e2#r536344384

{
return BUILD_DESC "-" BUILD_GIT_COMMIT;
}

std::string FormatFullVersion()
{
return CLIENT_BUILD;
Expand Down
1 change: 1 addition & 0 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;


std::string FormatVersion();
std::string FormatFullVersion();
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);

Expand Down
37 changes: 21 additions & 16 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,23 +591,28 @@ void SetupServerArgs(NodeContext& node)
argsman.AddHiddenArgs(hidden_args);
}

std::string VersionInfo()
{
return FormatVersion();//from clientversion.cpp
}

std::string CopyrightInfo()
{
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i ").translated, 2009, COPYRIGHT_YEAR));
}

std::string AboutMessageInfo()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AboutMessageInfo() is simple and can be modified more easily in the future.

{
const std::string SOURCE_CODE_URL = "<https://github.com/bitcoin/bitcoin>";
return strprintf(_("Please contribute if you find %s useful." "\n"
"Visit %s for further information.").translated, PACKAGE_NAME, "<" PACKAGE_URL ">") + "\n" +
strprintf(_("The source code is available at: %s").translated, SOURCE_CODE_URL);
}

std::string LicenseInfo()
{
const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>";

return CopyrightHolders(strprintf(_("Copyright (C) %i-%i").translated, 2009, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
strprintf(_("Please contribute if you find %s useful. "
"Visit %s for further information about the software.").translated,
PACKAGE_NAME, "<" PACKAGE_URL ">") +
"\n" +
strprintf(_("The source code is available from %s.").translated,
URL_SOURCE_CODE) +
"\n" +
"\n" +
_("This is experimental software.").translated + "\n" +
strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s").translated, "COPYING", "<https://opensource.org/licenses/MIT>") +
"\n";
const std::string LICENSE_URL = "<https://github.com/bitcoin/bitcoin/blob/master/COPYING>";
return strprintf(_("\nThis is experimental software.\nDistributed under the MIT software license:\n%s").translated, LICENSE_URL);
}

static bool fHaveGenesis = false;
Expand Down Expand Up @@ -881,7 +886,7 @@ void InitLogging(const ArgsManager& args)

fLogIPs = args.GetBoolArg("-logips", DEFAULT_LOGIPS);

std::string version_string = FormatFullVersion();
std::string version_string = FormatVersion();
#ifdef DEBUG
version_string += " (debug build)";
#else
Expand Down
5 changes: 4 additions & 1 deletion src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
*/
void SetupServerArgs(NodeContext& node);

/** Returns licensing information (for -version) */
/** Returns information (for -version) */
std::string VersionInfo();
std::string CopyrightInfo();
std::string AboutMessageInfo();
std::string LicenseInfo();

#endif // BITCOIN_INIT_H
1 change: 1 addition & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ void BitcoinGUI::showDebugWindowActivateConsole()
void BitcoinGUI::showHelpMessageClicked()
{
helpMessageDialog->show();
helpMessageDialog->raise();//bring to top if obscured
Copy link
Contributor Author

@RandyMcMillan RandyMcMillan Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the helpMessageDialog has already been presented - this change brings it to the front if the user re-clicks on the help menu item - otherwise it may remain obscured by any other windows.

}

#ifdef ENABLE_WALLET
Expand Down
Loading