@ -57,21 +57,20 @@ void AboutDialog::on_buttonBox_accepted()
}
}
/** "Help message" dialog box */
/** "Help message" dialog box */
HelpMessageDialog : : HelpMessageDialog ( QWidget * parent ) :
HelpMessageDialog : : HelpMessageDialog ( QWidget * parent , bool versionOnly ) :
QDialog ( parent ) ,
QDialog ( parent ) ,
ui ( new Ui : : HelpMessageDialog )
ui ( new Ui : : HelpMessageDialog )
{
{
ui - > setupUi ( this ) ;
ui - > setupUi ( this ) ;
GUIUtil : : restoreWindowGeometry ( " nHelpMessageDialogWindow " , this - > size ( ) , this ) ;
GUIUtil : : restoreWindowGeometry ( " nHelpMessageDialogWindow " , this - > size ( ) , this ) ;
header = tr ( " Bitcoin Core " ) + " " + tr ( " version " ) + " " +
QString version = tr ( " Bitcoin Core " ) + " " + tr ( " version " ) + " " + QString : : fromStdString ( FormatFullVersion ( ) ) ;
QString : : fromStdString ( FormatFullVersion ( ) ) + " \n \n " +
QString header = tr ( " Usage: " ) + " \n " +
tr ( " Usage: " ) + " \n " +
" bitcoin-qt [ " + tr ( " command-line options " ) + " ] " + " \n " ;
" bitcoin-qt [ " + tr ( " command-line options " ) + " ] " + " \n " ;
coreOptions = QString : : fromStdString ( HelpMessage ( HMM_BITCOIN_QT ) ) ;
QString coreOptions = QString : : fromStdString ( HelpMessage ( HMM_BITCOIN_QT ) ) ;
uiOptions = tr ( " UI options " ) + " : \n " +
QString uiOptions = tr ( " UI options " ) + " : \n " +
" -choosedatadir " + tr ( " Choose data directory on startup (default: 0) " ) + " \n " +
" -choosedatadir " + tr ( " Choose data directory on startup (default: 0) " ) + " \n " +
" -lang=<lang> " + tr ( " Set language, for example \" de_DE \" (default: system locale) " ) + " \n " +
" -lang=<lang> " + tr ( " Set language, for example \" de_DE \" (default: system locale) " ) + " \n " +
" -min " + tr ( " Start minimized " ) + " \n " +
" -min " + tr ( " Start minimized " ) + " \n " +
@ -81,7 +80,10 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent) :
ui - > helpMessageLabel - > setFont ( GUIUtil : : bitcoinAddressFont ( ) ) ;
ui - > helpMessageLabel - > setFont ( GUIUtil : : bitcoinAddressFont ( ) ) ;
// Set help message text
// Set help message text
ui - > helpMessageLabel - > setText ( header + " \n " + coreOptions + " \n " + uiOptions ) ;
if ( versionOnly )
ui - > helpMessageLabel - > setText ( version ) ;
else
ui - > helpMessageLabel - > setText ( version + " \n " + header + " \n " + coreOptions + " \n " + uiOptions ) ;
}
}
HelpMessageDialog : : ~ HelpMessageDialog ( )
HelpMessageDialog : : ~ HelpMessageDialog ( )
@ -93,8 +95,7 @@ HelpMessageDialog::~HelpMessageDialog()
void HelpMessageDialog : : printToConsole ( )
void HelpMessageDialog : : printToConsole ( )
{
{
// On other operating systems, the expected action is to print the message to the console.
// On other operating systems, the expected action is to print the message to the console.
QString strUsage = header + " \n " + coreOptions + " \n " + uiOptions + " \n " ;
fprintf ( stdout , " %s \n " , qPrintable ( ui - > helpMessageLabel - > text ( ) ) ) ;
fprintf ( stdout , " %s " , strUsage . toStdString ( ) . c_str ( ) ) ;
}
}
void HelpMessageDialog : : showOrPrint ( )
void HelpMessageDialog : : showOrPrint ( )