@@ -62,77 +62,47 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
62
62
ui->helpMessage ->setVisible (false );
63
63
} else {
64
64
setWindowTitle (tr (" Command-line options" ));
65
+ QString header = tr (" Usage:" ) + " \n " +
66
+ " bitcoin-qt [" + tr (" command-line options" ) + " ] " + " \n " ;
65
67
QTextCursor cursor (ui->helpMessage ->document ());
66
68
cursor.insertText (version);
67
69
cursor.insertBlock ();
68
- cursor.insertText (tr (" Usage:" ) + ' \n ' +
69
- " bitcoin-qt [" + tr (" command-line options" ) + " ]\n " );
70
-
70
+ cursor.insertText (header);
71
71
cursor.insertBlock ();
72
+
73
+ QString coreOptions = QString::fromStdString (HelpMessage (HMM_BITCOIN_QT));
74
+ text = version + " \n " + header + " \n " + coreOptions;
75
+
72
76
QTextTableFormat tf;
73
77
tf.setBorderStyle (QTextFrameFormat::BorderStyle_None);
74
78
tf.setCellPadding (2 );
75
79
QVector<QTextLength> widths;
76
80
widths << QTextLength (QTextLength::PercentageLength, 35 );
77
81
widths << QTextLength (QTextLength::PercentageLength, 65 );
78
82
tf.setColumnWidthConstraints (widths);
79
- QTextTable *table = cursor.insertTable (2 , 2 , tf);
80
83
81
- QString coreOptions = QString::fromStdString (HelpMessage (HMM_BITCOIN_QT));
82
- bool first = true ;
83
84
QTextCharFormat bold;
84
85
bold.setFontWeight (QFont::Bold);
85
- // note that coreOptions is not translated.
86
- foreach (const QString &line, coreOptions.split (' \n ' )) {
87
- if (!first) {
88
- table->appendRows (1 );
86
+
87
+ foreach (const QString &line, coreOptions.split (" \n " )) {
88
+ if (line.startsWith (" -" ))
89
+ {
90
+ cursor.currentTable ()->appendRows (1 );
91
+ cursor.movePosition (QTextCursor::PreviousCell);
89
92
cursor.movePosition (QTextCursor::NextRow);
93
+ cursor.insertText (line.trimmed ());
94
+ cursor.movePosition (QTextCursor::NextCell);
95
+ } else if (line.startsWith (" " )) {
96
+ cursor.insertText (line.trimmed ()+' ' );
97
+ } else if (line.size () > 0 ) {
98
+ // Title of a group
99
+ if (cursor.currentTable ())
100
+ cursor.currentTable ()->appendRows (1 );
101
+ cursor.movePosition (QTextCursor::Down);
102
+ cursor.insertText (line.trimmed (), bold);
103
+ cursor.insertTable (1 , 2 , tf);
90
104
}
91
- first = false ;
92
-
93
- if (line.startsWith (" " )) {
94
- int index = line.indexOf (' ' , 3 );
95
- if (index > 0 ) {
96
- cursor.insertText (line.left (index).trimmed ());
97
- cursor.movePosition (QTextCursor::NextCell);
98
- cursor.insertText (line.mid (index).trimmed ());
99
- continue ;
100
- }
101
- }
102
- cursor.movePosition (QTextCursor::NextCell, QTextCursor::KeepAnchor);
103
- table->mergeCells (cursor);
104
- cursor.insertText (line.trimmed (), bold);
105
- }
106
-
107
- table->appendRows (6 );
108
- cursor.movePosition (QTextCursor::NextRow);
109
- cursor.insertText (tr (" UI options" ) + " :" , bold);
110
- cursor.movePosition (QTextCursor::NextRow);
111
- if (GetBoolArg (" -help-debug" , false )) {
112
- cursor.insertText (" -allowselfsignedrootcertificates" );
113
- cursor.movePosition (QTextCursor::NextCell);
114
- cursor.insertText (tr (" Allow self signed root certificates (default: 0)" ));
115
- cursor.movePosition (QTextCursor::NextCell);
116
105
}
117
- cursor.insertText (" -choosedatadir" );
118
- cursor.movePosition (QTextCursor::NextCell);
119
- cursor.insertText (tr (" Choose data directory on startup (default: 0)" ));
120
- cursor.movePosition (QTextCursor::NextCell);
121
- cursor.insertText (" -lang=<lang>" );
122
- cursor.movePosition (QTextCursor::NextCell);
123
- cursor.insertText (tr (" Set language, for example \" de_DE\" (default: system locale)" ));
124
- cursor.movePosition (QTextCursor::NextCell);
125
- cursor.insertText (" -min" );
126
- cursor.movePosition (QTextCursor::NextCell);
127
- cursor.insertText (tr (" Start minimized" ));
128
- cursor.movePosition (QTextCursor::NextCell);
129
- cursor.insertText (" -rootcertificates=<file>" );
130
- cursor.movePosition (QTextCursor::NextCell);
131
- cursor.insertText (tr (" Set SSL root certificates for payment request (default: -system-)" ));
132
- cursor.movePosition (QTextCursor::NextCell);
133
- cursor.insertText (" -splash" );
134
- cursor.movePosition (QTextCursor::NextCell);
135
- cursor.insertText (tr (" Show splash screen on startup (default: 1)" ));
136
106
137
107
ui->helpMessage ->moveCursor (QTextCursor::Start);
138
108
ui->scrollArea ->setVisible (false );
0 commit comments