@ -62,13 +62,17 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
ui - > helpMessage - > setVisible ( false ) ;
ui - > helpMessage - > setVisible ( false ) ;
} else {
} else {
setWindowTitle ( tr ( " Command-line options " ) ) ;
setWindowTitle ( tr ( " Command-line options " ) ) ;
QString header = tr ( " Usage: " ) + " \n " +
" bitcoin-qt [ " + tr ( " command-line options " ) + " ] " + " \n " ;
QTextCursor cursor ( ui - > helpMessage - > document ( ) ) ;
QTextCursor cursor ( ui - > helpMessage - > document ( ) ) ;
cursor . insertText ( version ) ;
cursor . insertText ( version ) ;
cursor . insertBlock ( ) ;
cursor . insertBlock ( ) ;
cursor . insertText ( tr ( " Usage: " ) + ' \n ' +
cursor . insertText ( header ) ;
" bitcoin-qt [ " + tr ( " command-line options " ) + " ] \n " ) ;
cursor . insertBlock ( ) ;
cursor . insertBlock ( ) ;
QString coreOptions = QString : : fromStdString ( HelpMessage ( HMM_BITCOIN_QT ) ) ;
text = version + " \n " + header + " \n " + coreOptions ;
QTextTableFormat tf ;
QTextTableFormat tf ;
tf . setBorderStyle ( QTextFrameFormat : : BorderStyle_None ) ;
tf . setBorderStyle ( QTextFrameFormat : : BorderStyle_None ) ;
tf . setCellPadding ( 2 ) ;
tf . setCellPadding ( 2 ) ;
@ -76,63 +80,29 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
widths < < QTextLength ( QTextLength : : PercentageLength , 35 ) ;
widths < < QTextLength ( QTextLength : : PercentageLength , 35 ) ;
widths < < QTextLength ( QTextLength : : PercentageLength , 65 ) ;
widths < < QTextLength ( QTextLength : : PercentageLength , 65 ) ;
tf . setColumnWidthConstraints ( widths ) ;
tf . setColumnWidthConstraints ( widths ) ;
QTextTable * table = cursor . insertTable ( 2 , 2 , tf ) ;
QString coreOptions = QString : : fromStdString ( HelpMessage ( HMM_BITCOIN_QT ) ) ;
bool first = true ;
QTextCharFormat bold ;
QTextCharFormat bold ;
bold . setFontWeight ( QFont : : Bold ) ;
bold . setFontWeight ( QFont : : Bold ) ;
// note that coreOptions is not translated.
foreach ( const QString & line , coreOptions . split ( ' \n ' ) ) {
if ( ! first ) {
table - > appendRows ( 1 ) ;
cursor . movePosition ( QTextCursor : : NextRow ) ;
}
first = false ;
if ( line . startsWith ( " " ) ) {
foreach ( const QString & line , coreOptions . split ( " \n " ) ) {
int index = line . indexOf ( ' ' , 3 ) ;
if ( line . startsWith ( " - " ) )
if ( index > 0 ) {
{
cursor . insertText ( line . left ( index ) . trimmed ( ) ) ;
cursor . currentTable ( ) - > appendRows ( 1 ) ;
cursor . movePosition ( QTextCursor : : PreviousCell ) ;
cursor . movePosition ( QTextCursor : : NextRow ) ;
cursor . insertText ( line . trimmed ( ) ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( line . mid ( index ) . trimmed ( ) ) ;
} else if ( line . startsWith ( " " ) ) {
continue ;
cursor . insertText ( line . trimmed ( ) + ' ' ) ;
}
} else if ( line . size ( ) > 0 ) {
}
//Title of a group
cursor . movePosition ( QTextCursor : : NextCell , QTextCursor : : KeepAnchor ) ;
if ( cursor . currentTable ( ) )
table - > mergeCells ( cursor ) ;
cursor . currentTable ( ) - > appendRows ( 1 ) ;
cursor . movePosition ( QTextCursor : : Down ) ;
cursor . insertText ( line . trimmed ( ) , bold ) ;
cursor . insertText ( line . trimmed ( ) , bold ) ;
cursor . insertTable ( 1 , 2 , tf ) ;
}
}
table - > appendRows ( 6 ) ;
cursor . movePosition ( QTextCursor : : NextRow ) ;
cursor . insertText ( tr ( " UI options " ) + " : " , bold ) ;
cursor . movePosition ( QTextCursor : : NextRow ) ;
if ( GetBoolArg ( " -help-debug " , false ) ) {
cursor . insertText ( " -allowselfsignedrootcertificates " ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( tr ( " Allow self signed root certificates (default: 0) " ) ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
}
}
cursor . insertText ( " -choosedatadir " ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( tr ( " Choose data directory on startup (default: 0) " ) ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( " -lang=<lang> " ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( tr ( " Set language, for example \" de_DE \" (default: system locale) " ) ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( " -min " ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( tr ( " Start minimized " ) ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( " -rootcertificates=<file> " ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( tr ( " Set SSL root certificates for payment request (default: -system-) " ) ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( " -splash " ) ;
cursor . movePosition ( QTextCursor : : NextCell ) ;
cursor . insertText ( tr ( " Show splash screen on startup (default: 1) " ) ) ;
ui - > helpMessage - > moveCursor ( QTextCursor : : Start ) ;
ui - > helpMessage - > moveCursor ( QTextCursor : : Start ) ;
ui - > scrollArea - > setVisible ( false ) ;
ui - > scrollArea - > setVisible ( false ) ;