2013-06-21 17:21:11 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2018-01-05 04:42:49 -06:00
|
|
|
// Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
2013-06-21 17:21:11 -05:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
// Server.h - Thread in which the web server will run.
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef SERVER_H
|
|
|
|
#define SERVER_H
|
|
|
|
|
|
|
|
#include "pgAdmin4.h"
|
|
|
|
|
|
|
|
// QT headers
|
|
|
|
#include <QThread>
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
|
|
class Server : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-02-05 09:32:14 -06:00
|
|
|
Server(quint16 port, QString key, QString logFileName);
|
2013-06-21 17:21:11 -05:00
|
|
|
~Server();
|
|
|
|
|
|
|
|
bool Init();
|
2018-02-05 09:32:14 -06:00
|
|
|
QString getError() { return m_error; }
|
2013-06-21 17:21:11 -05:00
|
|
|
|
2018-03-15 02:56:24 -05:00
|
|
|
public slots:
|
|
|
|
void shutdown(QUrl url);
|
|
|
|
|
2013-06-21 17:21:11 -05:00
|
|
|
protected:
|
|
|
|
void run();
|
|
|
|
|
|
|
|
private:
|
2018-02-05 09:32:14 -06:00
|
|
|
void setError(QString error) { m_error = error; }
|
2013-06-21 17:21:11 -05:00
|
|
|
|
|
|
|
QString m_appfile;
|
|
|
|
QString m_error;
|
2013-10-04 11:12:10 -05:00
|
|
|
|
2016-01-18 08:33:28 -06:00
|
|
|
quint16 m_port;
|
2017-03-06 08:53:49 -06:00
|
|
|
QString m_key;
|
2018-02-05 09:32:14 -06:00
|
|
|
QString m_logFileName;
|
|
|
|
|
2017-03-28 07:26:16 -05:00
|
|
|
// Application name in UTF-8 for Python
|
2016-01-18 08:33:28 -06:00
|
|
|
wchar_t *m_wcAppName;
|
2017-03-28 07:26:16 -05:00
|
|
|
QByteArray PGA_APP_NAME_UTF8;
|
2018-02-05 09:32:14 -06:00
|
|
|
|
2017-03-28 07:26:16 -05:00
|
|
|
// PythonHome for Python
|
|
|
|
wchar_t *m_wcPythonHome;
|
|
|
|
QByteArray pythonHome_utf8;
|
2013-06-21 17:21:11 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SERVER_H
|
|
|
|
|