Skip to content

Commit ee0fa47

Browse files
committed
Possibility to blend out documentation in doxywizard
Create the possibility to blend out the documentation in the righthand panel of the doxywizard so it is clearer where the different settings are.
1 parent 35a3576 commit ee0fa47

12 files changed

Lines changed: 73 additions & 0 deletions

addon/doxywizard/doxywizard.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
// globally accessible variables
5353
bool DoxygenWizard::debugFlag = false;
54+
bool DoxygenWizard::hideDocumentation = false;
5455
QString DoxygenWizard::langCode;
5556
static QList<QString> newArgs;
5657

@@ -148,6 +149,10 @@ MainWindow::MainWindow()
148149
this,SLOT(resetToDefaults()));
149150
settings->addAction(tr("Use current settings at startup"),
150151
this,SLOT(makeDefaults()));
152+
m_hideDocumentation = settings->addAction(tr("Hide documentation"),
153+
this,SLOT(hideDocumentation()));
154+
m_hideDocumentation->setCheckable(true);
155+
m_hideDocumentation->setChecked(DoxygenWizard::hideDocumentation);
151156
settings->addAction(tr("Switch language..."),
152157
this,SLOT(switchLanguage()));
153158
m_clearRecent = settings->addAction(tr("Clear recent list"),
@@ -456,6 +461,15 @@ void MainWindow::makeDefaults()
456461
}
457462
}
458463

