]> icculus.org git repositories - duncan/yast2-web-wt.git/blob - src/YWebUIComponent.cc
- move the UICOmponent functions to its own fle
[duncan/yast2-web-wt.git] / src / YWebUIComponent.cc
1
2 #include "YWebUIComponent.h"
3 #include "YWebUI.h"
4
5 YWebUIComponent::YWebUIComponent()
6   : YUIComponent()
7 {
8
9 }
10
11 YUI * YWebUIComponent::createUI( int argc, char **argv, bool with_threads, const char * macro_file )
12 {
13   // save the arguments for the UI thread (http server args etc)
14    YWebUI::_argc = argc;
15    YWebUI::_argv = argv;
16
17    
18    WRun(YWebUI::_argc, YWebUI::_argv, &createApplication);
19    return YWebUI::ui();
20
21    pthread_t webserver_thread;
22    pthread_attr_t attr;
23    pthread_attr_init( & attr );
24
25    if( pthread_create( & webserver_thread, & attr, start_webserver_thread, 0 ) > 0 )
26    {
27      y2internal ("Could not create Web server thread, aborting");
28      abort();
29    }
30
31    y2milestone( "Server thread running");
32
33    // wait until the UI thread is ready
34    while (! YWebUI::ui() )
35    {
36      sleep( 1 );
37    }
38    return YWebUI::ui();
39 }
40
41 string YWebUIComponent::name() const { return "web"; }