2012-11-22 12:30:02 +00:00
|
|
|
#ifndef CS_EDITOR_H
|
|
|
|
#define CS_EDITOR_H
|
|
|
|
|
2014-03-16 11:44:01 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2012-11-23 13:05:49 +00:00
|
|
|
#include <QObject>
|
2013-09-03 09:12:19 +00:00
|
|
|
#include <QString>
|
2013-09-03 06:44:21 +00:00
|
|
|
#include <QLocalServer>
|
2013-09-03 09:12:19 +00:00
|
|
|
#include <QLocalSocket>
|
2013-09-03 06:44:21 +00:00
|
|
|
|
2014-03-16 11:44:01 +00:00
|
|
|
#include <extern/shiny/Main/Factory.hpp>
|
|
|
|
|
2013-03-31 16:00:46 +00:00
|
|
|
#ifndef Q_MOC_RUN
|
2013-03-07 02:00:59 +00:00
|
|
|
#include <components/files/configurationmanager.hpp>
|
2013-03-31 16:00:46 +00:00
|
|
|
#endif
|
2013-09-08 07:26:43 +00:00
|
|
|
|
2014-02-25 10:58:32 +00:00
|
|
|
#include <components/files/multidircollection.hpp>
|
|
|
|
|
2014-08-23 15:48:11 +00:00
|
|
|
#include <components/nifcache/nifcache.hpp>
|
|
|
|
|
2013-09-08 07:26:43 +00:00
|
|
|
#include "model/settings/usersettings.hpp"
|
2012-11-22 12:30:02 +00:00
|
|
|
#include "model/doc/documentmanager.hpp"
|
2013-02-02 15:14:58 +00:00
|
|
|
|
2012-11-22 12:30:02 +00:00
|
|
|
#include "view/doc/viewmanager.hpp"
|
2013-02-02 15:14:58 +00:00
|
|
|
#include "view/doc/startup.hpp"
|
2013-03-07 02:00:59 +00:00
|
|
|
#include "view/doc/filedialog.hpp"
|
2013-09-08 10:06:28 +00:00
|
|
|
#include "view/doc/newgame.hpp"
|
2013-09-08 07:26:43 +00:00
|
|
|
|
2014-04-23 03:19:53 +00:00
|
|
|
#include "view/settings/dialog.hpp"
|
2012-11-22 12:30:02 +00:00
|
|
|
|
2014-02-25 10:58:32 +00:00
|
|
|
namespace OgreInit
|
|
|
|
{
|
|
|
|
class OgreInit;
|
|
|
|
}
|
|
|
|
|
2012-11-22 12:30:02 +00:00
|
|
|
namespace CS
|
|
|
|
{
|
2012-11-23 13:05:49 +00:00
|
|
|
class Editor : public QObject
|
2012-11-22 12:30:02 +00:00
|
|
|
{
|
2012-11-23 13:05:49 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2014-08-23 15:48:11 +00:00
|
|
|
Nif::Cache mNifCache;
|
2013-09-27 09:36:06 +00:00
|
|
|
Files::ConfigurationManager mCfgMgr;
|
2013-06-12 10:36:35 +00:00
|
|
|
CSMSettings::UserSettings mUserSettings;
|
2012-11-22 12:30:02 +00:00
|
|
|
CSMDoc::DocumentManager mDocumentManager;
|
|
|
|
CSVDoc::ViewManager mViewManager;
|
2013-02-02 15:14:58 +00:00
|
|
|
CSVDoc::StartupDialogue mStartup;
|
2013-09-08 10:06:28 +00:00
|
|
|
CSVDoc::NewGameDialogue mNewGame;
|
2014-04-23 03:19:53 +00:00
|
|
|
CSVSettings::Dialog mSettings;
|
2013-08-18 20:11:29 +00:00
|
|
|
CSVDoc::FileDialog mFileDialog;
|
2013-09-08 12:31:20 +00:00
|
|
|
boost::filesystem::path mLocal;
|
2014-03-16 11:44:01 +00:00
|
|
|
boost::filesystem::path mResources;
|
2014-03-09 11:32:21 +00:00
|
|
|
bool mFsStrict;
|
2013-09-08 12:31:20 +00:00
|
|
|
|
2014-02-25 10:58:32 +00:00
|
|
|
void setupDataFiles (const Files::PathContainer& dataDirs);
|
|
|
|
|
2014-03-09 11:32:21 +00:00
|
|
|
std::pair<Files::PathContainer, std::vector<std::string> > readConfig();
|
2014-02-25 10:58:32 +00:00
|
|
|
///< \return data paths
|
2012-11-22 12:30:02 +00:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
Editor (const Editor&);
|
|
|
|
Editor& operator= (const Editor&);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2014-02-25 10:58:32 +00:00
|
|
|
Editor (OgreInit::OgreInit& ogreInit);
|
2012-11-22 12:30:02 +00:00
|
|
|
|
2013-09-03 06:44:21 +00:00
|
|
|
bool makeIPCServer();
|
2013-09-03 09:12:19 +00:00
|
|
|
void connectToIPCServer();
|
2013-09-03 06:44:21 +00:00
|
|
|
|
2012-11-22 12:30:02 +00:00
|
|
|
int run();
|
|
|
|
///< \return error status
|
2012-11-23 13:05:49 +00:00
|
|
|
|
2014-03-16 11:44:01 +00:00
|
|
|
std::auto_ptr<sh::Factory> setupGraphics();
|
|
|
|
///< The returned factory must persist at least as long as *this.
|
|
|
|
|
2013-02-02 15:14:58 +00:00
|
|
|
private slots:
|
2012-11-23 13:05:49 +00:00
|
|
|
|
2013-09-08 10:06:28 +00:00
|
|
|
void createGame();
|
|
|
|
void createAddon();
|
2013-02-02 15:14:58 +00:00
|
|
|
|
|
|
|
void loadDocument();
|
2013-10-27 03:55:44 +00:00
|
|
|
void openFiles (const boost::filesystem::path &path);
|
|
|
|
void createNewFile (const boost::filesystem::path& path);
|
2013-09-10 14:45:01 +00:00
|
|
|
void createNewGame (const boost::filesystem::path& file);
|
2013-09-03 06:44:21 +00:00
|
|
|
|
2013-09-03 09:12:19 +00:00
|
|
|
void showStartup();
|
|
|
|
|
2013-09-08 07:26:43 +00:00
|
|
|
void showSettings();
|
|
|
|
|
2014-04-21 07:02:58 +00:00
|
|
|
void documentAdded (CSMDoc::Document *document);
|
|
|
|
|
2014-04-26 11:11:27 +00:00
|
|
|
void lastDocumentDeleted();
|
|
|
|
|
2013-09-03 06:44:21 +00:00
|
|
|
private:
|
|
|
|
|
2013-09-03 10:22:48 +00:00
|
|
|
QString mIpcServerName;
|
|
|
|
QLocalServer *mServer;
|
|
|
|
QLocalSocket *mClientSocket;
|
2012-11-22 12:30:02 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-03-07 02:00:59 +00:00
|
|
|
#endif
|