Author: dmacvicar
Date: Tue Nov 13 14:34:26 2007
New Revision: 42015
URL: http://svn.opensuse.org/viewcvs/yast?rev=42015&view=rev
Log:
- move the UICOmponent functions to its own fle
disable creating a separate thread for now
Added:
branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.cc
Modified:
branches/tmp/sh/mod-ui/web-wt/src/CMakeLists.txt
branches/tmp/sh/mod-ui/web-wt/src/YWebUI.h
branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.h
Modified: branches/tmp/sh/mod-ui/web-wt/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/CMakeLists.txt?rev=42015&r1=42014&r2=42015&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/CMakeLists.txt (original)
+++ branches/tmp/sh/mod-ui/web-wt/src/CMakeLists.txt Tue Nov 13 14:34:26 2007
@@ -9,7 +9,7 @@
)
SET(web_yast_plugin_SRCS
- Y2CCWeb.cc YWebApplication.cc YWebDialog.cc YWebPushButton.cc YWebLabel.cc YWebUI_builtins.cc YWebUI_core.cc YWebUI_widgets.cc YWebWidgetFactory.cc
+ Y2CCWeb.cc YWebApplication.cc YWebDialog.cc YWebPushButton.cc YWebLabel.cc YWebUIComponent.cc YWebUI_builtins.cc YWebUI_core.cc YWebUI_widgets.cc YWebWidgetFactory.cc
)
SET(web_yast_plugin_HEADERS
Modified: branches/tmp/sh/mod-ui/web-wt/src/YWebUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWebUI.h?rev=42015&r1=42014&r2=42015&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebUI.h (original)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebUI.h Tue Nov 13 14:34:26 2007
@@ -24,6 +24,7 @@
#include
#include <WApplication>
+#include <WEnvironment>
class YEvent;
class YWebOptionalWidgetFactory;
@@ -33,6 +34,9 @@
using std::vector;
+Wt::WApplication *createApplication(const Wt::WEnvironment& env);
+void *start_webserver_thread( void * yui );
+
class YWebUI: public Wt::WApplication, public YUI
{
public:
Added: branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.cc?rev=42015&view=auto
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.cc (added)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.cc Tue Nov 13 14:34:26 2007
@@ -0,0 +1,41 @@
+
+#include "YWebUIComponent.h"
+#include "YWebUI.h"
+
+YWebUIComponent::YWebUIComponent()
+ : YUIComponent()
+{
+
+}
+
+YUI * YWebUIComponent::createUI( int argc, char **argv, bool with_threads, const char * macro_file )
+{
+ // save the arguments for the UI thread (http server args etc)
+ YWebUI::_argc = argc;
+ YWebUI::_argv = argv;
+
+
+ WRun(YWebUI::_argc, YWebUI::_argv, &createApplication);
+ return YWebUI::ui();
+
+ pthread_t webserver_thread;
+ pthread_attr_t attr;
+ pthread_attr_init( & attr );
+
+ if( pthread_create( & webserver_thread, & attr, start_webserver_thread, 0 ) > 0 )
+ {
+ y2internal ("Could not create Web server thread, aborting");
+ abort();
+ }
+
+ y2milestone( "Server thread running");
+
+ // wait until the UI thread is ready
+ while (! YWebUI::ui() )
+ {
+ sleep( 1 );
+ }
+ return YWebUI::ui();
+}
+
+string YWebUIComponent::name() const { return "web"; }
\ No newline at end of file
Modified: branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.h?rev=42015&r1=42014&r2=42015&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.h (original)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebUIComponent.h Tue Nov 13 14:34:26 2007
@@ -27,51 +27,25 @@
#include "YWebUI.h"
-extern void *start_webserver_thread( void * yui );
-
class YWebUIComponent : public YUIComponent
{
public:
- YWebUIComponent(): YUIComponent() {}
+ YWebUIComponent();
/**
* Create a Web UI. This is called from within setServerOptions().
*
* Reimplemented from YUIComponent.
**/
- virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file )
- {
- // save the arguments for the UI thread (http server args etc)
- YWebUI::_argc = argc;
- YWebUI::_argv = argv;
-
- pthread_t webserver_thread;
- pthread_attr_t attr;
- pthread_attr_init( & attr );
-
- if( pthread_create( & webserver_thread, & attr, start_webserver_thread, 0 ) > 0 )
- {
- y2internal ("Could not create Web server thread, aborting");
- abort();
- }
-
- y2milestone( "Server thread running");
-
- // wait until the UI thread is ready
- while (! YWebUI::ui() )
- {
- sleep( 1 );
- }
- return YWebUI::ui();
- }
+ virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file );
/**
* Returns the name of this YaST2 component.
*
* Reimplemented from YUIComponent.
**/
- virtual string name() const { return "web"; }
+ virtual string name() const;
};
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org