mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-23 13:04:17 +00:00
Ensure version number->string conversion is consistent
This commit is contained in:
parent
b37f09aa2e
commit
a584320357
4
init.cpp
4
init.cpp
@ -143,7 +143,7 @@ bool AppInit2(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
string beta = VERSION_IS_BETA ? _(" beta") : "";
|
string beta = VERSION_IS_BETA ? _(" beta") : "";
|
||||||
string strUsage = string() +
|
string strUsage = string() +
|
||||||
_("Bitcoin version") + " " + FormatVersion(VERSION) + pszSubVer + beta + "\n\n" +
|
_("Bitcoin version") + " " + FormatFullVersion() + "\n\n" +
|
||||||
_("Usage:") + "\t\t\t\t\t\t\t\t\t\t\n" +
|
_("Usage:") + "\t\t\t\t\t\t\t\t\t\t\n" +
|
||||||
" bitcoin [options] \t " + "\n" +
|
" bitcoin [options] \t " + "\n" +
|
||||||
" bitcoin [options] <command> [params]\t " + _("Send command to -server or bitcoind\n") +
|
" bitcoin [options] <command> [params]\t " + _("Send command to -server or bitcoind\n") +
|
||||||
@ -262,7 +262,7 @@ bool AppInit2(int argc, char* argv[])
|
|||||||
if (!fDebug && !pszSetDataDir[0])
|
if (!fDebug && !pszSetDataDir[0])
|
||||||
ShrinkDebugFile();
|
ShrinkDebugFile();
|
||||||
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||||
printf("Bitcoin version %s%s%s\n", FormatVersion(VERSION).c_str(), pszSubVer, VERSION_IS_BETA ? _(" beta") : "");
|
printf("Bitcoin version %s\n", FormatFullVersion().c_str());
|
||||||
#ifdef GUI
|
#ifdef GUI
|
||||||
printf("OS version %s\n", ((string)wxGetOsDescription()).c_str());
|
printf("OS version %s\n", ((string)wxGetOsDescription()).c_str());
|
||||||
printf("System default language is %d %s\n", g_locale.GetSystemLanguage(), ((string)g_locale.GetSysName()).c_str());
|
printf("System default language is %d %s\n", g_locale.GetSystemLanguage(), ((string)g_locale.GetSysName()).c_str());
|
||||||
|
2
ui.cpp
2
ui.cpp
@ -1814,7 +1814,7 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event)
|
|||||||
|
|
||||||
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
|
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
|
||||||
{
|
{
|
||||||
m_staticTextVersion->SetLabel(strprintf(_("version %s%s BETA"), FormatVersion(VERSION).c_str(), pszSubVer));
|
m_staticTextVersion->SetLabel(strprintf(_("version %s"), FormatFullVersion().c_str()));
|
||||||
|
|
||||||
// Change (c) into UTF-8 or ANSI copyright symbol
|
// Change (c) into UTF-8 or ANSI copyright symbol
|
||||||
wxString str = m_staticTextMain->GetLabel();
|
wxString str = m_staticTextMain->GetLabel();
|
||||||
|
29
util.cpp
29
util.cpp
@ -855,3 +855,32 @@ void AddTimeData(unsigned int ip, int64 nTime)
|
|||||||
printf("| nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
|
printf("| nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string FormatVersion(int nVersion)
|
||||||
|
{
|
||||||
|
if (nVersion%100 == 0)
|
||||||
|
return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
|
||||||
|
else
|
||||||
|
return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
|
||||||
|
}
|
||||||
|
|
||||||
|
string FormatFullVersion()
|
||||||
|
{
|
||||||
|
string s = FormatVersion(VERSION) + pszSubVer;
|
||||||
|
if (VERSION_IS_BETA)
|
||||||
|
s += _("-beta");
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
9
util.h
9
util.h
@ -184,6 +184,7 @@ uint64 GetRand(uint64 nMax);
|
|||||||
int64 GetTime();
|
int64 GetTime();
|
||||||
int64 GetAdjustedTime();
|
int64 GetAdjustedTime();
|
||||||
void AddTimeData(unsigned int ip, int64 nTime);
|
void AddTimeData(unsigned int ip, int64 nTime);
|
||||||
|
string FormatFullVersion();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -431,14 +432,6 @@ inline bool GetBoolArg(const string& strArg)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline string FormatVersion(int nVersion)
|
|
||||||
{
|
|
||||||
if (nVersion%100 == 0)
|
|
||||||
return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
|
|
||||||
else
|
|
||||||
return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user