d_splitter->widget(1)->show();
d_splitter->setStretchFactor(0,1);
d_splitter->setStretchFactor(1,4);
+ d_cellCodeScriptEditor->setFocus();
}
else
{
d_cellCodeScriptEditor->setReadOnly(false);
d_cellCodeScriptEditor->document()->setModified(false);
d_splitter->widget(1)->show();
- d_splitter->setStretchFactor(0,1);
- d_splitter->setStretchFactor(1,4);
}
else
{
}
return false;
}
+
+void DCCellScriptsEditorPageWidget::focusCustomScript()
+{
+ d_splitter->setStretchFactor(0,1);
+ d_splitter->setStretchFactor(1,4);
+ d_customScriptEditor->setFocus();
+}
+
+void DCCellScriptsEditorPageWidget::focusCellCodeScript()
+{
+ d_splitter->setStretchFactor(0,1);
+ d_splitter->setStretchFactor(1,4);
+ d_cellCodeScriptEditor->setFocus();
+
+}
bool saveCustomScriptOnlyToFile(bool saveModifiedOnly);
bool saveCellCodeScriptOnlyToFile(bool saveModifiedOnly);
+ void focusCustomScript();
+ void focusCellCodeScript();
+
signals:
void editingCellDestroyed(DCCell *cell);
void cellScriptsModifiedStatusChanged(QWidget *self, bool modified);
}
}
-void DCCellScriptsEditorTabWidget::openTab(DCCell *target)
+void DCCellScriptsEditorTabWidget::openTab(DCCell *target, bool focusInCellCodeScriptFirst)
{
+ DCCellScriptsEditorPageWidget *targetWidget = NULL;
int index = -1;
for (int i = 0; i < count(); i++)
{
if (it.value() == target)
{
index = i;
+ targetWidget = dynamic_cast<DCCellScriptsEditorPageWidget*>(it.key());
break;
}
}
}
else
{
- DCCellScriptsEditorPageWidget *widget = new DCCellScriptsEditorPageWidget(target, this);
- d_targets.insert(widget, target);
- setCurrentIndex(addTab(widget, QString::fromStdString(target->getName())));
- connect(widget, SIGNAL(editingCellDestroyed(DCCell*)), this, SLOT(slotCellDestroyed(DCCell*)));
- connect(widget, SIGNAL(cellScriptsModifiedStatusChanged(QWidget*, bool)), this, SLOT(slotTabPageContentModifiedStatusChanged(QWidget*, bool)));
- connect(widget, SIGNAL(cellScriptsSaved(QWidget*)), this, SLOT(slotTabPageContentSaved(QWidget*)));
+ targetWidget = new DCCellScriptsEditorPageWidget(target, this);
+ d_targets.insert(targetWidget, target);
+ setCurrentIndex(addTab(targetWidget, QString::fromStdString(target->getName())));
+ connect(targetWidget, SIGNAL(editingCellDestroyed(DCCell*)), this, SLOT(slotCellDestroyed(DCCell*)));
+ connect(targetWidget, SIGNAL(cellScriptsModifiedStatusChanged(QWidget*, bool)), this, SLOT(slotTabPageContentModifiedStatusChanged(QWidget*, bool)));
+ connect(targetWidget, SIGNAL(cellScriptsSaved(QWidget*)), this, SLOT(slotTabPageContentSaved(QWidget*)));
+ }
+
+ if (targetWidget)
+ {
+ if (focusInCellCodeScriptFirst)
+ targetWidget->focusCellCodeScript();
+ else
+ targetWidget->focusCustomScript();
}
}
DCCell* getCellForIndex(int i) const;
void setCurrentTabReadOnly(bool setReadOnly);
- void openTab(DCCell *editTarget);
+ void openTab(DCCell *editTarget, bool focusInCellCodeScriptFirst);
QSet<DCVCPage*> saveActiveTabContentToFile(bool saveModifiedOnly);
QSet<DCVCPage*> saveContentToFile(int tabIndex, bool saveModifiedOnly);
bool saveCustomScriptOnlyToFile(int tabIndex, bool saveModifiedOnly);
}
//static
-bool DCCellScriptsEditorWindow::startEditing(DCCell *cell)
+bool DCCellScriptsEditorWindow::startEditing(DCCell *cell, bool focusInCellCodeScriptFirst)
{
if (s_instance)
{
- return s_instance->startEditingPrivate(cell);
+ return s_instance->startEditingPrivate(cell, focusInCellCodeScriptFirst);
}
return false;
}
}
//static
+bool DCCellScriptsEditorWindow::closeEditor()
+{
+ if (s_instance && s_instance->isVisible())
+ {
+ return s_instance->close();
+ }
+ return true;
+}
+
+//static
void DCCellScriptsEditorWindow::destroyEditor()
{
if (s_instance)
updateWindowState();
}
-bool DCCellScriptsEditorWindow::startEditingPrivate(DCCell *cell)
+bool DCCellScriptsEditorWindow::startEditingPrivate(DCCell *cell, bool focusInCellCodeScriptFirst)
{
- d_tabWidget->openTab(cell);
+ d_tabWidget->openTab(cell, focusInCellCodeScriptFirst);
if (!isVisible())
{
bool maybeSave(DCCell *cell);
bool maybeSave(int index);
void updateWindowState();
- bool startEditingPrivate(DCCell *cell);
+ bool startEditingPrivate(DCCell *cell, bool focusInCellCodeScriptFirst);
bool saveScriptsBelongToPrivate(DCVCPage *page, bool modifiedOnly);
QSet<DCVCPage*> saveScriptsAllPrivate(bool modifiedOnly);
static DCCellScriptsEditorWindow* construct(DCCreator *creator);
static bool getIsVisible();
- static bool startEditing(DCCell *cell);
+ static bool startEditing(DCCell *cell, bool focusInCellCodeScriptFirst = true);
static bool saveScriptsBelongTo(DCVCPage *page, bool modifiedOnly);
static QSet<DCVCPage*> saveScriptsAll(bool modifiedOnly);
+ static bool closeEditor();
static void destroyEditor();
virtual void closeEvent(QCloseEvent *event);
return list;
}
+QList<QString> DCContainer::getAvailableScriptableCellTypes() const
+{
+ QList<QString> list;
+
+ list.append(QString::fromStdString(TKContainer::CELLTYPE_JSBASIC));
+ list.append(QString::fromStdString(TKContainer::CELLTYPE_BASICSTORAGE));
+
+ return list;
+}
+
bool DCContainer::getIsScriptable(const QString& type) const
{
std::string t = type.toStdString();
*/
QList<QString> getAvailableCellTypes() const;
+ QList<QString> getAvailableScriptableCellTypes() const;
+
/**
* @brief check if given cell type can have script
* @param type
dialog/dcinputnewcontentdirdialog.h \
codeeditor/dccellscriptseditorwindow.h \
codeeditor/dccellscriptseditortabwidget.h \
- codeeditor/dccellscriptseditorpagewidget.h
+ codeeditor/dccellscriptseditorpagewidget.h \
+ dialog/dcmanagecellcodedialog.h
SOURCES = main.cpp \
mainwindow.cpp \
dialog/dcinputnewcontentdirdialog.cpp \
codeeditor/dccellscriptseditorwindow.cpp \
codeeditor/dccellscriptseditortabwidget.cpp \
- codeeditor/dccellscriptseditorpagewidget.cpp
+ codeeditor/dccellscriptseditorpagewidget.cpp \
+ dialog/dcmanagecellcodedialog.cpp
RESOURCES = denncoCreator.qrc
#include <QTableView>
#include <QHeaderView>
-DCAddCellCodeClassDialog::DCAddCellCodeClassDialog(DCContainer *container, DCCreator *creator, const QString& path, QWidget *parent) :
- QDialog(parent), d_container(container), d_creator(creator)
+DCAddCellCodeClassDialog::DCAddCellCodeClassDialog(DCCreator *creator, const QString& path, QWidget *parent) :
+ QDialog(parent), d_creator(creator)
{
- setWindowTitle(tr("Add class"));
+ d_container = d_creator->getCurrentContainer();
+
+ setWindowTitle(tr("Add cell code"));
d_textField = new QLineEdit;
d_tableModel->setReadOnly(0,true);
d_comboBox = new QComboBox;
- d_comboBox->addItems(QStringList(d_container->getAvailableCellTypes()));
+ d_comboBox->addItems(QStringList(d_container->getAvailableScriptableCellTypes()));
- DCScene *scene = container->getScene();
+ DCScene *scene = d_container->getScene();
const QMap<QString,DCVCPage*> *pages = scene->getPages();
QMapIterator<QString, DCVCPage*> i(*pages);
int row = 0;
DCAddCellCodeClassDialog::~DCAddCellCodeClassDialog()
{
+ if (d_tableModel)
+ d_tableModel->deleteLater();
}
bool checkInput();
public:
- DCAddCellCodeClassDialog(DCContainer *container, DCCreator *creator, const QString& path, QWidget *parent = 0);
+ DCAddCellCodeClassDialog(DCCreator *creator, const QString& path, QWidget *parent = 0);
virtual ~DCAddCellCodeClassDialog();
QString getAddedCellCodeClassName() const;
DCAddCellDialog::~DCAddCellDialog()
{
-
+ if (d_tableModel)
+ d_tableModel->deleteLater();
}
bool DCAddCellDialog::checkInput()
void DCAssignCellCodeClassDialog::addNewClicked()
{
- DCAddCellCodeClassDialog dialog(d_container, d_creator, "");
+ DCAddCellCodeClassDialog dialog(d_creator, "");
dialog.exec();
updateClassList();
QString classname = dialog.getAddedCellCodeClassName();
--- /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 Nov-4, 2012.
+//
+#include "dcmanagecellcodedialog.h"
+
+#include "dccontainer.h"
+#include "dccreator.h"
+#include "dcscene.h"
+#include "dccellcode.h"
+#include "dcvcpage.h"
+#include "command/dccommand.h"
+#include "utils/dcqtitemmodel.h"
+#include "utils/dcutil.h"
+#include "dcsinglecolumntableview.h"
+#include "dialog/dcaddcellcodeclassdialog.h"
+
+#include <QLineEdit>
+#include <QTableView>
+#include <QHeaderView>
+
+DCManageCellCodeDialog::DCManageCellCodeDialog(DCCreator *creator, DCCellCode* cellCode, QWidget *parent) :
+ QDialog(parent), d_creator(creator), d_cellCode(cellCode), d_reloading(false)
+{
+ setWindowTitle(tr("Manage Cell Code"));
+ d_container = d_creator->getCurrentContainer();
+
+ d_textField = new QLineEdit;
+ d_table = new DCSingleColumnTableView();
+ QStringList headers;
+ headers << "Cell code";
+ d_tableModel = new DCQtItemModel(headers);
+ d_tableModel->setReadOnly(0,true);
+ d_table->setModel(d_tableModel);
+
+ d_comboBox = new QComboBox;
+ d_comboBox->addItems(QStringList(d_container->getAvailableScriptableCellTypes()));
+
+ setLayout(new QVBoxLayout);
+ d_table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
+
+ d_addButton = new QPushButton(tr("Add"));
+ d_closeButton = new QPushButton(tr("Close"));
+ d_saveButton = new QPushButton(tr("Save"));
+ QHBoxLayout *buttonLayout = new QHBoxLayout;
+ buttonLayout->addWidget(d_addButton);
+ buttonLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Expanding));
+ buttonLayout->addWidget(d_saveButton);
+ buttonLayout->addWidget(d_closeButton);
+ d_saveButton->setEnabled(false);
+ d_closeButton->setDefault(true);
+
+ QGridLayout *glayout = new QGridLayout;
+ glayout->addWidget(new QLabel(tr("name")),0,0);
+ glayout->addWidget(d_textField,0,1);
+ glayout->addWidget(new QLabel(tr("type")),1,0);
+ glayout->addWidget(d_comboBox);
+ ((QVBoxLayout*)layout())->addLayout(glayout);
+ layout()->addWidget(d_table);
+ d_statusText = new QLabel;
+ d_message = new QLabel;
+ d_message->setStyleSheet("color : red;");
+ layout()->addWidget(d_statusText);
+ layout()->addWidget(d_message);
+ ((QVBoxLayout*)layout())->addLayout(buttonLayout);
+
+ reloadViewData();
+
+ connect(d_textField, SIGNAL(textChanged(QString)), this, SLOT(textInputChanged(QString)));
+ connect(d_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(comboBoxSelectionChanged()));
+ connect(d_addButton, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
+ connect(d_saveButton, SIGNAL(clicked()), this, SLOT(saveButtonClicked()));
+ connect(d_closeButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(d_table,SIGNAL(selectionChangedSignal(QItemSelection,QItemSelection)), this, SLOT(listSelectionChanged(QItemSelection,QItemSelection)));
+ connect(d_creator, SIGNAL(commandExecuted(const QUndoCommand*)), this, SLOT(commandExecuted(const QUndoCommand*)));
+}
+
+DCManageCellCodeDialog::~DCManageCellCodeDialog()
+{
+ if (d_tableModel)
+ d_tableModel->deleteLater();
+}
+
+void DCManageCellCodeDialog::closeEvent(QCloseEvent *event)
+{
+ if (maybeSave())
+ {
+ event->accept();
+ }
+ else
+ {
+ event->ignore();
+ }
+}
+
+bool DCManageCellCodeDialog::maybeSave()
+{
+ if (!d_cellCode)
+ return true;
+
+ bool typeChanged = QString::fromStdString(d_cellCode->getCellAPIName()) != d_comboBox->currentText().trimmed();
+ bool nameChanged = DCUtil::getNameFromFQNPath(QString::fromStdString(d_cellCode->getFQNName())) != d_textField->text().trimmed();
+
+ bool r = true;
+
+ if (typeChanged || nameChanged)
+ {
+ QMessageBox::StandardButton ret;
+ ret = QMessageBox::warning(this, tr("Cell code manager"),
+ tr("The cell code has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+ if (ret == QMessageBox::Save)
+ {
+ if (typeChanged)
+ {
+ d_creator->doCommandChangeCellCodeClassType(this, d_cellCode, d_comboBox->currentText().trimmed());
+ }
+ if (nameChanged)
+ {
+ //TODO
+ QMessageBox::warning(this, "Not implemented", "Sorry! Renaming cell code name is not implemented now..\nIt will be supported in the future..");
+ d_textField->setText(DCUtil::getNameFromFQNPath(QString::fromStdString(d_cellCode->getFQNName())));
+ }
+ }
+ else if (ret == QMessageBox::Cancel)
+ {
+ r = false;
+ }
+ }
+ return r;
+}
+
+bool DCManageCellCodeDialog::updateWindowStatus()
+{
+ d_message->setText("");
+ d_statusText->setText("");
+
+ if (!d_cellCode)
+ return true;
+
+ QString name = DCUtil::getNameFromFQNPath(QString::fromStdString(d_cellCode->getFQNName()));
+ bool modified = name != d_textField->text().trimmed();
+ if (!modified)
+ modified = QString::fromStdString(d_cellCode->getCellAPIName()) != d_comboBox->currentText().trimmed();
+
+ QString windowTitle = name;
+ if (modified)
+ {
+ windowTitle.append("*");
+ d_saveButton->setEnabled(true);
+ d_saveButton->setDefault(true);
+ }
+ else
+ {
+ d_saveButton->setEnabled(false);
+ d_closeButton->setEnabled(true);
+ }
+ windowTitle.append(" - Manage Cell Code");
+
+ setWindowTitle(windowTitle);
+
+ return modified;
+}
+
+void DCManageCellCodeDialog::textInputChanged(const QString &text)
+{
+ updateWindowStatus();
+}
+
+void DCManageCellCodeDialog::comboBoxSelectionChanged()
+{
+ updateWindowStatus();
+}
+
+void DCManageCellCodeDialog::saveButtonClicked()
+{
+ bool typeChanged = QString::fromStdString(d_cellCode->getCellAPIName()) != d_comboBox->currentText().trimmed();
+ bool nameChanged = DCUtil::getNameFromFQNPath(QString::fromStdString(d_cellCode->getFQNName())) != d_textField->text().trimmed();
+
+ if (typeChanged)
+ {
+ d_creator->doCommandChangeCellCodeClassType(this, d_cellCode, d_comboBox->currentText().trimmed());
+ }
+ if (nameChanged)
+ {
+ //TODO
+ QMessageBox::warning(this, "Not implemented", "Sorry! Renaming cell code name is not implemented now..\nIt will be supported in the future..");
+ d_textField->setText(DCUtil::getNameFromFQNPath(QString::fromStdString(d_cellCode->getFQNName())));
+ }
+}
+
+void DCManageCellCodeDialog::addButtonClicked()
+{
+ DCAddCellCodeClassDialog dialog(d_creator, "", this);
+ dialog.exec();
+}
+
+void DCManageCellCodeDialog::deleteButtonClicked()
+{
+ //TODO
+ QMessageBox::warning(this, "Not implemented", "Sorry! Delete cell code is not implemented now..\nIt will be supported in the future..");
+}
+
+
+void DCManageCellCodeDialog::listSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
+{
+ if (d_reloading)
+ return;
+
+ DCCellCode *newCellCode = NULL;
+ if (selected.count()>0)
+ {
+ QString selectedPath = d_tableModel->data(selected.at(0).indexes().at(0), Qt::DisplayRole).toString();
+ newCellCode = dynamic_cast<DCCellCode*>(d_container->getCellCode(selectedPath.toStdString()));
+ }
+
+ if (newCellCode != d_cellCode)
+ {
+ if (maybeSave())
+ {
+ d_cellCode = newCellCode;
+ reloadViewData();
+ updateWindowStatus();
+ }
+ else
+ {
+ QItemSelectionModel s(d_tableModel);
+ s.select(deselected,QItemSelectionModel::Select);
+ d_table->setSelectionModel(&s);
+ }
+ }
+
+ updateWindowStatus();
+}
+
+void DCManageCellCodeDialog::commandExecuted(const QUndoCommand *executedCommand)
+{
+ reloadViewData();
+}
+
+void DCManageCellCodeDialog::reloadViewData()
+{
+ d_reloading = true;
+
+ const TKCellCodeMap* cellcodes = d_container->getCellCodes();
+ TKCellCode *emtpyCellCodeClass = d_container->getEmptyCellCodeClass();
+ int selection = -1;
+ int row = 0;
+ d_tableModel->removeAllItems();
+ for ( TKCellCodeMap::const_iterator it = cellcodes->begin(); it != cellcodes->end(); ++it ) {
+ if (it->second != emtpyCellCodeClass)
+ {
+ if (it->second == d_cellCode)
+ {
+ selection = row;
+ }
+ d_tableModel->insertString(QString::fromStdString(it->first));
+ row++;
+ }
+ }
+ d_table->setModel(d_tableModel);
+ if (selection >= 0)
+ {
+ d_table->selectRow(selection);
+ }
+
+ if (d_cellCode)
+ {
+ d_textField->setText(DCUtil::getNameFromFQNPath(QString::fromStdString(d_cellCode->getFQNName())));
+
+ QString type = QString::fromStdString(d_cellCode->getCellAPIName());
+ for (int i = 0; i < d_comboBox->count(); i++)
+ {
+ if (d_comboBox->itemText(i) == type)
+ {
+ d_comboBox->setCurrentIndex(i);
+ break;
+ }
+ }
+ }
+
+ updateWindowStatus();
+ d_reloading = false;
+}
--- /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 Nov-4, 2012.
+//
+#ifndef DCMANAGECELLCODEDIALOG_H
+#define DCMANAGECELLCODEDIALOG_H
+
+#include <QDialog>
+#include <QTableView>
+#include <QComboBox>
+#include <QLabel>
+#include <QUndoCommand>
+
+class DCContainer;
+class DCCreator;
+class DCCellCode;
+class DCQtItemModel;
+class DCSingleColumnTableView;
+
+class DCManageCellCodeDialog : public QDialog
+{
+ Q_OBJECT
+
+ DCContainer *d_container;
+ DCCreator *d_creator;
+ DCSingleColumnTableView *d_table;
+ DCQtItemModel *d_tableModel;
+ QComboBox *d_comboBox;
+ QPushButton *d_addButton;
+ QPushButton *d_deleteButton;
+ QPushButton *d_saveButton;
+ QPushButton *d_closeButton;
+ DCCellCode *d_cellCode;
+ QLineEdit *d_textField;
+ QLabel *d_statusText;
+ QLabel *d_message;
+ bool d_reloading;
+
+ bool maybeSave();
+ bool updateWindowStatus();
+ void reloadViewData();
+
+public:
+ DCManageCellCodeDialog(DCCreator *creator, DCCellCode *cellCode, QWidget *parent = 0);
+ virtual ~DCManageCellCodeDialog();
+
+protected:
+ virtual void closeEvent(QCloseEvent *event);
+
+signals:
+
+private slots:
+ void textInputChanged(const QString &text);
+ void addButtonClicked();
+ void deleteButtonClicked();
+ void saveButtonClicked();
+ void comboBoxSelectionChanged();
+ void listSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
+ void commandExecuted(const QUndoCommand* executedCommand);
+
+};
+
+#endif // DCMANAGECELLCODEDIALOG_H
DCRenameCellDialog::~DCRenameCellDialog()
{
-
+ if (d_tableModel)
+ d_tableModel->deleteLater();
}
bool DCRenameCellDialog::checkInput()
#include "utils/dcresources.h"
#include "utils/dcskeltoncreatorutil.h"
#include "dialog/dcinputnewcontentdirdialog.h"
+#include "dialog/dcmanagecellcodedialog.h"
#include "dccellscriptseditorwindow.h"
#include <QCloseEvent>
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+ manageCellCodeAct = new QAction(tr("Manage Cell Code..."), this);
+ connect(manageCellCodeAct, SIGNAL(triggered()), this, SLOT(manageCellCode()));
+
cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
fileMenu->addAction(exitAct);
editMenu = menuBar()->addMenu(tr("&Edit"));
+ editMenu->addAction(manageCellCodeAct);
+ editMenu->addSeparator();
editMenu->addAction(cutAct);
editMenu->addAction(copyAct);
editMenu->addAction(pasteAct);
{
if (d_creator->getCurrentContent())
{
+ if (!DCCellScriptsEditorWindow::closeEditor())
+ return false;
+
if (d_creator->getCurrentContent()->getIsModified())
{
QMessageBox::StandardButton ret;
socket->close();
}
}
+
+void MainWindow::manageCellCode()
+{
+ if (!d_creator)
+ return;
+
+ DCManageCellCodeDialog dialog(d_creator, NULL, this);
+ dialog.exec();
+}
void about();
void documentWasModified();
void playContent();
+ void manageCellCode();
private:
void createActions();
QAction *saveAct;
QAction *saveAsAct;
QAction *exitAct;
+ QAction *manageCellCodeAct;
QAction *cutAct;
QAction *copyAct;
QAction *playAct;
{
if (index.isValid())
{
- DCAddCellCodeClassDialog dialog(container, d_creator, containerBasedPath);
+ DCAddCellCodeClassDialog dialog(d_creator, containerBasedPath);
dialog.exec();
}
}
connect(DCAnimationTimer::instance(), SIGNAL(goNextFrame()), this, SLOT(doAnimation()));
connect(this, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(resizeEvent(QRectF)));
d_viewControlTool = new DCToolWindowViewControl(d_creator);
-
+ addToolWindow(d_viewControlTool);
}
DCUIGraphicsScene::~DCUIGraphicsScene()
void DCToolWindowCellEditor::slotCellCodeEditButtonPressed()
{
- if (d_cell)
+ if (d_cell && d_cell->getCellCode())
{
- //TODO
- DCCellScriptsEditorWindow::startEditing(d_cell);
+ DCCellScriptsEditorWindow::startEditing(d_cell, true);
}
}
{
if (d_cell)
{
- DCCellScriptsEditorWindow::startEditing(d_cell);
+ DCCellScriptsEditorWindow::startEditing(d_cell, false);
}
}