Initial PoC of a CherryPy app integrate with the runtime.

Upon startup, the runtime will attempt to locate pgAdmin4.py in a
number of different relative locations. Once found, it will execute
it in a new thread. The main window is then created and the brower's
initial page is set to the root of the CherryPy server. At present,
that's http://127.0.0.1:8080.
This commit is contained in:
Dave Page
2013-06-21 23:21:11 +01:00
parent 1afc31c657
commit 28f45ea9f9
56 changed files with 21993 additions and 47 deletions

View File

@@ -9,9 +9,12 @@
//
//////////////////////////////////////////////////////////////////////////
#include "pgAdmin4.h"
// Must be before QT
#include <Python.h>
// QT headers
#include <QtGlobal>
#if QT_VERSION >= 0x050000
@@ -20,16 +23,30 @@
#include <QApplication>
#endif
// App headers
#include "BrowserWindow.h"
#include "Server.h"
int main(int argc, char * argv[])
{
// Create the QT application
QApplication app(argc, argv);
// Initialise Python
Py_SetProgramName(argv[0]);
Py_Initialize();
// Fire up the webserver
// TODO: Find an unused port number to use
Server *server = new Server();
if (!server->Init())
{
qDebug() << server->getError();
QString error("An error occurred initialising the application server:\n\n" + server->getError());
QMessageBox::critical(NULL, QString("Fatal Error"), error);
exit(1);
}
server->start();
// Create & show the main window
BrowserWindow browserWindow;
@@ -37,9 +54,6 @@ int main(int argc, char * argv[])
// Go!
return app.exec();
// Shutdown Python
Py_Finalize();
}