blob: d6c50586b253a971e335b79eb2b5a02853ee700e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <QtGui/QApplication>
#include "serverwidget.h"
#include "httpserver.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
quint16 port = 3001;
Server server(port);
server.addRootPath("../../examples");
server.addRootPath("../../demos");
ServerWidget w;
w.ui->label_portMessage->setText
(QString("The server is running on http://localhost:%1/. Open the address in a "
"Google Native Client-enabled web browser.").arg(port));
w.ui->label_portMessage->setOpenExternalLinks(true);
w.ui->label_portMessage->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByMouse);
w.ui->lineEdit->setText(QDir::toNativeSeparators(QDir::currentPath() + "/nacldemo"));
server.setSaveLocationLineEdit(w.ui->lineEdit);
QObject::connect(w.ui->pushButton_save, SIGNAL(clicked()),
&server, SLOT(saveDemoFiles()));
w.show();
return a.exec();
}
|