summaryrefslogtreecommitdiffstats
path: root/addon/doxywizard/doxywizard.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2005-01-11 19:39:24 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2005-01-11 19:39:24 (GMT)
commit13feb604f3aa783f927ed47df8e4c561a8d8032a (patch)
tree54c695c7de59dfcbeb32cf134b82f5e4d0eeb460 /addon/doxywizard/doxywizard.cpp
parent8dc1328efbd82110ca3def379951286b09fddd15 (diff)
downloadDoxygen-13feb604f3aa783f927ed47df8e4c561a8d8032a.zip
Doxygen-13feb604f3aa783f927ed47df8e4c561a8d8032a.tar.gz
Doxygen-13feb604f3aa783f927ed47df8e4c561a8d8032a.tar.bz2
Release-1.4.1
Diffstat (limited to 'addon/doxywizard/doxywizard.cpp')
-rw-r--r--addon/doxywizard/doxywizard.cpp57
1 files changed, 40 insertions, 17 deletions
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp
index 97ff827..83ae3b6 100644
--- a/addon/doxywizard/doxywizard.cpp
+++ b/addon/doxywizard/doxywizard.cpp
@@ -32,7 +32,6 @@
#include "expert.h"
#include "config.h"
-
const int messageTimeout = 5000; //!< status bar message timeout in millisec.
#if defined(Q_OS_MACX)
@@ -46,6 +45,34 @@ QCString getResourcePath()
result+="/Contents/Resources/";
return result;
}
+
+#define GRAPHVIZ_PATH "/Applications/Graphviz.app"
+#define DOT_PATH GRAPHVIZ_PATH "/Contents/MacOS"
+#define DOT_LOCATION DOT_PATH "/dot"
+
+bool checkIfDotInstalled()
+{
+ QFileInfo fi(GRAPHVIZ_PATH);
+ if (fi.exists() && fi.isDir())
+ {
+ fi.setFile(DOT_LOCATION);
+ if (fi.exists() && fi.isFile())
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void setDotPath()
+{
+ if (checkIfDotInstalled())
+ {
+ Config_getString("DOT_PATH")=DOT_PATH;
+ Config_getBool("HAVE_DOT")=TRUE;
+ }
+}
+
#endif
@@ -651,10 +678,7 @@ MainWidget::MainWidget(QWidget *parent)
Config::instance()->init();
Config::instance()->check();
#if defined(Q_OS_MACX)
- // we bundle dot with doxywizard on the Mac so we can safely enable
- // it here
- Config_getString("DOT_PATH")=getResourcePath();
- Config_getBool("HAVE_DOT")=TRUE;
+ setDotPath();
#endif
QWidget *w = new QWidget(this);
@@ -1079,7 +1103,10 @@ void MainWidget::launchWizard()
break;
}
#if defined(Q_OS_MACX)
- Config_getString("DOT_PATH")=getResourcePath();
+ if (Config_getBool("HAVE_DOT"))
+ {
+ setDotPath();
+ }
#endif
setConfigSaved(FALSE);
}
@@ -1098,9 +1125,11 @@ void MainWidget::loadConfigFromFile(const QString &fn)
{
Config::instance()->convertStrToVal();
#if defined(Q_OS_MACX)
- if (Config_getString("DOT_PATH")!=getResourcePath())
+ if (checkIfDotInstalled() &&
+ qstricmp(Config_getString("DOT_PATH"),DOT_PATH)!=0
+ )
{
- Config_getString("DOT_PATH")=getResourcePath();
+ Config_getString("DOT_PATH")=DOT_PATH;
setConfigSaved(FALSE);
}
else
@@ -1134,12 +1163,9 @@ void MainWidget::launchExpert()
expert.init();
expert.exec();
#if defined(Q_OS_MACX)
- // we bundle dot with doxywizard on the Mac so we can safely enable
- // it here
- Config_getString("DOT_PATH")=getResourcePath();
- Config_getBool("HAVE_DOT")=TRUE;
+ setDotPath();
#endif
- setConfigSaved(FALSE);
+ if (expert.hasChanged()) setConfigSaved(FALSE);
}
void MainWidget::saveDefaults()
@@ -1191,10 +1217,7 @@ void MainWidget::resetConfig()
// initialize config settings
Config::instance()->init();
#if defined(Q_OS_MACX)
- // we bundle dot with doxywizard on the Mac so we can safely enable
- // it here
- Config_getString("DOT_PATH")=getResourcePath();
- Config_getBool("HAVE_DOT")=TRUE;
+ setDotPath();
#endif
m_configFileName = "";