mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 16:49:55 +00:00
51332b86a1
If another instance of OpenCS is started, then it will terminate. This is done by creating a QLocalServer with a unique ID. If another QLocalServer with the same ID attempts to be opened, then the creation of the QLocalServer will fail and the application will terminate.
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#ifndef CS_EDITOR_H
|
|
#define CS_EDITOR_H
|
|
|
|
#include <QLocalServer>
|
|
|
|
#include <QObject>
|
|
#ifndef Q_MOC_RUN
|
|
#include <components/files/configurationmanager.hpp>
|
|
#endif
|
|
#include "model/doc/documentmanager.hpp"
|
|
|
|
#include "view/doc/viewmanager.hpp"
|
|
#include "view/doc/startup.hpp"
|
|
#include "view/doc/filedialog.hpp"
|
|
#include "model/settings/usersettings.hpp"
|
|
|
|
namespace CS
|
|
{
|
|
class Editor : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
CSMSettings::UserSettings mUserSettings;
|
|
CSMDoc::DocumentManager mDocumentManager;
|
|
CSVDoc::ViewManager mViewManager;
|
|
CSVDoc::StartupDialogue mStartup;
|
|
FileDialog mFileDialog;
|
|
|
|
Files::ConfigurationManager mCfgMgr;
|
|
void setupDataFiles();
|
|
|
|
// not implemented
|
|
Editor (const Editor&);
|
|
Editor& operator= (const Editor&);
|
|
|
|
public:
|
|
|
|
Editor();
|
|
|
|
bool makeIPCServer();
|
|
|
|
int run();
|
|
///< \return error status
|
|
|
|
private slots:
|
|
|
|
void createDocument();
|
|
|
|
void loadDocument();
|
|
void openFiles();
|
|
void createNewFile();
|
|
|
|
private:
|
|
|
|
QLocalServer *server;
|
|
};
|
|
}
|
|
|
|
#endif
|