1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-11 18:37:08 +00:00
OpenMW/apps/opencs/editor.cpp
2012-11-23 14:08:20 +01:00

29 lines
705 B
C++

#include "editor.hpp"
#include <sstream>
#include <QtGui/QApplication>
CS::Editor::Editor() : mViewManager (mDocumentManager), mNewDocumentIndex (0)
{
connect (&mViewManager, SIGNAL (newDocumentRequest ()), this, SLOT (createDocument ()));
}
void CS::Editor::createDocument()
{
std::ostringstream stream;
stream << "NewDocument" << (++mNewDocumentIndex);
CSMDoc::Document *document = mDocumentManager.addDocument (stream.str());
mViewManager.addView (document);
}
int CS::Editor::run()
{
/// \todo Instead of creating an empty document, open a small welcome dialogue window with buttons for new/load/recent projects
createDocument();
return QApplication::exec();
}