summaryrefslogtreecommitdiff
path: root/addon/doxywizard
diff options
context:
space:
mode:
Diffstat (limited to 'addon/doxywizard')
-rw-r--r--addon/doxywizard/Makefile.in7
-rw-r--r--addon/doxywizard/config.l2
-rw-r--r--addon/doxywizard/config_doxyw.l2
-rw-r--r--addon/doxywizard/doxywizard.cpp30
-rw-r--r--addon/doxywizard/doxywizard.pro.in20
-rw-r--r--addon/doxywizard/expert.cpp32
-rw-r--r--addon/doxywizard/inputbool.cpp2
-rw-r--r--addon/doxywizard/inputbool.h2
-rw-r--r--addon/doxywizard/inputint.cpp2
-rw-r--r--addon/doxywizard/inputint.h2
-rw-r--r--addon/doxywizard/inputstring.cpp50
-rw-r--r--addon/doxywizard/inputstring.h6
-rw-r--r--addon/doxywizard/inputstrlist.cpp2
-rw-r--r--addon/doxywizard/inputstrlist.h2
-rw-r--r--addon/doxywizard/version.h2
-rw-r--r--addon/doxywizard/wizard.cpp53
-rw-r--r--addon/doxywizard/wizard.h2
17 files changed, 163 insertions, 55 deletions
diff --git a/addon/doxywizard/Makefile.in b/addon/doxywizard/Makefile.in
index 152c2b7..9b14174 100644
--- a/addon/doxywizard/Makefile.in
+++ b/addon/doxywizard/Makefile.in
@@ -1,7 +1,7 @@
#
#
#
-# Copyright (C) 1997-2013 by Dimitri van Heesch.
+# Copyright (C) 1997-2014 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
@@ -29,11 +29,6 @@ distclean: Makefile.doxywizard
$(MAKE) -f Makefile.doxywizard distclean
$(RM) Makefile.doxywizard
-realclean: Makefile.doxywizard
- $(RM) configdoc.cpp
- $(RM) config_doxyw.cpp
- $(MAKE) distclean
-
install:
$(INSTTOOL) -d $(INSTALL)/bin
$(INSTTOOL) -m 755 ../../bin/doxywizard $(INSTALL)/bin
diff --git a/addon/doxywizard/config.l b/addon/doxywizard/config.l
index 48d233e..f11bc46 100644
--- a/addon/doxywizard/config.l
+++ b/addon/doxywizard/config.l
@@ -2,7 +2,7 @@
*
* $Id: config_templ.l,v 1.8 2001/01/01 10:15:16 root Exp $
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l
index 3a26eb6..400330f 100644
--- a/addon/doxywizard/config_doxyw.l
+++ b/addon/doxywizard/config_doxyw.l
@@ -2,7 +2,7 @@
*
* $Id: config_templ.l,v 1.8 2001/01/01 10:15:16 root Exp $
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp
index ce764e0..99310a1 100644
--- a/addon/doxywizard/doxywizard.cpp
+++ b/addon/doxywizard/doxywizard.cpp
@@ -624,20 +624,34 @@ bool MainWindow::discardUnsavedChanges(bool saveOption)
}
//-----------------------------------------------------------------------
-
int main(int argc,char **argv)
{
QApplication a(argc,argv);
- MainWindow &main = MainWindow::instance();
- if (argc==2 && argv[1][0]!='-') // name of config file as an argument
+ if (argc == 2)
{
- main.loadConfigFromFile(QString::fromLocal8Bit(argv[1]));
+ if (!qstrcmp(argv[1],"--help"))
+ {
+ QMessageBox msgBox;
+ msgBox.setText(QString().sprintf("Usage: %s [config file]",argv[0]));
+ msgBox.exec();
+ exit(0);
+ }
}
- else if (argc>1)
+ if (argc > 2)
{
- printf("Usage: %s [config file]\n",argv[0]);
+ QMessageBox msgBox;
+ msgBox.setText(QString().sprintf("Too many arguments specified\n\nUsage: %s [config file]",argv[0]));
+ msgBox.exec();
exit(1);
}
- main.show();
- return a.exec();
+ else
+ {
+ MainWindow &main = MainWindow::instance();
+ if (argc==2 && argv[1][0]!='-') // name of config file as an argument
+ {
+ main.loadConfigFromFile(QString::fromLocal8Bit(argv[1]));
+ }
+ main.show();
+ return a.exec();
+ }
}
diff --git a/addon/doxywizard/doxywizard.pro.in b/addon/doxywizard/doxywizard.pro.in
index 01832df..0c8d049 100644
--- a/addon/doxywizard/doxywizard.pro.in
+++ b/addon/doxywizard/doxywizard.pro.in
@@ -6,12 +6,12 @@ TEMPLATE = app
DESTDIR = ../../bin
TARGET =
DEPENDPATH += .
-INCLUDEPATH += .
+INCLUDEPATH += . ../../generated_src/doxywizard
QT += xml
CONFIG += $extraopts
-OBJECTS_DIR = obj
-MOC_DIR = moc
-RCC_DIR = rcc
+OBJECTS_DIR = ../../objects/doxywizard
+MOC_DIR = ../../moc/doxywizard
+RCC_DIR = ../../rcc/doxywizard
DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
macx-g++ {
@@ -27,13 +27,13 @@ RESOURCES += doxywizard.qrc
INCBUFSIZE=$(PYTHON) ../../src/increasebuffer.py
win32:RC_FILE += doxywizard.rc
-config.target = config_doxyw.cpp
-config.commands = $(LEX) -P$*YY -t $*.l | $(INCBUFSIZE) >$*.cpp
-config.depends = config_doxyw.l ../../src/increasebuffer.py
-configdoc.target = configdoc.cpp
-configdoc.commands = $(PYTHON) ../../src/configgen.py -wiz ../../src/config.xml > configdoc.cpp
+config.target = ../../generated_src/doxywizard/config_doxyw.cpp
+config.commands = $(LEX) -Pconfig_doxywYY -t ../../addon/doxywizard/config_doxyw.l | $(INCBUFSIZE) >../../generated_src/doxywizard/$*.cpp
+config.depends = ../../addon/doxywizard/config_doxyw.l ../../src/increasebuffer.py
+configdoc.target = ../../generated_src/doxywizard/configdoc.cpp
+configdoc.commands = $(PYTHON) ../../src/configgen.py -wiz ../../src/config.xml > ../../generated_src/doxywizard/configdoc.cpp
configdoc.depends = ../../src/config.xml ../../src/configgen.py
-version.target = ../../src/version.cpp
+version.target = ../../generated_src/doxywizard/version.cpp
version.commands = cd ../../src;$(PYTHON) version.py
version.depends = ../../configure
QMAKE_EXTRA_TARGETS += configdoc config version
diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp
index 4c988c9..fe6609e 100644
--- a/addon/doxywizard/expert.cpp
+++ b/addon/doxywizard/expert.cpp
@@ -9,7 +9,7 @@
#include "config.h"
#include "version.h"
#include "configdoc.h"
-#include "../../src/settings.h"
+#include "settings.h"
#define SA(x) QString::fromAscii(x)
@@ -323,6 +323,32 @@ static QString getDocsForNode(const QDomElement &child)
}
}
}
+ else if (child.attribute(SA("format")) == SA("image"))
+ {
+ QString abspath = child.attribute(SA("abspath"));
+ if (defval != SA(""))
+ {
+ docs+=SA("<br/>");
+ if (abspath != SA("1"))
+ {
+ docs += SA(" The default image is: <code>") + defval + SA("</code>.");
+ }
+ else
+ {
+ docs += SA(" The default image (with absolute path) is: <code>") + defval + SA("</code>.");
+ }
+ docs += SA("<br/>");
+ }
+ else
+ {
+ if (abspath == SA("1"))
+ {
+ docs+=SA("<br/>");
+ docs += SA(" The image has to be specified with full path.");
+ docs += SA("<br/>");
+ }
+ }
+ }
else // if (child.attribute(SA("format")) == SA("string"))
{
if (defval != SA(""))
@@ -477,6 +503,10 @@ QWidget *Expert::createTopicWidget(QDomElement &elem)
{
mode = InputString::StringFile;
}
+ else if (format==SA("image"))
+ {
+ mode = InputString::StringImage;
+ }
else // format=="string"
{
mode = InputString::StringFree;
diff --git a/addon/doxywizard/inputbool.cpp b/addon/doxywizard/inputbool.cpp
index 9e28852..be99b0a 100644
--- a/addon/doxywizard/inputbool.cpp
+++ b/addon/doxywizard/inputbool.cpp
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/inputbool.h b/addon/doxywizard/inputbool.h
index 69a6893..03bb76e 100644
--- a/addon/doxywizard/inputbool.h
+++ b/addon/doxywizard/inputbool.h
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/inputint.cpp b/addon/doxywizard/inputint.cpp
index 876a920..e0c426c 100644
--- a/addon/doxywizard/inputint.cpp
+++ b/addon/doxywizard/inputint.cpp
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/inputint.h b/addon/doxywizard/inputint.h
index c4723be..6662865 100644
--- a/addon/doxywizard/inputint.h
+++ b/addon/doxywizard/inputint.h
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/inputstring.cpp b/addon/doxywizard/inputstring.cpp
index 36fe319..ad258f7 100644
--- a/addon/doxywizard/inputstring.cpp
+++ b/addon/doxywizard/inputstring.cpp
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
@@ -44,6 +44,7 @@ InputString::InputString( QGridLayout *layout,int &row,
layout->addWidget( m_com, row, 1, 1, 3, Qt::AlignLeft );
m_le=0;
m_br=0;
+ m_im=0;
row++;
}
else
@@ -51,28 +52,39 @@ InputString::InputString( QGridLayout *layout,int &row,
layout->addWidget( m_lab, row, 0 );
m_le = new QLineEdit;
m_le->setText( s );
+ m_im = 0;
//layout->setColumnMinimumWidth(2,150);
- if (m==StringFile || m==StringDir)
+ if (m==StringFile || m==StringDir || m==StringImage)
{
layout->addWidget( m_le, row, 1 );
m_br = new QToolBar;
m_br->setIconSize(QSize(24,24));
- if (m==StringFile)
+ if (m==StringFile || m==StringImage)
{
QAction *file = m_br->addAction(QIcon(QString::fromAscii(":/images/file.png")),QString(),this,SLOT(browse()));
file->setToolTip(tr("Browse to a file"));
+ layout->addWidget( m_br,row,2 );
+ if (m==StringImage)
+ {
+ m_im = new QLabel;
+ m_im->setMinimumSize(1,55);
+ m_im->setAlignment(Qt::AlignLeft|Qt::AlignTop);
+ row++;
+ layout->addWidget( m_im,row,1 );
+ }
}
else
{
QAction *dir = m_br->addAction(QIcon(QString::fromAscii(":/images/folder.png")),QString(),this,SLOT(browse()));
dir->setToolTip(tr("Browse to a folder"));
+ layout->addWidget( m_br,row,2 );
}
- layout->addWidget( m_br,row,2 );
}
else
{
layout->addWidget( m_le, row, 1, 1, 2 );
m_br=0;
+ m_im=0;
}
m_com=0;
row++;
@@ -119,6 +131,33 @@ void InputString::updateDefault()
{
m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>"));
}
+ if (m_im)
+ {
+ if (m_str.isEmpty())
+ {
+ m_im->setText(tr("No Project logo selected."));
+ }
+ else
+ {
+ QFile Fout(m_str);
+ if(!Fout.exists())
+ {
+ m_im->setText(tr("Sorry, cannot find file(")+m_str+QString::fromAscii(");"));
+ }
+ else
+ {
+ QPixmap pm(m_str);
+ if (!pm.isNull())
+ {
+ m_im->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
+ }
+ else
+ {
+ m_im->setText(tr("Sorry, no preview available (")+m_str+QString::fromAscii(");"));
+ }
+ }
+ }
+ }
if (m_le && m_le->text()!=m_str) m_le->setText( m_str );
emit changed();
}
@@ -128,6 +167,7 @@ void InputString::setEnabled(bool state)
{
m_lab->setEnabled(state);
if (m_le) m_le->setEnabled(state);
+ if (m_im) m_le->setEnabled(state);
if (m_br) m_br->setEnabled(state);
if (m_com) m_com->setEnabled(state);
updateDefault();
@@ -136,7 +176,7 @@ void InputString::setEnabled(bool state)
void InputString::browse()
{
QString path = QFileInfo(MainWindow::instance().configFileName()).path();
- if (m_sm==StringFile)
+ if (m_sm==StringFile || m_sm==StringImage)
{
QString fileName = QFileDialog::getOpenFileName(&MainWindow::instance(),
tr("Select file"),path);
diff --git a/addon/doxywizard/inputstring.h b/addon/doxywizard/inputstring.h
index c904dad..90ea87d 100644
--- a/addon/doxywizard/inputstring.h
+++ b/addon/doxywizard/inputstring.h
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
@@ -35,7 +35,8 @@ class InputString : public QObject, public Input
enum StringMode { StringFree=0,
StringFile=1,
StringDir=2,
- StringFixed=3
+ StringFixed=3,
+ StringImage=4
};
InputString( QGridLayout *layout,int &row,
@@ -77,6 +78,7 @@ class InputString : public QObject, public Input
void updateDefault();
QLabel *m_lab;
QLineEdit *m_le;
+ QLabel *m_im;
QToolBar *m_br;
QComboBox *m_com;
QString m_str;
diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp
index 23c20ff..0a0f01f 100644
--- a/addon/doxywizard/inputstrlist.cpp
+++ b/addon/doxywizard/inputstrlist.cpp
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/inputstrlist.h b/addon/doxywizard/inputstrlist.h
index 352ed5e..0d7efe7 100644
--- a/addon/doxywizard/inputstrlist.h
+++ b/addon/doxywizard/inputstrlist.h
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/version.h b/addon/doxywizard/version.h
index 9d523c1..b31fe4f 100644
--- a/addon/doxywizard/version.h
+++ b/addon/doxywizard/version.h
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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
diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp
index ce989e7..56933e0 100644
--- a/addon/doxywizard/wizard.cpp
+++ b/addon/doxywizard/wizard.cpp
@@ -468,6 +468,7 @@ Step1::Step1(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(w
projVersion->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
// project icon
QLabel *projLogo = new QLabel(this);
+ projLogo->setMinimumSize(1,55);
projLogo->setText(tr("Project logo:"));
projLogo->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
@@ -481,10 +482,7 @@ Step1::Step1(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(w
m_projNumber = new QLineEdit;
QPushButton *projIconSel = new QPushButton(this);
projIconSel->setText(tr("Select..."));
- QPixmap pm(QSize(120,55));
- pm.fill();
m_projIconLab = new QLabel;
- m_projIconLab->setPixmap(pm);
grid->addWidget(m_projName,0,1,1,2);
grid->addWidget(m_projBrief,1,1,1,2);
@@ -567,12 +565,31 @@ void Step1::selectProjectIcon()
QString path = QFileInfo(MainWindow::instance().configFileName()).path();
QString iconName = QFileDialog::getOpenFileName(this,
tr("Select project icon/image"),path);
- QPixmap pm(iconName);
- if (!pm.isNull())
+ if (iconName.isEmpty())
{
- m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
- updateStringOption(m_modelData,STR_PROJECT_LOGO,iconName);
+ m_projIconLab->setText(tr("No Project logo selected."));
}
+ else
+ {
+ QFile Fout(iconName);
+ if(!Fout.exists())
+ {
+ m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromAscii(");"));
+ }
+ else
+ {
+ QPixmap pm(iconName);
+ if (!pm.isNull())
+ {
+ m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
+ }
+ else
+ {
+ m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromAscii(");"));
+ }
+ }
+ }
+ updateStringOption(m_modelData,STR_PROJECT_LOGO,iconName);
}
void Step1::selectSourceDir()
@@ -663,17 +680,27 @@ void Step1::init()
QString iconName = getStringOption(m_modelData,STR_PROJECT_LOGO);
if (!iconName.isEmpty())
{
- QPixmap pm(iconName);
- if (!pm.isNull())
+ QFile Fout(iconName);
+ if(!Fout.exists())
+ {
+ m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromAscii(");"));
+ }
+ else
{
- m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
+ QPixmap pm(iconName);
+ if (!pm.isNull())
+ {
+ m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
+ }
+ else
+ {
+ m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromAscii(");"));
+ }
}
}
else
{
- QPixmap pm(QSize(120,55));
- pm.fill();
- m_projIconLab->setPixmap(pm);
+ m_projIconLab->setText(tr("No Project logo selected."));
}
option = m_modelData[STR_INPUT];
if (option->value().toStringList().count()>0)
diff --git a/addon/doxywizard/wizard.h b/addon/doxywizard/wizard.h
index 877de1d..a18df62 100644
--- a/addon/doxywizard/wizard.h
+++ b/addon/doxywizard/wizard.h
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 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