Skip to content

Commit 566de44

Browse files
committed
Dump translated help of the settings to file
Dump translated help of the settings to file as used in the help windows of the doxywizard (bottom left)
1 parent 0972710 commit 566de44

4 files changed

Lines changed: 56 additions & 1 deletion

File tree

addon/doxywizard/doxywizard.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,11 @@ void MainWindow::showSettings()
815815
m_saveLog->setEnabled(true);
816816
}
817817

818+
void MainWindow::dump()
819+
{
820+
m_expert->dump();
821+
}
822+
818823
void MainWindow::configChanged()
819824
{
820825
m_modified = true;
@@ -895,7 +900,7 @@ static void usage(const char *exeName, const QString txt)
895900
{
896901
QMessageBox msgBox;
897902
QString fullText = txt;
898-
fullText += QString::fromLatin1("Usage: %1 [--debug] [--language [lang]] [config file]\n").arg(QString::fromLatin1(exeName));
903+
fullText += QString::fromLatin1("Usage: %1 [--debug] [--dump] [--language [lang]] [config file]\n").arg(QString::fromLatin1(exeName));
899904
fullText += QString::fromLatin1("Usage: %1 --help\n").arg(QString::fromLatin1(exeName));
900905
fullText += QString::fromLatin1("Usage: %1 --version\n").arg(QString::fromLatin1(exeName));
901906
msgBox.setText(fullText);
@@ -919,6 +924,7 @@ int main(int argc,char **argv)
919924

920925
int optInd=1;
921926
bool langSet = false;
927+
bool dumpFlag = false;
922928
QString langSel;
923929
while (optInd<argc && argv[optInd][0]=='-' && argv[optInd][1]=='-')
924930
{
@@ -947,6 +953,10 @@ int main(int argc,char **argv)
947953
msgBox.exec();
948954
exit(0);
949955
}
956+
else if (!qstrcmp(argv[optInd],"--dump"))
957+
{
958+
dumpFlag = true;
959+
}
950960
else if (!qstrcmp(argv[optInd],"--debug"))
951961
{
952962
DoxygenWizard::debugFlag = true;
@@ -1015,6 +1025,10 @@ int main(int argc,char **argv)
10151025
{
10161026
main.loadConfigFromFile(QString::fromLocal8Bit(argv[argc-1]));
10171027
}
1028+
if (dumpFlag)
1029+
{
1030+
main.dump();
1031+
}
10181032
main.show();
10191033
return a.exec();
10201034
}

addon/doxywizard/doxywizard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class MainWindow : public QMainWindow
4545
void outputLogStart();
4646
void outputLogText(QString text);
4747
void outputLogFinish();
48+
void dump();
4849
void setLanguage(const QString &langCode)
4950
{
5051
m_settings.setValue(QString::fromLatin1("language/code"), langCode);

addon/doxywizard/expert.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,3 +1165,42 @@ void Expert::refresh()
11651165
m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(0));
11661166
}
11671167

1168+
bool compareFunction (QString a, QString b) {return a<b;}
1169+
1170+
void Expert::dump()
1171+
{
1172+
QFile fileOut(SA("dump_%1.txt").arg(DoxygenWizard::langCode));
1173+
if (fileOut.open(QFile::WriteOnly|QFile::Text))
1174+
{
1175+
QTextStream out(&fileOut);
1176+
out.setCodec("UTF-8");
1177+
QHashIterator<QString, Input*> i(m_options);
1178+
std::vector<QString> v;
1179+
while (i.hasNext())
1180+
{
1181+
i.next();
1182+
if (!i.value())
1183+
{
1184+
// no value present, like for not compiled in settings (CLANG_...)
1185+
}
1186+
else if (i.value()->docs().isEmpty())
1187+
{
1188+
// no documentation present, like for Obsolete items
1189+
}
1190+
else
1191+
{
1192+
v.push_back(i.key());
1193+
}
1194+
}
1195+
std::sort(v.begin(),v.end(),compareFunction);
1196+
for (const auto & n : v)
1197+
{
1198+
out << n << ": " << m_options[n]->docs() << endl;
1199+
out << SA("=================================") << endl;
1200+
}
1201+
1202+
fileOut.flush();
1203+
fileOut.close();
1204+
}
1205+
}
1206+

addon/doxywizard/expert.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Expert : public QSplitter, public DocIntf
4646
bool htmlOutputPresent(const QString &workingDir) const;
4747
bool pdfOutputPresent(const QString &workingDir) const;
4848
QString getHtmlOutputIndex(const QString &workingDir) const;
49+
void dump();
4950

5051
// DocIntf methods
5152
void setHeader(const char *name);

0 commit comments

Comments
 (0)