Author: sh-sh-sh
Date: Thu Jan 17 16:29:33 2008
New Revision: 43720
URL: http://svn.opensuse.org/viewcvs/yast?rev=43720&view=rev
Log:
YCP-less logging
Modified:
trunk/core/libyui/src/YAlignment.cc
trunk/core/libyui/src/YApplication.cc
trunk/core/libyui/src/YBarGraph.cc
trunk/core/libyui/src/YCheckBoxFrame.cc
trunk/core/libyui/src/YComboBox.cc
trunk/core/libyui/src/YDialog.cc
trunk/core/libyui/src/YLayoutBox.cc
trunk/core/libyui/src/YMultiProgressMeter.cc
trunk/core/libyui/src/YPackageSelector.cc
trunk/core/libyui/src/YPushButton.cc
trunk/core/libyui/src/YSelectionWidget.cc
trunk/core/libyui/src/YShortcut.cc
trunk/core/libyui/src/YShortcutManager.cc
trunk/core/libyui/src/YUILog.h
trunk/core/libyui/src/YWizard.cc
Modified: trunk/core/libyui/src/YAlignment.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YAlignment.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YAlignment.cc (original)
+++ trunk/core/libyui/src/YAlignment.cc Thu Jan 17 16:29:33 2008
@@ -17,12 +17,13 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YAlignment.h"
#include "YBothDim.h"
using std::min;
+using std::max;
struct YAlignmentPrivate
@@ -210,7 +211,7 @@
{
if ( ! hasChildren() )
{
- y2error( "No child in %s", widgetClass() );
+ yuiError() << "No child in " << this << endl;
return;
}
@@ -299,9 +300,9 @@
moveChild( firstChild(), newChildPos.hor, newChildPos.vert );
#if 0
- y2debug( "setSize( alignment, %d, %d )", newWidth, newHeight );
- y2debug( "setSize( child, %d, %d )", newChildSize.hor, newChildSize.vert );
- y2debug( "moveChild( %d, %d) ", newChildPos.hor, newChildPos.vert );
+ yuiDebug() << "setSize( alignment, " << newWidth << ", " << newHeight << ")" << endl;
+ yuiDebug() << "setSize( child, " << newChildSize.hor << ", " << newChildSize.vert << ")" << endl;
+ yuiDebug() << "moveChild( " << newChildPos.hor << ", " << newChildPos.vert << ")" << endl;
#endif
}
Modified: trunk/core/libyui/src/YApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YApplication.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YApplication.cc (original)
+++ trunk/core/libyui/src/YApplication.cc Thu Jan 17 16:29:33 2008
@@ -20,8 +20,8 @@
#include // setlocale()
#include <map>
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YApplication.h"
#include "YDialog.h"
@@ -124,7 +124,7 @@
setenv( "LANG", lang.c_str(), 1 ); // 1 : replace
setlocale( LC_NUMERIC, "C" ); // but always format numbers with "."
- y2milestone ( "Setting language to \"%s\"", lang.c_str() );
+ yuiMilestone() << "Setting language to " << lang << endl;
}
Modified: trunk/core/libyui/src/YBarGraph.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YBarGraph.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YBarGraph.cc (original)
+++ trunk/core/libyui/src/YBarGraph.cc Thu Jan 17 16:29:33 2008
@@ -19,8 +19,8 @@
#include
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YUISymbols.h"
#include "YBarGraph.h"
@@ -230,146 +230,3 @@
if ( _barGraph->priv->updatesPending )
_barGraph->updateDisplay();
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#if 0
-
-
-
-YCPValue YBarGraph::changeWidget( const YCPSymbol & property, const YCPValue & newValue )
-{
- string s = property->symbol();
-
- /**
- * @property integer-list Values
- * The numerical values of each segment.
- */
- if ( s == YUIProperty_Values )
- {
- if ( newValue->isList() )
- {
- parseValuesList ( newValue->asList() );
- doUpdate();
-
- return YCPBoolean( true );
- }
- else
- {
- y2error( "YBarGraph::changeWidget( `Values ): list of integers expected, not %s",
- newValue->toString().c_str() );
-
- return YCPBoolean( false );
- }
- }
- /**
- * @property string-list Labels
- * The labels for each segment. "\n" allowed.
- * Use "%1" as a placeholder for the current value.
- */
- if ( s == YUIProperty_Labels )
- {
- if ( newValue->isList() )
- {
- parseLabelsList ( newValue->asList() );
- doUpdate();
-
- return YCPBoolean( true );
- }
- else
- {
- y2error( "YBarGraph::changeWidget( `Labels ): list of strings expected, not %s",
- newValue->toString().c_str() );
-
- return YCPBoolean( false );
- }
- }
- else return YWidget::changeWidget( property, newValue );
-}
-
-
-
-void YBarGraph::parseValuesList( const YCPList & newVal )
-{
- _values.clear();
-
- for ( int i=0; i < newVal->size(); i++ )
- {
- YCPValue val( newVal->value(i) );
-
- if ( val->isInteger() )
- {
- _values.push_back( val->asInteger()->value() );
- }
- else
- {
- y2error( "YBarGraph::parseValueList(): Syntax error: "
- "Expecting integer, you passed \"%s\"",
- val->toString().c_str() );
-
- _values.push_back(0);
- }
- }
-}
-
-
-void YBarGraph::parseLabelsList( const YCPList & newLabels )
-{
- _labels.clear();
-
- if ( newLabels->size() != segments() )
- {
- y2warning( "YBarGraph::parseLabelsList(): Warning: "
- "The number of labels ( %d ) is not equal "
- "to the number of values ( %d )!",
- segments(), newLabels->size() );
- }
-
- for ( int i=0; i < newLabels->size(); i++ )
- {
- YCPValue val( newLabels->value(i) );
-
- if ( i < segments() )
- {
- if ( val->isString() )
- {
- _labels.push_back( val->asString()->value() );
- }
- else
- {
- y2error( "YBarGraph::parseLabelsList(): Syntax error: "
- "Expecting string, you passed \"%s\"",
- val->toString().c_str() );
-
- _labels.push_back( "" );
- }
- }
- else
- {
- y2error( "YBarGraph::parseLabelsList(): Warning: "
- "Ignoring excess label \"%s\"",
- val->toString().c_str() );
- }
- }
-}
-
-
-#endif
Modified: trunk/core/libyui/src/YCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCheckBoxFrame.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YCheckBoxFrame.cc (original)
+++ trunk/core/libyui/src/YCheckBoxFrame.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YUISymbols.h"
#include "YMacroRecorder.h"
@@ -74,7 +74,7 @@
void YCheckBoxFrame::setAutoEnable( bool autoEnable )
{
- // y2debug( "Auto enable %s", autoEnable ? "on" : "off" );
+ // yuiDebug() << "Auto enable: " << boolalpha << autoEnable << endl;
priv->autoEnable = autoEnable;
}
@@ -85,7 +85,7 @@
void YCheckBoxFrame::setInvertAutoEnable( bool invertAutoEnable )
{
- // y2debug( "Invert auto enable %s", invertAutoEnable ? "on" : "off" );
+ // yuiDebug() << "Invert auto enable: ", boolalpha << invertAutoEnable << endl;
priv->invertAutoEnable = invertAutoEnable;
}
@@ -97,10 +97,7 @@
if ( invertAutoEnable() )
enabled = ! enabled;
- y2debug( "%s child widgets of %s",
- enabled ? "Enabling" : "Disabling",
- widgetClass() );
-
+ yuiDebug() << ( enabled ? "Enabling" : "Disabling" ) << " child widgets of " << this << endl;
setChildrenEnabled( enabled );
}
}
Modified: trunk/core/libyui/src/YComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YComboBox.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YComboBox.cc (original)
+++ trunk/core/libyui/src/YComboBox.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YUISymbols.h"
#include "YMacroRecorder.h"
Modified: trunk/core/libyui/src/YDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YDialog.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YDialog.cc (original)
+++ trunk/core/libyui/src/YDialog.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include
#include "YDialog.h"
#include "YShortcutManager.h"
@@ -59,7 +59,7 @@
_dialogStack.push( this );
#if VERBOSE_DIALOGS
- y2debug( "New YDialog at %p", this );
+ yuiDebug() << "New YDialog " << this << endl;
#endif
}
@@ -67,7 +67,7 @@
YDialog::~YDialog()
{
#if VERBOSE_DIALOGS
- y2debug( "Destroying YDialog at %p", this );
+ yuiDebug() << "Destroying " << this << endl;
#endif
}
@@ -105,7 +105,7 @@
{
if ( priv->shortcutCheckPostponed && ! force )
{
- y2debug( "shortcut check postponed" );
+ yuiDebug() << "Shortcut check postponed" << endl;
}
else
{
@@ -130,8 +130,9 @@
{
if ( newDefaultButton && priv->defaultButton ) // already have one?
{
- y2error( "Too many `opt(`default) PushButtons: [%s]",
- newDefaultButton->label().c_str() );
+ yuiError() << "Too many `opt(`default) PushButtons: ["
+ << newDefaultButton->label()
+ << "]" << endl;
}
priv->defaultButton = newDefaultButton;
@@ -142,7 +143,7 @@
YDialog::setInitialSize()
{
#if VERBOSE_DIALOGS
- y2debug( "Setting initial size for YDialog at %p", this );
+ yuiDebug() << "Setting initial size for " << this << endl;
#endif
// Trigger geometry management
Modified: trunk/core/libyui/src/YLayoutBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YLayoutBox.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YLayoutBox.cc (original)
+++ trunk/core/libyui/src/YLayoutBox.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui-layout"
-#include
+#define YUILogComponent "ui-layout"
+#include "YUILog.h"
#include "YLayoutBox.h"
#include "YAlignment.h"
@@ -91,9 +91,9 @@
{
priv->debugLayout = deb;
- y2debug( "YLayoutBox: Layout debugging %s",
- deb ? "enabled" : "disabled" );
-
+ yuiDebug() << "YLayoutBox: Layout debugging "
+ << ( deb ? "enabled" : "disabled" )
+ << endl;
}
@@ -202,16 +202,14 @@
{
if ( dominatingChild >= 0 )
{
- y2debug( "YLayoutBox::findDominatingChild(): "
- "Found dominating child: %s - preferred size: %d, weight: %d",
- dominatingChild->widgetClass(),
- dominatingChild->preferredSize( primary() ),
- dominatingChild->weight( primary() ) );
+ yuiDebug() << "Found dominating child: " << dominatingChild
+ << " - preferred size: " << dominatingChild->preferredSize( primary() )
+ << ", weight: " << dominatingChild->weight( primary() )
+ << endl;
}
else
{
- y2debug( "YLayoutBox::findDominatingChild(): "
- "This layout doesn't have a dominating child." );
+ yuiDebug() << "This layout doesn't have a dominating child." << endl;
}
}
@@ -444,13 +442,13 @@
if ( debugLayout() )
{
- y2debug( "Distributing extra space" );
- y2debug( "new size: %d", newSize );
- y2debug( "distributable size: %d", distributableSize );
- y2debug( "rubber band extra: %d", rubberBandExtra );
- y2debug( "rubber bands: %d", rubberBands );
- y2debug( "total weight: %d", totalWeight );
- y2debug( "non weighted extra: %d", nonWeightedExtra );
+ yuiDebug() << "Distributing extra space" << endl;
+ yuiDebug() << "\tnew size: " << newSize << endl;
+ yuiDebug() << "\tdistributable size: " << distributableSize << endl;
+ yuiDebug() << "\trubber band extra: " << rubberBandExtra << endl;
+ yuiDebug() << "\trubber bands: " << rubberBands << endl;
+ yuiDebug() << "\ttotal weight: " << totalWeight << endl;
+ yuiDebug() << "\tnon weighted extra: " << nonWeightedExtra << endl;
}
int i=0;
@@ -468,9 +466,12 @@
if ( childSize[i] < child->preferredSize( primary() ) )
{
- y2debug( "Resizing child widget #%d (%s) below its preferred size of %d to %d "
- "- check the layout!",
- i, child->widgetClass(), child->preferredSize( primary() ), childSize[i] );
+ yuiDebug() << "Resizing child widget #" << i
+ << "(" << child
+ << ") below its preferred size of " << child->preferredSize( primary() )
+ << " to " << childSize[i]
+ << " - check the layout!"
+ << endl;
}
}
else
@@ -520,7 +521,7 @@
int remainingMargins = 0L;
double marginScale = 0.0;
- y2debug ( "Not enough space - %d too small - check the layout!", tooSmall );
+ yuiDebug() << "Not enough space: " << tooSmall << " too small - check the layout!" << endl;
// Maybe some of the children are YAlignments with margins that can be reduced
@@ -536,7 +537,7 @@
if ( alignment )
{
totalMargins += alignment->totalMargins( primary() );
- y2debug( "Found alignment with margins" );
+ yuiDebug() << "Found alignment with margins" << endl;
}
}
}
@@ -548,14 +549,16 @@
tooSmall = 0L;
marginScale = ( (double) remainingMargins ) / totalMargins;
- y2debug( "Making up for insufficient space by reducing margins to %.3g%% - %d left for margins",
- 100.0 * marginScale, remainingMargins );
+ yuiDebug() << "Making up for insufficient space by reducing margins to "
+ << 100.0 * marginScale << "% - "
+ << remainingMargins << " left for margins"
+ << endl;
}
else // Reducing all margins to zero still doesn't solve the problem
{
tooSmall -= totalMargins;
- y2debug( "Reducing all margins to 0, but still %d too small", tooSmall );
+ yuiDebug() << "Reducing all margins to 0, but still " << tooSmall << " too small" << endl;
}
@@ -602,8 +605,9 @@
{
if ( debugLayout() )
{
- y2debug( "Distributing insufficient space of %d amoung %d losers",
- tooSmall, loserCount );
+ yuiDebug() << "Distributing insufficient space of " << tooSmall
+ << " amoung " << loserCount << " losers"
+ << endl;
}
int dividedLoss = std::max( tooSmall / loserCount, 1 );
@@ -639,15 +643,14 @@
{
YWidget * child = *it;
- y2debug( "child #%d ( %s ) will get %d - %d too small "
- "(preferred size: %d, weight: %d, stretchable: %s), pos %d",
- i, child->widgetClass(),
- childSize[i],
- child->preferredSize( primary() ) - childSize[i],
- child->preferredSize( primary() ),
- child->weight( primary() ),
- child->stretchable( primary() ) ? "yes" : "no",
- childPos[i] );
+ yuiDebug() << "child #" << i <<" ( " << child
+ << " ) will get " << childSize[i]
+ << " - " << child->preferredSize( primary() ) - childSize[i] << " too small"
+ << " (preferred size: "<< child->preferredSize( primary() )
+ << ", weight: " << child->weight( primary() )
+ << ", stretchable: " << ( child->stretchable( primary() ) ? "yes" : "no" )
+ << "), pos: " << childPos[i]
+ << endl;
}
}
}
@@ -692,21 +695,24 @@
if ( childSize[i] < preferred )
{
- y2debug( "Resizing child widget #%d (%s) below its preferred size of %d to %d "
- "- check the layout!",
- i, child->widgetClass(), preferred, childSize[i] );
+ yuiDebug() << "Resizing child widget #" << i
+ << " (" << child
+ << ") below its preferred size of " << preferred
+ << " to " << childSize[i]
+ << "- check the layout!"
+ << endl;
}
if ( debugLayout() )
{
- y2debug( "child #%d (%s) will get %d "
- "(preferred size: %d, weight: %d, stretchable: %s), pos %d",
- i, child->widgetClass(),
- childSize[i],
- preferred,
- child->weight( secondary() ),
- child->stretchable( secondary() ) ? "yes" : "no",
- childPos[i] );
+ yuiDebug() << "child #" << i
+ << " (" << child
+ << ") will get " << childSize[i]
+ << "(preferred size: " << preferred
+ << ", weight: " << child->weight( secondary() )
+ << ", stretchable: " << ( child->stretchable( secondary() ) ? "yes" : "no" )
+ << "), pos: " << childPos[i]
+ << endl;
}
}
}
@@ -730,14 +736,12 @@
if ( debugLayout() )
{
- string label = child->debugLabel();
-
- if ( ! label.empty() )
- label = "\"" + label + "\"";
-
- y2milestone( "x: %4d y: %4d w: %4d h: %4d %s %s",
- x_pos[i], y_pos[i], width[i], height[i],
- child->widgetClass(), label.c_str() );
+ yuiMilestone() << "x: " << x_pos[i]
+ << " y: " << y_pos[i]
+ << " w: " << width[i]
+ << " h: " << height[i]
+ << child
+ << endl;
}
}
}
Modified: trunk/core/libyui/src/YMultiProgressMeter.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YMultiProgressMeter.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YMultiProgressMeter.cc (original)
+++ trunk/core/libyui/src/YMultiProgressMeter.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YUISymbols.h"
#include "YMultiProgressMeter.h"
@@ -176,65 +176,3 @@
}
-
-
-#if 0
- //
- // SetProp
- //
-
- /**
- * @property string Values the current values for all segments
- */
- if ( s == YUIProperty_Values )
- {
- if ( newValue->isList() )
- {
- YCPList valList = newValue->asList();
-
- if ( valList->size() == segments() )
- {
- for ( int i=0; i < segments(); i++ )
- {
- setCurrentValue( i, valList->value( i )->asInteger()->value() );
- }
-
- y2debug( "Setting values: %s", valList->toString().c_str() );
- doUpdate(); // notify derived classes
- return YCPBoolean( true );
- }
- else
- {
- y2error( "Expected %d values for MultiProgressMeter, not %d (%s)",
- segments(), valList->size(), valList->toString().c_str() );
- }
-
- return YCPBoolean( false );
- }
- else
- {
- y2error( "Expected list<integer> for MultiProgressMeter values, not %s",
- newValue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
-
- //
- // GetProp
- //
-
- string s = property->symbol();
- if ( s == YUIProperty_Values )
- {
- YCPList values;
-
- for ( int i=0; i < segments(); i++ )
- {
- val = ( i < (int) _currentValues.size() ) ? _currentValues[ i ] : -1;
- values->add( YCPInteger( val ) );
- }
-
- return values;
- }
-
-#endif
Modified: trunk/core/libyui/src/YPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YPackageSelector.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YPackageSelector.cc (original)
+++ trunk/core/libyui/src/YPackageSelector.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui-pkg"
-#include
+#define YUILogComponent "ui-pkg"
+#include "YUILog.h"
#include "YPackageSelector.h"
@@ -27,7 +27,7 @@
: YWidget( parent )
, _modeFlags( modeFlags )
{
- y2milestone( "YPackageSelector flags: 0x%lx", modeFlags );
+ yuiMilestone() << "YPackageSelector flags: " << hex << modeFlags << dec << endl;
setDefaultStretchable( YD_HORIZ, true );
setDefaultStretchable( YD_VERT, true );
Modified: trunk/core/libyui/src/YPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YPushButton.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YPushButton.cc (original)
+++ trunk/core/libyui/src/YPushButton.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YUI.h"
#include "YApplication.h"
Modified: trunk/core/libyui/src/YSelectionWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YSelectionWidget.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YSelectionWidget.cc (original)
+++ trunk/core/libyui/src/YSelectionWidget.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include <algorithm>
#include "YSelectionWidget.h"
@@ -157,7 +157,7 @@
priv->itemCollection.push_back( item );
item->setIndex( priv->itemCollection.size() - 1 );
- // y2debug( "Adding item \"%s\"", item->label().c_str() );
+ // yuiDebug() << "Adding item \"" << item->label() << "\"" << endl;
//
// Enforce single selection (if applicable)
@@ -316,7 +316,7 @@
item->childrenEnd() );
if ( selectedItem )
{
- // y2debug( "Selected item: \"%s\"", selectedItem->label().c_str() );
+ // yuiDebug() <<( "Selected item: \"" << selectedItem->label() << "\"" << endl;
return selectedItem;
}
}
Modified: trunk/core/libyui/src/YShortcut.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YShortcut.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YShortcut.cc (original)
+++ trunk/core/libyui/src/YShortcut.cc Thu Jan 17 16:29:33 2008
@@ -18,8 +18,8 @@
-#define y2log_component "ui-shortcuts"
-#include
+#define YUILogComponent "ui-shortcuts"
+#include "YUILog.h"
#include "YShortcut.h"
#include "YPushButton.h"
#include // toupper(), tolower()
@@ -46,14 +46,14 @@
{
_isWizardButton = strstr( shortcutWidget->widgetClass(), "WizardButton" );
- // y2debug( "%s %s is %sa wizard button", widgetClass(), cleanShortcutString().c_str(), _isWizardButton ? "" : "not " );
+ // yuiDebug() << shortcutWidget << ( _isWizardButton ? " is " : " is not " ) << "a wizard button" << endl;
}
else
{
_isWizardButton = 0;
}
- // y2debug( "%s %s is %sa button", widgetClass(), cleanShortcutString().c_str(), _isButton ? "" : "not " );
+ // yuiDebug() << shortcutWidget << ( _isButton ? " is " : " is not " ) << "a button" << endl;
}
@@ -140,8 +140,10 @@
if ( pos == string::npos )
{
- y2error( "Can't find '%c' in %s \"%s\"",
- newShortcut, widgetClass(), cleanShortcutString().c_str() );
+ yuiError() << "Can't find '<< " << newShortcut
+ << "' in " << widgetClass()
+ << " \"" << cleanShortcutString() << "\""
+ << endl;
return;
}
Modified: trunk/core/libyui/src/YShortcutManager.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YShortcutManager.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YShortcutManager.cc (original)
+++ trunk/core/libyui/src/YShortcutManager.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui-shortcuts"
-#include
+#define YUILogComponent "ui-shortcuts"
+#include "YUILog.h"
#include "YShortcutManager.h"
#include "YDialog.h"
@@ -45,7 +45,7 @@
void
YShortcutManager::checkShortcuts( bool autoResolve )
{
- y2debug( "Checking keyboard shortcuts" );
+ yuiDebug() << "Checking keyboard shortcuts" << endl;
clearShortcutList();
findShortcutWidgets( _dialog->childrenBegin(), _dialog->childrenEnd() );
@@ -78,10 +78,10 @@
{
shortcut->setConflict();
_conflictCount++;
- y2milestone( "Shortcut conflict: '%c' used for %s \"%s\"",
- shortcut->preferred(),
- shortcut->widgetClass(),
- shortcut->shortcutString().c_str() );
+
+ yuiMilestone() << "Shortcut conflict: '" << shortcut->preferred()
+ << "' used for " << shortcut->widget()
+ << endl;
}
}
else // No or invalid shortcut
@@ -93,9 +93,7 @@
if ( ! shortcut->widget()->autoShortcut() )
{
- y2milestone( "No valid shortcut for %s \"%s\"",
- shortcut->widgetClass(),
- shortcut->cleanShortcutString().c_str() );
+ yuiMilestone() << "No valid shortcut for " << shortcut->widget() << endl;
}
}
}
@@ -117,32 +115,19 @@
}
else
{
- y2debug( "No shortcut conflicts" );
+ yuiDebug() << "No shortcut conflicts" << endl;
}
-
-#if 0
- for ( unsigned i=0; i < _shortcutList.size(); i++ )
- {
- YShortcut *shortcut = _shortcutList[i];
-
- y2debug( "Shortcut '%c' for %s \"%s\" ( original: \"%s\" )",
- shortcut->shortcut() ? shortcut->shortcut() : ' ',
- shortcut->widgetClass(),
- shortcut->cleanShortcutString().c_str(),
- shortcut->shortcutString().c_str() );
- }
-#endif
}
void
YShortcutManager::resolveAllConflicts()
{
- y2debug( "Resolving shortcut conflicts" );
+ yuiDebug() << "Resolving shortcut conflicts" << endl;
if ( ! _didCheck )
{
- y2milestone( "Call checkShortcuts() first!" );
+ yuiMilestone() << "Call checkShortcuts() first!" << endl;
return;
}
@@ -186,9 +171,7 @@
if ( shortcut->conflict() )
{
- y2milestone( "Couldn't resolve shortcut conflict for %s \"%s\"",
- shortcut->widgetClass(), shortcut->cleanShortcutString().c_str() );
-
+ yuiMilestone() << "Couldn't resolve shortcut conflict for " << shortcut->widget() << endl;
}
@@ -199,7 +182,7 @@
if ( _conflictCount > 0 )
{
- y2debug( "%d shortcut conflict(s) left", _conflictCount );
+ yuiDebug() << _conflictCount << " shortcut conflict(s) left" << endl;
}
}
@@ -208,7 +191,7 @@
void
YShortcutManager::resolveConflict( YShortcut * shortcut )
{
- // y2debug( "Picking shortcut for %s \"%s\"", shortcut->widgetClass(), shortcut->cleanShortcutString().c_str() );
+ // yuiDebug() << "Picking shortcut for " << shortcut->widget() << endl;
char candidate = shortcut->preferred(); // This is always normalized, no need to normalize again.
@@ -221,7 +204,7 @@
for ( string::size_type pos = 0; pos < str.length(); pos++ ) // Search all the shortcut string.
{
char c = YShortcut::normalized( str[ pos ] );
- // y2debug( "Checking #%d '%c'", (int) c, c );
+ // yuiDebug() << "Checking '" << c << "'" << endl;
if ( YShortcut::isValid(c) && ! _used[ (int) c ] ) // Could we use this character?
{
@@ -229,7 +212,7 @@
|| ! YShortcut::isValid( candidate ) ) // or don't we have anything yet?
{
candidate = c; // Use this one.
- // y2debug( "Picking %c", c );
+ // yuiDebug() << "Picking '" << c << "'" << endl;
if ( _wanted[ (int) c ] == 0 ) // It doesn't get any better than this:
break; // Nobody wants this shortcut anyway.
@@ -244,20 +227,24 @@
{
if ( shortcut->widget()->autoShortcut() )
{
- y2debug( "Automatically assigning shortcut '%c' to %s(`opt(`autoShortcut ), \"%s\" )",
- candidate, shortcut->widgetClass(), shortcut->cleanShortcutString().c_str() );
+ yuiDebug() << "Automatically assigning shortcut '" << candidate
+ << "' to " << shortcut->widgetClass() << "(`opt(`autoShortcut ), \""
+ << shortcut->cleanShortcutString() << "\" )"
+ << endl;
}
else
{
- y2debug( "Reassigning shortcut '%c' for %s \"%s\"",
- candidate, shortcut->widgetClass(), shortcut->cleanShortcutString().c_str() );
+ yuiDebug() << "Reassigning shortcut '" << candidate
+ << "' for " << shortcut->widget()
+ << endl;
}
shortcut->setShortcut( candidate );
}
else
{
- y2debug( "Keeping preferred shortcut '%c' for %s \"%s\"",
- candidate, shortcut->widgetClass(), shortcut->cleanShortcutString().c_str() );
+ yuiDebug() << "Keeping preferred shortcut '" << candidate
+ << "' for " << shortcut->widget()
+ << endl;
}
_used[ (int) candidate ] = true;
@@ -265,8 +252,11 @@
}
else // No unique shortcut found
{
- y2milestone( "Couldn't resolve shortcut conflict for %s \"%s\" - assigning no shortcut",
- shortcut->widgetClass(), shortcut->cleanShortcutString().c_str() );
+ yuiMilestone() << "Couldn't resolve shortcut conflict for "
+ << shortcut->widget()
+ << " - assigning no shortcut"
+ << endl;
+
shortcut->clearShortcut();
shortcut->setConflict( false );
}
Modified: trunk/core/libyui/src/YUILog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUILog.h?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YUILog.h (original)
+++ trunk/core/libyui/src/YUILog.h Thu Jan 17 16:29:33 2008
@@ -52,6 +52,8 @@
using std::endl;
using std::hex;
using std::dec;
+using std::boolalpha;
+using std::noboolalpha;
//
// ------ End of user relevant part ------
Modified: trunk/core/libyui/src/YWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWizard.cc?rev=43720&r1=43719&r2=43720&view=diff
==============================================================================
--- trunk/core/libyui/src/YWizard.cc (original)
+++ trunk/core/libyui/src/YWizard.cc Thu Jan 17 16:29:33 2008
@@ -17,8 +17,8 @@
/-*/
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YWizard.h"
#include "YPushButton.h"
@@ -81,17 +81,19 @@
void
YWizard::setButtonLabel( YPushButton * button, const string & label )
{
+ // FIXME: Throw exception? ( YUI_CHECK_PTR() )
+
if ( button )
button->setLabel( label );
else
- y2error( "NULL button" );
+ yuiError() << "NULL button" << endl;
}
void
YWizard::ping()
{
- y2debug( "YWizard is active" );
+ yuiDebug() << "YWizard is active" << endl;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org