#include "dccontent.h"
#include "dcglvisualizerwidget.h"
#include "dctreeviewwidget.h"
+#include "dccellcodescripttreeviewwidget.h"
#include "TKConsole.h"
#include "utils/dcresources.h"
#include "utils/dcskeltoncreatorutil.h"
#if defined(Q_WS_WIN)
const QString DENNCO_ENGINE = "QtDennco.exe";
#elif defined(Q_WS_MAC)
- const QString DENNCO_ENGINE = "QtDennco";
+ const QString DENNCO_ENGINE = "QtDennco.app";
#elif defined(Q_OS_UNIX)
const QString DENNCO_ENGINE = "./QtDennco";
#endif
d_treeViewWidget = new DCTreeViewWidget(this, d_creator);
ui->treeViewDock->layout()->addWidget(d_treeViewWidget);
+ d_cellCodeScriptTreeViewWidget = new DCCellCodeScriptTreeViewWidget(this, d_creator);
+ ui->cellCodeScriptTreeViewDock->layout()->addWidget(d_cellCodeScriptTreeViewWidget);
+
DCCellScriptsEditorWindow::construct(d_creator);
setCurrentContent("");
setUnifiedTitleAndToolBarOnMac(true);
+
+ tabifyDockWidget(ui->dock2,ui->dock1);
}
MainWindow::~MainWindow()
{
if (d_contentOpenHistory.length() > idx)
{
- loadContent(d_contentOpenHistory.at(idx));
+ loadContent(QString(d_contentOpenHistory.at(idx)));
return true;
}
}
if (d_player.state() == QProcess::NotRunning)
{
QStringList args;
+#ifdef Q_WS_MAC
+ args << QCoreApplication::applicationDirPath() + "/../../../" + DENNCO_ENGINE;
+ args << "--args";
+#endif
args << "-creatorControlled";
args << d_IPCServerName;
+#ifdef Q_WS_MAC
+ d_player.start("open" , args);
+#else
d_player.start(DENNCO_ENGINE, args);
+#endif
d_player.waitForStarted();
}
DCManageCellCodeDialog dialog(d_creator, NULL, this);
dialog.exec();
}
+
+
+//static
+bool MainWindow::openExternalEditorFor(const QString &path)
+{
+ static QList<QProcess*> s_processes;
+ static QMutex s_mutex;
+
+ QMutexLocker locker(&s_mutex);
+
+ QString editorPath = readSettingsForExternalScriptEditorPath();
+ if (editorPath.isEmpty() || editorPath.length() == 0)
+ {
+ DCCodeEditorExternalEditorSettingDialog dialog;
+ dialog.exec();
+ editorPath = readSettingsForExternalScriptEditorPath();
+ }
+ if (editorPath.isEmpty() || editorPath.length() == 0)
+ return false;
+
+ QString parameterOrg = readSettingsForExternalScriptEditorParameters();
+ QString parameter = "";
+ int i = 0;
+ int j = parameterOrg.indexOf(QRegExp("%F[ \t\"']|%F$"),i);
+ while (j >= 0)
+ {
+ parameter += parameterOrg.mid(i, j-i);
+ parameter += path;
+ i = j + 2;
+ if (i > parameterOrg.length())
+ break;
+ j = parameterOrg.indexOf(QRegExp("%F[ \t\"']|%F$"),i);
+ }
+ if (i < parameterOrg.length())
+ parameter += parameterOrg.mid(i);
+
+ QList<QProcess*>::iterator it = s_processes.begin();
+ while (it != s_processes.end())
+ {
+ if ((*it)->state() != QProcess::Running)
+ {
+ delete (*it);
+ it = s_processes.erase(it);
+ }
+ else
+ ++it;
+ }
+ QProcess *newProcess = new QProcess;
+ newProcess->start("\"" + editorPath + "\" " + parameter);
+
+ s_processes.append(newProcess);
+
+ return true;
+}