mirror of https://github.com/OpenMW/openmw.git
added new document function
parent
997386d873
commit
303506d24b
@ -1,20 +1,28 @@
|
||||
|
||||
#include "editor.hpp"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
CS::Editor::Editor() : mViewManager (mDocumentManager)
|
||||
CS::Editor::Editor() : mViewManager (mDocumentManager), mNewDocumentIndex (0)
|
||||
{
|
||||
connect (&mViewManager, SIGNAL (newDocumentRequest ()), this, SLOT (createDocument ()));
|
||||
}
|
||||
|
||||
void CS::Editor::createDocument()
|
||||
{
|
||||
CSMDoc::Document *document = mDocumentManager.addDocument();
|
||||
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();
|
||||
|
Loading…
Reference in New Issue