Author: sh-sh-sh
Date: Fri Nov 9 19:03:46 2007
New Revision: 41947
URL: http://svn.opensuse.org/viewcvs/yast?rev=41947&view=rev
Log:
ported PartitionSplitter
Removed:
branches/tmp/sh/mod-ui/qt/src/QY2BarGraph.cc
branches/tmp/sh/mod-ui/qt/src/QY2BarGraph.h
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/YOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.cc
branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.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/Makefile.am
branches/tmp/sh/mod-ui/qt/src/YQIntField.cc
branches/tmp/sh/mod-ui/qt/src/YQIntField.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/YQPartitionSplitter.cc
branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.h
branches/tmp/sh/mod-ui/qt/src/YQSlider.cc
branches/tmp/sh/mod-ui/qt/src/YQSlider.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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Fri Nov 9 19:03:46 2007
@@ -417,4 +417,5 @@
2007-11-09 sh@suse.de
* Ported YBarGraph
+* Ported YPartitionSplitter
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Fri Nov 9 19:03:46 2007
@@ -63,6 +63,7 @@
#include "YMultiProgressMeter.h"
#include "YMultiSelectionBox.h"
#include "YPackageSelector.h"
+#include "YPartitionSplitter.h"
#include "YProgressBar.h"
#include "YPushButton.h"
#include "YRadioButton.h"
@@ -3005,7 +3006,6 @@
}
rejectAllOptions( term,optList );
- YWidget *slider;
string label = term->value( argnr )->asString()->value();
int minValue = term->value( argnr+1 )->asInteger()->value();
@@ -3081,41 +3081,30 @@
return 0;
}
- for ( int o=0; o < optList->size(); o++ )
- {
- if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_countShowDelta ) opt.countShowDelta.setValue( true );
- else logUnknownOption( term, optList->value(o) );
- }
-
- YWidget *splitter;
-
- if ( YUI::ui()->hasPartitionSplitter() )
- {
- int usedSize = term->value( argnr )->asInteger()->value();
- int totalFreeSize = term->value( argnr+1 )->asInteger()->value();
- int newPartSize = term->value( argnr+2 )->asInteger()->value();
- int minNewPartSize = term->value( argnr+3 )->asInteger()->value();
- int minFreeSize = term->value( argnr+4 )->asInteger()->value();
- YCPString usedLabel = term->value( argnr+5 )->asString();
- YCPString freeLabel = term->value( argnr+6 )->asString();
- YCPString newPartLabel = term->value( argnr+7 )->asString();
- YCPString freeFieldLabel = term->value( argnr+8 )->asString();
- YCPString newPartFieldLabel = term->value( argnr+9 )->asString();
-
- splitter = YUI::ui()->createPartitionSplitter( parent, opt,
- usedSize, totalFreeSize,
- newPartSize, minNewPartSize, minFreeSize,
- usedLabel, freeLabel, newPartLabel,
- freeFieldLabel, newPartFieldLabel );
-
- }
- else
- {
- y2error( "This UI does not support the PartitionSplitter widget." );
- return 0;
- }
+ rejectAllOptions( term, optList );
- return splitter;
+ int usedSize = term->value( argnr )->asInteger()->value();
+ int totalFreeSize = term->value( argnr+1 )->asInteger()->value();
+ int newPartSize = term->value( argnr+2 )->asInteger()->value();
+ int minNewPartSize = term->value( argnr+3 )->asInteger()->value();
+ int minFreeSize = term->value( argnr+4 )->asInteger()->value();
+ string usedLabel = term->value( argnr+5 )->asString()->value();
+ string freeLabel = term->value( argnr+6 )->asString()->value();
+ string newPartLabel = term->value( argnr+7 )->asString()->value();
+ string freeFieldLabel = term->value( argnr+8 )->asString()->value();
+ string newPartFieldLabel = term->value( argnr+9 )->asString()->value();
+
+ return YUI::optionalWidgetFactory()->createPartitionSplitter( parent,
+ usedSize,
+ totalFreeSize,
+ newPartSize,
+ minNewPartSize,
+ minFreeSize,
+ usedLabel,
+ freeLabel,
+ newPartLabel,
+ freeFieldLabel,
+ newPartFieldLabel );
}
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc Fri Nov 9 19:03:46 2007
@@ -199,7 +199,17 @@
}
YPartitionSplitter *
-YOptionalWidgetFactory::createPartitionSplitter( YWidget * parent )
+YOptionalWidgetFactory::createPartitionSplitter( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel )
{
THROW_UNSUPPORTED( "YPartitionSplitter" );
}
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h Fri Nov 9 19:03:46 2007
@@ -99,7 +99,18 @@
virtual YMultiProgressMeter * createMultiProgressMeter ( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
virtual bool hasPartitionSplitter();
- virtual YPartitionSplitter * createPartitionSplitter ( YWidget * parent );
+ virtual YPartitionSplitter * createPartitionSplitter ( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel );
+
virtual bool hasDownloadProgress();
virtual YDownloadProgress * createDownloadProgress ( YWidget * parent,
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.cc?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.cc Fri Nov 9 19:03:46 2007
@@ -17,8 +17,6 @@
/-*/
-#include
-#include
#define y2log_component "ui"
#include
@@ -27,97 +25,177 @@
#include "YPartitionSplitter.h"
-YPartitionSplitter::YPartitionSplitter( const YWidgetOpt & opt,
- int usedSize,
- int totalFreeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel )
- : YWidget ( opt )
- , _usedSize ( usedSize )
- , _totalFreeSize ( totalFreeSize )
- , _newPartSize ( newPartSize )
- , _minNewPartSize ( minNewPartSize )
- , _minFreeSize ( minFreeSize )
- , _usedLabel ( usedLabel )
- , _freeLabel ( freeLabel )
- , _newPartLabel ( newPartLabel )
- , _freeFieldLabel ( freeFieldLabel )
- , _newPartFieldLabel ( newPartFieldLabel )
+struct YPartitionSplitterPrivate
{
+ YPartitionSplitterPrivate( int usedSize,
+ int totalFreeSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel )
+ : usedSize ( usedSize )
+ , totalFreeSize ( totalFreeSize )
+ , minNewPartSize ( minNewPartSize )
+ , minFreeSize ( minFreeSize )
+ , usedLabel ( usedLabel )
+ , freeLabel ( freeLabel )
+ , newPartLabel ( newPartLabel )
+ , freeFieldLabel ( freeFieldLabel )
+ , newPartFieldLabel ( newPartFieldLabel )
+ {}
+
+ int usedSize;
+ int totalFreeSize;
+ int minNewPartSize;
+ int minFreeSize;
+ string usedLabel;
+ string freeLabel;
+ string newPartLabel;
+ string freeFieldLabel;
+ string newPartFieldLabel;
+};
+
+
+
+
+YPartitionSplitter::YPartitionSplitter( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel )
+ : YWidget( parent )
+ , priv( new YPartitionSplitterPrivate( usedSize,
+ totalFreeSize,
+ minNewPartSize,
+ minFreeSize,
+ usedLabel,
+ freeLabel,
+ newPartLabel,
+ freeFieldLabel,
+ newPartFieldLabel )
+ )
+{
+ YUI_CHECK_NEW( priv );
+
setDefaultStretchable( YD_HORIZ, true );
setStretchable( YD_VERT, false );
}
-void YPartitionSplitter::setValue( int newValue )
+YPartitionSplitter::~YPartitionSplitter()
+{
+ // NOP
+}
+
+
+int YPartitionSplitter::usedSize() const
{
- _newPartSize = newValue;
+ return priv->usedSize;
}
-YCPValue YPartitionSplitter::changeWidget( const YCPSymbol & property,
- const YCPValue & newValue )
+int YPartitionSplitter::totalFreeSize() const
{
- string sym = property->symbol();
+ return priv->totalFreeSize;
+}
- /**
- * @property integer Value the numerical value
- */
- if ( sym == YUIProperty_Value )
- {
- if ( newValue->isInteger() )
- {
- int val = newValue->asInteger()->value();
-
- if ( val < minNewPartSize() )
- {
- y2warning( "YPartitionSplitter::changeWidget( `Value ): "
- "Warning: New value %d below minNewPartSize ( %d )",
- val, minNewPartSize() );
- setValue( minNewPartSize() );
- }
- else if ( val > maxNewPartSize() )
- {
- y2warning( "YPartitionSplitter::changeWidget( `Value ): "
- "Warning: New value %d above maxNewPartSize ( %d )",
- val, maxNewPartSize() );
- setValue( maxNewPartSize() );
- }
- else
- {
- setValue( val );
- }
-
- return YCPBoolean( true );
- }
- else
- {
- y2error( "YPartitionSplitter::changeWidget( `Value ): "
- "Error: Expecting integer value, not %s",
- newValue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- else return YWidget::changeWidget( property, newValue );
+int YPartitionSplitter::minNewPartSize() const
+{
+ return priv->minNewPartSize;
}
+int YPartitionSplitter::minFreeSize() const
+{
+ return priv->minFreeSize;
+}
+
+
+string YPartitionSplitter::usedLabel() const
+{
+ return priv->usedLabel;
+}
+
-YCPValue YPartitionSplitter::queryWidget( const YCPSymbol & property )
+string YPartitionSplitter::freeLabel() const
{
- string s = property->symbol();
- if ( s == YUIProperty_Value ) return YCPInteger( newPartSize() );
- else return YWidget::queryWidget( property );
+ return priv->freeLabel;
}
+string YPartitionSplitter::newPartLabel() const
+{
+ return priv->newPartLabel;
+}
+
+
+string YPartitionSplitter::freeFieldLabel() const
+{
+ return priv->freeFieldLabel;
+}
+
+
+string YPartitionSplitter::newPartFieldLabel() const
+{
+ return priv->newPartFieldLabel;
+}
+
+
+const YPropertySet &
+YPartitionSplitter::propertySet()
+{
+ static YPropertySet propSet;
+
+ if ( propSet.isEmpty() )
+ {
+ /*
+ * @property string Value the value (the size of the new partition)
+ */
+ propSet.add( YProperty( YUIProperty_Value, YStringProperty ) );
+ propSet.add( YWidget::propertySet() );
+ }
+
+ return propSet;
+}
+
+
+bool
+YPartitionSplitter::setProperty( const string & propertyName, const YPropertyValue & val )
+{
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
+
+ if ( propertyName == YUIProperty_Value ) setValue( val.integerVal() );
+ else
+ {
+ return YWidget::setProperty( propertyName, val );
+ }
+
+ return true; // success -- no special processing necessary
+}
+
+
+YPropertyValue
+YPartitionSplitter::getProperty( const string & propertyName )
+{
+ propertySet().check( propertyName ); // throws exceptions if not found
+
+ if ( propertyName == YUIProperty_Value ) return YPropertyValue( value() );
+ else
+ {
+ return YWidget::getProperty( propertyName );
+ }
+}
+
void
YPartitionSplitter::saveUserInput( YMacroRecorder *macroRecorder )
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h Fri Nov 9 19:03:46 2007
@@ -20,32 +20,87 @@
#define YPartitionSplitter_h
#include "YWidget.h"
-#include
-#include
class YMacroRecorder;
+class YPartitionSplitterPrivate;
+/**
+ * PartitionSplitter: A (very custom) widget for easily splitting one existing
+ * partition into two.
+ *
+ * Layout:
+ *
+ * +--------------------+---------------+--------------------------+
+ * | Old Partition | Old Partition | New Partition |
+ * | used | free | |
+ * +--------------------+---------------+--------------------------+
+ *
+ * Old Partition free New Partition
+ * [ 123 ] ================O================================ [ 123 ]
+ *
+ *
+ * At the top, there is a BarGraph that dynamicylla displays the sizes in
+ * graphical form. Below are an IntField to the left and an IntField to the
+ * right, each with its respective label. Between the two IntFields there is a
+ * Slider.
+ *
+ * The user can enter a value in either IntField or drag the slider. The other
+ * sub-widgets (including the BarGraph) will automatically be
+ * adjusted. Visually (in the BarGraph), the border between "old partition
+ * free" and "new partition" will move left and right. The border between "old
+ * partition used" and "old partition free" is static.
+ *
+ * There are built-in (configurable) limits for the minimum sizes of "old
+ * partition free" and "new partition".
+ **/
class YPartitionSplitter : public YWidget
{
protected:
/**
- * Constructor
+ * Constructor.
+ *
+ * usedSize: Used size of the old partition (constant)
+ *
+ * totalFreeSize: Total free size of the old partition before the split:
+ * OldPartitionFree + NewPartition
+ *
+ * newPartSize': Initial size of the new partition
+ *
+ * minNewPartSize: Miminum size of the new partition
+ *
+ * minFreeSize: Minimum free size of the old partition
+ *
+ * usedLabel: BarGraph label for the used part of the old partition
+ *
+ * freeLabel: BarGraph label for the free part of the old partition
+ *
+ * newPartLabel: BarGraph label for the new partition
+ *
+ * freeFieldLabel: IntField label for the free part of the old partition
+ *
+ * newPartFieldLabel: IntField label for the size of the new partition
**/
- YPartitionSplitter( const YWidgetOpt & opt,
- int usedSize,
- int totalFreeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel );
+ YPartitionSplitter( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel );
public:
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YPartitionSplitter();
+
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
@@ -53,41 +108,65 @@
virtual const char * widgetClass() const { return "YPartitionSplitter"; }
/**
- * Implements the ChangeWidget() UI command.
+ * The value of this PartitionSplitter: The size of the new partition.
+ *
+ * Derived classes are required to implement this.
**/
- YCPValue changeWidget( const YCPSymbol & property,
- const YCPValue & newValue );
+ virtual int value() = 0;
/**
- * Implements the QueryWidget() UI command.
+ * Set the value (the size of the new partition).
+ *
+ * Derived classes are required to implement this.
**/
- YCPValue queryWidget( const YCPSymbol & property );
+ virtual void setValue( int newValue ) = 0;
+
+
+ // Access methods
+ int usedSize() const;
+ int totalFreeSize() const;
+ int minFreeSize() const;
+ int maxFreeSize() const { return totalFreeSize() - minNewPartSize(); }
+ int freeSize() { return totalFreeSize() - newPartSize(); }
+ int newPartSize() { return value(); }
+ int minNewPartSize() const;
+ int maxNewPartSize() const { return totalFreeSize() - minFreeSize(); }
+
+ string usedLabel() const;
+ string freeLabel() const;
+ string newPartLabel() const;
+ string freeFieldLabel() const;
+ string newPartFieldLabel() const;
/**
- * Change the slider value.
+ * Set a property.
+ * Reimplemented from YWidget.
*
- * Overload this, but call YPartitionSplitter::setValue()
- * at the end of your own method.
+ * 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).
**/
- virtual void setValue( int newValue );
-
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
- // Access methods
+ /**
+ * Get a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
+ **/
+ virtual YPropertyValue getProperty( const string & propertyName );
- int usedSize() { return _usedSize; }
- int totalFreeSize() { return _totalFreeSize; }
- int newPartSize() { return _newPartSize; }
- int minNewPartSize() { return _minNewPartSize; }
- int maxNewPartSize() { return _totalFreeSize - _minFreeSize; }
- int minFreeSize() { return _minFreeSize; }
- int maxFreeSize() { return _totalFreeSize - _minNewPartSize; }
- int remainingFreeSize() { return _totalFreeSize - _newPartSize; }
- const YCPString usedLabel() { return _usedLabel; }
- const YCPString freeLabel() { return _freeLabel; }
- const YCPString newPartLabel() { return _newPartLabel; }
- const YCPString freeFieldLabel() { return _freeFieldLabel; }
- const YCPString newPartFieldLabel() { return _newPartFieldLabel; }
+ /**
+ * Return this class's property set.
+ * This also initializes the property upon the first call.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual const YPropertySet & propertySet();
/**
@@ -101,22 +180,12 @@
/**
* Save the widget's user input to a macro recorder.
- * Intentionally declared as "private" so all macro recording internals are
- * handled by the abstract libyui level, not by a specific UI.
**/
virtual void saveUserInput( YMacroRecorder *macroRecorder );
+ ImplPtr<YPartitionSplitterPrivate> priv;
+
- int _usedSize;
- int _totalFreeSize;
- int _newPartSize;
- int _minNewPartSize;
- int _minFreeSize;
- YCPString _usedLabel;
- YCPString _freeLabel;
- YCPString _newPartLabel;
- YCPString _freeFieldLabel;
- YCPString _newPartFieldLabel;
};
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Fri Nov 9 19:03:46 2007
@@ -482,43 +482,6 @@
virtual YWidget * createDumbTab( YWidget *parent, YWidgetOpt & opt );
virtual bool hasDumbTab() { return false; }
- /**
- * Creates a PartitionSplitter widget.
- *
- * 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!
- *
- * @param parent the parent widget
- * @param opt the widget options
- * @param usedSize size of the used part of the partition
- * @param totalFreeSize total size of the free part of the partition ( before the split )
- * @param newPartSize suggested size of the new partition
- * @param minNewPartSize minimum size of the new partition
- * @param minFreeSize minimum remaining free size of the old partition
- * @param usedLabel BarGraph label for the used part of the old partition
- * @param freeLabel BarGraph label for the free part of the old partition
- * @param newPartLabel BarGraph label for the new partition
- * @param freeFieldLabel label for the remaining free space field
- * @param newPartFieldLabel label for the new partition size field
- **/
-
- virtual YWidget *createPartitionSplitter( YWidget * parent,
- YWidgetOpt & opt,
- int usedSize,
- int totalFreeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel );
-
- virtual bool hasPartitionSplitter() { return false; }
-
-
protected:
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h Fri Nov 9 19:03:46 2007
@@ -185,7 +185,6 @@
#define YUIOpt_autoShortcut "autoShortcut"
#define YUIOpt_boldFont "boldFont"
#define YUIOpt_centered "centered"
-#define YUIOpt_countShowDelta "countShowDelta"
#define YUIOpt_debugLayout "debugLayout"
#define YUIOpt_decorated "decorated"
#define YUIOpt_default "default"
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=41947&r1=41946&r2=41947&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 Nov 9 19:03:46 2007
@@ -92,7 +92,7 @@
else if ( symbol == YUISpecialWidget_VMultiProgressMeter ) hasWidget = fact->hasMultiProgressMeter();
else if ( symbol == YUISpecialWidget_Slider ) hasWidget = fact->hasSlider();
else if ( symbol == YUISpecialWidget_PatternSelector ) hasWidget = fact->hasPatternSelector();
- else if ( symbol == YUISpecialWidget_PartitionSplitter ) hasWidget = hasPartitionSplitter();
+ else if ( symbol == YUISpecialWidget_PartitionSplitter ) hasWidget = fact->hasPartitionSplitter();
else if ( symbol == YUISpecialWidget_SimplePatchSelector ) hasWidget = fact->hasSimplePatchSelector();
else if ( symbol == YUISpecialWidget_Wizard ) hasWidget = fact->hasWizard();
else if ( symbol == YUISpecialWidget_Date ) hasWidget = fact->hasDateField();
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=41947&r1=41946&r2=41947&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 Nov 9 19:03:46 2007
@@ -65,24 +65,5 @@
}
-YWidget * YUI::createPartitionSplitter( YWidget * parent,
- YWidgetOpt & opt,
- int usedSize,
- int totalFreeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel )
-{
- y2error( "Default createPartitionSplitter() method called - "
- "forgot to call HasSpecialWidget()?" );
-
- return 0;
-}
-
// EOF
Modified: branches/tmp/sh/mod-ui/qt/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/Makefile.am?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/qt/src/Makefile.am Fri Nov 9 19:03:46 2007
@@ -103,7 +103,6 @@
YQWizardButton.cc \
\
YFrameBuffer.cc \
- QY2BarGraph.cc \
QY2ComboTabWidget.cc \
QY2DiskUsageList.cc \
QY2CharValidator.cc \
@@ -166,7 +165,6 @@
YQWizard.moc \
YQWizardButton.moc \
\
- QY2BarGraph.moc \
QY2ComboTabWidget.moc \
QY2DiskUsageList.moc \
QY2CharValidator.moc \
@@ -219,7 +217,6 @@
YQWizard.o YQWizard.lo: YQWizard.moc
YQWizardButton.o YQWizardButton.lo: YQWizardButton.moc
-QY2BarGraph.o QY2BarGraph.lo: QY2BarGraph.moc
QY2ComboTabWidget.o QY2ComboTabWidget.lo: QY2ComboTabWidget.cc
QY2DiskUsageList.o QY2DiskUsageList.lo: QY2DiskUsageList.cc
QY2CharValidator.o QY2CharValidator.lo: QY2CharValidator.moc
@@ -268,7 +265,6 @@
YQWizard.moc: YQWizard.h
YQWizardButton.moc: YQWizardButton.h
-QY2BarGraph.moc: QY2BarGraph.h
QY2ComboTabWidget.moc: QY2ComboTabWidget.h
QY2DiskUsageList.moc: QY2DiskUsageList.h
QY2CharValidator.moc: QY2CharValidator.h
Modified: branches/tmp/sh/mod-ui/qt/src/YQIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQIntField.cc?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQIntField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQIntField.cc Fri Nov 9 19:03:46 2007
@@ -56,8 +56,8 @@
setValue( initialValue );
- connect( _qt_spinBox, SIGNAL( valueChanged( int ) ),
- this, SLOT ( valueChanged( int ) ) );
+ connect( _qt_spinBox, SIGNAL( valueChanged ( int ) ),
+ this, SLOT ( valueChangedSlot( int ) ) );
}
@@ -83,10 +83,11 @@
void
-YQIntField::valueChanged( int newValue )
+YQIntField::valueChangedSlot( int newValue )
{
if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+ emit valueChanged( newValue );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQIntField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQIntField.h?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQIntField.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQIntField.h Fri Nov 9 19:03:46 2007
@@ -113,6 +113,14 @@
**/
virtual bool setKeyboardFocus();
+
+signals:
+
+ /**
+ * Emitted when the value changes (regardless of the notify flag).
+ **/
+ void valueChanged( int newValue );
+
protected slots:
@@ -120,7 +128,7 @@
* Slot for "value changed". This will send a ValueChanged event if
* 'notify' is set.
**/
- void valueChanged( int newValue );
+ void valueChangedSlot( int newValue );
protected:
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc Fri Nov 9 19:03:46 2007
@@ -200,13 +200,36 @@
bool YQOptionalWidgetFactory::hasPartitionSplitter()
{
- return false;
+ return true;
}
YQPartitionSplitter *
-YQOptionalWidgetFactory::createPartitionSplitter( YWidget * parent )
+YQOptionalWidgetFactory::createPartitionSplitter( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel )
{
- THROW_UNSUPPORTED( "YQPartitionSplitter" );
+ YQPartitionSplitter * partitionSplitter = new YQPartitionSplitter( parent,
+ usedSize,
+ totalFreeSize,
+ newPartSize,
+ minNewPartSize,
+ minFreeSize,
+ usedLabel,
+ freeLabel,
+ newPartLabel,
+ freeFieldLabel,
+ newPartFieldLabel );
+ YUI_CHECK_NEW( partitionSplitter );
+
+ return partitionSplitter;
}
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h Fri Nov 9 19:03:46 2007
@@ -91,7 +91,17 @@
virtual YQMultiProgressMeter * createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
virtual bool hasPartitionSplitter();
- virtual YQPartitionSplitter * createPartitionSplitter ( YWidget * parent );
+ virtual YQPartitionSplitter * createPartitionSplitter ( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel );
virtual bool hasDownloadProgress();
virtual YQDownloadProgress * createDownloadProgress ( YWidget * parent,
Modified: branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc Fri Nov 9 19:03:46 2007
@@ -23,179 +23,161 @@
#include "utf8.h"
#include "YQUI.h"
#include "YEvent.h"
+#include "YQWidgetFactory.h"
+#include "YQOptionalWidgetFactory.h"
#include "YQPartitionSplitter.h"
+#include "YQLayoutBox.h"
+#include "YQBarGraph.h"
+#include "YQIntField.h"
+#include "YQSlider.h"
#include "YQSignalBlocker.h"
-YQPartitionSplitter::YQPartitionSplitter( QWidget * parent,
- const YWidgetOpt & opt,
- int arg_usedSize,
- int arg_totalFreeSize,
- int arg_newPartSize,
- int arg_minNewSize,
- int arg_minFreeSize,
- const YCPString & arg_usedLabel,
- const YCPString & arg_freeLabel,
- const YCPString & arg_newPartLabel,
- const YCPString & arg_freeFieldLabel,
- const YCPString & arg_newPartFieldLabel )
- : QVBox( parent )
- , YPartitionSplitter( opt,
- arg_usedSize,
- arg_totalFreeSize,
- arg_newPartSize,
- arg_minNewSize,
- arg_minFreeSize,
- arg_usedLabel,
- arg_freeLabel,
- arg_newPartLabel,
- arg_freeFieldLabel,
- arg_newPartFieldLabel )
+YQPartitionSplitter::YQPartitionSplitter( YWidget * parent,
+ int usedSize,
+ int totalFreeSize,
+ int newPartSize,
+ int minNewSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel )
+ : QWidget( (QWidget *) parent->widgetRep() )
+ , YPartitionSplitter( parent,
+ usedSize,
+ totalFreeSize,
+ newPartSize,
+ minNewSize,
+ minFreeSize,
+ usedLabel,
+ freeLabel,
+ newPartLabel,
+ freeFieldLabel,
+ newPartFieldLabel )
+ , _vbox( 0 )
+ , _barGraph( 0 )
+ , _hbox( 0 )
+ , _freeSizeField( 0 )
+ , _newPartSlider( 0 )
{
setWidgetRep( this );
- _countShowDelta = opt.countShowDelta.value();
+ // Replace children manager so it will accept one single direct child (the outer vbox)
+ setChildrenManager( new YSingleWidgetChildManager( this ) );
- setSpacing( YQWidgetSpacing );
- setMargin( YQWidgetMargin );
-
-
- // BarGraph
-
- _barGraph = new QY2BarGraph( this );
- _barGraph->setSegments(3);
- _barGraph->setLabel( 0, fromUTF8( usedLabel()->value() ) );
- _barGraph->setLabel( 1, fromUTF8( freeLabel()->value() ) );
- _barGraph->setLabel( 2, fromUTF8( newPartLabel()->value() ) );
-
-
- // upper inner HBox for the labels
-
- _labels_hbox = new QHBox( this );
- _labels_hbox->setSpacing( YQWidgetMargin );
-
-
- // Label for the free size
-
- _qt_freeFieldLabel = new QLabel( fromUTF8( freeFieldLabel()->value() ),
- _labels_hbox );
- _qt_freeFieldLabel->setTextFormat( QLabel::PlainText );
- _qt_freeFieldLabel->setAlignment( Qt::AlignLeft );
-
-
- // Label for the new partition size
-
- _qt_newPartFieldLabel = new QLabel( fromUTF8( newPartFieldLabel()->value() ),
- _labels_hbox );
- _qt_newPartFieldLabel->setTextFormat( QLabel::PlainText );
- _qt_newPartFieldLabel->setAlignment( Qt::AlignRight );
-
-
- // lower inner HBox for the fields and the slider
-
- _fields_hbox = new QHBox( this );
- _fields_hbox->setSpacing( YQWidgetMargin );
-
-
- // SpinBox for the free size
-
- _qt_freeSizeField = new QSpinBox( minFreeSize(), maxFreeSize(),
- 1, // step
- _fields_hbox );
- _qt_freeFieldLabel->setBuddy( _qt_freeSizeField );
-
-
- // Slider for the free size
-
- _qt_freeSizeSlider = new QSlider( minFreeSize(), maxFreeSize(),
- 1, // pageStep
- remainingFreeSize(), // initial value
- QSlider::Horizontal, _fields_hbox );
-
-
- // SpinBox for the new partition size
-
- _qt_newPartSizeField = new QSpinBox( minNewPartSize(), maxNewPartSize(),
- 1, // step
- _fields_hbox );
- _qt_newPartFieldLabel->setBuddy( _qt_newPartSizeField );
+ //
+ // Create internal widgets
+ //
+
+ _vbox = YUI::widgetFactory()->createVBox( this );
+ _barGraph = dynamic_cast ( YUI::optionalWidgetFactory()->createBarGraph( _vbox ) );
+ YUI_CHECK_PTR( _barGraph );
- // Initialize all fields and the bar graph
+ int freeSize = totalFreeSize - newPartSize;
+
+ {
+ YBarGraphMultiUpdate multiUpdate( _barGraph );
- setValue( newPartSize() );
+ _barGraph->addSegment( YBarGraphSegment( usedSize, usedLabel ) );
+ _barGraph->addSegment( YBarGraphSegment( freeSize, freeLabel ) );
+ _barGraph->addSegment( YBarGraphSegment( newPartSize, newPartLabel) );
+ }
+
+ _hbox = YUI::widgetFactory()->createHBox( _vbox );
+
+ _freeSizeField = dynamic_cast
+ ( YUI::widgetFactory()->createIntField( _hbox, freeFieldLabel,
+ minFreeSize, maxFreeSize(), freeSize) );
+ YUI_CHECK_PTR( _freeSizeField );
+ _freeSizeField->setStretchable( YD_HORIZ, false );
+
+ _newPartSlider = dynamic_cast
+ ( YUI::optionalWidgetFactory()->createSlider( _hbox, newPartFieldLabel,
+ minNewSize, maxNewPartSize(), newPartSize ) );
+ YUI_CHECK_PTR( _newPartSlider );
+ _newPartSlider->setStretchable( YD_HORIZ, true );
// Connect signals
- connect( _qt_freeSizeSlider, SIGNAL( valueChanged (int) ),
- this, SLOT ( setFreeSizeSlot(int) ) );
+ connect( _newPartSlider, SIGNAL( valueChanged (int) ),
+ this, SLOT ( setNewPartSizeSlot(int) ) );
- connect( _qt_freeSizeField, SIGNAL( valueChanged (int) ),
+ connect( _freeSizeField, SIGNAL( valueChanged (int) ),
this, SLOT ( setFreeSizeSlot(int) ) );
+}
- connect( _qt_newPartSizeField,SIGNAL( valueChanged (int) ),
- this, SLOT ( setNewPartSizeSlot(int) ) );
+
+YQPartitionSplitter::~YQPartitionSplitter()
+{
+ // NOP
}
void YQPartitionSplitter::setEnabled( bool enabled )
{
- _qt_freeFieldLabel->setEnabled ( enabled );
- _qt_newPartFieldLabel->setEnabled ( enabled );
- _qt_freeSizeSlider->setEnabled ( enabled );
- _qt_freeSizeField->setEnabled ( enabled );
- _qt_freeSizeField->setEnabled ( enabled );
- _qt_newPartSizeField->setEnabled ( enabled );
+ _freeSizeField->setEnabled ( enabled );
+ _newPartSlider->setEnabled ( enabled );
+
YWidget::setEnabled( enabled );
}
int YQPartitionSplitter::preferredWidth()
{
- return sizeHint().width();
+ return _vbox->preferredWidth();
}
int YQPartitionSplitter::preferredHeight()
{
- return sizeHint().height();
+ return _vbox->preferredHeight();
}
void YQPartitionSplitter::setSize( int newWidth, int newHeight )
{
- resize( newWidth, newHeight );
+ QWidget::resize( newWidth, newHeight );
+ _vbox->setSize ( newWidth, newHeight );
}
-void YQPartitionSplitter::setValue( int new_newPartSize )
+int YQPartitionSplitter::value()
{
- YPartitionSplitter::setValue( new_newPartSize );
+ YUI_CHECK_PTR( _newPartSlider );
+
+ return _newPartSlider->value();
+}
- if ( ! _barGraph )
- return;
- YQSignalBlocker sigBlocker1( _barGraph );
- YQSignalBlocker sigBlocker2( _qt_freeSizeField );
- YQSignalBlocker sigBlocker3( _qt_freeSizeSlider );
- YQSignalBlocker sigBlocker4( _qt_newPartSizeField );
-
- _barGraph->setValue( 0, usedSize() );
- _barGraph->setValue( 1, remainingFreeSize() );
- _barGraph->setValue( 2, newPartSize() );
- _barGraph->update();
-
- _qt_freeSizeField->setValue ( remainingFreeSize() );
- _qt_freeSizeSlider->setValue( remainingFreeSize() );
- _qt_newPartSizeField->setValue( newPartSize() );
+void YQPartitionSplitter::setValue( int newValue )
+{
+ YUI_CHECK_PTR( _barGraph );
+ YUI_CHECK_PTR( _freeSizeField );
+ YUI_CHECK_PTR( _newPartSlider );
+
+ YQSignalBlocker sigBlocker1( _barGraph );
+ YQSignalBlocker sigBlocker2( _freeSizeField );
+ YQSignalBlocker sigBlocker3( _newPartSlider );
+
+ _newPartSlider->setValue( newValue );
+
+ int freeSize = totalFreeSize() - newValue;
+ _freeSizeField->setValue ( freeSize );
+
+ YBarGraphMultiUpdate multiUpdate( _barGraph );
+ {
+ _barGraph->setValue( freeSegment, freeSize );
+ _barGraph->setValue( newPartSegment, newValue );
+ }
}
void YQPartitionSplitter::setFreeSizeSlot( int newFreeSize )
{
int newPartSize = totalFreeSize() - newFreeSize;
- if( _countShowDelta )
- newPartSize += usedSize();
setValue( newPartSize );
@@ -206,12 +188,8 @@
void YQPartitionSplitter::setNewPartSizeSlot( int newPartSize )
{
+ setValue( newPartSize );
- if( _countShowDelta )
- setValue( remainingFreeSize() - totalFreeSize() );
- else
- setValue( newPartSize );
-
if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
@@ -219,7 +197,7 @@
bool YQPartitionSplitter::setKeyboardFocus()
{
- _qt_newPartSizeField->setFocus();
+ _newPartSlider->setKeyboardFocus();
return true;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.h?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.h Fri Nov 9 19:03:46 2007
@@ -20,18 +20,16 @@
#ifndef YQPartitionSplitter_h
#define YQPartitionSplitter_h
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "QY2BarGraph.h"
+#include "qwidget.h"
#include "YPartitionSplitter.h"
+class YLayoutBox;
+class YQBarGraph;
+class YQIntField;
+class YQSlider;
+
-class YQPartitionSplitter : public QVBox, public YPartitionSplitter
+class YQPartitionSplitter : public QWidget, public YPartitionSplitter
{
Q_OBJECT
@@ -40,20 +38,38 @@
/**
* Constructor.
**/
- YQPartitionSplitter( QWidget * parent,
- const YWidgetOpt & opt,
- int usedSize,
- int freeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel );
+ YQPartitionSplitter( YWidget * parent,
+ int usedSize,
+ int freeSize,
+ int newPartSize,
+ int minNewPartSize,
+ int minFreeSize,
+ const string & usedLabel,
+ const string & freeLabel,
+ const string & newPartLabel,
+ const string & freeFieldLabel,
+ const string & newPartFieldLabel );
+
+ /**
+ * Destructor.
+ **/
+ ~YQPartitionSplitter();
/**
+ * Return the value (the size of the new partition).
+ *
+ * Implemented from YPartitionSplitter.
+ **/
+ virtual int value();
+
+ /**
+ * Set the value (the size of the new partition).
+ *
+ * Implemented from YPartitionSplitter.
+ **/
+ virtual void setValue( int newValue );
+
+ /**
* Set enabled/disabled state.
*
* Reimplemented from YWidget.
@@ -86,12 +102,6 @@
**/
virtual bool setKeyboardFocus();
- /**
- * Change the value.
- * Calls YPartitionSplitter::setProgress() internally.
- * Inherited from YPartitionSplitter.
- **/
- void setValue( int newValue );
public slots:
/**
@@ -107,22 +117,24 @@
protected:
- /*
- * Widgets
- *
- * Indentation indicates widget hierarchy
- **/
+ enum
+ {
+ usedSegment = 0,
+ freeSegment = 1,
+ newPartSegment = 2
+ };
- QY2BarGraph * _barGraph;
- QHBox * _labels_hbox;
- QLabel * _qt_freeFieldLabel;
- QLabel * _qt_newPartFieldLabel;
- QHBox * _fields_hbox;
- QSpinBox * _qt_freeSizeField;
- QSlider * _qt_freeSizeSlider;
- QSpinBox * _qt_newPartSizeField;
+
+ //
+ // Widgets
+ //
+
+ YLayoutBox * _vbox;
+ YQBarGraph * _barGraph;
+ YLayoutBox * _hbox;
+ YQIntField * _freeSizeField;
+ YQSlider * _newPartSlider;
- bool _countShowDelta;
};
Modified: branches/tmp/sh/mod-ui/qt/src/YQSlider.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSlider.cc?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSlider.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSlider.cc Fri Nov 9 19:03:46 2007
@@ -79,8 +79,8 @@
connect( _qt_slider, SIGNAL( valueChanged(int) ),
_qt_spinBox, SLOT ( setValue (int) ) );
- connect( _qt_spinBox, SIGNAL( valueChanged(int) ),
- this, SLOT ( valueChanged(int) ) );
+ connect( _qt_spinBox, SIGNAL( valueChanged (int) ),
+ this, SLOT ( valueChangedSlot(int) ) );
}
@@ -108,10 +108,12 @@
void
-YQSlider::valueChanged( int newValue )
+YQSlider::valueChangedSlot( int newValue )
{
if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+
+ emit valueChanged( newValue );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQSlider.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSlider.h?rev=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSlider.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSlider.h Fri Nov 9 19:03:46 2007
@@ -116,7 +116,7 @@
* Slot for "value changed". This will send a ValueChanged event if
* 'notify' is set.
**/
- void valueChanged( int newValue );
+ void valueChangedSlot( int newValue );
/**
* Slot for setting the value.
@@ -125,6 +125,14 @@
**/
void setValueSlot( int newValue );
+
+signals:
+
+ /**
+ * Emitted when the value changes (regardless of the notify flag).
+ **/
+ void valueChanged( int newValue );
+
protected:
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=41947&r1=41946&r2=41947&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Fri Nov 9 19:03:46 2007
@@ -83,38 +83,5 @@
}
-bool YQUI::hasPartitionSplitter()
-{
- return true;
-}
-
-YWidget * YQUI::createPartitionSplitter( YWidget * parent,
- YWidgetOpt & opt,
- int usedSize,
- int totalFreeSize,
- int newPartSize,
- int minNewPartSize,
- int minFreeSize,
- const YCPString & usedLabel,
- const YCPString & freeLabel,
- const YCPString & newPartLabel,
- const YCPString & freeFieldLabel,
- const YCPString & newPartFieldLabel )
-{
- return new YQPartitionSplitter( (QWidget *) ( parent->widgetRep() ),
- opt,
- usedSize,
- totalFreeSize,
- newPartSize,
- minNewPartSize,
- minFreeSize,
- usedLabel,
- freeLabel,
- newPartLabel,
- freeFieldLabel,
- newPartFieldLabel );
-}
-
-
// EOF
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org