1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
Index: qtiplot-0.9.7.4/qtiplot/src/scripting/ScriptEdit.cpp
===================================================================
--- qtiplot-0.9.7.4.orig/qtiplot/src/scripting/ScriptEdit.cpp
+++ qtiplot-0.9.7.4/qtiplot/src/scripting/ScriptEdit.cpp
@@ -28,7 +28,11 @@
***************************************************************************/
#include "ScriptEdit.h"
#include "Note.h"
+
+#ifdef SCRIPTING_PYTHON
#include "PythonSyntaxHighlighter.h"
+#endif
+
#include "FindReplaceDialog.h"
#include <QAction>
@@ -58,9 +62,11 @@ ScriptEdit::ScriptEdit(ScriptingEnv *env
setTextFormat(Qt::PlainText);
setAcceptRichText (false);
+#ifdef SCRIPTING_PYTHON
if (scriptEnv->name() == QString("Python"))
d_highlighter = new PythonSyntaxHighlighter(this);
-
+#endif
+
d_fmt_default.setBackground(palette().brush(QPalette::Base));
d_fmt_failure.setBackground(QBrush(QColor(255,128,128)));
@@ -142,6 +148,7 @@ void ScriptEdit::customEvent(QEvent *e)
connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&)));
connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&)));
+#ifdef SCRIPTING_PYTHON
if (scriptEnv->name() == QString("Python") && !d_highlighter)
d_highlighter = new PythonSyntaxHighlighter(this);
else {
@@ -149,6 +156,7 @@ void ScriptEdit::customEvent(QEvent *e)
delete d_highlighter;
d_highlighter = 0;
}
+#endif
}
}
@@ -585,13 +593,16 @@ void ScriptEdit::setDirPath(const QStrin
void ScriptEdit::rehighlight()
{
+#ifdef SCRIPTING_PYTHON
if (scriptEnv->name() != QString("Python"))
return;
-
+#endif
if (d_highlighter)
delete d_highlighter;
+#ifdef SCRIPTING_PYTHON
d_highlighter = new PythonSyntaxHighlighter(this);
+#endif
}
void ScriptEdit::showFindDialog(bool replace)
|