#include "dccodeeditor.h"
#include "dccell.h"
#include "dccellcode.h"
+#include "mainwindow.h"
+#include "dialog/dccodeeditorexternaleditorsettingdialog.h"
+
+static const char* S_EXTERNAL_EDITOR_BUTTON_LABEL1 = "Use external editor...";
+static const char* S_EXTERNAL_EDITOR_BUTTON_LABEL2 = "Editor script";
DCCellScriptsEditorPageWidget::DCCellScriptsEditorPageWidget(DCCell *targetCell, QWidget *parent) :
- QWidget(parent), d_cell(targetCell), d_modified(false)
+ QWidget(parent), d_cell(targetCell), d_modified(false),
+ d_customScriptExternalMode(false), d_cellCodeScriptExternalMode(false)
{
if (d_cell->getIsCellCodeAssgined())
{
d_customScriptEditor = new DCCodeEditor(this);
d_cellCodeScriptEditor = new DCCodeEditor(this);
- QVBoxLayout *customScriptEditorLayout = new QVBoxLayout;
- customScriptEditorLayout->addWidget(new QLabel(tr("custom script")));
- customScriptEditorLayout->addWidget(d_customScriptEditor);
+ QVBoxLayout *customScriptEditorBaseLayout = new QVBoxLayout;
+ QHBoxLayout *customScriptEditorTopLayout = new QHBoxLayout;
+ customScriptEditorTopLayout->addWidget(new QLabel(tr("custom script")));
+ d_customScriptEditExternalButton = new QPushButton(tr(S_EXTERNAL_EDITOR_BUTTON_LABEL1));
+ customScriptEditorTopLayout->addStretch();
+ customScriptEditorTopLayout->addWidget(d_customScriptEditExternalButton);
+ customScriptEditorBaseLayout->addLayout(customScriptEditorTopLayout);
+ customScriptEditorBaseLayout->addWidget(d_customScriptEditor);
QWidget *customScriptWidget = new QWidget;
- customScriptWidget->setLayout(customScriptEditorLayout);
-
- QVBoxLayout *cellCodeScriptEditorLayout = new QVBoxLayout;
- cellCodeScriptEditorLayout->addWidget(new QLabel(tr("cell code script")));
- cellCodeScriptEditorLayout->addWidget(d_cellCodeScriptEditor);
+ customScriptWidget->setLayout(customScriptEditorBaseLayout);
+
+ QVBoxLayout *cellCodeScriptEditorBaseLayout = new QVBoxLayout;
+ QHBoxLayout *cellCodeScriptEditorTopLayout = new QHBoxLayout;
+ cellCodeScriptEditorTopLayout->addWidget(new QLabel(tr("cell code script")));
+ d_cellCodeScriptEditExternalButton = new QPushButton(tr(S_EXTERNAL_EDITOR_BUTTON_LABEL1));
+ cellCodeScriptEditorTopLayout->addStretch();
+ cellCodeScriptEditorTopLayout->addWidget(d_cellCodeScriptEditExternalButton);
+ cellCodeScriptEditorBaseLayout->addLayout(cellCodeScriptEditorTopLayout);
+ cellCodeScriptEditorBaseLayout->addWidget(d_cellCodeScriptEditor);
QWidget *cellCodeScriptWidget = new QWidget;
- cellCodeScriptWidget->setLayout(cellCodeScriptEditorLayout);
+ cellCodeScriptWidget->setLayout(cellCodeScriptEditorBaseLayout);
d_splitter->addWidget(customScriptWidget);
d_splitter->addWidget(cellCodeScriptWidget);
connect(&d_cellCodeScriptFolder, SIGNAL(modificationStatusChanged(bool)), this, SLOT(folderCellCodeScriptModifiedStatusChanged(bool)));
connect(&d_customScriptFolder, SIGNAL(fileModifiedByExternalEditor(qint64)), this, SLOT(folderCustomScriptFileModifiedByExternalEditor(qint64)));
connect(&d_cellCodeScriptFolder, SIGNAL(fileModifiedByExternalEditor(qint64)), this, SLOT(folderCellCodeScriptFileModifiedByExternalEditor(qint64)));
+ connect(d_customScriptEditExternalButton, SIGNAL(clicked()), this, SLOT(useExternalEditorForCustomScriptPressed()));
+ connect(d_cellCodeScriptEditExternalButton, SIGNAL(clicked()), this, SLOT(useExternalEditorForCellCodeScriptPressed()));
loadScripts();
}
d_cellCodeScriptEditor->disconnect(this);
d_customScriptEditor->setPlainText(d_customScriptFolder.getCurrentScript());
+ d_customScriptEditor->setReadOnly(d_customScriptExternalMode);
if (d_cell->getIsCellCodeAssgined())
{
d_cellCodeScriptEditor->setPlainText(d_cellCodeScriptFolder.getCurrentScript());
- d_cellCodeScriptEditor->setReadOnly(false);
+ d_cellCodeScriptEditor->setReadOnly(d_cellCodeScriptExternalMode);
+ d_cellCodeScriptEditExternalButton->setEnabled(true);
d_cellCodeScriptEditor->document()->setModified(false);
d_splitter->widget(1)->show();
}
{
d_cellCodeScriptEditor->setPlainText("");
d_cellCodeScriptEditor->setReadOnly(true);
+ d_cellCodeScriptEditExternalButton->setEnabled(false);
d_splitter->widget(1)->hide();
}
disconnect(d_cell, 0, this, 0);
}
this->disconnect();
+
+ QList<QProcess*>::iterator it = d_processes.begin();
+ while (it != d_processes.end())
+ {
+ delete (*it);
+ it = d_processes.erase(it);
+ }
}
//slot
d_cellCodeScriptFolder.attach(cellCode);
d_cellCodeScriptEditor->setPlainText(d_cellCodeScriptFolder.getCurrentScript());
d_cellCodeScriptEditor->setReadOnly(false);
+ d_cellCodeScriptEditExternalButton->setEnabled(true);
d_splitter->widget(1)->show();
d_splitter->setStretchFactor(0,1);
d_splitter->setStretchFactor(1,4);
{
d_cellCodeScriptEditor->setPlainText("");
d_cellCodeScriptEditor->setReadOnly(true);
+ d_cellCodeScriptEditExternalButton->setEnabled(false);
d_splitter->widget(1)->hide();
}
emit cellCodeScriptModifiedByExternalEditor(this,notifiedTime);
}
+//slot
+void DCCellScriptsEditorPageWidget::useExternalEditorForCustomScriptPressed()
+{
+ if (d_customScriptExternalMode)
+ {
+ d_customScriptExternalMode = false;
+ d_customScriptEditor->setReadOnly(false);
+ d_customScriptEditExternalButton->setText(tr(S_EXTERNAL_EDITOR_BUTTON_LABEL1));
+ }
+ else
+ {
+ if (openExternalEditor(d_cell->getWorkFilePathForCustomScript()))
+ {
+ saveCustomScriptOnlyToFile(true);
+ d_customScriptExternalMode = true;
+ d_customScriptEditor->setReadOnly(true);
+ d_customScriptEditExternalButton->setText(tr(S_EXTERNAL_EDITOR_BUTTON_LABEL2));
+ }
+ }
+
+}
+
+//slot
+void DCCellScriptsEditorPageWidget::useExternalEditorForCellCodeScriptPressed()
+{
+ if (!d_cell->getIsCellCodeAssgined())
+ return;
+
+ if (d_cellCodeScriptExternalMode)
+ {
+ d_cellCodeScriptExternalMode = false;
+ d_cellCodeScriptEditor->setReadOnly(false);
+ d_cellCodeScriptEditExternalButton->setText(tr(S_EXTERNAL_EDITOR_BUTTON_LABEL1));
+ }
+ else
+ {
+ DCCellCode *cellCode = d_cell->getCellCode();
+ if (openExternalEditor(cellCode->getWorkFilePathForCellCodeScript()))
+ {
+ saveCellCodeScriptOnlyToFile(true);
+ d_cellCodeScriptExternalMode = true;
+ d_cellCodeScriptEditor->setReadOnly(true);
+ d_cellCodeScriptEditExternalButton->setText(tr(S_EXTERNAL_EDITOR_BUTTON_LABEL2));
+ }
+ }
+
+}
+
void DCCellScriptsEditorPageWidget::updateModifiedStatus()
{
bool modified = d_customScriptFolder.getIsModified();
}
}
+bool DCCellScriptsEditorPageWidget::openExternalEditor(const QString& path)
+{
+ QString editorPath = MainWindow::readSettingsForExternalScriptEditorPath();
+ if (editorPath.isEmpty() || editorPath.length() == 0)
+ {
+ DCCodeEditorExternalEditorSettingDialog dialog;
+ dialog.exec();
+ editorPath = MainWindow::readSettingsForExternalScriptEditorPath();
+ }
+ if (editorPath.isEmpty() || editorPath.length() == 0)
+ return false;
+
+ QString parameterOrg = MainWindow::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 = d_processes.begin();
+ while (it != d_processes.end())
+ {
+ if ((*it)->state() != QProcess::Running)
+ {
+ delete (*it);
+ it = d_processes.erase(it);
+ }
+ else
+ ++it;
+ }
+ QProcess *newProcess = new QProcess;
+ newProcess->start("\"" + editorPath + "\" " + parameter);
+
+ d_processes.append(newProcess);
+
+ return true;
+}
+
bool DCCellScriptsEditorPageWidget::getIsModified() const
{
return d_modified;
{
d_customScriptEditor->setReadOnly(readOnly);
d_cellCodeScriptEditor->setReadOnly(readOnly);
+ d_customScriptEditExternalButton->setEnabled(!readOnly);
+ d_cellCodeScriptEditExternalButton->setEnabled(!readOnly);
}
d_cellCodeScriptEditor->setPlainText(d_cellCodeScriptFolder.getCurrentScript(true));
d_cellCodeScriptEditor->setReadOnly(false);
d_cellCodeScriptEditor->document()->setModified(false);
+ d_cellCodeScriptEditExternalButton->setEnabled(true);
d_splitter->widget(1)->show();
}
else
{
d_cellCodeScriptEditor->setPlainText("");
d_cellCodeScriptEditor->setReadOnly(true);
+ d_cellCodeScriptEditExternalButton->setEnabled(false);
d_splitter->widget(1)->hide();
}
#include <QWidget>
#include <QSplitter>
+#include <QPushButton>
+#include <QProcess>
#include "dceditscriptfolder.h"
DCEditScriptFolder d_customScriptFolder;
DCEditScriptFolder d_cellCodeScriptFolder;
+ QPushButton *d_customScriptEditExternalButton;
+ QPushButton *d_cellCodeScriptEditExternalButton;
+ bool d_customScriptExternalMode;
+ bool d_cellCodeScriptExternalMode;
+ QList<QProcess*> d_processes;
+
bool loadCustomScript(bool forceReload = false);
bool loadCellCodeScript(bool forceReload = false);
bool loadScripts();
void updateModifiedStatus();
+ bool openExternalEditor(const QString& path);
public:
DCCellScriptsEditorPageWidget(DCCell *targetCell, QWidget *parent = 0);
bool getIsCellCodeModifiedByExternalEditor() const;
qint64 getCustomScriptLoadedTime() const;
qint64 getCellCodeScriptLoadedTime() const;
+ bool getIsCustomScriptExternalMode() const { return d_customScriptExternalMode; }
+ bool getIsCellCodeScriptExternalMode() const { return d_cellCodeScriptExternalMode; }
void setReadOnly(bool readOnly);
QSet<DCVCPage*> saveScriptsToFile(bool saveModifiedOnly);
void folderCellCodeScriptModifiedStatusChanged(bool modified);
void folderCustomScriptFileModifiedByExternalEditor(qint64 notifiedTime);
void folderCellCodeScriptFileModifiedByExternalEditor(qint64 notifiedTime);
+
+ void useExternalEditorForCustomScriptPressed();
+ void useExternalEditorForCellCodeScriptPressed();
};
#endif // DCCELLCODEEDITORPAGEWIDGET_H
if (currentWidget() == tabPage)
{
DCCellScriptsEditorPageWidget *pageWidget = dynamic_cast<DCCellScriptsEditorPageWidget*>(currentWidget());
-
- {
- QMutexLocker locker(&mutex);
- if (pendingPages.contains(tabPage))
- {
- return;
- }
- pendingPages.append(tabPage);
- }
-
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Cell scripts editor"),
- tr("The custom script has been modified by other editor.\n"
- "Do you want to reload ?"),
- QMessageBox::Yes | QMessageBox::No);
- if (ret == QMessageBox::Yes)
+ if (pageWidget->getIsCustomScriptExternalMode())
{
pageWidget->reloadCustomScript();
}
+ else
{
- QMutexLocker locker(&mutex);
- pendingPages.removeOne(tabPage);
+ {
+ QMutexLocker locker(&mutex);
+ if (pendingPages.contains(tabPage))
+ {
+ return;
+ }
+ pendingPages.append(tabPage);
+ }
+
+ QMessageBox::StandardButton ret;
+ ret = QMessageBox::warning(this, tr("Cell scripts editor"),
+ tr("The custom script has been modified by other editor.\n"
+ "Do you want to reload ?"),
+ QMessageBox::Yes | QMessageBox::No);
+ if (ret == QMessageBox::Yes)
+ {
+ pageWidget->reloadCustomScript();
+ }
+ {
+ QMutexLocker locker(&mutex);
+ pendingPages.removeOne(tabPage);
+ }
}
}
}
if (currentWidget() == tabPage)
{
DCCellScriptsEditorPageWidget *pageWidget = dynamic_cast<DCCellScriptsEditorPageWidget*>(currentWidget());
-
- {
- QMutexLocker locker(&mutex);
- if (pendingPages.contains(tabPage))
- {
- return;
- }
- pendingPages.append(tabPage);
- }
-
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Cell scripts editor"),
- tr("The cell code script has been modified by other editor.\n"
- "Do you want to reload ?"),
- QMessageBox::Yes | QMessageBox::No);
- if (ret == QMessageBox::Yes)
+ if (pageWidget->getIsCellCodeScriptExternalMode())
{
pageWidget->reloadCellCodeScript();
}
+ else
{
- QMutexLocker locker(&mutex);
- pendingPages.removeOne(tabPage);
+ {
+ QMutexLocker locker(&mutex);
+ if (pendingPages.contains(tabPage))
+ {
+ return;
+ }
+ pendingPages.append(tabPage);
+ }
+
+ QMessageBox::StandardButton ret;
+ ret = QMessageBox::warning(this, tr("Cell scripts editor"),
+ tr("The cell code script has been modified by other editor.\n"
+ "Do you want to reload ?"),
+ QMessageBox::Yes | QMessageBox::No);
+ if (ret == QMessageBox::Yes)
+ {
+ pageWidget->reloadCellCodeScript();
+ }
+ {
+ QMutexLocker locker(&mutex);
+ pendingPages.removeOne(tabPage);
+ }
}
}
}
dialog/dcmanagecellcodedialog.h \
engine/versioninfo.h \
codeeditor/dceditscriptfolder.h \
- codeeditor/dccodeeditorscriptmanager.h
+ codeeditor/dccodeeditorscriptmanager.h \
+ dialog/dccodeeditorexternaleditorsettingdialog.h
SOURCES = main.cpp \
mainwindow.cpp \
codeeditor/dccellscriptseditorpagewidget.cpp \
dialog/dcmanagecellcodedialog.cpp \
codeeditor/dceditscriptfolder.cpp \
- codeeditor/dccodeeditorscriptmanager.cpp
+ codeeditor/dccodeeditorscriptmanager.cpp \
+ dialog/dccodeeditorexternaleditorsettingdialog.cpp
RESOURCES = denncoCreator.qrc
--- /dev/null
+// Copyright (c) 2012 Dennco Project
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+//
+// Created by tkawata on Dec-19, 2012.
+//
+#include "dccodeeditorexternaleditorsettingdialog.h"
+
+#include <QFileDialog>
+#include <QVBoxLayout>
+#include <QLabel>
+#include <QTextLine>
+#include <QGroupBox>
+
+#include "mainwindow.h"
+
+DCCodeEditorExternalEditorSettingDialog::DCCodeEditorExternalEditorSettingDialog(QWidget *parent) :
+ QDialog(parent), d_ok(false)
+{
+ setWindowTitle(tr("Choose external editor"));
+ QString instruction =
+ "<br><p>Executable:<ul><li>set the file path for the external editor.</li></ul></p>"
+ "<p>Parameter: <ul><li>Set the parameters to pass to the executable file.<br>"
+ "%F will be replaced to the file name of the script file to edit. </li></ul></p><br>";
+
+ QLabel *instructionLabel = new QLabel;
+ instructionLabel->setTextFormat(Qt::RichText);
+ instructionLabel->setWordWrap(true);
+ instructionLabel->setFrameStyle(QFrame::Box);
+ instructionLabel->setLineWidth(1);
+ instructionLabel->setText(instruction);
+ QGridLayout *gridLayout = new QGridLayout;
+ d_executableText = new QLineEdit;
+ d_chooseFileButton = new QPushButton(tr("Choose..."));
+ gridLayout->addWidget(new QLabel(tr("Executable:")), 0,0);
+ gridLayout->addWidget(d_executableText, 0,1);
+ gridLayout->addWidget(d_chooseFileButton, 0, 2);
+
+ d_parameterText = new QLineEdit;
+ gridLayout->addWidget(new QLabel(tr("Parameter:")), 1,0);
+ gridLayout->addWidget(d_parameterText, 1,1,1,2);
+
+ d_okButton = new QPushButton(tr("OK"));
+ d_cancelButton = new QPushButton(tr("Cancel"));
+ QHBoxLayout *buttonLayout = new QHBoxLayout;
+ buttonLayout->addStretch();
+ buttonLayout->addWidget(d_okButton);
+ buttonLayout->addWidget(d_cancelButton);
+
+ QVBoxLayout *layoutBase = new QVBoxLayout;
+ layoutBase->addWidget(instructionLabel);
+ layoutBase->addLayout(gridLayout);
+ layoutBase->addLayout(buttonLayout);
+
+ setLayout(layoutBase);
+
+ d_executableText->setText(MainWindow::readSettingsForExternalScriptEditorPath());
+ QString parameter = MainWindow::readSettingsForExternalScriptEditorParameters();
+ if (parameter.isEmpty() || parameter.length() == 0)
+ {
+ parameter = "\"%F\"";
+ }
+ d_parameterText->setText(parameter);
+
+ connect(d_chooseFileButton, SIGNAL(clicked()), this, SLOT(chooseFileButtonPressed()));
+ connect(d_okButton, SIGNAL(clicked()), this, SLOT(okButtonPressed()));
+ connect(d_cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonPressed()));
+}
+
+DCCodeEditorExternalEditorSettingDialog::~DCCodeEditorExternalEditorSettingDialog()
+{
+
+}
+
+bool DCCodeEditorExternalEditorSettingDialog::getResult() const
+{
+ return d_ok;
+}
+
+void DCCodeEditorExternalEditorSettingDialog::chooseFileButtonPressed()
+{
+ QFileDialog dialog(this, tr("Choose editor"), d_executableText->text());
+ dialog.setAcceptMode(QFileDialog::AcceptOpen);
+ dialog.setFileMode(QFileDialog::ExistingFile);
+ if (dialog.exec())
+ {
+ d_executableText->setText(dialog.selectedFiles().at(0));
+ }
+}
+
+void DCCodeEditorExternalEditorSettingDialog::okButtonPressed()
+{
+ MainWindow::writeSettingsForExternalScriptEditorPath(d_executableText->text());
+ MainWindow::writeSettingsForExternalScriptEditorParameters(d_parameterText->text());
+ d_ok = true;
+ close();
+}
+
+void DCCodeEditorExternalEditorSettingDialog::cancelButtonPressed()
+{
+ close();
+}
--- /dev/null
+// Copyright (c) 2012 Dennco Project
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+//
+// Created by tkawata on Dec-19, 2012.
+//
+#ifndef DCCODEEDITOREXTERNALEDITORSETTINGDIALOG_H
+#define DCCODEEDITOREXTERNALEDITORSETTINGDIALOG_H
+
+#include <QDialog>
+#include <QLineEdit>
+#include <QPushButton>
+
+class DCCodeEditorExternalEditorSettingDialog : public QDialog
+{
+ Q_OBJECT
+
+ bool d_ok;
+ QLineEdit *d_executableText;
+ QLineEdit *d_parameterText;
+
+ QPushButton *d_chooseFileButton;
+ QPushButton *d_okButton;
+ QPushButton *d_cancelButton;
+
+public:
+ explicit DCCodeEditorExternalEditorSettingDialog(QWidget *parent = 0);
+ virtual ~DCCodeEditorExternalEditorSettingDialog();
+
+ bool getResult() const;
+signals:
+
+public slots:
+ void chooseFileButtonPressed();
+ void okButtonPressed();
+ void cancelButtonPressed();
+
+};
+
+#endif // DCCODEEDITOREXTERNALEDITORSETTINGDIALOG_H
#include "utils/dcskeltoncreatorutil.h"
#include "dialog/dcinputnewcontentdirdialog.h"
#include "dialog/dcmanagecellcodedialog.h"
+#include "dialog/dccodeeditorexternaleditorsettingdialog.h"
#include "dccellscriptseditorwindow.h"
#include <QCloseEvent>
return false;
}
+void MainWindow::doExternalEditorSetting()
+{
+ DCCodeEditorExternalEditorSettingDialog dialog(this);
+ dialog.exec();
+}
+
void MainWindow::about()
{
QMessageBox::about(this, tr("About Application"),
connect(playAct, SIGNAL(triggered()), this, SLOT(playContent()));
+ externalEditorSettingAct = new QAction(tr("&External editor..."), this);
+ externalEditorSettingAct->setStatusTip(tr("Setup properties for external code editor."));
+ connect(externalEditorSettingAct, SIGNAL(triggered()), this, SLOT(doExternalEditorSetting()));
+
aboutAct = new QAction(tr("&About"), this);
aboutAct->setStatusTip(tr("Show the application's About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
menuBar()->addSeparator();
+ settingMenu = menuBar()->addMenu(tr("&Setting"));
+ settingMenu->addAction(externalEditorSettingAct);
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(aboutAct);
}
settings.setValue("segeometory", value);
}
+//static
+QString MainWindow::readSettingsForExternalScriptEditorPath()
+{
+ QSettings settings("dennco project", "dennco creator");
+ return settings.value("external editor path").toString();
+}
+
+//static
+QString MainWindow::readSettingsForExternalScriptEditorParameters()
+{
+ QSettings settings("dennco project", "dennco creator");
+ return settings.value("external editor param").toString();
+}
+
+//static
+void MainWindow::writeSettingsForExternalScriptEditorPath(const QString &arg)
+{
+ QSettings settings("dennco project", "dennco creator");
+ settings.setValue("external editor path", arg);
+}
+
+//static
+void MainWindow::writeSettingsForExternalScriptEditorParameters(const QString &arg)
+{
+ QSettings settings("dennco project", "dennco creator");
+ settings.setValue("external editor param", arg);
+}
+
bool MainWindow::maybeSave()
{
if (d_creator->getCurrentContent())
static QByteArray readSettingsForCellScriptsEditorGeometory();
static void writeSettingsForCellScriptsEditorGeometory(const QByteArray &value);
+ static QString readSettingsForExternalScriptEditorPath();
+ static QString readSettingsForExternalScriptEditorParameters();
+ static void writeSettingsForExternalScriptEditorPath(const QString& arg);
+ static void writeSettingsForExternalScriptEditorParameters(const QString& arg);
protected:
void closeEvent(QCloseEvent *event);
bool save();
bool save(bool showMessage);
bool saveAs();
+ void doExternalEditorSetting();
void about();
void documentWasModified();
void playContent();
QMenu *openRecentMenu;
QMenu *editMenu;
QMenu *helpMenu;
+ QMenu *settingMenu;
QToolBar *fileToolBar;
QToolBar *editToolBar;
QToolBar *playToolBar;
QAction *copyAct;
QAction *playAct;
QAction *pasteAct;
+ QAction *externalEditorSettingAct;
QAction *aboutAct;
QList<QAction*> openRecentActs;