mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-11 18:37:08 +00:00
29 lines
705 B
C++
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();
|
|
} |