Author: sh-sh-sh
Date: Thu Feb 7 16:11:10 2008
New Revision: 44247
URL: http://svn.opensuse.org/viewcvs/yast?rev=44247&view=rev
Log:
- Renamed YUI_core.cc to YUI.cc - only one YUI*.cc file left now
- Moved YCP-specific part out of YUI constructor into YUIComponent
Added:
trunk/core/libyui/src/YUI.cc
- copied, changed from r44242, trunk/core/libyui/src/YUI_core.cc
Removed:
trunk/core/libyui/src/YUI_core.cc
Modified:
trunk/core/libyui/src/Makefile.am
trunk/core/libyui/src/YUIComponent.cc
Modified: trunk/core/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/Makefile.am?rev=44247&r1=44246&r2=44247&view=diff
==============================================================================
--- trunk/core/libyui/src/Makefile.am (original)
+++ trunk/core/libyui/src/Makefile.am Thu Feb 7 16:11:10 2008
@@ -14,6 +14,7 @@
libpy2UI_la_SOURCES = \
Y2UINamespace.cc \
Y2CCUI.cc \
+ YUI.cc \
YCP_UI.cc \
YCPDialogParser.cc \
YCPErrorDialog.cc \
@@ -41,7 +42,6 @@
YUIException.cc \
YUILog.cc \
YUIPlugin.cc \
- YUI_core.cc \
YApplication.cc \
YWidget.cc \
YWidgetFactory.cc \
Copied: trunk/core/libyui/src/YUI.cc (from r44242, trunk/core/libyui/src/YUI_core.cc)
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUI.cc?p2=trunk/core/libyui/src/YUI.cc&p1=trunk/core/libyui/src/YUI_core.cc&r1=44242&r2=44247&rev=44247&view=diff
==============================================================================
--- trunk/core/libyui/src/YUI_core.cc (original)
+++ trunk/core/libyui/src/YUI.cc Thu Feb 7 16:11:10 2008
@@ -10,7 +10,7 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YUI_core.cc
+ File: YUI.cc
Authors: Stefan Hundhammer
Stanislav Visnovsky
@@ -27,14 +27,11 @@
#include // pipe()
#include // fcntl()
#include
-#include // setlocale()
#include
#define YUILogComponent "ui"
#include "YUILog.h"
-#define YUILogComponent "ui"
-#include "YUILog.h"
#include
#include "Y2UINamespace.h"
@@ -45,10 +42,6 @@
#include "YApplication.h"
#include "YMacro.h"
-// FIXME: Move this to YCP-specific part
-#include "YCPMacroRecorder.h"
-#include "YCPMacroPlayer.h"
-
typedef YCPValue (*v2) ();
typedef YCPValue (*v2v) (const YCPValue &);
@@ -62,15 +55,6 @@
extern void *start_ui_thread( void * yui );
-static void
-yui_y2logger( YUILogLevel_t logLevel,
- const char * logComponent,
- const char * sourceFileName,
- int sourceLineNo,
- const char * sourceFunctionName,
- const char * message );
-
-
YUI::YUI( bool withThreads )
: _withThreads( withThreads )
@@ -78,12 +62,6 @@
, _eventsBlocked( false )
{
_yui = this;
-
- // FIXME: Move this to YCP-specific part
- YUILog::setLoggerFunction( yui_y2logger );
-
- YMacro::setRecorder( new YCPMacroRecorder() );
- YMacro::setPlayer ( new YCPMacroPlayer() );
}
@@ -237,11 +215,6 @@
}
-extern YCPValue UIUserInput ();
-extern YCPValue UITimeoutUserInput( const YCPInteger& timeout );
-extern YCPValue UIWaitForEvent();
-extern YCPValue UIWaitForEventTimeout( const YCPInteger & timeout );
-
YCPValue YUI::callFunction( void * function, int argc, YCPValue argv[] )
{
@@ -438,42 +411,5 @@
}
-static void
-yui_y2logger( YUILogLevel_t logLevel,
- const char * logComponent,
- const char * sourceFileName,
- int sourceLineNo,
- const char * sourceFunctionName,
- const char * message )
-{
- loglevel_t y2logLevel = LOG_DEBUG;
-
- switch ( logLevel )
- {
- case YUI_LOG_DEBUG: y2logLevel = LOG_DEBUG; break;
- case YUI_LOG_MILESTONE: y2logLevel = LOG_MILESTONE; break;
- case YUI_LOG_WARNING: y2logLevel = LOG_WARNING; break;
- case YUI_LOG_ERROR: y2logLevel = LOG_ERROR; break;
- }
-
- if ( ! logComponent )
- logComponent = "??";
-
- if ( ! sourceFileName )
- sourceFileName = "??";
-
- if ( ! sourceFunctionName )
- sourceFunctionName = "??";
-
- if ( ! message )
- message = "";
-
- y2_logger( y2logLevel, logComponent,
- sourceFileName, sourceLineNo, sourceFunctionName,
- "%s", message );
-}
-
-
-
// EOF
Modified: trunk/core/libyui/src/YUIComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUIComponent.cc?rev=44247&r1=44246&r2=44247&view=diff
==============================================================================
--- trunk/core/libyui/src/YUIComponent.cc (original)
+++ trunk/core/libyui/src/YUIComponent.cc Thu Feb 7 16:11:10 2008
@@ -28,6 +28,24 @@
#include "Y2UINamespace.h"
#include "YUI.h"
+#include "YMacro.h"
+#include "YCPMacroRecorder.h"
+#include "YCPMacroPlayer.h"
+
+#define YUILogComponent "ui"
+#include "YUILog.h"
+
+
+static void
+yui_y2logger( YUILogLevel_t logLevel,
+ const char * logComponent,
+ const char * sourceFileName,
+ int sourceLineNo,
+ const char * sourceFunctionName,
+ const char * message );
+
+
+
// Most class variables are static so they can be accessed from static methods.
@@ -105,7 +123,12 @@
}
y2debug( "Creating UI" );
+ YUILog::setLoggerFunction( yui_y2logger );
_ui = createUI( _argc, _argv, _with_threads, _macro_file );
+
+
+ YMacro::setRecorder( new YCPMacroRecorder() );
+ YMacro::setPlayer ( new YCPMacroPlayer() );
}
@@ -191,4 +214,49 @@
return 0;
}
+
+
+static void
+yui_y2logger( YUILogLevel_t logLevel,
+ const char * logComponent,
+ const char * sourceFileName,
+ int sourceLineNo,
+ const char * sourceFunctionName,
+ const char * message )
+{
+ loglevel_t y2logLevel = LOG_DEBUG;
+
+ switch ( logLevel )
+ {
+ case YUI_LOG_DEBUG: y2logLevel = LOG_DEBUG; break;
+ case YUI_LOG_MILESTONE: y2logLevel = LOG_MILESTONE; break;
+ case YUI_LOG_WARNING: y2logLevel = LOG_WARNING; break;
+ case YUI_LOG_ERROR: y2logLevel = LOG_ERROR; break;
+ }
+
+ if ( ! logComponent )
+ logComponent = "??";
+
+ if ( ! sourceFileName )
+ sourceFileName = "??";
+
+ if ( ! sourceFunctionName )
+ sourceFunctionName = "??";
+
+ if ( ! message )
+ message = "";
+
+ y2_logger( y2logLevel, logComponent,
+ sourceFileName, sourceLineNo, sourceFunctionName,
+ "%s", message );
+}
+
+
+
+
+
+
+
+
+
// EOF
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org