forked from inderpreetsingh/LBE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaka_engine.C
executable file
·65 lines (47 loc) · 1.38 KB
/
laka_engine.C
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/***************************************************************
Filename: laka_engine.C
Purpose : main app file of Laka Engine
Author : Gauravjeet Singh, Inderpreet Singh, Shaina Sabarwal
License : GNU GPL V3
***************************************************************/
#include "laka_engine.h"
LakaEngine::LakaEngine(const WEnvironment &env)
:WApplication(env)
{
container = new WContainerWidget(root());
container->setStyleClass("container");
useStyleSheet("resources/default.css");
clicked = false;
authButton = new WPushButton("Login/Register",container);
authButton->clicked().connect(this, &LakaEngine::authFormLoader);
postLoop = new PostLoop(container);
}
void LakaEngine::authFormLoader()
{
if (clicked == false)
{
clicked = true;
new AuthForm(container);
}
}
WApplication *createApplication(const WEnvironment &env)
{
return new LakaEngine(env);
}
int main(int argc, char **argv)
{
try{
Wt::WServer server(argv[0]);
server.setServerConfiguration(argc,argv, WTHTTP_CONFIGURATION);
server.addEntryPoint(Wt::Application, createApplication);
Session::configureAuth();
if(server.start()){
Wt::WServer::waitForShutdown();
server.stop();
}
} catch (Wt::WServer::Exception& e) {
std::cerr << e.what() << std::endl;
} catch (std::exception &e) {
std::cerr<< "exception" << e.what() <<std::endl;
}
}