diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-05 19:59:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 19:59:19 (GMT) |
commit | 1d8ce1a94fe9ad665ca0ef73ec88a3c5726cfec5 (patch) | |
tree | 8103698e5cb43963ba6655b7c6993a04701fc342 | |
parent | 7343874ae210ae1e1ab9c39b700159222872f48e (diff) | |
parent | 6deb25ba0cb0286f879071d0aaa069c1776fe06f (diff) | |
download | Doxygen-1d8ce1a94fe9ad665ca0ef73ec88a3c5726cfec5.zip Doxygen-1d8ce1a94fe9ad665ca0ef73ec88a3c5726cfec5.tar.gz Doxygen-1d8ce1a94fe9ad665ca0ef73ec88a3c5726cfec5.tar.bz2 |
Merge pull request #8154 from albert-github/feature/bug_doxyw_menu_handling
Handling Enable / Disable menu items (doxywizard)
-rwxr-xr-x | addon/doxywizard/doxywizard.cpp | 15 | ||||
-rwxr-xr-x | addon/doxywizard/doxywizard.h | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index fe8e60c..dc54d09 100755 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -69,11 +69,11 @@ MainWindow::MainWindow() this, SLOT(quit()), Qt::CTRL+Qt::Key_Q); QMenu *settings = menuBar()->addMenu(tr("Settings")); - settings->addAction(tr("Reset to factory defaults"), + m_resetDefault = settings->addAction(tr("Reset to factory defaults"), this,SLOT(resetToDefaults())); settings->addAction(tr("Use current settings at startup"), this,SLOT(makeDefaults())); - settings->addAction(tr("Clear recent list"), + m_clearRecent = settings->addAction(tr("Clear recent list"), this,SLOT(clearRecent())); QMenu *help = menuBar()->addMenu(tr("Help")); @@ -379,6 +379,8 @@ void MainWindow::clearRecent() { m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i++),QString::fromLatin1("")); } + m_clearRecent->setEnabled(false); + m_recentMenu->setEnabled(false); m_settings.sync(); } @@ -396,6 +398,8 @@ void MainWindow::resetToDefaults() m_expert->resetToDefaults(); m_settings.setValue(QString::fromLatin1("wizard/loadsettings"), false); m_settings.sync(); + m_modified = false; + updateTitle(); m_wizard->refresh(); } } @@ -474,6 +478,9 @@ void MainWindow::addRecentFileList(const QString &fileName) m_recentFiles.removeLast(); m_recentFiles.prepend(fileName); } + m_clearRecent->setEnabled(m_recentFiles.count()>0); + m_recentMenu->setEnabled(m_recentFiles.count()>0); + m_settings.sync(); } void MainWindow::updateRecentFile(void) { @@ -488,6 +495,9 @@ void MainWindow::updateRecentFile(void) { m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i),QString::fromLatin1("")); } + m_clearRecent->setEnabled(m_recentFiles.count()>0); + m_recentMenu->setEnabled(m_recentFiles.count()>0); + m_settings.sync(); } void MainWindow::openRecent(QAction *action) @@ -685,6 +695,7 @@ void MainWindow::configChanged() void MainWindow::updateTitle() { QString title = tr("Doxygen GUI frontend"); + m_resetDefault->setEnabled(m_modified); if (m_modified) { title+=QString::fromLatin1(" +"); diff --git a/addon/doxywizard/doxywizard.h b/addon/doxywizard/doxywizard.h index 3fc2b65..48dc5d3 100755 --- a/addon/doxywizard/doxywizard.h +++ b/addon/doxywizard/doxywizard.h @@ -94,6 +94,8 @@ class MainWindow : public QMainWindow QSettings m_settings; QMenu *m_recentMenu; QStringList m_recentFiles; + QAction *m_resetDefault; + QAction *m_clearRecent; QProcess *m_runProcess; QTimer *m_timer; QTabWidget *m_tabs; |