summaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
Diffstat (limited to 'addon')
-rw-r--r--addon/doxywizard/config_doxyw.l3
-rwxr-xr-xaddon/doxywizard/doxywizard.cpp19
-rwxr-xr-xaddon/doxywizard/doxywizard.h2
-rw-r--r--addon/doxywizard/inputstrlist.cpp65
4 files changed, 74 insertions, 15 deletions
diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l
index ccebfc4..71d48c9 100644
--- a/addon/doxywizard/config_doxyw.l
+++ b/addon/doxywizard/config_doxyw.l
@@ -483,6 +483,9 @@ static void readIncludeFile(const QString &incName)
}
BEGIN(g_lastState);
}
+<GetQuotedString>("\\\\"|"@\\"|"\\@"|"@@") {
+ g_tmpString+=yytext;
+ }
<GetQuotedString>"\\\"" {
g_tmpString+='"';
}
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp
index 5b0becc..a06459c 100755
--- a/addon/doxywizard/doxywizard.cpp
+++ b/addon/doxywizard/doxywizard.cpp
@@ -72,11 +72,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"));
@@ -226,6 +226,10 @@ void MainWindow::quit()
{
saveSettings();
}
+ else
+ {
+ return;
+ }
QApplication::exit(0);
}
@@ -378,6 +382,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();
}
@@ -395,6 +401,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();
}
}
@@ -473,6 +481,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)
{
@@ -487,6 +498,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)
@@ -684,6 +698,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 5e9254c..ff587aa 100755
--- a/addon/doxywizard/doxywizard.h
+++ b/addon/doxywizard/doxywizard.h
@@ -98,6 +98,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;
diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp
index 814104b..f92f3fe 100644
--- a/addon/doxywizard/inputstrlist.cpp
+++ b/addon/doxywizard/inputstrlist.cpp
@@ -3,8 +3,8 @@
* Copyright (C) 1997-2019 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -25,7 +25,7 @@
#include <QTextCodec>
InputStrList::InputStrList( QGridLayout *layout,int &row,
- const QString & id,
+ const QString & id,
const QStringList &sl, ListMode lm,
const QString & docs)
: m_default(sl), m_strList(sl), m_docs(docs), m_id(id)
@@ -50,7 +50,7 @@ InputStrList::InputStrList( QGridLayout *layout,int &row,
m_lb = new QListWidget;
//m_lb->setMinimumSize(400,100);
foreach (QString s, m_strList) m_lb->addItem(s);
-
+
m_brFile=0;
m_brDir=0;
if (lm!=ListString)
@@ -60,7 +60,7 @@ InputStrList::InputStrList( QGridLayout *layout,int &row,
m_brFile = toolBar->addAction(QIcon(QString::fromLatin1(":/images/file.png")),QString(),
this,SLOT(browseFiles()));
m_brFile->setToolTip(tr("Browse to a file"));
- }
+ }
if (lm&ListDir)
{
m_brDir = toolBar->addAction(QIcon(QString::fromLatin1(":/images/folder.png")),QString(),
@@ -78,9 +78,9 @@ InputStrList::InputStrList( QGridLayout *layout,int &row,
m_value = m_strList;
- connect(m_le, SIGNAL(returnPressed()),
+ connect(m_le, SIGNAL(returnPressed()),
this, SLOT(addString()) );
- connect(m_lb, SIGNAL(currentTextChanged(const QString &)),
+ connect(m_lb, SIGNAL(currentTextChanged(const QString &)),
this, SLOT(selectText(const QString &)));
connect( m_lab, SIGNAL(enter()), SLOT(help()) );
connect( m_lab, SIGNAL(reset()), SLOT(reset()) );
@@ -154,7 +154,7 @@ void InputStrList::browseFiles()
QString path = QFileInfo(MainWindow::instance().configFileName()).path();
QStringList fileNames = QFileDialog::getOpenFileNames();
- if (!fileNames.isEmpty())
+ if (!fileNames.isEmpty())
{
QStringList::Iterator it;
for ( it= fileNames.begin(); it != fileNames.end(); ++it )
@@ -184,7 +184,7 @@ void InputStrList::browseDir()
QString path = QFileInfo(MainWindow::instance().configFileName()).path();
QString dirName = QFileDialog::getExistingDirectory();
- if (!dirName.isNull())
+ if (!dirName.isNull())
{
QDir dir(path);
if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
@@ -228,7 +228,7 @@ void InputStrList::update()
void InputStrList::updateDefault()
{
- if (m_strList==m_default || !m_lab->isEnabled())
+ if (isDefault() || !m_lab->isEnabled())
{
m_lab->setText(QString::fromLatin1("<qt>")+m_id+QString::fromLatin1("</qt"));
}
@@ -246,9 +246,9 @@ void InputStrList::reset()
void InputStrList::writeValue(QTextStream &t,QTextCodec *codec)
{
bool first=true;
- foreach (QString s, m_strList)
+ foreach (QString s, m_strList)
{
- if (!first)
+ if (!first)
{
t << " \\" << endl;
t << " ";
@@ -258,9 +258,48 @@ void InputStrList::writeValue(QTextStream &t,QTextCodec *codec)
}
}
+#include <QMessageBox>
bool InputStrList::isDefault()
{
- return m_strList==m_default;
+ bool isEq = m_strList==m_default;
+
+ if (!isEq)
+ {
+ isEq = true;
+
+ auto it1 = m_strList.begin();
+ auto it2 = m_default.begin();
+ while (it1!=m_strList.end() && it2!=m_default.end())
+ {
+ // skip over empty values
+ while (it1!=m_strList.end() && (*it1).isEmpty())
+ {
+ ++it1;
+ }
+ while (it2!=m_default.end() && (*it2).isEmpty())
+ {
+ ++it2;
+ }
+ if ((it1!=m_strList.end()) && (it2!=m_default.end()))
+ {
+ if ((*it1).trimmed()!= (*it2).trimmed()) // difference so not the default
+ {
+ isEq=false;
+ break;
+ }
+ ++it1;
+ ++it2;
+ }
+ else if ((it1!=m_strList.end()) || (it2!=m_default.end()))
+ {
+ // one list empty so cannot be the default
+ isEq=false;
+ break;
+ }
+ }
+ }
+
+ return isEq;
}
bool InputStrList::isEmpty()