464+
void MainWindow::hideDocumentation()
465+
{
466+
// New state
467+
DoxygenWizard::hideDocumentation = m_hideDocumentation->isChecked();
468+
m_settings.setValue(QString::fromLatin1("documentation/hide"), DoxygenWizard::hideDocumentation);
469+
m_settings.sync();
470+
m_expert-> hideDocumentation();
471+
}
472+
459473
void MainWindow::switchLanguage()
460474
{
461475
LanguageDialog languageDialog(DoxygenWizard::langCode,this);
@@ -1041,6 +1055,9 @@ int main(int argc,char **argv)
10411055
{
10421056
qDebug() << "Starting doxywizard...";
10431057

1058+
QSettings settings(QString::fromLatin1("Doxygen.org"), QString::fromLatin1("Doxywizard"));
1059+
DoxygenWizard::hideDocumentation = settings.value(QString::fromLatin1("documentation/hide")).toBool();
1060+
10441061
if (langSet)
10451062
{
10461063
DoxygenWizard::langCode = langSel;

addon/doxywizard/doxywizard.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class MainWindow : public QMainWindow
6464
void selectTab(int);
6565
void quit();
6666
void switchLanguage();
67+
void hideDocumentation();
6768

6869
private slots:
6970
void openRecent(QAction *action);
@@ -106,6 +107,7 @@ class MainWindow : public QMainWindow
106107
QWidget *m_runTab;
107108
QString m_fileName;
108109
QSettings m_settings;
110+
QAction *m_hideDocumentation;
109111
QMenu *m_recentMenu;
110112
QStringList m_recentFiles;
111113
QAction *m_resetDefault;
@@ -121,6 +123,7 @@ class MainWindow : public QMainWindow
121123
namespace DoxygenWizard
122124
{
123125
extern bool debugFlag;
126+
extern bool hideDocumentation;
124127
extern QString langCode;
125128
QString msgFileNotFound(const QString &fileName);
126129
QString msgNoPreviewAvailable(const QString &fileName);

addon/doxywizard/expert.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ void Expert::createOptionCard(GroupEntry &group, const QDomElement &child)
570570
entry.docs = docs;
571571
entry.card = container;
572572
entry.docsLabel = docsLabel;
573+
entry.sep = sep;
573574
entry.treeItem = optTreeItem;
574575
entry.input = input;
575576
group.options.append(entry);
@@ -642,6 +643,23 @@ void Expert::ensureGroupCardsCreated(GroupEntry &group)
642643
}
643644
}
644645
}
646+
void Expert::hideDocumentation()
647+
{
648+
for (GroupEntry &group : m_groups)
649+
{
650+
for (const OptionEntry &opt : group.options)
651+
{
652+
if (opt.sep)
653+
{
654+
opt.sep->setHidden(DoxygenWizard::hideDocumentation);
655+
}
656+
if (opt.docsLabel)
657+
{
658+
opt.docsLabel->setHidden(DoxygenWizard::hideDocumentation);
659+
}
660+
}
661+
}
662+
}
645663

646664
// Create cards for every group that hasn't been created yet, then do a full
647665
// dependency update (needed when cross-group deps span newly-created groups).
@@ -651,6 +669,7 @@ void Expert::ensureAllGroupsCreated()
651669
{
652670
ensureGroupCardsCreated(group);
653671
}
672+
hideDocumentation();
654673

655674
// Re-run update so cross-group dependencies are fully applied
656675
QHashIterator<QString,Input*> i(m_options);

addon/doxywizard/expert.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class Expert : public QWidget, public DocIntf
6161

6262
public slots:
6363
void refresh();
64+
void hideDocumentation();
6465

6566
private slots:
6667
void filterChanged(const QString &text);
@@ -81,6 +82,7 @@ class Expert : public QWidget, public DocIntf
8182
QString docs;
8283
QWidget *card; ///< card widget (docs label + control holder)
8384
QLabel *docsLabel; ///< docs label inside the card
85+
QFrame *sep; ///< separator settings inside the card
8486
QTreeWidgetItem *treeItem; ///< child item in the left tree (nullptr when showAll)
8587
Input *input; ///< the Input object
8688
bool labelHighlighted = false; ///< true when docsLabel shows highlighted text

addon/doxywizard/i18n/doxywizard_de.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ Angegebener Grund: %2</translation>
359359
<source>Language changed to: %1</source>
360360
<translation>Sprache geändert zu: %1</translation>
361361
</message>
362+
<message>
363+
<source>Hide documentation</source>
364+
<translation>Dokumentation ausblenden</translation>
365+
</message>
362366
<message>
363367
<source>Switch language...</source>
364368
<translation>Sprache wechseln...</translation>

addon/doxywizard/i18n/doxywizard_es.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ Razón dada: %2</translation>
359359
<source>Doxygen GUI frontend</source>
360360
<translation>Interfaz gráfica de Doxygen</translation>
361361
</message>
362+
<message>
363+
<source>Hide documentation</source>
364+
<translation>Ocultar documentación</translation>
365+
</message>
362366
<message>
363367
<source>Switch language...</source>
364368
<translation>Cambiar idioma...</translation>

addon/doxywizard/i18n/doxywizard_fr.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ Raison donnée : %2</translation>
359359
<source>Language changed to: %1</source>
360360
<translation>Langue changée en : %1</translation>
361361
</message>
362+
<message>
363+
<source>Hide documentation</source>
364+
<translation>Masquer la documentation</translation>
365+
</message>
362366
<message>
363367
<source>Switch language...</source>
364368
<translation>Changer de langue...</translation>

addon/doxywizard/i18n/doxywizard_ja.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ Reason given: %2</source>
359359
<source>Doxygen GUI frontend</source>
360360
<translation>Doxygen GUIフロントエンド</translation>
361361
</message>
362+
<message>
363+
<source>Hide documentation</source>
364+
<translation>ドキュメントを非表示にする</translation>
365+
</message>
362366
<message>
363367
<source>Switch language...</source>
364368
<translation>言語を切り替える...</translation>

addon/doxywizard/i18n/doxywizard_ko.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ Reason given: %2</source>
359359
<source>Doxygen GUI frontend</source>
360360
<translation>Doxygen GUI 프론트엔드</translation>
361361
</message>
362+
<message>
363+
<source>Hide documentation</source>
364+
<translation>문서 숨기기</translation>
365+
</message>
362366
<message>
363367
<source>Switch language...</source>
364368
<translation>언어 전환...</translation>

addon/doxywizard/i18n/doxywizard_ru.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ Reason given: %2</source>
359359
<source>Doxygen GUI frontend</source>
360360
<translation>Графический интерфейс Doxygen</translation>
361361
</message>
362+
<message>
363+
<source>Hide documentation</source>
364+
<translation>Скрыть документацию</translation>
365+
</message>
362366
<message>
363367
<source>Switch language...</source>
364368
<translation>Сменить язык...</translation>

0 commit comments

Comments
 (0)