2018-07-14 06:06:33 +00:00
|
|
|
#include "EditorWidget.hpp"
|
2018-07-26 03:41:48 +00:00
|
|
|
#include "MainWindow.hpp"
|
2018-08-06 04:20:42 +00:00
|
|
|
#include <QStandardItemModel>
|
2018-07-14 06:06:33 +00:00
|
|
|
|
|
|
|
EditorWidget::EditorWidget(QWidget* parent)
|
|
|
|
: QWidget(parent)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2018-07-26 03:41:48 +00:00
|
|
|
|
|
|
|
void EditorUndoCommand::undo()
|
|
|
|
{
|
|
|
|
g_MainWindow->openEditor(m_node.get());
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorUndoCommand::redo()
|
|
|
|
{
|
|
|
|
g_MainWindow->openEditor(m_node.get());
|
|
|
|
}
|
2018-08-06 04:20:42 +00:00
|
|
|
|
|
|
|
FieldProjectNode::FieldProjectNode(ProjectModel::CollectionNode* collection, QWidget* parent)
|
|
|
|
: FieldComboBox(parent)
|
|
|
|
{
|
|
|
|
setCollection(collection);
|
|
|
|
}
|
|
|
|
|
|
|
|
void FieldProjectNode::setCollection(ProjectModel::CollectionNode* collection)
|
|
|
|
{
|
|
|
|
m_collection = collection;
|
|
|
|
|
|
|
|
if (!collection)
|
|
|
|
{
|
|
|
|
setModel(new QStandardItemModel(0, 1, this));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ProjectModel* model = g_MainWindow->projectModel();
|
|
|
|
setModel(model->getNullProxy());
|
|
|
|
setRootModelIndex(model->getNullProxy()->mapFromSource(model->index(collection)));
|
|
|
|
}
|