2012-11-22 13:30:02 +01:00
|
|
|
#ifndef CS_EDITOR_H
|
|
|
|
#define CS_EDITOR_H
|
|
|
|
|
2012-11-23 14:05:49 +01:00
|
|
|
#include <QObject>
|
2013-09-03 04:12:19 -05:00
|
|
|
#include <QString>
|
2013-09-03 01:44:21 -05:00
|
|
|
#include <QLocalServer>
|
2013-09-03 04:12:19 -05:00
|
|
|
#include <QLocalSocket>
|
2013-09-03 01:44:21 -05:00
|
|
|
|
2013-03-31 18:00:46 +02:00
|
|
|
#ifndef Q_MOC_RUN
|
2013-03-07 03:00:59 +01:00
|
|
|
#include <components/files/configurationmanager.hpp>
|
2013-03-31 18:00:46 +02:00
|
|
|
#endif
|
2013-09-08 09:26:43 +02:00
|
|
|
|
|
|
|
#include "model/settings/usersettings.hpp"
|
2012-11-22 13:30:02 +01:00
|
|
|
#include "model/doc/documentmanager.hpp"
|
2013-02-02 16:14:58 +01:00
|
|
|
|
2012-11-22 13:30:02 +01:00
|
|
|
#include "view/doc/viewmanager.hpp"
|
2013-02-02 16:14:58 +01:00
|
|
|
#include "view/doc/startup.hpp"
|
2013-03-07 03:00:59 +01:00
|
|
|
#include "view/doc/filedialog.hpp"
|
2013-09-08 12:06:28 +02:00
|
|
|
#include "view/doc/newgame.hpp"
|
2013-09-08 09:26:43 +02:00
|
|
|
|
|
|
|
#include "view/settings/usersettingsdialog.hpp"
|
2012-11-22 13:30:02 +01:00
|
|
|
|
|
|
|
namespace CS
|
|
|
|
{
|
2012-11-23 14:05:49 +01:00
|
|
|
class Editor : public QObject
|
2012-11-22 13:30:02 +01:00
|
|
|
{
|
2012-11-23 14:05:49 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-09-27 11:36:06 +02:00
|
|
|
Files::ConfigurationManager mCfgMgr;
|
2013-06-12 12:36:35 +02:00
|
|
|
CSMSettings::UserSettings mUserSettings;
|
2012-11-22 13:30:02 +01:00
|
|
|
CSMDoc::DocumentManager mDocumentManager;
|
|
|
|
CSVDoc::ViewManager mViewManager;
|
2013-02-02 16:14:58 +01:00
|
|
|
CSVDoc::StartupDialogue mStartup;
|
2013-09-08 12:06:28 +02:00
|
|
|
CSVDoc::NewGameDialogue mNewGame;
|
2013-09-08 09:26:43 +02:00
|
|
|
CSVSettings::UserSettingsDialog mSettings;
|
2013-08-18 15:11:29 -05:00
|
|
|
CSVDoc::FileDialog mFileDialog;
|
2013-03-07 03:00:59 +01:00
|
|
|
|
2013-09-08 14:31:20 +02:00
|
|
|
boost::filesystem::path mLocal;
|
|
|
|
|
2013-03-07 03:00:59 +01:00
|
|
|
void setupDataFiles();
|
2012-11-22 13:30:02 +01:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
Editor (const Editor&);
|
|
|
|
Editor& operator= (const Editor&);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Editor();
|
|
|
|
|
2013-09-03 01:44:21 -05:00
|
|
|
bool makeIPCServer();
|
2013-09-03 04:12:19 -05:00
|
|
|
void connectToIPCServer();
|
2013-09-03 01:44:21 -05:00
|
|
|
|
2012-11-22 13:30:02 +01:00
|
|
|
int run();
|
|
|
|
///< \return error status
|
2012-11-23 14:05:49 +01:00
|
|
|
|
2013-02-02 16:14:58 +01:00
|
|
|
private slots:
|
2012-11-23 14:05:49 +01:00
|
|
|
|
2013-09-08 12:06:28 +02:00
|
|
|
void createGame();
|
|
|
|
void createAddon();
|
2013-02-02 16:14:58 +01:00
|
|
|
|
|
|
|
void loadDocument();
|
2013-10-26 22:55:44 -05:00
|
|
|
void openFiles (const boost::filesystem::path &path);
|
|
|
|
void createNewFile (const boost::filesystem::path& path);
|
2013-09-10 16:45:01 +02:00
|
|
|
void createNewGame (const boost::filesystem::path& file);
|
2013-09-03 01:44:21 -05:00
|
|
|
|
2013-09-03 04:12:19 -05:00
|
|
|
void showStartup();
|
|
|
|
|
2013-09-08 09:26:43 +02:00
|
|
|
void showSettings();
|
|
|
|
|
2013-09-03 01:44:21 -05:00
|
|
|
private:
|
|
|
|
|
2013-09-03 05:22:48 -05:00
|
|
|
QString mIpcServerName;
|
|
|
|
QLocalServer *mServer;
|
|
|
|
QLocalSocket *mClientSocket;
|
2012-11-22 13:30:02 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-03-07 03:00:59 +01:00
|
|
|
#endif
|