1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:49:55 +00:00
openmw-tes3mp/apps/opencs/editor.hpp
Marc Bouvier 563bd0b430 [Feature #881] Raise OpenCS New Window After Re-execution
The OpenCS startup window of the existing exist is raised when trying to
start a new instance. This is done by the new instance connection to the
existing instance's QLocalServer. Once the connection is established the
existing instance raises the startup window.
2013-09-03 04:12:19 -05:00

66 lines
1.4 KiB
C++

#ifndef CS_EDITOR_H
#define CS_EDITOR_H
#include <QObject>
#include <QString>
#include <QLocalServer>
#include <QLocalSocket>
#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();
void connectToIPCServer();
int run();
///< \return error status
private slots:
void createDocument();
void loadDocument();
void openFiles();
void createNewFile();
void showStartup();
private:
QString ipcServerName;
QLocalServer *server;
QLocalSocket *clientToServerSocket;
};
}
#endif