1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
15 Author: Stefan Hundhammer <sh@suse.de>
16 Stanislav Visnovsky <visnov@suse.cz>
20 #ifndef YWebUIComponent_h
21 #define YWebUIComponent_h
23 #include <YUIComponent.h>
25 #define y2log_component "web-ui"
26 #include <ycp/y2log.h>
30 extern void *start_webserver_thread( void * yui );
32 class YWebUIComponent : public YUIComponent
36 YWebUIComponent(): YUIComponent() {}
39 * Create a Web UI. This is called from within setServerOptions().
41 * Reimplemented from YUIComponent.
43 virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file )
45 // save the arguments for the UI thread (http server args etc)
49 pthread_t webserver_thread;
51 pthread_attr_init( & attr );
53 if( pthread_create( & webserver_thread, & attr, start_webserver_thread, 0 ) > 0 )
55 y2internal ("Could not create Web server thread, aborting");
59 y2milestone( "Server thread running");
61 // wait until the UI thread is ready
62 while (! YWebUI::ui() )
70 * Returns the name of this YaST2 component.
72 * Reimplemented from YUIComponent.
74 virtual string name() const { return "web"; }
79 #endif // YWebUIComponent_h