Author: sh-sh-sh
Date: Fri Jul 13 19:20:43 2007
New Revision: 39411
URL: http://svn.opensuse.org/viewcvs/yast?rev=39411&view=rev
Log:
ported MultiProgressMeter
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h
branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h
branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.cc
branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.h
branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Fri Jul 13 19:20:43 2007
@@ -335,3 +335,8 @@
2007-07-06 18:30 sh@suse.de
* Ported YTree
+
+2007-07-13 19:20 sh@suse.de
+
+* Ported MultiProgressMeter
+ - now using float values internally to safeguard against huge numbers
\ No newline at end of file
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Fri Jul 13 19:20:43 2007
@@ -34,13 +34,13 @@
#include "YCPValueWidgetID.h"
#include "YCPItemParser.h"
#include "YCPTreeItemParser.h"
+#include "YCP_UI_Exception.h"
#include "YDialog.h"
#include "YUI_util.h"
#include "YWidgetFactory.h"
#include "YOptionalWidgetFactory.h"
#include "YBothDim.h"
-
#include "YAlignment.h"
#include "YBarGraph.h"
#include "YCheckBox.h"
@@ -55,6 +55,7 @@
#include "YLayoutBox.h"
#include "YMenuButton.h"
#include "YMultiLineEdit.h"
+#include "YMultiProgressMeter.h"
#include "YMultiSelectionBox.h"
#include "YPackageSelector.h"
#include "YProgressBar.h"
@@ -261,8 +262,8 @@
else if ( s == YUISpecialWidget_DownloadProgress ) w = parseDownloadProgress ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_BarGraph ) w = parseBarGraph ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_DumbTab ) w = parseDumbTab ( p, opt, term, ol, n );
- else if ( s == YUISpecialWidget_HMultiProgressMeter ) w = parseMultiProgressMeter ( p, opt, term, ol, n, true );
- else if ( s == YUISpecialWidget_VMultiProgressMeter ) w = parseMultiProgressMeter ( p, opt, term, ol, n, false );
+ else if ( s == YUISpecialWidget_HMultiProgressMeter ) w = parseMultiProgressMeter ( p, opt, term, ol, n, YD_HORIZ );
+ else if ( s == YUISpecialWidget_VMultiProgressMeter ) w = parseMultiProgressMeter ( p, opt, term, ol, n, YD_VERT );
else if ( s == YUISpecialWidget_PartitionSplitter ) w = parsePartitionSplitter ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_PatternSelector ) w = parsePatternSelector ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_SimplePatchSelector ) w = parseSimplePatchSelector ( p, opt, term, ol, n );
@@ -2876,7 +2877,7 @@
YWidget *
YCPDialogParser::parseMultiProgressMeter( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- bool horizontal )
+ YUIDimension dim )
{
int numArgs = term->size() - argnr;
@@ -2887,39 +2888,52 @@
return 0;
}
- YCPList maxValues = term->value( argnr )->asList();
-
- if ( maxValues->size() < 1 )
+ vector<float> maxValues;
+
+ try
{
- y2error( "Empty MultiProgressMeter maxValues list" );
- return 0;
+ maxValues = parseNumList( term->value( argnr )->asList() );
}
-
- for ( int i=0; i < maxValues->size(); i++ )
+ catch ( YUIException & exception )
{
- if ( ! maxValues->value( i )->isInteger() )
- {
- y2error( "MultiProgressMeter maxValues list should contain integer values, not %s",
- maxValues->value( i )->toString().c_str() );
- return 0;
- }
+ YUI_RETHROW( exception );
+ }
+
+ if ( maxValues.size() < 1 )
+ {
+ YUI_THROW( YCPDialogSyntaxErrorException( "Expected list<integer> or list<float>",
+ term->value( argnr ) ) );
}
-
rejectAllOptions( term,optList );
- YWidget *multiProgressMeter;
+ return YUI::optionalWidgetFactory()->createMultiProgressMeter( parent, dim, maxValues );
+}
- if ( YUI::ui()->hasMultiProgressMeter() )
- {
- multiProgressMeter = YUI::ui()->createMultiProgressMeter( parent, opt, horizontal, maxValues );
- }
- else
+
+vector<float>
+YCPDialogParser::parseNumList( const YCPList & yList )
+{
+ vector<float> result;
+
+ for ( int i=0; i < yList->size(); i++ )
{
- y2error( "This UI does not support the MultiProgressMeter widget." );
- return 0;
+ YCPValue val = yList->value( i );
+
+ if ( val->isInteger() )
+ {
+ result.push_back( (float) val->asInteger()->value() );
+ }
+ else if ( val->isFloat() )
+ {
+ result.push_back( val->asFloat()->value() );
+ }
+ else
+ {
+ YUI_THROW( YCPDialogSyntaxErrorException( "Expected list<integer> or list<float>", yList ) );
+ }
}
- return multiProgressMeter;
+ return result;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h Fri Jul 13 19:20:43 2007
@@ -19,12 +19,14 @@
#ifndef YCPDialogParser_h
#define YCPDialogParser_h
+#include <vector>
#include
#include
#include "YTypes.h"
#include "YWidgetOpt.h"
+using std::vector;
class YWidget;
class YMenu;
@@ -92,6 +94,13 @@
* Parse a menu list (for menu buttons)
**/
static int parseMenuItemList( const YCPList & itemList, YMenuButton *menu_button, YMenu *parentMenu = 0 );
+
+ /**
+ * Parse a list of numeric values and return it as a vector<float>.
+ * Throws exceptions upon syntax errors.
+ **/
+ static vector<float> parseNumList( const YCPList & yList );
+
protected:
@@ -243,7 +252,8 @@
const YCPList & optList, int argnr );
static YWidget * parseMultiProgressMeter( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term,
- const YCPList & optList, int argnr, bool horizontal );
+ const YCPList & optList, int argnr,
+ YUIDimension dim );
static YWidget * parseSlider( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term,
const YCPList & optList, int argnr );
@@ -294,7 +304,6 @@
**/
static void rejectAllOptions( const YCPTerm & term, const YCPList & optList );
-
private:
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc Fri Jul 13 19:20:43 2007
@@ -43,6 +43,7 @@
#include "YCheckBox.h"
#include "YComboBox.h"
#include "YMultiSelectionBox.h"
+#include "YMultiProgressMeter.h"
#include "YRadioButton.h"
#include "YRadioButtonGroup.h"
#include "YSelectionBox.h"
@@ -66,6 +67,10 @@
if ( trySetTreeValue ( widget, val ) ) return true;
if ( trySetComboBoxValue ( widget, val ) ) return true;
}
+ if ( propertyName == YUIProperty_Values )
+ {
+ if ( trySetMultiProgressMeterValues ( widget, val ) ) return true;
+ }
else if ( propertyName == YUIProperty_CurrentItem )
{
if ( trySetSelectionBoxValue ( widget, val ) ) return true;
@@ -407,7 +412,31 @@
}
+bool
+YCPPropertyHandler::trySetMultiProgressMeterValues( YWidget * widget, const YCPValue & val )
+{
+ YMultiProgressMeter * multiProgressMeter = dynamic_cast (widget);
+
+ if ( ! multiProgressMeter )
+ return false;
+
+ if ( ! val->isList() )
+ {
+ string msg = "Expected a list of integers or floats";
+ YUI_THROW( YUIBadPropertyArgException( YProperty( YUIProperty_Values,
+ YOtherProperty ),
+ widget, msg ) );
+
+ }
+
+ multiProgressMeter->setCurrentValues( YCPDialogParser::parseNumList( val->asList() ) );
+
+ return true;
+}
+
+
+//------------------------------------------------------------------------------
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h Fri Jul 13 19:20:43 2007
@@ -83,6 +83,7 @@
static bool trySetSelectionWidgetItems ( YWidget * widget, const YCPValue & val );
static bool trySetRadioButtonGroupCurrentButton ( YWidget * widget, const YCPValue & val );
static bool trySetMultiSelectionBoxSelectedItems ( YWidget * widget, const YCPValue & val );
+ static bool trySetMultiProgressMeterValues ( YWidget * widget, const YCPValue & val );
/**
* All trySet..() functions try to dynamic_cast 'widget' to the expected
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.cc Fri Jul 13 19:20:43 2007
@@ -17,9 +17,6 @@
/-*/
-#include
-#include
-#include
#define y2log_component "ui"
#include
@@ -27,30 +24,164 @@
#include "YMultiProgressMeter.h"
+struct YMultiProgressMeterPrivate
+{
+ YMultiProgressMeterPrivate( YUIDimension dim,
+ const vector<float> & maxValues )
+ : dim( dim )
+ , maxValues( maxValues )
+ {
+ // Make currentValues as large as maxValues
+ // and initialize each element with 0
+ currentValues = vector<float>( maxValues.size(), 0.0 );
+ }
+
+
+ YUIDimension dim;
+ vector<float> maxValues;
+ vector<float> currentValues;
+};
+
+
+
+
+YMultiProgressMeter::YMultiProgressMeter( YWidget * parent,
+ YUIDimension dim,
+ const vector<float> & maxValues )
+ : YWidget( parent )
+ , priv( new YMultiProgressMeterPrivate( dim, maxValues ) )
+{
+ YUI_CHECK_NEW( priv );
+
+ setDefaultStretchable( YD_HORIZ, dim == YD_HORIZ );
+ setDefaultStretchable( YD_VERT, dim == YD_VERT );
+}
+
+
+YMultiProgressMeter::~YMultiProgressMeter()
+{
+ // NOP
+}
+
+
+YUIDimension
+YMultiProgressMeter::dimension() const
+{
+ return priv->dim;
+}
+
+
+bool YMultiProgressMeter::horizontal() const
+{
+ return priv->dim == YD_HORIZ;
+}
+
+
+bool YMultiProgressMeter::vertical() const
+{
+ return priv->dim == YD_VERT;
+}
+
+
+int YMultiProgressMeter::segments() const
+{
+ return (int) priv->maxValues.size();
+}
+
+
+float YMultiProgressMeter::maxValue( int segment ) const
+{
+ YUI_CHECK_INDEX( segment, 0, (int) priv->maxValues.size() );
+
+ return priv->maxValues[ segment ];
+}
+
+
+float YMultiProgressMeter::currentValue( int segment ) const
+{
+ YUI_CHECK_INDEX( segment, 0, (int) priv->currentValues.size() );
+
+ return priv->currentValues[ segment ];
+}
+
+
+void YMultiProgressMeter::setCurrentValue( int segment, float value )
+{
+ YUI_CHECK_INDEX( segment, 0, (int) priv->currentValues.size() );
+
+ if ( value < 0.0 ) // Allow -1 etc. as marker values
+ value = 0.0;
+
+ if ( value > maxValue( segment ) ) // Don't complain (beware of rounding errors)
+ value = maxValue( segment );
+
+ priv->currentValues[ segment ] = value;
+}
+
+
+void YMultiProgressMeter::setCurrentValues( const vector<float> & values )
+{
+ for ( int i=0; i < values.size(); i++ )
+ {
+ setCurrentValue( i, values[i] );
+ }
+
+ doUpdate();
+}
+
-YMultiProgressMeter::YMultiProgressMeter( const YWidgetOpt & opt,
- bool horizontal,
- const YCPList & maxValues )
- : YWidget( opt )
- , _horizontal( horizontal )
+const YPropertySet &
+YMultiProgressMeter::propertySet()
{
- for ( int i=0; i < maxValues->size(); i++ )
+ static YPropertySet propSet;
+
+ if ( propSet.isEmpty() )
{
- Value_t val = maxValues->value( i )->asInteger()->value();
- _maxValues.push_back( val );
- _currentValues.push_back( val );
+ /*
+ * @property list<integer> Values the current values for all segments
+ */
+ propSet.add( YProperty( YUIProperty_Values, YOtherProperty ) );
+ propSet.add( YWidget::propertySet() );
}
- y2milestone( "maxValues: %s", maxValues->toString().c_str() );
+ return propSet;
+}
+
+
+bool
+YMultiProgressMeter::setProperty( const string & propertyName, const YPropertyValue & val )
+{
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
+
+ if ( propertyName == YUIProperty_Values ) return false; // need special processing
+ else
+ {
+ YWidget::setProperty( propertyName, val );
+ }
- setDefaultStretchable( YD_HORIZ, _horizontal );
- setDefaultStretchable( YD_VERT, ! _horizontal );
+ return true; // success -- no special handling necessary
}
-YCPValue YMultiProgressMeter::changeWidget( const YCPSymbol & property, const YCPValue & newValue )
+YPropertyValue
+YMultiProgressMeter::getProperty( const string & propertyName )
{
- string s = property->symbol();
+ propertySet().check( propertyName ); // throws exceptions if not found
+
+ if ( propertyName == YUIProperty_Values ) return YPropertyValue( YOtherProperty );
+ else
+ {
+ return YWidget::getProperty( propertyName );
+ }
+}
+
+
+
+
+#if 0
+ //
+ // SetProp
+ //
/**
* @property string Values the current values for all segments
@@ -87,13 +218,11 @@
return YCPBoolean( false );
}
}
- else return YWidget::changeWidget( property, newValue );
-}
-
+ //
+ // GetProp
+ //
-YCPValue YMultiProgressMeter::queryWidget( const YCPSymbol & property )
-{
string s = property->symbol();
if ( s == YUIProperty_Values )
{
@@ -101,63 +230,11 @@
for ( int i=0; i < segments(); i++ )
{
- Value_t val = ( i < (int) _currentValues.size() ) ? _currentValues[ i ] : -1;
+ val = ( i < (int) _currentValues.size() ) ? _currentValues[ i ] : -1;
values->add( YCPInteger( val ) );
}
return values;
}
- else return YWidget::queryWidget( property );
-}
-
-
-YMultiProgressMeter::Value_t
-YMultiProgressMeter::maxValue( int segment ) const
-{
- if ( segment >= 0 && segment <= (int) _maxValues.size() )
- return _maxValues[ segment ];
- else
- {
- y2error( "Index %d out of range (0..%zu)", segment, _maxValues.size() -1 );
- return -1;
- }
-}
-
-
-YMultiProgressMeter::Value_t
-YMultiProgressMeter::currentValue( int segment ) const
-{
- if ( segment >= 0 && segment <= (int) _currentValues.size() )
- return _currentValues[ segment ];
- else
- {
- y2error( "Index %d out of range (0..%zu)", segment, _currentValues.size() -1 );
- return -1;
- }
-}
-
-
-void YMultiProgressMeter::setCurrentValue( int segment, Value_t value )
-{
- if ( segment >= 0 && segment <= (int) _currentValues.size() )
- {
- if ( value < 0 ) // Allow -1 etc. as marker values
- value = 0;
-
- if ( value > maxValue( segment ) )
- {
- y2error( "Current value %lld for segment #%d exceeds maximum of %lld",
- value, segment, maxValue( segment ) );
-
- value = maxValue( segment );
- }
-
- _currentValues[ segment ] = value;
- // y2debug( "Segment[ %d ]: %d", segment, value );
- }
- else
- {
- y2error( "Index %d out of range (0..%zu)", segment, _currentValues.size() -1 );
- }
-}
+#endif
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h Fri Jul 13 19:20:43 2007
@@ -20,8 +20,10 @@
#define YMultiProgressMeter_h
#include "YWidget.h"
-#include
#include <vector>
+using std::vector;
+
+class YMultiProgressMeterPrivate;
class YMultiProgressMeter : public YWidget
@@ -30,65 +32,96 @@
/**
* Constructor
**/
- YMultiProgressMeter( const YWidgetOpt & opt,
- bool horizontal,
- const YCPList & maxValues );
+ YMultiProgressMeter( YWidget * parent,
+ YUIDimension dim,
+ const vector<float> & maxValues );
public:
/**
- * Returns a descriptive name of this widget class for logging,
+ * Destructor.
+ **/
+ virtual ~YMultiProgressMeter();
+
+ /**
+ * Return a descriptive name of this widget class for logging,
* debugging etc.
**/
virtual const char * widgetClass() { return "YMultiProgressMeter"; }
- typedef long long Value_t;
-
/**
- * Implements the ui command changeWidget.
+ * Return the orientation of the MultiProgressBar.
+ **/
+ YUIDimension dimension() const;
+
+ /**
+ * Return 'true' if the orientation is horizontal.
**/
- YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newValue );
-
+ bool horizontal() const;
+
/**
- * Implements the ui command queryWidget
+ * Return 'true' if the orientation is vertical.
**/
- YCPValue queryWidget( const YCPSymbol & property );
+ bool vertical() const;
/**
- * Returns the number of segments
+ * Return the number of segments.
**/
- int segments() const { return (int) _maxValues.size(); }
+ int segments() const;
/**
- * Returns the maximum value for the specified segment (counting from 0)
+ * Return the maximum value for the specified segment (counting from 0).
**/
- Value_t maxValue( int segment ) const;
+ float maxValue( int segment ) const;
/**
- * Returns the current value for the specified segment (counting from 0).
+ * Return the current value for the specified segment (counting from 0).
* If no value has been set yet, -1 is returned.
**/
- Value_t currentValue( int segment ) const;
+ float currentValue( int segment ) const;
/**
- * Sets the current value for the specified segment.
+ * Set the current value for the specified segment.
* This must be in the range 0..maxValue( segment ).
+ *
+ * Remember to call doUpdate() after all changed values are set!
**/
- void setCurrentValue( int segment, Value_t value );
+ void setCurrentValue( int segment, float value );
/**
- * Returns 'true' if the orientation is horizontal.
+ * Set all current values and call doUpdate().
**/
- bool horizontal() const { return _horizontal; }
-
+ void setCurrentValues( const vector<float> & values );
+
/**
- * Returns 'true' if the orientation is vertical.
+ * Set a property.
+ * Reimplemented from YWidget.
+ *
+ * This function may throw YUIPropertyExceptions.
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- bool vertical() const { return ! _horizontal; }
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
-
-protected:
+ /**
+ * Get a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
+ **/
+ virtual YPropertyValue getProperty( const string & propertyName );
/**
+ * Return this class's property set.
+ * This also initializes the property upon the first call.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual const YPropertySet & propertySet();
+
+ /**
* Notification that values have been updated and the widget needs to be
* redisplayed. Derived classes need to reimplement this.
**/
@@ -97,9 +130,8 @@
private:
- bool _horizontal;
- std::vector _maxValues;
- std::vector _currentValues;
+ ImplPtr<YMultiProgressMeterPrivate> priv;
+
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc Fri Jul 13 19:20:43 2007
@@ -135,7 +135,7 @@
}
YBarGraph *
-YOptionalWidgetFactory::createBarGraph( YWidget * parent, list<int> values, list<string> labels )
+YOptionalWidgetFactory::createBarGraph( YWidget * parent, const vector<int> & values, const vector<string> & labels )
{
THROW_UNSUPPORTED( "YBarGraph" );
}
@@ -174,15 +174,21 @@
}
YMultiProgressMeter *
-YOptionalWidgetFactory::createHMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues )
+YOptionalWidgetFactory::createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues )
{
THROW_UNSUPPORTED( "YMultiProgressMeter" );
}
YMultiProgressMeter *
-YOptionalWidgetFactory::createVMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues )
+YOptionalWidgetFactory::createHMultiProgressMeter( YWidget * parent, const vector<float> & maxValues )
{
- THROW_UNSUPPORTED( "YMultiProgressMeter" );
+ return createMultiProgressMeter( parent, YD_HORIZ, maxValues );
+}
+
+YMultiProgressMeter *
+YOptionalWidgetFactory::createVMultiProgressMeter( YWidget * parent, const vector<float> & maxValues )
+{
+ return createMultiProgressMeter( parent, YD_VERT, maxValues );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h Fri Jul 13 19:20:43 2007
@@ -20,12 +20,13 @@
#define YOptionalWidgetFactory_h
#include <string>
-#include <list>
+#include <vector>
+#include "YTypes.h"
#include "YWizard.h"
using std::string;
-using std::list;
+using std::vector;
class YBarGraph;
class YDateField;
@@ -84,7 +85,7 @@
virtual YTimeField * createTimeField ( YWidget * parent, const string & label );
virtual bool hasBarGraph();
- virtual YBarGraph * createBarGraph ( YWidget * parent, list<int> values, list<string> labels );
+ virtual YBarGraph * createBarGraph ( YWidget * parent, const vector<int> & values, const vector<string> & labels );
virtual bool hasPatternSelector();
virtual YWidget * createPatternSelector ( YWidget * parent, long modeFlags = 0 );
@@ -93,8 +94,9 @@
virtual YWidget * createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
virtual bool hasMultiProgressMeter();
- virtual YMultiProgressMeter * createHMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues );
- virtual YMultiProgressMeter * createVMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues );
+ YMultiProgressMeter * createHMultiProgressMeter( YWidget * parent, const vector<float> & maxValues );
+ YMultiProgressMeter * createVMultiProgressMeter( YWidget * parent, const vector<float> & maxValues );
+ virtual YMultiProgressMeter * createMultiProgressMeter ( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
virtual bool hasPartitionSplitter();
virtual YPartitionSplitter * createPartitionSplitter ( YWidget * parent );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Fri Jul 13 19:20:43 2007
@@ -510,18 +510,6 @@
/**
- * Creates a (horizontal or vertical) MultiProgressMeter.
- *
- * This is a special widget that the UI may or may not support.
- * Overwrite this method at your own discretion.
- * If you do, remember to overwrite the has...() method as well!
- **/
- virtual YWidget * createMultiProgressMeter( YWidget *parent, YWidgetOpt & opt,
- bool horizontal, const YCPList & maxValues );
- virtual bool hasMultiProgressMeter() { return false; }
-
-
- /**
* Creates a Slider widget.
*
* This is a special widget that the UI may or may not support.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h Fri Jul 13 19:20:43 2007
@@ -31,6 +31,7 @@
using std::string;
using std::ostream;
+using std::endl;
class YWidget;
@@ -167,7 +168,7 @@
/**
* Check if a widget pointer is valid.
- * Throws YUIInvalidWidgetException if it is 0 or invalid (already deleted).
+ * Throws YUIInvalidWidgetException if it is 0 or invalid (already deleted).
**/
#define YUI_CHECK_WIDGET( WIDGET ) \
do \
@@ -179,6 +180,28 @@
} while( 0 )
+/**
+ * Check if an index is in range:
+ * VALID_MIN <= INDEX <= VALID_MAX
+ *
+ * Throws YUIInvalidWidgetException if out of range.
+ **/
+#define YUI_CHECK_INDEX_MSG( INDEX, VALID_MIN, VALID_MAX, MSG ) \
+ do \
+ { \
+ if ( (INDEX) < (VALID_MIN) || \
+ (INDEX) > (VALID_MAX) ) \
+ { \
+ YUI_THROW( YUIIndexOutOfRangeException( (INDEX), (VALID_MIN), (VALID_MAX), (MSG) ) ); \
+ } \
+ } while( 0 )
+
+
+#define YUI_CHECK_INDEX( INDEX, VALID_MIN, VALID_MAX ) \
+ YUI_CHECK_INDEX_MSG( (INDEX), (VALID_MIN), (VALID_MAX), "")
+
+
+
/**
* Helper class for UI exceptions: Store _FILE_, _FUNCTION_ and _LINE_.
@@ -578,7 +601,7 @@
virtual ~YUIBadPropertyArgException() throw()
{}
-
+
protected:
/**
@@ -625,7 +648,7 @@
return str << "Too many children for "
<< widgetClass
- << std::endl;
+ << endl;
}
private:
@@ -682,7 +705,7 @@
return str << childWidgetClass
<< " is not a child of "
<< containerWidgetClass
- << std::endl;
+ << endl;
}
private:
@@ -700,7 +723,7 @@
* YUI::optionalWidgetFactory()->hasXYWidget() before trying to create such a
* widget. This exception is thrown if that check wasn't done, the application
* tried to create that kind of widget anyway, but the UI doesn't support that
- * widget.
+ * widget.
**/
class YUIUnsupportedWidgetException: public YUIException
{
@@ -717,7 +740,7 @@
/**
* Exception class for "value other than YD_HORIZ or YD_VERT used for
- * dimension".
+ * dimension".
**/
class YUIInvalidDimensionException: public YUIException
{
@@ -725,13 +748,81 @@
YUIInvalidDimensionException()
: YUIException( "Invalid dimension (neither YD_HORIZ nor YD_VERT)" )
{}
-
+
virtual ~YUIInvalidDimensionException() throw()
{}
};
/**
+ * Exception class for "index out of range"
+ **/
+class YUIIndexOutOfRangeException: public YUIException
+{
+public:
+ /**
+ * Constructor.
+ *
+ * 'invalidIndex' is the offending index value. It should be between
+ *'validMin' and 'validMax':
+ *
+ * validMin <= index <= validMax
+ **/
+ YUIIndexOutOfRangeException( int invalidIndex,
+ int validMin,
+ int validMax,
+ const string & msg = "" )
+ : YUIException( msg )
+ , _invalidIndex( invalidIndex )
+ , _validMin( validMin )
+ , _validMax( validMax )
+ {}
+
+ virtual ~YUIIndexOutOfRangeException() throw()
+ {}
+
+ /**
+ * Return the offending index value.
+ **/
+ int invalidIndex() const { return _invalidIndex; }
+
+ /**
+ * Return the valid minimum index.
+ **/
+ int validMin() const { return _validMin; }
+
+ /**
+ * Return the valid maximum index.
+ **/
+ int validMax() const { return _validMax; }
+
+protected:
+
+ /**
+ * Write proper error message with all relevant data.
+ * Reimplemented from YUIException.
+ **/
+ virtual ostream & dumpOn( ostream & str ) const
+ {
+ string prefix = msg();
+
+ if ( prefix.empty() )
+ prefix = "Index out of range";
+
+ return str << prefix << ": " << _invalidIndex
+ << " valid: " << _validMin << " .. " << _validMax
+ << endl;
+ }
+
+private:
+
+ int _invalidIndex;
+ int _validMin;
+ int _validMax;
+};
+
+
+/**
* Exception class for plugin load failure
**/
class YUIPluginException: public YUIException
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Fri Jul 13 19:20:43 2007
@@ -86,8 +86,8 @@
else if ( symbol == YUISpecialWidget_BarGraph ) hasWidget = hasBarGraph();
else if ( symbol == YUISpecialWidget_DumbTab ) hasWidget = hasDumbTab();
else if ( symbol == YUISpecialWidget_DownloadProgress ) hasWidget = hasDownloadProgress();
- else if ( symbol == YUISpecialWidget_HMultiProgressMeter ) hasWidget = hasMultiProgressMeter();
- else if ( symbol == YUISpecialWidget_VMultiProgressMeter ) hasWidget = hasMultiProgressMeter();
+ else if ( symbol == YUISpecialWidget_HMultiProgressMeter ) hasWidget = fact->hasMultiProgressMeter();
+ else if ( symbol == YUISpecialWidget_VMultiProgressMeter ) hasWidget = fact->hasMultiProgressMeter();
else if ( symbol == YUISpecialWidget_Slider ) hasWidget = hasSlider();
else if ( symbol == YUISpecialWidget_PatternSelector ) hasWidget = fact->hasPatternSelector();
else if ( symbol == YUISpecialWidget_PartitionSplitter ) hasWidget = hasPartitionSplitter();
@@ -925,9 +925,16 @@
ret = YCPBoolean( success );
}
- catch( YUIPropertyException & exception )
+ catch( YUIException & exception )
{
- y2error( "Caught property exception" );
+ YUI_CAUGHT( exception );
+ ycperror( "UI::ChangeWidget() failed for property %s of %s with ID %s, new value: %s",
+ property->toString().c_str(),
+ widget->widgetClass(),
+ id->toString().c_str(),
+ newValue->toString().c_str() );
+
+ ret = YCPNull();
}
}
@@ -1018,9 +1025,14 @@
return YCPVoid();
}
}
- catch( YUIPropertyException & exception )
+ catch( YUIException & exception )
{
- y2error( "Caught property exception" );
+ YUI_CAUGHT( exception );
+ ycperror( "UI::QueryWidget() failed for property %s of %s with ID %s",
+ property->toString().c_str(),
+ widget->widgetClass(),
+ id->toString().c_str() );
+
return YCPVoid();
}
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc Fri Jul 13 19:20:43 2007
@@ -103,16 +103,6 @@
}
-YWidget * YUI::createMultiProgressMeter( YWidget *parent, YWidgetOpt & opt,
- bool horizontal, const YCPList & maxValues )
-{
- y2error( "Default createMultiProgressMeter() method called - "
- "forgot to call HasSpecialWidget()?" );
-
- return 0;
-}
-
-
YWidget * YUI::createSlider( YWidget *parent, YWidgetOpt & opt,
const YCPString & label,
int minValue, int maxValue, int initialValue )
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.cc Fri Jul 13 19:20:43 2007
@@ -27,12 +27,11 @@
-YQMultiProgressMeter::YQMultiProgressMeter( QWidget * parent,
- const YWidgetOpt & opt,
- bool horizontal,
- const YCPList & maxValues )
- : QWidget( parent )
- , YMultiProgressMeter( opt, horizontal, maxValues )
+YQMultiProgressMeter::YQMultiProgressMeter( YWidget * parent,
+ YUIDimension dim,
+ const vector<float> & maxValues )
+ : QWidget( (QWidget *) parent->widgetRep() )
+ , YMultiProgressMeter( parent, dim, maxValues )
{
_triangularShaped = false;
init();
@@ -40,6 +39,12 @@
}
+YQMultiProgressMeter::~YQMultiProgressMeter()
+{
+ // NOP
+}
+
+
void YQMultiProgressMeter::init()
{
_margin = 2;
@@ -97,7 +102,7 @@
// Add up the total sum of all maxValues
- Value_t totalSum = 0;
+ float totalSum = 0.0;
for( int i=0; i < segments(); i++ )
totalSum += maxValue( i );
@@ -105,7 +110,7 @@
// Figure out minimal segment length
- Value_t minLength = segmentMinLength();
+ int minLength = segmentMinLength();
// Limit the minimum if there isn't even that much space
@@ -116,20 +121,20 @@
// First attempt of scaling factor from values to pixel coordinates
- if ( totalSum == 0 )
+ if ( totalSum == 0.0 )
{
y2error( "Avoiding division by zero: totalSum" );
return;
}
- double scale = ( (double) totalLength ) / ( (double) totalSum );
- int scaledMinLength = (int) ( minLength / scale );
+ float scale = ( (float) totalLength ) / totalSum;
+ float scaledMinLength = ( (float) minLength ) / scale;
// Check how many segments would become smaller than the minimum
int smallSegmentsCount = 0;
- Value_t restSum = 0;
+ float restSum = 0.0;
for ( int i=0; i < segments(); i++ )
{
@@ -145,7 +150,7 @@
int distributableLength = totalLength - smallSegmentsCount * minLength;
- if ( restSum == 0 )
+ if ( restSum == 0.0 )
{
y2error( "Avoiding division by zero: restSum" );
return;
@@ -153,7 +158,7 @@
// Recompute scale to take small segments into account that now get screen
// space disproportional to their real size (maxValue).
- scale = ( (double) distributableLength ) / ( (double) restSum );
+ scale = ( (float) distributableLength ) / ( restSum );
// Calculate indentation
@@ -232,13 +237,13 @@
if ( currentValue( segment ) < maxValue( segment ) )
{
- if ( maxValue( segment ) == 0 )
+ if ( maxValue( segment ) == 0.0 )
{
y2error( "Avoiding division by zero: maxValue[%d]", segment );
return;
}
- double emptyPart = 1.0 - ( (double) currentValue( segment ) ) / ( (double) maxValue( segment ) );
+ float emptyPart = 1.0 - ( currentValue( segment ) ) / ( maxValue( segment ) );
fillStart = (int) ( length * emptyPart );
fillHeight = (int) ( indent * emptyPart );
}
@@ -355,26 +360,6 @@
}
-void YQMultiProgressMeter::setEnabled( bool enabled )
-{
- QWidget::setEnabled( enabled );
- QWidget::update();
- YWidget::setEnabled( enabled );
-}
-
-
-int YQMultiProgressMeter::preferredWidth()
-{
- return horizontal() ? length() : thickness();
-}
-
-
-int YQMultiProgressMeter::preferredHeight()
-{
- return horizontal() ? thickness() : length();
-}
-
-
int YQMultiProgressMeter::thickness()
{
int thickness = triangularShaped() ? 35 : 23;
@@ -395,13 +380,6 @@
}
-void YQMultiProgressMeter::setSize( int newWidth, int newHeight )
-{
- resize( newWidth, newHeight );
- doUpdate();
-}
-
-
void YQMultiProgressMeter::setTriThickness( int value )
{
_triThickness = value;
@@ -411,4 +389,31 @@
}
+void YQMultiProgressMeter::setEnabled( bool enabled )
+{
+ QWidget::setEnabled( enabled );
+ QWidget::update();
+ YWidget::setEnabled( enabled );
+}
+
+
+int YQMultiProgressMeter::preferredWidth()
+{
+ return horizontal() ? length() : thickness();
+}
+
+
+int YQMultiProgressMeter::preferredHeight()
+{
+ return horizontal() ? thickness() : length();
+}
+
+
+void YQMultiProgressMeter::setSize( int newWidth, int newHeight )
+{
+ resize( newWidth, newHeight );
+ doUpdate();
+}
+
+
#include "YQMultiProgressMeter.moc"
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiProgressMeter.h Fri Jul 13 19:20:43 2007
@@ -39,31 +39,13 @@
/**
* Constructor.
**/
- YQMultiProgressMeter( QWidget * parent,
- const YWidgetOpt & opt,
- bool horizontal,
- const YCPList & maxValues );
-
- /**
- * Inherited from YWidget: Sets the enabled state of the
- * widget. All new widgets are enabled per definition. Only
- * enabled widgets can take user input.
- **/
- void setEnabled( bool enabled );
-
+ YQMultiProgressMeter( YWidget * parent,
+ YUIDimension dim,
+ const vector<float> & maxValues );
/**
- * Preferred width of the widget.
- *
- * Reimplemented from YWidget.
- **/
- virtual int preferredWidth();
-
- /**
- * Preferred height of the widget.
- *
- * Reimplemented from YWidget.
+ * Destructor.
**/
- virtual int preferredHeight();
+ virtual ~YQMultiProgressMeter();
/**
* Overall thickness (in pixels) of the MultiProgressMeter.
@@ -76,13 +58,6 @@
int length();
/**
- * Set the new size of the widget.
- *
- * Reimplemented from YWidget.
- **/
- virtual void setSize( int newWidth, int newHeight );
-
- /**
* Returns the margin around the widget contents.
**/
int margin() const { return _margin; }
@@ -126,7 +101,7 @@
* Set the thickness (base to point) of the small triangles next to the
* spacing between individual segments. The base length of those small
* triangles is double this value minus one.
- *
+ *
* Use -1 to switch off those triangles - in which case triSpacing (see
* below) will be set to 0.
*
@@ -157,7 +132,35 @@
**/
void setTriangularShaped( bool triangular = true );
-
+ /**
+ * Handle enabled/disabled state.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setEnabled( bool enabled );
+
+ /**
+ * Preferred width of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual int preferredWidth();
+
+ /**
+ * Preferred height of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
+
+
protected:
/**
@@ -183,7 +186,7 @@
* reimplemented from QWidget.
**/
virtual void mouseDoubleClickEvent ( QMouseEvent * e );
-
+
/**
* Draw segment number 'segment' with pixel length 'length' from pixel
* coordinate 'offset' on and fill it according to that segment's current
Modified: branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc Fri Jul 13 19:20:43 2007
@@ -127,7 +127,7 @@
}
YQBarGraph *
-YQOptionalWidgetFactory::createBarGraph( YWidget * parent, list<int> values, list<string> labels )
+YQOptionalWidgetFactory::createBarGraph( YWidget * parent, const vector<int> & values, const vector<string> & labels )
{
THROW_UNSUPPORTED( "YQBarGraph" );
}
@@ -172,19 +172,16 @@
bool YQOptionalWidgetFactory::hasMultiProgressMeter()
{
- return false;
+ return true;
}
YQMultiProgressMeter *
-YQOptionalWidgetFactory::createHMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues )
+YQOptionalWidgetFactory::createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues )
{
- THROW_UNSUPPORTED( "YQMultiProgressMeter" );
-}
+ YQMultiProgressMeter * multiProgressMeter = new YQMultiProgressMeter( parent, dim, maxValues );
+ YUI_CHECK_NEW( multiProgressMeter );
-YQMultiProgressMeter *
-YQOptionalWidgetFactory::createVMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues )
-{
- THROW_UNSUPPORTED( "YQMultiProgressMeter" );
+ return multiProgressMeter;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h Fri Jul 13 19:20:43 2007
@@ -41,7 +41,7 @@
#endif
using std::string;
-using std::list;
+using std::vector;
@@ -85,7 +85,7 @@
virtual YQTimeField * createTimeField ( YWidget * parent, const string & label );
virtual bool hasBarGraph();
- virtual YQBarGraph * createBarGraph ( YWidget * parent, list<int> values, list<string> labels );
+ virtual YQBarGraph * createBarGraph ( YWidget * parent, const vector<int> & values, const vector<string> & labels );
virtual bool hasPatternSelector();
virtual YQPatternSelector * createPatternSelector ( YWidget * parent, long modeFlags = 0 );
@@ -94,8 +94,7 @@
virtual YQSimplePatchSelector * createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
virtual bool hasMultiProgressMeter();
- virtual YQMultiProgressMeter * createHMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues );
- virtual YQMultiProgressMeter * createVMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues );
+ virtual YQMultiProgressMeter * createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
virtual bool hasPartitionSplitter();
virtual YQPartitionSplitter * createPartitionSplitter ( YWidget * parent );
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Fri Jul 13 19:20:43 2007
@@ -467,12 +467,6 @@
YWidget * createDumbTab ( YWidget * parent,
YWidgetOpt & opt );
- bool hasMultiProgressMeter();
- YWidget * createMultiProgressMeter( YWidget * parent,
- YWidgetOpt & opt,
- bool horizontal,
- const YCPList & maxValues );
-
bool hasSlider();
YWidget * createSlider ( YWidget * parent,
YWidgetOpt & opt,
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc?rev=39411&r1=39410&r2=39411&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Fri Jul 13 19:20:43 2007
@@ -177,24 +177,6 @@
}
-bool YQUI::hasMultiProgressMeter()
-{
- return true;
-}
-
-
-YWidget * YQUI::createMultiProgressMeter( YWidget * parent,
- YWidgetOpt & opt,
- bool horizontal,
- const YCPList & maxValues )
-{
- return new YQMultiProgressMeter( (QWidget *) ( parent->widgetRep() ),
- opt,
- horizontal,
- maxValues );
-}
-
-
bool YQUI::hasSlider()
{
return true;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org