|
|
|
@ -37,6 +37,9 @@ CS::Editor::Editor (OgreInit::OgreInit& ogreInit)
|
|
|
|
|
mNewGame.setLocalData (mLocal);
|
|
|
|
|
mFileDialog.setLocalData (mLocal);
|
|
|
|
|
|
|
|
|
|
connect (&mDocumentManager, SIGNAL (documentAdded (CSMDoc::Document *)),
|
|
|
|
|
this, SLOT (documentAdded (CSMDoc::Document *)));
|
|
|
|
|
|
|
|
|
|
connect (&mViewManager, SIGNAL (newGameRequest ()), this, SLOT (createGame ()));
|
|
|
|
|
connect (&mViewManager, SIGNAL (newAddonRequest ()), this, SLOT (createAddon ()));
|
|
|
|
|
connect (&mViewManager, SIGNAL (loadDocumentRequest ()), this, SLOT (loadDocument ()));
|
|
|
|
@ -150,9 +153,8 @@ void CS::Editor::openFiles (const boost::filesystem::path &savePath)
|
|
|
|
|
foreach (const QString &path, mFileDialog.selectedFilePaths())
|
|
|
|
|
files.push_back(path.toUtf8().constData());
|
|
|
|
|
|
|
|
|
|
CSMDoc::Document *document = mDocumentManager.addDocument (files, savePath, false);
|
|
|
|
|
mDocumentManager.addDocument (files, savePath, false);
|
|
|
|
|
|
|
|
|
|
mViewManager.addView (document);
|
|
|
|
|
mFileDialog.hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -166,9 +168,8 @@ void CS::Editor::createNewFile (const boost::filesystem::path &savePath)
|
|
|
|
|
|
|
|
|
|
files.push_back(mFileDialog.filename().toUtf8().constData());
|
|
|
|
|
|
|
|
|
|
CSMDoc::Document *document = mDocumentManager.addDocument (files, savePath, true);
|
|
|
|
|
mDocumentManager.addDocument (files, savePath, true);
|
|
|
|
|
|
|
|
|
|
mViewManager.addView (document);
|
|
|
|
|
mFileDialog.hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -178,9 +179,7 @@ void CS::Editor::createNewGame (const boost::filesystem::path& file)
|
|
|
|
|
|
|
|
|
|
files.push_back (file);
|
|
|
|
|
|
|
|
|
|
CSMDoc::Document *document = mDocumentManager.addDocument (files, file, true);
|
|
|
|
|
|
|
|
|
|
mViewManager.addView (document);
|
|
|
|
|
mDocumentManager.addDocument (files, file, true);
|
|
|
|
|
|
|
|
|
|
mNewGame.hide();
|
|
|
|
|
}
|
|
|
|
@ -287,3 +286,8 @@ std::auto_ptr<sh::Factory> CS::Editor::setupGraphics()
|
|
|
|
|
|
|
|
|
|
return factory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CS::Editor::documentAdded (CSMDoc::Document *document)
|
|
|
|
|
{
|
|
|
|
|
mViewManager.addView (document);
|
|
|
|
|
}
|