YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2007
- 26 participants
- 747 discussions
[yast-commit] r39108 - /branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
by sh-sh-sh@svn.opensuse.org 02 Jul '07
by sh-sh-sh@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: sh-sh-sh
Date: Mon Jul 2 16:34:27 2007
New Revision: 39108
URL: http://svn.opensuse.org/viewcvs/yast?rev=39108&view=rev
Log:
added missing destructor
Modified:
branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
Modified: branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSelect…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc Mon Jul 2 16:34:27 2007
@@ -77,6 +77,12 @@
}
+YQSelectionBox::~YQSelectionBox()
+{
+ // NOP
+}
+
+
void YQSelectionBox::setLabel( const string & label )
{
YSelectionBox::setLabel( label );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39107 - in /branches/tmp/sh/mod-ui/qt/src: YQComboBox.cc YQComboBox.h YQMultiSelectionBox.cc YQMultiSelectionBox.h YQSelectionBox.cc YQUI.h YQUI_widgets.cc YQWidgetFactory.cc YQWidgetFactory.h
by sh-sh-sh@svn.opensuse.org 02 Jul '07
by sh-sh-sh@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: sh-sh-sh
Date: Mon Jul 2 16:32:31 2007
New Revision: 39107
URL: http://svn.opensuse.org/viewcvs/yast?rev=39107&view=rev
Log:
compiles
Modified:
branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc
branches/tmp/sh/mod-ui/qt/src/YQComboBox.h
branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.h
branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
Modified: branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQComboB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc Mon Jul 2 16:32:31 2007
@@ -73,9 +73,52 @@
}
+string YQComboBox::text()
+{
+ return toUTF8( _qt_combo_box->currentText() );
+}
+
+
+void YQComboBox::setText( const string & newValue )
+{
+ QString text = fromUTF8( newValue );
+
+ if ( isValidText( text ) )
+ {
+ _qt_combo_box->blockSignals( true );
+ _qt_combo_box->setCurrentText( text );
+ _qt_combo_box->blockSignals( false );
+ }
+ else
+ {
+ y2error( "%s \"%s\": Rejecting invalid value \"%s\"",
+ widgetClass(), debugLabel().c_str(), newValue.c_str() );
+ }
+}
+
+
+void YQComboBox::addItem( YItem * item )
+{
+ YComboBox::addItem( item );
+ _qt_combo_box->insertItem( fromUTF8( item->label() ) );
+
+ if ( item->selected() )
+ setText( item->label() );
+}
+
+
+void YQComboBox::deleteAllItems()
+{
+ _qt_combo_box->blockSignals( true );
+ _qt_combo_box->clear();
+ YSelectionWidget::deleteAllItems();
+ _qt_combo_box->blockSignals( false );
+}
+
+
void YQComboBox::setLabel( const string & label )
{
- _qt_label->setText( fromUTF8(label->value() ) );
+ _qt_label->setText( fromUTF8( label ) );
if ( _qt_label->text().isEmpty() )
{
@@ -127,86 +170,69 @@
}
-int YQComboBox::preferredWidth()
+bool YQComboBox::isValidText( const QString & txt ) const
{
- return sizeHint().width();
-}
+ if ( ! _validator )
+ return true;
+ int pos = 0;
+ QString text( txt ); // need a non-const QString &
-int YQComboBox::preferredHeight()
-{
- return sizeHint().height();
+ return _validator->validate( text, pos ) == QValidator::Acceptable;
}
-void YQComboBox::setSize( int newWidth, int newHeight )
+void YQComboBox::slotSelected( int i )
{
- resize( newWidth, newHeight );
-}
-
+ if ( notify() )
+ {
+ if ( ! YQUI::ui()->eventPendingFor( this ) )
+ {
+ // Avoid overwriting a (more important) ValueChanged event with a SelectionChanged event
-void YQComboBox::setEnabled( bool enabled )
-{
- _qt_label->setEnabled( enabled );
- _qt_combo_box->setEnabled( enabled );
- YWidget::setEnabled( enabled );
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::SelectionChanged ) );
+ }
+ }
}
-void YQComboBox::itemAdded( const string & label, int index, bool selected )
+void YQComboBox::textChanged( const QString & new_text )
{
- _qt_combo_box->insertItem( fromUTF8( label ) );
-
- if ( selected )
- setValue( label );
+ if ( notify() )
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
-int YQComboBox::currentItem() const
+void YQComboBox::setInputMaxLength( int len )
{
- return _qt_combo_box->currentItem();
+ _qt_combo_box->lineEdit()->setMaxLength( len );
+ YComboBox::setInputMaxLength( len );
}
-string YQComboBox::value() const
+int YQComboBox::preferredWidth()
{
- return toUTF8( _qt_combo_box->currentText() );
+ return sizeHint().width();
}
-bool YQComboBox::isValidText( const QString & txt ) const
+int YQComboBox::preferredHeight()
{
- if ( ! _validator )
- return true;
-
- int pos = 0;
- QString text( txt ); // need a non-const QString &
-
- return _validator->validate( text, pos ) == QValidator::Acceptable;
+ return sizeHint().height();
}
-void YQComboBox::setValue( const string & ytext )
+void YQComboBox::setSize( int newWidth, int newHeight )
{
- QString text = fromUTF8( ytext->value() );
-
- if ( isValidText( text ) )
- {
- _qt_combo_box->blockSignals( true );
- _qt_combo_box->setCurrentText( text );
- _qt_combo_box->blockSignals( false );
- }
- else
- {
- y2error( "%s \"%s\": Rejecting invalid value \"%s\"",
- widgetClass(), debugLabel().c_str(), ytext->value().c_str() );
- }
+ resize( newWidth, newHeight );
}
-void YQComboBox::setCurrentItem( int index )
+void YQComboBox::setEnabled( bool enabled )
{
- _qt_combo_box->setCurrentItem( index );
+ _qt_label->setEnabled( enabled );
+ _qt_combo_box->setEnabled( enabled );
+ YWidget::setEnabled( enabled );
}
@@ -218,40 +244,4 @@
}
-// slots
-
-void YQComboBox::slotSelected( int i )
-{
- if ( notify() )
- {
- if ( ! YQUI::ui()->eventPendingFor( this ) )
- {
- // Avoid overwriting a (more important) ValueChanged event with a SelectionChanged event
-
- YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::SelectionChanged ) );
- }
- }
-}
-
-
-void YQComboBox::textChanged( const QString & new_text )
-{
- if ( notify() )
- YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
-}
-
-
-void YQComboBox::deleteAllItems()
-{
- _qt_combo_box->blockSignals( true );
- _qt_combo_box->clear();
- YSelectionWidget::deleteAllItems();
- _qt_combo_box->blockSignals( false );
-}
-
-void YQComboBox::setInputMaxLength( const YCPInteger & numberOfChars)
-{
- _qt_combo_box->lineEdit()->setMaxLength(numberOfChars->asInteger()->value());
-}
-
#include "YQComboBox.moc"
Modified: branches/tmp/sh/mod-ui/qt/src/YQComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQComboB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQComboBox.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQComboBox.h Mon Jul 2 16:32:31 2007
@@ -35,7 +35,6 @@
Q_OBJECT
public:
-
/**
* Constructor.
**/
@@ -47,103 +46,79 @@
~YQComboBox();
/**
- * 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 );
-
- /**
- * Preferred width of the widget.
+ * Add one item. This widget assumes ownership of the item object and will
+ * delete it in its destructor.
*
- * Reimplemented from YWidget.
- **/
- virtual int preferredWidth();
-
- /**
- * Preferred height of the widget.
- *
- * Reimplemented from YWidget.
+ * Reimplemented from YComboBox.
**/
- virtual int preferredHeight();
+ virtual void addItem( YItem * item );
/**
- * Set the new size of the widget.
+ * Delete all items.
*
- * Reimplemented from YWidget.
+ * Reimplemented from YSelectionWidget.
**/
- virtual void setSize( int newWidth, int newHeight );
+ virtual void deleteAllItems();
/**
* Change the label text.
+ *
+ * Reimplemented from YSelectionWidget.
**/
- void setLabel( const string & label );
+ virtual void setLabel( const string & label );
/**
* Change the valid input characters.
*
- * Reimplemented from @ref YComboBox
+ * Reimplemented from YComboBox.
**/
- void setValidChars( const string & validChars );
+ virtual void setValidChars( const string & validChars );
/**
- * Returns 'true' if the given text is valid according to the current
- * setting of ValidChars.
- **/
- bool isValidText( const QString & txt ) const;
-
- /**
- * Notification that a new item has been added.
+ * Specify the amount of characters which can be inserted.
*
* Reimplemented from YComboBox.
**/
- void itemAdded( const string & itemText, int itemIndex, bool selected );
+ virtual void setInputMaxLength( int numberOfChars );
/**
- * Inherited from YComboBox:
- * Returns the ComboBox value.
+ * Returns 'true' if the given text is valid according to the current
+ * setting of ValidChars.
**/
- string value() const;
+ bool isValidText( const QString & txt ) const;
/**
- * Inherited from YComboBox:
- * Sets the ComboBox value to a random value that is not already in
- * the item list. Will be called for editable ComboBox widgets only.
+ * 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 setValue( const string & newValue );
+ virtual void setEnabled( bool enabled );
/**
- * Inherited from YComboBox:
- * Returns the index of the currently selected item (from 0 on)
- * or -1 if no item is selected.
- **/
- int currentItem() const;
-
- /**
- * Inherited from YComboBox:
- * Selects an item from the list. Notice there intentionally is no
- * corresponding getCurrentItem() method - use getValue() instead.
+ * Preferred width of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- void setCurrentItem( int index );
+ virtual int preferredWidth();
/**
- * Accept the keyboard focus.
+ * Preferred height of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- virtual bool setKeyboardFocus();
+ virtual int preferredHeight();
/**
- * Delete all items.
+ * Set the new size of the widget.
*
- * Reimplemented from YSelectionWidget.
+ * Reimplemented from YWidget.
**/
- virtual void deleteAllItems();
+ virtual void setSize( int newWidth, int newHeight );
/**
- * Specify the amount of characters which can be inserted.
- *
- * Reimplemented from YComboBox.
+ * Accept the keyboard focus.
**/
- void setInputMaxLength( const YCPInteger & numberOfChars );
+ virtual bool setKeyboardFocus();
protected slots:
@@ -163,6 +138,27 @@
protected:
+
+ /**
+ * Return this ComboBox's current value as text.
+ *
+ * Called internally from value(), selectedItem() and related.
+ *
+ * Implemented from YComboBox.
+ **/
+ virtual string text();
+
+ /**
+ *
+ * Set this ComboBox's current value as text.
+ *
+ * Called internally whenever the content is to change
+ * programmatically. Don't call setValue() or selectItem() from here.
+ *
+ * Implemented from YComboBox.
+ **/
+ virtual void setText( const string & newText );
+
//
// Data members
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiS…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc Mon Jul 2 16:32:31 2007
@@ -35,221 +35,174 @@
#define SHRINKABLE_VISIBLE_LINES 2
-YQMultiSelectionBox::YQMultiSelectionBox( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & label )
- : QVBox( parent )
- , YMultiSelectionBox( opt, label )
+YQMultiSelectionBox::YQMultiSelectionBox( YWidget * parent,
+ const string & label )
+ : QVBox( (QWidget *) parent->widgetRep() )
+ , YMultiSelectionBox( parent, label )
{
setWidgetRep( this );
setSpacing( YQWidgetSpacing );
setMargin( YQWidgetMargin );
- _qt_label = new QLabel( fromUTF8(label->value() ), this );
+ _qt_label = new QLabel( fromUTF8( label ), this );
_qt_label->setTextFormat( QLabel::PlainText );
- _qt_listview = new QListView( this );
- _qt_listview->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
- _qt_listview->addColumn( "" ); // QListView doesn't have one single column by default!
- _qt_listview->setSorting( 0, false );
- _qt_listview->header()->hide();
- _qt_label->setBuddy( _qt_listview );
+ _qt_listView = new QListView( this );
+ _qt_listView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+ _qt_listView->addColumn( "" ); // QListView doesn't have one single column by default!
+ _qt_listView->setSorting( 0, false );
+ _qt_listView->header()->hide();
+ _qt_label->setBuddy( _qt_listView );
// Very small default size if specified
- _shrinkable = opt.isShrinkable.value();
- connect( _qt_listview, SIGNAL( selectionChanged() ),
+ connect( _qt_listView, SIGNAL( selectionChanged() ),
this, SLOT ( slotSelected() ) );
-
+
connect( this, SIGNAL( valueChanged() ),
this, SLOT ( slotValueChanged() ) );
}
-void
-YQMultiSelectionBox::setLabel( const YCPString & label )
+YQMultiSelectionBox::~YQMultiSelectionBox()
{
- _qt_label->setText( fromUTF8(label->value() ) );
- YMultiSelectionBox::setLabel( label );
+ // NOP
}
-int YQMultiSelectionBox::preferredWidth()
+void
+YQMultiSelectionBox::setLabel( const string & label )
{
- int hintWidth = _qt_label->sizeHint().width() + frameWidth();
-
- return max( 80, hintWidth );
+ _qt_label->setText( fromUTF8( label ) );
+ YMultiSelectionBox::setLabel( label );
}
-int YQMultiSelectionBox::preferredHeight()
+void
+YQMultiSelectionBox::addItem( YItem * yItem )
{
- int hintHeight = _qt_label->sizeHint().height();
- int visibleLines = _shrinkable ? SHRINKABLE_VISIBLE_LINES : DEFAULT_VISIBLE_LINES;
- hintHeight += visibleLines * _qt_listview->fontMetrics().lineSpacing();
- hintHeight += _qt_listview->frameWidth() * 2;
+ YMultiSelectionBox::addItem( yItem ); // will also check for NULL
- return max( 80, hintHeight );
-}
+ _qt_listView->blockSignals( true );
+ YQMultiSelectionBoxItem * msbItem =
+ new YQMultiSelectionBoxItem( this, _qt_listView, yItem );
-void
-YQMultiSelectionBox::setSize( int newWidth, int newHeight )
-{
- resize( newWidth, newHeight );
-}
+ YUI_CHECK_NEW( msbItem );
+ if ( yItem->selected() )
+ msbItem->setOn( true );
-void
-YQMultiSelectionBox::setEnabled( bool enabled )
+ _qt_listView->blockSignals( false );
+}
+
+void YQMultiSelectionBox::selectItem( YItem * yItem, bool selected )
{
- _qt_label->setEnabled( enabled );
- _qt_listview->setEnabled( enabled );
- _qt_listview->triggerUpdate();
- YWidget::setEnabled( enabled );
+ YMultiSelectionBox::selectItem( yItem, selected );
+ YQMultiSelectionBoxItem * msbItem = findItem( yItem );
+
+ if ( msbItem )
+ msbItem->setOn( selected );
}
void
-YQMultiSelectionBox::itemAdded( const YCPString & label, int index, bool selected )
+YQMultiSelectionBox::deselectAllItems()
{
- _qt_listview->blockSignals( true );
-
- YQMultiSelectionBoxItem * item = new YQMultiSelectionBoxItem( this, _qt_listview, fromUTF8( label->value() ) );
-
- if ( item && selected )
- {
- item->setOn( true );
- }
+ YMultiSelectionBox::deselectAllItems();
- _qt_listview->blockSignals( false );
+ _qt_listView->blockSignals( true );
+ _qt_listView->clearSelection();
+ _qt_listView->blockSignals( false );
}
-int
-YQMultiSelectionBox::getCurrentItem()
+void
+YQMultiSelectionBox::deleteAllItems()
{
- int index = 0;
- QListViewItem * child = _qt_listview->firstChild();
+ YMultiSelectionBox::deleteAllItems();
- while ( child )
- {
- if ( child->isSelected() ) // don't confuse this with isOn() !
- {
- return index;
- }
- index++;
- child = child->nextSibling();
- }
-
- return -1;
+ _qt_listView->blockSignals( true );
+ _qt_listView->clear();
+ _qt_listView->blockSignals( false );
}
-void
-YQMultiSelectionBox::setCurrentItem( int index )
+YItem *
+YQMultiSelectionBox::currentItem()
{
- _qt_listview->blockSignals( true );
- _qt_listview->clearSelection();
- QListViewItem * child = _qt_listview->firstChild();
+ QListViewItem * currentQItem = _qt_listView->currentItem();
- for ( int i = 0; i < index; i++ )
+ if ( currentQItem )
{
- child = child->nextSibling();
+ YQMultiSelectionBoxItem * item = dynamic_cast<YQMultiSelectionBoxItem *> (currentQItem);
- if ( ! child )
- {
- y2error( "Don't have that many items" );
- return;
- }
+ if ( item )
+ return item->yItem();
}
- child->setSelected( true );
- _qt_listview->blockSignals( false );
+ return 0;
}
-bool
-YQMultiSelectionBox::setKeyboardFocus()
+void
+YQMultiSelectionBox::setCurrentItem( YItem * yItem )
{
- _qt_listview->setFocus();
- return true;
+ YQMultiSelectionBoxItem * msbItem = findItem( yItem );
+
+ if ( msbItem )
+ {
+ _qt_listView->blockSignals( true );
+ _qt_listView->setCurrentItem( msbItem );
+ _qt_listView->blockSignals( false );
+ }
}
void
-YQMultiSelectionBox::deleteAllItems()
+YQMultiSelectionBox::setEnabled( bool enabled )
{
- _qt_listview->blockSignals( true );
- _qt_listview->clear();
- YSelectionWidget::deleteAllItems();
- _qt_listview->blockSignals( false );
+ _qt_label->setEnabled( enabled );
+ _qt_listView->setEnabled( enabled );
+ _qt_listView->triggerUpdate();
+ YWidget::setEnabled( enabled );
}
-bool
-YQMultiSelectionBox::itemIsSelected( int index )
+int YQMultiSelectionBox::preferredWidth()
{
- QListViewItem * child = _qt_listview->firstChild();
+ int hintWidth = _qt_label->sizeHint().width() + frameWidth();
- for ( int i = 0; i < index; i++ )
- {
- child = child->nextSibling();
+ return max( 80, hintWidth );
+}
- if ( ! child )
- {
- y2error( "Don't have that many items" );
- return false;
- }
- }
- QCheckListItem * item = ( QCheckListItem * ) child;
+int YQMultiSelectionBox::preferredHeight()
+{
+ int hintHeight = _qt_label->sizeHint().height();
+ int visibleLines = shrinkable() ? SHRINKABLE_VISIBLE_LINES : DEFAULT_VISIBLE_LINES;
+ hintHeight += visibleLines * _qt_listView->fontMetrics().lineSpacing();
+ hintHeight += _qt_listView->frameWidth() * 2;
- return item->isOn();
+ return max( 80, hintHeight );
}
void
-YQMultiSelectionBox::selectItem( int index )
+YQMultiSelectionBox::setSize( int newWidth, int newHeight )
{
- _qt_listview->blockSignals( true );
- QListViewItem * child = _qt_listview->firstChild();
-
- for ( int i = 0; i < index; i++ )
- {
- child = child->nextSibling();
-
- if ( ! child )
- {
- y2error( "Don't have that many items" );
- return;
- }
- }
-
- QCheckListItem * item = ( QCheckListItem * ) child;
-
- item->setOn( true );
- _qt_listview->blockSignals( false );
+ resize( newWidth, newHeight );
}
-void
-YQMultiSelectionBox::deselectAllItems()
+bool
+YQMultiSelectionBox::setKeyboardFocus()
{
- _qt_listview->blockSignals( true );
-
- QListViewItem * child = _qt_listview->firstChild();
+ _qt_listView->setFocus();
- while ( child )
- {
- QCheckListItem * item = ( QCheckListItem * ) child;
- item->setOn( false );
- child = child->nextSibling();
- }
-
- _qt_listview->blockSignals( false );
+ return true;
}
@@ -261,7 +214,7 @@
if ( ! YQUI::ui()->eventPendingFor( this ) )
{
// Avoid overwriting a (more important) ValueChanged event with a SelectionChanged event
-
+
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::SelectionChanged ) );
}
}
@@ -283,6 +236,27 @@
}
+YQMultiSelectionBoxItem *
+YQMultiSelectionBox::findItem( YItem * wantedItem )
+{
+ QListViewItemIterator it( _qt_listView );
+
+ while ( *it )
+ {
+ YQMultiSelectionBoxItem * item = dynamic_cast<YQMultiSelectionBoxItem *> (*it);
+
+ if ( item && item->yItem() == wantedItem )
+ return item;
+
+ ++it;
+ }
+
+ return 0;
+}
+
+
+
+
int YQMultiSelectionBoxItem::_item_count = 0;
@@ -290,10 +264,13 @@
YQMultiSelectionBoxItem::YQMultiSelectionBoxItem( YQMultiSelectionBox * parent,
QListView * listView,
- const QString & text )
- : QCheckListItem( listView, text, QCheckListItem::CheckBox )
+ YItem * yItem )
+ : QCheckListItem( listView, fromUTF8( yItem->label() ), QCheckListItem::CheckBox )
+ , _yItem( yItem )
, _multiSelectionBox( parent )
{
+ YUI_CHECK_PTR( yItem );
+
_serial = _item_count++;
}
@@ -301,6 +278,7 @@
void
YQMultiSelectionBoxItem::stateChange( bool newState )
{
+ _yItem->setSelected( newState );
_multiSelectionBox->sendValueChanged();
QCheckListItem::stateChange( newState );
}
@@ -312,7 +290,7 @@
/*
* Return a sort key that depends on creation ( i.e. insertion ) order.
*/
-
+
static QString sortKey;
sortKey.sprintf( "%010d", INT_MAX - _serial );
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiS…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.h Mon Jul 2 16:32:31 2007
@@ -22,12 +22,13 @@
#include <qvbox.h>
#include <qlistview.h>
-#include <ycp/YCPString.h>
#include "YMultiSelectionBox.h"
class QLabel;
+class YQMultiSelectionBoxItem;
+
class YQMultiSelectionBox : public QVBox, public YMultiSelectionBox
{
@@ -38,117 +39,111 @@
/**
* Constructor.
**/
- YQMultiSelectionBox( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & label );
+ YQMultiSelectionBox( YWidget * parent, const string & label );
/**
- * Inherited from YWidget: Sets the enabled state of the
- * widget. All new widgets are enabled per definition. Only
- * enabled widgets can take user input.
+ * Destructor.
**/
- void setEnabled( bool enabled );
-
+ ~YQMultiSelectionBox();
+
/**
- * Preferred width of the widget.
+ * Change the label text.
*
- * Reimplemented from YWidget.
+ * Reimplemented from YSelectionWidget.
**/
- virtual int preferredWidth();
+ virtual void setLabel( const string & label );
/**
- * Preferred height of the widget.
+ * Add an item.
*
- * Reimplemented from YWidget.
+ * Reimplemented from YSelectionWidget.
**/
- virtual int preferredHeight();
+ virtual void addItem( YItem * item );
/**
- * Set the new size of the widget.
+ * Select or deselect an item.
*
- * Reimplemented from YWidget.
- **/
- virtual void setSize( int newWidth, int newHeight );
-
- /**
- * Change the label text.
+ * Reimplemented from YSelectionWidget.
**/
- virtual void setLabel( const YCPString & label );
+ virtual void selectItem( YItem * item, bool selected = true );
/**
- * Notification that a new item has been added.
+ * Deselect all items.
*
* Reimplemented from YSelectionWidget.
**/
- virtual void itemAdded( const YCPString & itemText, int index, bool selected );
+ virtual void deselectAllItems();
/**
- * Returns the index of the item that currently has the keyboard focus.
+ * Delete all items.
*
- * Reimplemented from YMultiSelectionBox
+ * Reimplemented from YSelectionWidget.
**/
- virtual int getCurrentItem();
-
+ virtual void deleteAllItems();
+
/**
- * Set the keyboard focus to one item.
+ * Return the the item that currently has the keyboard focus
+ * or 0 if no item currently has the keyboard focus.
*
- * Reimplemented from YMultiSelectionBox
+ * Reimplemented from YMultiSelectionBox.
**/
- virtual void setCurrentItem( int index );
+ virtual YItem * currentItem();
/**
- * Accept the keyboard focus.
+ * Set the keyboard focus to the specified item.
+ * 0 means clear the keyboard focus.
+ *
+ * Reimplemented from YMultiSelectionBox.
**/
- virtual bool setKeyboardFocus();
+ virtual void setCurrentItem( YItem * item );
/**
- * Delete all items.
+ * Set enabled/disabled state.
*
- * Reimplemented from YMultiSelectionBox
+ * Reimplemented from YWidget.
**/
- virtual void deleteAllItems();
+ virtual void setEnabled( bool enabled );
/**
- * Sends a ValueChanged signal.
+ * Preferred width of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- void sendValueChanged();
-
-
-signals:
+ virtual int preferredWidth();
/**
- * Emitted upon when an item changes its state.
+ * Preferred height of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- void valueChanged();
-
-
-protected:
+ virtual int preferredHeight();
/**
- * Check whether or not item #index is selected.
+ * Set the new size of the widget.
*
- * Reimplemented from YMultiSelectionBox
+ * Reimplemented from YWidget.
**/
- virtual bool itemIsSelected( int index );
+ virtual void setSize( int newWidth, int newHeight );
/**
- * Select item #index.
- *
- * Reimplemented from YMultiSelectionBox
+ * Accept the keyboard focus.
**/
- virtual void selectItem( int index );
+ virtual bool setKeyboardFocus();
/**
- * Deselect all items.
- *
- * Reimplemented from YMultiSelectionBox
+ * Sends a ValueChanged signal.
**/
- virtual void deselectAllItems();
+ void sendValueChanged();
+signals:
+ /**
+ * Emitted upon when an item changes its state.
+ **/
+ void valueChanged();
+
protected slots:
-
/**
* Send SelectionChanged event if `opt(`notify) is set.
**/
@@ -161,11 +156,14 @@
protected:
+ /**
+ * Find the counterpart of 'item'. Return 0 if there is none.
+ **/
+ YQMultiSelectionBoxItem * findItem( YItem * item );
+
QLabel * _qt_label;
- QListView * _qt_listview;
-
- bool _shrinkable;
+ QListView * _qt_listView;
};
@@ -178,13 +176,18 @@
**/
YQMultiSelectionBoxItem( YQMultiSelectionBox * parent,
QListView * listView,
- const QString & text );
+ YItem * yItem );
/**
* Destructor.
**/
virtual ~YQMultiSelectionBoxItem() {}
+ /**
+ * Return the corresponding YItem.
+ **/
+ YItem * yItem() const { return _yItem; }
+
protected:
@@ -198,18 +201,17 @@
/**
* Returns the sort key for any column.
- * Reimplemented from @ref QListViewItem.
+ * In this case, maintain item creation order.
*
- * This method is the true reason for this class - a pure QListViewItem is
- * too dumb to retain insertion order even if sorting is explicitly
- * disabled: It gets sorted in reverse insertion order. :-(
+ * Reimplemented from QListViewItem.
**/
virtual QString key ( int column,
bool ascending ) const;
// Data members
-
+
+ YItem * _yItem;
int _serial;
YQMultiSelectionBox * _multiSelectionBox;
Modified: branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSelect…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc Mon Jul 2 16:32:31 2007
@@ -42,7 +42,7 @@
YQSelectionBox::YQSelectionBox( YWidget * parent, const string & label )
: QVBox( (QWidget *) parent->widgetRep() )
- , YSelectionBox( opt, label )
+ , YSelectionBox( parent, label )
{
setWidgetRep( this );
@@ -128,7 +128,7 @@
_qt_listBox->insertItem( icon, fromUTF8( item->label() ) );
}
- if ( selected )
+ if ( item->selected() )
{
_qt_listBox->blockSignals( true );
_qt_listBox->setCurrentItem( item->index() );
@@ -292,11 +292,26 @@
}
-void YQSelectionBox::slotActivated( QListBoxItem * item )
+void YQSelectionBox::slotActivated( QListBoxItem * qItem )
{
- selectItem( QListBox::index( item ) );
+ YItem * item = itemAt( _qt_listBox->index( qItem ) );
- YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::Activated ) );
+ if ( item )
+ {
+#if 1
+ y2debug( "Item %s selected", item->label().c_str() );
+#endif
+ YSelectionBox::deselectAllItems();
+ item->setSelected( true );
+
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::Activated ) );
+ }
+ else
+ {
+ y2error( "%s: No YItem %s found",
+ debugLabel().c_str(),
+ toUTF8( qItem->text() ).c_str() );
+ }
}
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?r…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Mon Jul 2 16:32:31 2007
@@ -450,14 +450,11 @@
/*** Widget creation methods, all reimplemented from YUI ***/
- YWidget * createComboBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createIntField ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int minValue, int maxValue, int initialValue);
YWidget * createLogView ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, int maxLines );
YWidget * createMultiLineEdit ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text);
YWidget * createProgressBar ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPInteger & maxProgress, const YCPInteger & currentProgress );
YWidget * createMenuButton ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
- YWidget * createSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
- YWidget * createMultiSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createTable ( YWidget * parent, YWidgetOpt & opt, vector<string> header);
YWidget * createTree ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
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_wid…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Mon Jul 2 16:32:31 2007
@@ -23,7 +23,6 @@
#include "YQBarGraph.h"
#include "YQCheckBox.h"
-#include "YQComboBox.h"
#include "YQDate.h"
#include "YQDialog.h"
#include "YQDownloadProgress.h"
@@ -33,13 +32,11 @@
#include "YQMenuButton.h"
#include "YQMultiLineEdit.h"
#include "YQMultiProgressMeter.h"
-#include "YQMultiSelectionBox.h"
#include "YQPackageSelectorPlugin.h"
#include "YQPartitionSplitter.h"
#include "YQPatternSelector.h"
#include "YQSimplePatchSelector.h"
#include "YQProgressBar.h"
-#include "YQSelectionBox.h"
#include "YQSlider.h"
#include "YQTable.h"
#include "YQTime.h"
@@ -121,26 +118,6 @@
return new YQMultiLineEdit( (QWidget *) ( parent->widgetRep() ), opt, label, initialText);
}
-YWidget * YQUI::createSelectionBox ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label )
-{
- return new YQSelectionBox( (QWidget *) ( parent->widgetRep() ), opt, label);
-}
-
-YWidget * YQUI::createMultiSelectionBox( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label )
-{
- return new YQMultiSelectionBox( (QWidget *) ( parent->widgetRep() ), opt, label);
-}
-
-YWidget * YQUI::createComboBox ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label )
-{
- return new YQComboBox( (QWidget *) ( parent->widgetRep() ), opt, label);
-}
YWidget * YQUI::createTree ( YWidget * parent,
YWidgetOpt & opt,
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Mon Jul 2 16:32:31 2007
@@ -150,7 +150,10 @@
YQComboBox *
YQWidgetFactory::createComboBox( YWidget * parent, const string & label, bool editable )
{
- return 0; // FIXME: TO DO
+ YQComboBox * comboBox = new YQComboBox( parent, label, editable );
+ YUI_CHECK_NEW( comboBox );
+
+ return comboBox;
}
@@ -158,7 +161,10 @@
YQSelectionBox *
YQWidgetFactory::createSelectionBox( YWidget * parent, const string & label )
{
- return 0; // FIXME: TO DO
+ YQSelectionBox * selectionBox = new YQSelectionBox( parent, label );
+ YUI_CHECK_NEW( selectionBox );
+
+ return selectionBox;
}
@@ -237,7 +243,6 @@
}
-
YQLogView *
YQWidgetFactory::createLogView( YWidget * parent, const string & label, int visibleLines, int storedLines )
{
@@ -246,12 +251,14 @@
-YQSelectionBox *
+YQMultiSelectionBox *
YQWidgetFactory::createMultiSelectionBox( YWidget * parent, const string & label )
{
- return 0; // FIXME: TO DO
-}
+ YQMultiSelectionBox * multiSelectionBox = new YQMultiSelectionBox( parent, label );
+ YUI_CHECK_NEW( multiSelectionBox );
+ return multiSelectionBox;
+}
@@ -259,7 +266,7 @@
YQWidgetFactory::createPackageSelector( YWidget * parent, long modeFlags )
{
YQUI::ui()->setAutoActivateDialogs( false );
-
+
YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin();
if ( plugin )
@@ -269,7 +276,6 @@
}
-
YWidget *
YQWidgetFactory::createPkgSpecial( YWidget * , const string & )
{
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Mon Jul 2 16:32:31 2007
@@ -37,6 +37,7 @@
#include "YQLogView.h"
#include "YQMenuButton.h"
#include "YQMultiLineEdit.h"
+#include "YQMultiSelectionBox.h"
#include "YQPackageSelector.h"
#include "YQProgressBar.h"
#include "YQPushButton.h"
@@ -103,7 +104,7 @@
virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label );
virtual YQImage * createImage ( YWidget * parent, const string & imageFileName, bool animated = false );
virtual YQLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 );
- virtual YQSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label );
+ virtual YQMultiSelectionBox *createMultiSelectionBox( YWidget * parent, const string & label );
virtual YQPackageSelector * createPackageSelector ( YWidget * parent, long modeFlags = 0 );
virtual YWidget * createPkgSpecial ( YWidget * parent, const string & name ); // NCurses only, will throw exception in the Qt UI
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39106 - in /trunk/installation: package/yast2-installation.changes src/include/misc.ycp
by locilka@svn.opensuse.org 02 Jul '07
by locilka@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: locilka
Date: Mon Jul 2 15:39:51 2007
New Revision: 39106
URL: http://svn.opensuse.org/viewcvs/yast?rev=39106&view=rev
Log:
- Applied patch from sassmann(a)novell.com for PS3 support with
576x384 resolution (#273147).
Modified:
trunk/installation/package/yast2-installation.changes
trunk/installation/src/include/misc.ycp
Modified: trunk/installation/package/yast2-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-insta…
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Mon Jul 2 15:39:51 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jul 2 15:38:27 CEST 2007 - locilka(a)suse.cz
+
+- Applied patch from sassmann(a)novell.com for PS3 support with
+ 576x384 resolution (#273147).
+
+-------------------------------------------------------------------
Fri Jun 29 11:50:47 CEST 2007 - locilka(a)suse.cz
- Extended "Suggested Installation Sources" to support two levels
Modified: trunk/installation/src/include/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/include/misc.yc…
==============================================================================
--- trunk/installation/src/include/misc.ycp (original)
+++ trunk/installation/src/include/misc.ycp Mon Jul 2 15:39:51 2007
@@ -168,15 +168,26 @@
heading_bg_color, heading, body )
: ( heading + body );
+ integer size_x = tointeger(display_info["Width"]:800);
+ integer size_y = tointeger(display_info["Height"]:600);
+ // 576x384 support for for ps3
+ // bugzilla #273147
+ if (size_x >= 800 && size_y >= 600) {
+ size_x = 70;
+ size_y = 18;
+ } else {
+ size_x = 54;
+ size_y = 15;
+ }
UI::OpenDialog(
`VBox(
`VSpacing( 0.4 ),
- `HSpacing( 70 ), // force width
+ `HSpacing( size_x ), // force width
`HBox(
`HSpacing( 0.7 ),
- `VSpacing( 18 ), // force height
+ `VSpacing( size_y ), // force height
`RichText( text ),
`HSpacing( 0.7 )
),
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39105 - /branches/tmp/sh/mod-ui/core/libyui/src/
by sh-sh-sh@svn.opensuse.org 02 Jul '07
by sh-sh-sh@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: sh-sh-sh
Date: Mon Jul 2 15:38:20 2007
New Revision: 39105
URL: http://svn.opensuse.org/viewcvs/yast?rev=39105&view=rev
Log:
compiles
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
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/YComboBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.cc
branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Mon Jul 2 15:38:20 2007
@@ -1796,19 +1796,16 @@
YSelectionBox *selBox = YUI::widgetFactory()->createSelectionBox( parent, label );
-#warning TO DO: shrinkable / immediate
-#if 0
if ( shrinkable )
selBox->setShrinkable( true );
if ( immediate )
- selBox->setImmediate( true ); // includes setNotify()
-#endif
+ selBox->setImmediateMode( true ); // includes setNotify()
if ( numargs >= 2 )
{
YCPList itemList = term->value( argnr+1 )->asList();
- selBox->addItems( YCPItemParser::parseItemList( itemList );
+ selBox->addItems( YCPItemParser::parseItemList( itemList ) );
}
return selBox;
@@ -1858,21 +1855,27 @@
return 0;
}
+ string label = term->value( argnr )->asString()->value();
+ bool shrinkable = false;
+
for ( int o=0; o < optList->size(); o++ )
{
- if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_shrinkable ) opt.isShrinkable.setValue( true );
+ if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_shrinkable ) shrinkable = true;
else logUnknownOption( term, optList->value(o) );
}
- YMultiSelectionBox *multi_sel_box =
- dynamic_cast<YMultiSelectionBox *> ( YUI::ui()->createMultiSelectionBox( parent, opt, term->value( argnr )->asString() ) );
+ YMultiSelectionBox * multiSelectionBox = YUI::widgetFactory()->createMultiSelectionBox( parent, label );
+
+ if ( shrinkable )
+ multiSelectionBox->setShrinkable( true );
- if ( multi_sel_box && numargs >= 2 )
+ if ( numargs >= 2 )
{
- multi_sel_box->parseItemList( term->value( argnr+1 )->asList() );
+ YCPList itemList = term->value( argnr+1 )->asList();
+ multiSelectionBox->addItems( YCPItemParser::parseItemList( itemList ) );
}
- return multi_sel_box;
+ return multiSelectionBox;
}
@@ -1926,20 +1929,24 @@
return 0;
}
+ string label = term->value( argnr )->asString()->value();
+ bool editable = false;
+
for ( int o=0; o < optList->size(); o++ )
{
- if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_editable ) opt.isEditable.setValue( true );
+ if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_editable ) editable = true;
else logUnknownOption( term, optList->value(o) );
}
- YComboBox *combo_box = dynamic_cast<YComboBox *> ( YUI::ui()->createComboBox( parent, opt, term->value( argnr )->asString() ) );
+ YComboBox * comboBox = YUI::widgetFactory()->createComboBox( parent, label, editable );
- if ( combo_box && numargs >=2 )
+ if ( numargs >= 2 )
{
- combo_box->parseItemList( term->value( argnr+1 )->asList() );
+ YCPList itemList = term->value( argnr+1 )->asList();
+ comboBox->addItems( YCPItemParser::parseItemList( itemList ) );
}
- return combo_box;
+ return comboBox;
}
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.cc Mon Jul 2 15:38:20 2007
@@ -23,8 +23,13 @@
#include <ycp/YCPString.h>
#include <ycp/YCPInteger.h>
#include <ycp/YCPBoolean.h>
+#include <ycp/YCPTerm.h>
+
+#define y2log_component "ui"
+#include <ycp/y2log.h>
#include "YCPPropertyHandler.h"
+#include "YCPItemParser.h"
#include "YCheckBox.h"
#include "YSelectionBox.h"
@@ -58,7 +63,7 @@
if ( trySetSelectionWidgetItems( widget, val ) ) return;
}
- y2error( "Can't handle property %s::%s - not changing anything"
+ y2error( "Can't handle property %s::%s - not changing anything",
widget->widgetClass(), propertyName.c_str() );
}
@@ -79,8 +84,19 @@
{
val = tryGetSelectionBoxValue ( widget ); if ( ! val.isNull() ) return val;
val = tryGetComboBoxValue ( widget ); if ( ! val.isNull() ) return val;
+
+ // tryGetMultiSelectionBoxCurrentItem
}
+
+ // FIXME: TO DO:
+ // FIXME: TO DO:
+ // FIXME: TO DO:
+
+ // tryGetMultiSelectionBoxSelectedItems
+ // tryGetSelectionWidgetItems
+ // tryGetRadioButtonGroupCurrentButton
+
y2error( "Can't handle property %s::%s - returning 'nil'",
widget->widgetClass(), propertyName.c_str() );
@@ -113,7 +129,7 @@
YUI_THROW( YUIBadPropertyArgException( YProperty( YUIProperty_Value,
YOtherProperty ),
- checkbox ) );
+ checkBox ) );
return false;
}
@@ -147,7 +163,7 @@
bool
YCPPropertyHandler::trySetComboBoxValue( YWidget * widget, const YCPValue & val )
{
- YSelectionBox * comboBox = dynamic_cast<YSelectionBox *> (widget);
+ YComboBox * comboBox = dynamic_cast<YComboBox *> (widget);
if ( ! comboBox )
return false;
@@ -164,7 +180,7 @@
{
if ( val->isString() || val->isInteger() )
{
- comboBox->setText( val->toString() );
+ comboBox->setValue( val->toString() );
return true;
}
}
@@ -189,13 +205,13 @@
wantedId = val->asTerm()->value(0);
}
- for ( YItemIterator it = selWidget->itemsBegin();
+ for ( YItemConstIterator it = selWidget->itemsBegin();
it != selWidget->itemsEnd();
++it )
{
YCPItem * item = dynamic_cast<YCPItem *> (*it);
- if ( item && item->id() && wantedId )
+ if ( item && wantedId->equal( item->id() ) )
return item;
}
@@ -206,18 +222,18 @@
bool
YCPPropertyHandler::trySetSelectionWidgetItems( YWidget * widget, const YCPValue & val )
{
- YSelectionWidget * selWidget = dynamic_cast<YCheckBox *> (widget );
+ YSelectionWidget * selWidget = dynamic_cast<YSelectionWidget *> (widget );
if ( ! selWidget )
return false;
if ( val->isList() )
{
- selWidget->setItems( YCPItemParser::parseItemList( val->asList ) );
+ selWidget->setItems( YCPItemParser::parseItemList( val->asList() ) );
return true;
}
- YUI_THROW( YUIBadPropertyArgException( YProperty( propertyName,
+ YUI_THROW( YUIBadPropertyArgException( YProperty( YUIProperty_Items,
YOtherProperty ),
widget ) );
return false;
@@ -231,7 +247,7 @@
YCPValue
-YPropertyHandler::tryGetCheckBoxValue( YWidget * widget )
+YCPPropertyHandler::tryGetCheckBoxValue( YWidget * widget )
{
YCheckBox * checkBox = dynamic_cast<YCheckBox *> (widget);
@@ -251,7 +267,7 @@
YCPValue
-YPropertyHandler::tryGetComboBoxValue( YWidget * widget )
+YCPPropertyHandler::tryGetComboBoxValue( YWidget * widget )
{
YComboBox * comboBox = dynamic_cast<YComboBox *> (widget);
@@ -269,19 +285,19 @@
return item->id();
}
- return YCPString( comboBox->text() );
+ return YCPString( comboBox->value() );
}
YCPValue
-YPropertyHandler::tryGetSelectionBoxValue( YWidget * widget )
+YCPPropertyHandler::tryGetSelectionBoxValue( YWidget * widget )
{
YSelectionBox * selBox = dynamic_cast<YSelectionBox *> (widget);
if ( ! selBox )
return YCPNull();
- YItem * selectedItem = selBox()->selectedItem();
+ YItem * selectedItem = selBox->selectedItem();
if ( selectedItem )
{
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPPropertyHandler.h Mon Jul 2 15:38:20 2007
@@ -27,6 +27,10 @@
using std::string;
+class YCPItem;
+class YWidget;
+class YSelectionWidget;
+
/**
* Get and set complex widget properties.
@@ -39,7 +43,7 @@
* versa) or for historical reasons to maintain backward compatibility with
* existing YCP code.
**/
-class YPropertyHandler
+class YCPPropertyHandler
{
public:
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc Mon Jul 2 15:38:20 2007
@@ -29,8 +29,8 @@
struct YComboBoxPrivate
{
YComboBoxPrivate( bool editable )
- , editable( editable )
- , inputMaxLength( -1 );
+ : editable( editable )
+ , inputMaxLength( -1 )
{}
bool editable;
@@ -42,8 +42,9 @@
YComboBox::YComboBox( YWidget * parent, const string & label, bool editable )
- : YSelectionWidget( parent, label )
- , priv( new YComboBoxPrivate( editable )
+ : YSelectionWidget( parent, label,
+ true ) // enforceSingleSelection
+ , priv( new YComboBoxPrivate( editable ) )
{
YUI_CHECK_NEW( priv );
}
@@ -122,7 +123,7 @@
}
-const YItem *
+YItem *
YComboBox::selectedItem()
{
string currentText = text();
@@ -146,8 +147,9 @@
else
{
YSelectionWidget::deselectAllItems();
- return 0;
}
+
+ return 0;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h Mon Jul 2 15:38:20 2007
@@ -54,7 +54,7 @@
* 'editable' means the user can freely enter any value without being
* restricted to the items of the ComboBox's list.
**/
- YComboBox( YWidget * parent, const string * label, bool editable );
+ YComboBox( YWidget * parent, const string & label, bool editable );
public:
/**
@@ -109,7 +109,7 @@
* compare an editable ComboBox's user input against the text labels of
* all items and try to return an item if there is any match.
**/
- virtual const YItem * selectedItem();
+ virtual YItem * selectedItem();
/**
* Return all selected items.
@@ -171,6 +171,35 @@
virtual void setInputMaxLength( int numberOfChars );
/**
+ * 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).
+ **/
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
+
+ /**
+ * 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();
+
+ /**
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.cc Mon Jul 2 15:38:20 2007
@@ -17,144 +17,115 @@
/-*/
-#include <ycp/YCPSymbol.h>
-#include <ycp/YCPBoolean.h>
-#include <ycp/YCPVoid.h>
-#define y2log_component "ui"
#include <ycp/y2log.h>
+#include "YMultiSelectionBox.h"
#include "YUISymbols.h"
#include "YMacroRecorder.h"
-#include "YMultiSelectionBox.h"
+#include "YUIException.h"
-YMultiSelectionBox::YMultiSelectionBox( const YWidgetOpt & opt, YCPString label )
- : YSelectionWidget( opt,label )
+struct YMultiSelectionBoxPrivate
{
- // y2debug( "YMultiSelectionBox( %s )", label->value_cstr() );
+ YMultiSelectionBoxPrivate()
+ : shrinkable( false )
+ {}
+
+ bool shrinkable;
+};
+
- // Derived classes need to check opt.shrinkable!
+YMultiSelectionBox::YMultiSelectionBox( YWidget * parent, const string & label )
+ : YSelectionWidget( parent, label,
+ false ) // enforceSingleSelection
+ , priv( new YMultiSelectionBoxPrivate )
+{
+ YUI_CHECK_NEW( priv );
+
setDefaultStretchable( YD_HORIZ, true );
setDefaultStretchable( YD_VERT, true );
}
-YCPValue YMultiSelectionBox::changeWidget( const YCPSymbol & property, const YCPValue & newValue )
+YMultiSelectionBox::~YMultiSelectionBox()
{
- string sym = property->symbol();
+ // NOP
+}
- /**
- * @property string Label
- * The label above the list describing what it is all about
- */
- if ( sym == YUIProperty_Label )
- {
- return changeLabel( newValue );
- }
-
- /**
- * @property string CurrentItem
- * The item that currently has the keyboard focus
- */
- else if ( sym == YUIProperty_CurrentItem ) // Select item with that id
- {
- int index = itemWithId( newValue, true ); // true: log error
- if ( index < 0 ) return YCPBoolean( false );
- else
- {
- setCurrentItem( index );
- return YCPBoolean( true );
- }
- }
- /**
- * @property id_list SelectedItems
- * The items that are currently selected
- */
- else if ( sym == YUIProperty_SelectedItems )
- {
- if ( ! newValue->isList() )
- {
- y2error( "MultiSelectionBox: Can't set property %s: "
- "Expected list of IDs or item labels, not %s",
- sym.c_str(), newValue->toString().c_str() );
-
- return YCPBoolean( false );
- }
-
- OptimizeChanges below( *this ); // delay screen updates until this block is left
-
- deselectAllItems();
- YCPList selected_items = newValue->asList();
-
- for ( int i = 0; i < selected_items->size(); i++ )
- {
- YCPValue id = selected_items->value(i);
- int index = itemWithId( id, true ); // true: log error
-
- if ( index < 0 ) // No such item
- {
- return YCPBoolean( false );
- }
-
- selectItem( index );
- }
-
- return YCPBoolean( false );
- }
+bool YMultiSelectionBox::shrinkable() const
+{
+ return priv->shrinkable;
+}
+
+
+void YMultiSelectionBox::setShrinkable( bool shrinkable )
+{
+ priv->shrinkable = shrinkable;
+}
- /**
- * @property id_list Items
- * The items that are displayed
- */
- else if ( sym == YUIProperty_Items )
+
+const YPropertySet &
+YMultiSelectionBox::propertySet()
+{
+ static YPropertySet propSet;
+
+ if ( propSet.isEmpty() )
{
- return changeItems ( newValue );
+ /*
+ * @property itemList SelectedItems All currently selected items
+ * @property itemList Items All items
+ * @property itemID CurrentItem The current item (no matter if selected or not)
+ * @property string Label Caption above the input field
+ */
+ propSet.add( YProperty( YUIProperty_CurrentItem, YOtherProperty ) );
+ propSet.add( YProperty( YUIProperty_SelectedItems, YOtherProperty ) );
+ propSet.add( YProperty( YUIProperty_Items, YOtherProperty ) );
+ propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
+ propSet.add( YWidget::propertySet() );
}
- else
- return YWidget::changeWidget( property, newValue );
-}
+ return propSet;
+}
-YCPValue YMultiSelectionBox::queryWidget( const YCPSymbol & property )
+bool
+YMultiSelectionBox::setProperty( const string & propertyName, const YPropertyValue & val )
{
- string sym = property->symbol();
- if ( sym == YUIProperty_Label ) return getLabel();
- else if ( sym == YUIProperty_CurrentItem )
- {
- int index = getCurrentItem();
- // y2debug( "current item: %d", index );
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
- if ( index >= 0 )
- {
- if ( item_ids->value( index ).isNull() ) return item_labels->value( index );
- else return item_ids->value( index );
- }
- else return YCPVoid();
- }
- else if ( sym == YUIProperty_SelectedItems )
+ if ( propertyName == YUIProperty_CurrentItem ) return false; // Needs special handling
+ else if ( propertyName == YUIProperty_SelectedItems ) return false; // Needs special handling
+ else if ( propertyName == YUIProperty_Items ) return false; // Needs special handling
+ else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() );
+ else
{
- YCPList selected_items;
+ YWidget::setProperty( propertyName, val );
+ }
+
+ return true; // success -- no special processing necessary
+}
+
- for ( int i = 0; i < numItems(); i++ )
- {
- if ( itemIsSelected(i) ) // ask specific UI for selection state
- {
- selected_items->add( item_ids->value(i).isNull() ||
- item_ids->value(i)->isVoid() ?
- item_labels->value(i) : item_ids->value(i) );
- }
- }
+YPropertyValue
+YMultiSelectionBox::getProperty( const string & propertyName )
+{
+ propertySet().check( propertyName ); // throws exceptions if not found
- return selected_items;
+ if ( propertyName == YUIProperty_CurrentItem ) return YPropertyValue( YOtherProperty );
+ else if ( propertyName == YUIProperty_SelectedItems ) return YPropertyValue( YOtherProperty );
+ else if ( propertyName == YUIProperty_Items ) return YPropertyValue( YOtherProperty );
+ else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
+ else
+ {
+ return YWidget::getProperty( propertyName );
}
- else return YWidget::queryWidget( property );
}
+
void YMultiSelectionBox::saveUserInput( YMacroRecorder *macroRecorder )
{
macroRecorder->recordWidgetProperty( this, YUIProperty_CurrentItem );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h Mon Jul 2 15:38:20 2007
@@ -20,82 +20,105 @@
#define YMultiSelectionBox_h
#include "YSelectionWidget.h"
-#include <ycp/YCPString.h>
-#include <ycp/YCPList.h>
-#include <ycp/YCPVoid.h>
class YMacroRecorder;
+class YMultiSelectionBoxPrivate;
class YMultiSelectionBox : public YSelectionWidget
{
protected:
/**
- * Constructor
- * @param text the initial text of the MultiSelectionBox label
- * @param opt the widget options
+ * Constructor.
**/
- YMultiSelectionBox( const YWidgetOpt & opt, YCPString label );
+ YMultiSelectionBox( YWidget * parent, const string & label );
public:
/**
+ * Destructor.
+ **/
+ virtual ~YMultiSelectionBox();
+
+ /**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
**/
virtual const char * widgetClass() { return "YMultiSelectionBox"; }
/**
- * Implements the ui command changeWidget.
+ * Return 'true' if this MultiSelectionBox should be very small.
**/
- YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
+ bool shrinkable() const;
/**
- * Implements the ui command queryWidget
+ * Make this MultiSelectionBox very small. This will take effect only upon
+ * the next geometry management run.
+ *
+ * Derived classes can overwrite this, but should call this base class
+ * function in the new function.
**/
- YCPValue queryWidget( const YCPSymbol & property );
+ virtual void setShrinkable( bool shrinkable = true );
/**
- * The name of the widget property that will return user input.
- * Inherited from YWidget.
+ * 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).
**/
- const char *userInputProperty() { return YUIProperty_SelectedItems; }
-
-
-protected:
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
+
/**
- * Check whether or not item #index is selected.
+ * Get a property.
+ * Reimplemented from YWidget.
*
- * Reimplement this in derived classes!
+ * This method may throw YUIPropertyExceptions.
**/
- virtual bool itemIsSelected( int index ) = 0;
+ virtual YPropertyValue getProperty( const string & propertyName );
/**
- * Select item #index.
+ * Return this class's property set.
+ * This also initializes the property upon the first call.
*
- * Reimplement this in derived classes!
+ * Reimplemented from YWidget.
**/
- virtual void selectItem( int index ) = 0;
+ virtual const YPropertySet & propertySet();
/**
- * Deselect all items.
- *
- * Reimplement this in derived classes!
+ * The name of the widget property that will return user input.
+ * Inherited from YWidget.
**/
- virtual void deselectAllItems() = 0;
+ const char *userInputProperty() { return YUIProperty_SelectedItems; }
/**
- * Returns the index of the item that currently has the keyboard focus.
+ * Return the the item that currently has the keyboard focus
+ * or 0 if no item currently has the keyboard focus.
*
- * Reimplement this in derived classes!
+ * Notice that for a MultiSelectionBox the current item is not necessarily
+ * selected, i.e., its check box may or may not be checked.
+ *
+ * Derived classes are required to implement this function.
**/
- virtual int getCurrentItem() = 0;
+ virtual YItem * currentItem() = 0;
/**
- * Set the keyboard focus to one item.
+ * Set the keyboard focus to the specified item.
+ * 0 means clear the keyboard focus.
+ *
+ * Notice that for a MultiSelectionBox the current item is not necessarily
+ * selected, i.e., its check box may or may not be checked.
+ * Use selectItem() for that.
+ *
+ * Also notice that selectItem() does not make that newly selected item the
+ * current item.
*
- * Reimplement this in derived classes!
+ * Derived classes are required to implement this function.
**/
- virtual void setCurrentItem( int index ) = 0;
+ virtual void setCurrentItem( YItem * item ) = 0;
private:
/**
@@ -104,6 +127,9 @@
* handled by the abstract libyui level, not by a specific UI.
**/
virtual void saveUserInput( YMacroRecorder *macroRecorder );
+
+
+ ImplPtr<YMultiSelectionBoxPrivate> priv;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc Mon Jul 2 15:38:20 2007
@@ -30,18 +30,18 @@
{
YSelectionBoxPrivate()
: shrinkable( false )
- , immediate( false )
+ , immediateMode( false )
{}
bool shrinkable;
- bool immediate;
+ bool immediateMode;
};
YSelectionBox::YSelectionBox( YWidget * parent, const string & label )
- : YSelectionWidget( parent,label,
+ : YSelectionWidget( parent, label,
true ) // enforceSingleSelection
, priv( new YSelectionBoxPrivate() )
{
@@ -53,7 +53,7 @@
}
-YSelectionBox::~YSelectionBox
+YSelectionBox::~YSelectionBox()
{
// NOP
}
@@ -61,7 +61,7 @@
bool YSelectionBox::shrinkable() const
{
- return priv->shrinkable();
+ return priv->shrinkable;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.cc Mon Jul 2 15:38:20 2007
@@ -60,7 +60,7 @@
}
-YSelectionWidget::deleteAllItems()
+void YSelectionWidget::deleteAllItems()
{
YItemIterator it = priv->itemCollection.begin();
@@ -116,7 +116,7 @@
{
string fullPath;
- if ( item && ! icon->iconName().empty() )
+ if ( item && ! item->iconName().empty() )
{
// FIXME
// FIXME
@@ -132,7 +132,7 @@
// FIXME
// FIXME
- fullPath += priv->iconBasePath + "/" + icon->iconName();
+ fullPath += priv->iconBasePath + "/" + item->iconName();
}
return fullPath;
@@ -141,12 +141,12 @@
void YSelectionWidget::addItem( YItem * item )
{
- YUI_CHECK_NULL( item );
+ YUI_CHECK_PTR( item );
// Add the new item to the item list
priv->itemCollection.push_back( item );
- item->setIndex( itemCollection.size() - 1 );
+ item->setIndex( priv->itemCollection.size() - 1 );
if ( item->hasIconName() )
priv->hasIcons = true;
@@ -155,7 +155,7 @@
// Enforce single selection (if applicable)
//
- if ( priv->enforceSingleSelection && selected )
+ if ( priv->enforceSingleSelection && item->selected() )
{
YItem * oldSelectedItem = selectedItem();
@@ -185,7 +185,7 @@
{
YItem * item = new YItem( itemLabel, iconName, selected );
YUI_CHECK_NEW( item );
- additem( item );
+ addItem( item );
}
@@ -238,10 +238,10 @@
YItem *
YSelectionWidget::itemAt( int index ) const
{
- if ( index < 0 || index >= priv->itemCollection.size() )
+ if ( index < 0 || index >= (int) priv->itemCollection.size() )
return 0;
- return priv->itemCollection( index );
+ return priv->itemCollection[ index ];
}
@@ -251,7 +251,7 @@
}
-const YItem *
+YItem *
YSelectionWidget::selectedItem()
{
for ( YItemConstIterator it = itemsBegin();
@@ -266,10 +266,10 @@
}
-YItemConstList
+YConstItemCollection
YSelectionWidget::selectedItems()
{
- YItemConstList selectedItems;
+ YConstItemCollection selectedItems;
for ( YItemConstIterator it = itemsBegin();
it != itemsEnd();
@@ -291,7 +291,7 @@
void YSelectionWidget::selectItem( YItem * item, bool selected )
{
- YUI_CHECK_NULL( item );
+ YUI_CHECK_PTR( item );
if ( ! itemsContain( item ) )
YUI_THROW( YUIException( "Item does not belong to this widget" ) );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.h Mon Jul 2 15:38:20 2007
@@ -116,7 +116,7 @@
* Delete all items and add new items.
**/
void setItems( const YItemCollection & itemCollection )
- { deleteAllItems(); addItems( itemCollection ) }
+ { deleteAllItems(); addItems( itemCollection ); }
/**
* Return an iterator that points to the first item.
@@ -156,7 +156,7 @@
/**
* Return the (first) selected item or 0 if none is selected.
**/
- virtual const YItem * selectedItem();
+ virtual YItem * selectedItem();
/**
* Return all selected items. This is mostly useful for derived classes
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc Mon Jul 2 15:38:20 2007
@@ -377,6 +377,10 @@
bool YTree::parseItemList( const YCPList & itemList,
YTreeItem * parentItem )
{
+ // FIXME
+ // FIXME
+ // FIXME
+#if 0
for ( int i=0; i < itemList->size(); i++ )
{
YCPValue item = itemList->value(i);
@@ -424,7 +428,11 @@
return false;
}
}
-
+#endif
+ // FIXME
+ // FIXME
+ // FIXME
+
return true;
}
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Mon Jul 2 15:38:20 2007
@@ -449,9 +449,6 @@
virtual YWidget *createLogView( YWidget *parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, int maxLines ) = 0;
virtual YWidget *createMenuButton( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
virtual YWidget *createMultiLineEdit( YWidget *parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text ) = 0;
- virtual YWidget *createSelectionBox( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
- virtual YWidget *createMultiSelectionBox( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
- virtual YWidget *createComboBox( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
virtual YWidget *createTree( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
virtual YWidget *createTable( YWidget *parent, YWidgetOpt & opt, vector<string> header ) = 0;
virtual YWidget *createProgressBar( YWidget *parent, YWidgetOpt & opt, const YCPString & label, const YCPInteger & maxprogress, const YCPInteger & progress ) = 0;
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Mon Jul 2 15:38:20 2007
@@ -53,6 +53,7 @@
#include "YCPValueWidgetID.h"
#include "YCPDialogParser.h"
#include "YCPItemParser.h"
+#include "YCPPropertyHandler.h"
#include "YOptionalWidgetFactory.h"
#include "YCheckBox.h"
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Mon Jul 2 15:38:20 2007
@@ -41,6 +41,7 @@
class YLogView;
class YMenuButton;
class YMultiLineEdit;
+class YMultiSelectionBox;
class YPackageSelector;
class YProgressBar;
class YPushButton;
@@ -113,7 +114,7 @@
virtual YMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label ) = 0;
virtual YImage * createImage ( YWidget * parent, const string & imageFileName, bool animated = false ) = 0;
virtual YLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 ) = 0;
- virtual YSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label ) = 0;
+ virtual YMultiSelectionBox *createMultiSelectionBox ( YWidget * parent, const string & label ) = 0;
virtual YPackageSelector * createPackageSelector ( YWidget * parent, long ModeFlags = 0 ) = 0;
virtual YWidget * createPkgSpecial ( YWidget * parent, const string & subwidgetName ) = 0; // NCurses only
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39104 - in /trunk/yast2: library/network/src/SuSEFirewallExpertRules.ycp package/yast2.changes
by locilka@svn.opensuse.org 02 Jul '07
by locilka@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: locilka
Date: Mon Jul 2 15:18:58 2007
New Revision: 39104
URL: http://svn.opensuse.org/viewcvs/yast?rev=39104&view=rev
Log:
- Fixed adding of firewall custom rules in case of empty
destination port but source port set (#284998).
Modified:
trunk/yast2/library/network/src/SuSEFirewallExpertRules.ycp
trunk/yast2/package/yast2.changes
Modified: trunk/yast2/library/network/src/SuSEFirewallExpertRules.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/network/src/SuSEFi…
==============================================================================
--- trunk/yast2/library/network/src/SuSEFirewallExpertRules.ycp (original)
+++ trunk/yast2/library/network/src/SuSEFirewallExpertRules.ycp Mon Jul 2 15:18:58 2007
@@ -244,8 +244,17 @@
// Creating new record
string new_rule = params["network"]:"" + "," + params["protocol"]:"";
- if (params["dport"]:"" != "") new_rule = new_rule + "," + params["dport"]:"";
- if (params["sport"]:"" != "") new_rule = new_rule + "," + params["sport"]:"";
+
+ // either 'dport' or 'sport'
+ if (params["dport"]:"" != "" || params["sport"]:"" != "") {
+ // 'dport' can be empty even if 'sport' is set
+ new_rule = new_rule + "," + params["dport"]:"";
+
+ if (params["sport"]:"" != "") {
+ new_rule = new_rule + "," + params["sport"]:"";
+ }
+ }
+
if (new_rule == "0/0,all") {
y2warning("Adding rule '%1' that allows everything from all networks!", new_rule);
}
Modified: trunk/yast2/package/yast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=…
==============================================================================
--- trunk/yast2/package/yast2.changes (original)
+++ trunk/yast2/package/yast2.changes Mon Jul 2 15:18:58 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jul 2 15:16:20 CEST 2007 - locilka(a)suse.cz
+
+- Fixed adding of firewall custom rules in case of empty
+ destination port but source port set (#284998).
+
+-------------------------------------------------------------------
Thu Jun 28 21:33:42 CEST 2007 - jsrain(a)suse.cz
- added mode for live CD installation
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39103 - /branches/tmp/sh/mod-ui/core/libyui/src/
by sh-sh-sh@svn.opensuse.org 02 Jul '07
by sh-sh-sh@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: sh-sh-sh
Date: Mon Jul 2 13:28:36 2007
New Revision: 39103
URL: http://svn.opensuse.org/viewcvs/yast?rev=39103&view=rev
Log:
cleanup
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h
branches/tmp/sh/mod-ui/core/libyui/src/YBarGraph.h
branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YDate.h
branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h
branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h
branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h
branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.h
branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h
branches/tmp/sh/mod-ui/core/libyui/src/YImage.h
branches/tmp/sh/mod-ui/core/libyui/src/YIntField.h
branches/tmp/sh/mod-ui/core/libyui/src/YLogView.h
branches/tmp/sh/mod-ui/core/libyui/src/YMenuButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YMultiLineEdit.h
branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h
branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h
branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h
branches/tmp/sh/mod-ui/core/libyui/src/YProgressBar.h
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h
branches/tmp/sh/mod-ui/core/libyui/src/YReplacePoint.h
branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YSlider.h
branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h
branches/tmp/sh/mod-ui/core/libyui/src/YTable.h
branches/tmp/sh/mod-ui/core/libyui/src/YTime.h
branches/tmp/sh/mod-ui/core/libyui/src/YTree.h
branches/tmp/sh/mod-ui/core/libyui/src/YWizard.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h Mon Jul 2 13:28:36 2007
@@ -27,6 +27,7 @@
/**
* Implementation of all the alignment widgets:
+ *
* - Left, Right, HCenter,
* - Top, Bottom, VCenter,
* - HVCenter
@@ -34,14 +35,15 @@
**/
class YAlignment : public YSingleChildContainerWidget
{
-public:
+protected:
/**
* Constructor.
**/
- YAlignment( YWidget * parent,
- YAlignmentType horAlign,
- YAlignmentType vertAlign );
+ YAlignment( YWidget * parent,
+ YAlignmentType horAlign,
+ YAlignmentType vertAlign );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YBarGraph.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YBarGraph.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YBarGraph.h Mon Jul 2 13:28:36 2007
@@ -22,18 +22,17 @@
#include <ycp/YCPList.h>
#include "YWidget.h"
-/**
- * @short Implementation of the BarGraph widget
- **/
+
class YBarGraph : public YWidget
{
-public:
+protected:
/**
* Constructor
**/
YBarGraph( const YWidgetOpt & opt );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h Mon Jul 2 13:28:36 2007
@@ -38,12 +38,13 @@
class YCheckBox : public YWidget
{
-public:
+protected:
/**
* Constructor.
**/
YCheckBox( YWidget * parent, const string & label );
-
+
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc Mon Jul 2 13:28:36 2007
@@ -45,7 +45,7 @@
: YSelectionWidget( parent, label )
, priv( new YComboBoxPrivate( editable )
{
-
+ YUI_CHECK_NEW( priv );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.h Mon Jul 2 13:28:36 2007
@@ -22,9 +22,29 @@
#include "YSelectionWidget.h"
class YMacroRecorder;
-
class YComboBoxPrivate;
+
+/**
+ * ComboBox (a.k.a. "drop down box", "drop down selection"):
+ *
+ * A widget with a drop-down list of predefined values to select from.
+ * Optionally, this widget can be created in "editable" mode which means that
+ * the user can freely enter any text.
+ *
+ * In non-editable mode, a ComboBox works very much like a SelectionBox that
+ * uses fewer screen space. In that mode, it is recommended to use
+ * selectedItem() to retrieve its current value and selectItem() to set it.
+ *
+ * In editable mode, a ComboBox is more like an InputField with a list to pick
+ * predefined values from (for less typing). In that mode, it is recommended to
+ * use value() and setValue().
+ *
+ * In either mode, it might be dangerous to use the iterators the
+ * (itemsBegin(), itemsEnd()) the base class (YSelectionWidget) provides to
+ * find the currently selected item: The items' "selected" flag may or may not
+ * be up to date. YComboBox::selectedItem() makes sure they are up to date.
+ **/
class YComboBox : public YSelectionWidget
{
protected:
@@ -58,50 +78,60 @@
bool editable() const;
/**
- * Return the value of this combo box:
+ * Return the value of this ComboBox:
*
* The text of a list item if the user (or the appplication) selected a
- * list item or the content of the combo box's input field if the combo box
+ * list item or the content of the ComboBox's input field if the ComboBox
* is editable and the user (or the application) entered text there.
*
- * Notice that YSelectionBox::selectedItem() might not be very reliable for
- * combo boxes. Better use this function instead.
+ * See also YComboBox::selectedItem().
**/
string value();
/**
- * Set the value of this combo box by string.
- * For editable combo boxes, set the content of the combo box's input
- * field.
+ * Set the value of this ComboBox by string: Try to find a list item with
+ * that label and select it.
+ *
+ * If there is no matching list item, editable ComboBoxes will set their
+ * input field to that text. Non-editable ComboBoxes will throw an
+ * exception.
+ *
+ * See also selectItem().
**/
void setValue( const string & newText );
/**
- * Return the (first) selected item or 0 if none is selected.
+ * Return the (first) selected item or 0 if none is selected or if this
+ * ComboBox is editable and the user entered something that does not match
+ * any of the ComboBox's list items (in that case, use value() instead).
*
* Reimplemented from YSelectionWidget for better reliability: This will
- * compare an editable combo box's user input against the text labels of
+ * compare an editable ComboBox's user input against the text labels of
* all items and try to return an item if there is any match.
**/
virtual const YItem * selectedItem();
-
+
/**
- * Return all selected items.
+ * Return all selected items.
+ *
+ * This is not particularly useful for ComboBoxes since there can be no
+ * more than one selected item anyway; * better use selectedItem() or
+ * value() instead.
*
* This function does not transfer ownership of those items to the caller,
* so don't try to delete them!
*
* Reimplemented from YSelectionWidget for better reliability.
**/
- virtual YCosntItemCollection selectedItems();
+ virtual YConstItemCollection selectedItems();
/**
- * Select or deselect an item.
+ * Select or deselect an item. See also setValue().
*
* Reimplemented from YSelectionWidget.
**/
virtual void selectItem( YItem * item, bool selected = true );
-
+
/**
* Get the valid input characters. No input validation is performed (i.e.,
* the user can enter anything) if this is empty.
@@ -150,7 +180,7 @@
protected:
/**
- * Return this combo box's current value as text.
+ * Return this ComboBox's current value as text.
*
* Called internally from value(), selectedItem() and related.
*
@@ -160,7 +190,7 @@
/**
*
- * Set this combo box's current value as text.
+ * Set this ComboBox's current value as text.
*
* Called internally whenever the content is to change
* programmatically. Don't call setValue() or selectItem() from here.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YContainerWidget.h Mon Jul 2 13:28:36 2007
@@ -29,12 +29,13 @@
**/
class YContainerWidget : public YWidget
{
-public:
+protected:
/**
* Constructor.
**/
YContainerWidget( const YWidgetOpt & opt );
+public:
/**
* Cleans up: Deletes all child widgets.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDate.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDate.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDate.h Mon Jul 2 13:28:36 2007
@@ -22,19 +22,17 @@
#include "YWidget.h"
#include <ycp/YCPString.h>
-/**
- * Implementation of the Date and Heading widgets
- **/
+
class YDate : public YWidget
{
-public:
-
+protected:
/**
* Creates a new date
* @param text the initial text of the date
**/
YDate( const YWidgetOpt & opt, const YCPString & label );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h Mon Jul 2 13:28:36 2007
@@ -29,13 +29,12 @@
class YDialog : public YSingleChildContainerWidget
{
-public:
+protected:
/**
* Constructor.
**/
YDialog( const YWidgetOpt & opt );
-protected:
/**
* Destructor.
* Don't delete a dialog directly, use YDialog::deleteCurrentDialog().
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDownloadProgress.h Mon Jul 2 13:28:36 2007
@@ -23,13 +23,10 @@
#include <ycp/YCPString.h>
#include <ycp/YCPInteger.h>
-/**
- * @short Implementation of the Slider widget
- **/
+
class YDownloadProgress : public YWidget
{
-public:
-
+protected:
/**
* Constructor
**/
@@ -38,6 +35,7 @@
const YCPString & filename,
int expectedSize );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h Mon Jul 2 13:28:36 2007
@@ -22,18 +22,16 @@
#include "YContainerWidget.h"
#include <ycp/YCPString.h>
-/**
- * Implementation of the YDumbTab widget
- **/
+
class YDumbTab : public YContainerWidget
{
-public:
-
+protected:
/**
* Constructor
**/
YDumbTab( const YWidgetOpt & opt );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.h Mon Jul 2 13:28:36 2007
@@ -28,12 +28,13 @@
class YEmpty : public YWidget
{
-public:
+protected:
/**
* Constructor.
**/
YEmpty( YWidget * parent );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h Mon Jul 2 13:28:36 2007
@@ -29,12 +29,13 @@
class YFrame : public YSingleChildContainerWidget
{
-public:
+protected:
/**
* Constructor.
**/
YFrame( YWidget * parent, const string & label );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YImage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YImage.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YImage.h Mon Jul 2 13:28:36 2007
@@ -27,9 +27,6 @@
class YImagePrivate;
-/**
- * @short Implementation of the Image widget
- **/
class YImage : public YWidget
{
public:
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YIntField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YIntField.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YIntField.h Mon Jul 2 13:28:36 2007
@@ -23,13 +23,10 @@
#include <ycp/YCPString.h>
#include <ycp/YCPInteger.h>
-/**
- * @short Implementation of the IntField widget
- **/
+
class YIntField : public YWidget
{
-public:
-
+protected:
/**
* Constructor
**/
@@ -39,6 +36,7 @@
int maxValue,
int initialValue );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLogView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLogView.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLogView.h Mon Jul 2 13:28:36 2007
@@ -25,12 +25,10 @@
using std::deque;
-/**
- * @short Implementation of the LogView widget
- **/
+
class YLogView : public YWidget
{
-public:
+protected:
/**
* Constructor.
**/
@@ -39,6 +37,7 @@
int visibleLines,
int maxLines );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMenuButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMenuButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMenuButton.h Mon Jul 2 13:28:36 2007
@@ -31,12 +31,9 @@
typedef vector<YMenuItem *>::const_iterator YMenuItemListConstIterator;
-/**
- * @short Implementation of the MenuButton widget
- **/
class YMenuButton : public YWidget
{
-public:
+protected:
/**
* Constructor
* @param opt widget options
@@ -44,6 +41,7 @@
**/
YMenuButton( const YWidgetOpt & opt, YCPString label );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMultiLineEdit.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiLineEdit.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiLineEdit.h Mon Jul 2 13:28:36 2007
@@ -23,21 +23,19 @@
#include <ycp/YCPString.h>
#include <deque>
-
class YMacroRecorder;
-/**
- * @short Implementation of the MultiLineEdit widget
- **/
+
class YMultiLineEdit : public YWidget
{
-public:
+protected:
/**
* Constructor.
**/
YMultiLineEdit( const YWidgetOpt & opt,
const YCPString & label );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiProgressMeter.h Mon Jul 2 13:28:36 2007
@@ -24,15 +24,9 @@
#include <vector>
-/**
- * Implementation of the VMultiProgressMeter and HMultiProgressMeter widgets
- **/
class YMultiProgressMeter : public YWidget
{
-public:
-
- typedef long long Value_t;
-
+protected:
/**
* Constructor
**/
@@ -40,12 +34,15 @@
bool horizontal,
const YCPList & maxValues );
+public:
/**
* Returns 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.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YMultiSelectionBox.h Mon Jul 2 13:28:36 2007
@@ -26,13 +26,10 @@
class YMacroRecorder;
-/**
- * @short Implementation of the MultiSelectionBox widget.
- **/
+
class YMultiSelectionBox : public YSelectionWidget
{
-public:
-
+protected:
/**
* Constructor
* @param text the initial text of the MultiSelectionBox label
@@ -40,6 +37,7 @@
**/
YMultiSelectionBox( const YWidgetOpt & opt, YCPString label );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h Mon Jul 2 13:28:36 2007
@@ -34,8 +34,7 @@
class YPackageSelector : public YWidget
{
-public:
-
+protected:
/**
* Constructor.
*
@@ -44,6 +43,7 @@
**/
YPackageSelector( YWidget * parent, long modeFlags = 0 );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
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…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPartitionSplitter.h Mon Jul 2 13:28:36 2007
@@ -26,13 +26,10 @@
class YMacroRecorder;
-/**
- * @short Implementation of the Slider widget
- **/
+
class YPartitionSplitter : public YWidget
{
-public:
-
+protected:
/**
* Constructor
**/
@@ -48,6 +45,7 @@
const YCPString & freeFieldLabel,
const YCPString & newPartFieldLabel );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YProgressBar.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YProgressBar.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YProgressBar.h Mon Jul 2 13:28:36 2007
@@ -23,13 +23,10 @@
#include <ycp/YCPString.h>
#include <ycp/YCPInteger.h>
-/**
- * @short Implementation of the ProgressBar widget
- **/
+
class YProgressBar : public YWidget
{
-public:
-
+protected:
/**
* Constructor.
**/
@@ -38,6 +35,7 @@
const YCPInteger & maxProgress,
const YCPInteger & initialProgress );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h Mon Jul 2 13:28:36 2007
@@ -28,12 +28,13 @@
class YPushButton : public YWidget
{
-public:
+protected:
/**
* Constructor.
**/
YPushButton( YWidget * parent, const string & label );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h Mon Jul 2 13:28:36 2007
@@ -46,7 +46,7 @@
**/
class YRadioButton : public YWidget
{
-public:
+protected:
/**
* Constructor.
*
@@ -65,6 +65,7 @@
**/
YRadioButton( YWidget * parent, const string & label );
+public:
/**
* Destructor: Removes the button from the radio button group.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h Mon Jul 2 13:28:36 2007
@@ -31,12 +31,13 @@
class YRadioButtonGroup : public YSingleChildContainerWidget
{
-public:
+protected:
/**
* Constructor.
**/
YRadioButtonGroup( YWidget * parent );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YReplacePoint.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YReplacePoint.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YReplacePoint.h Mon Jul 2 13:28:36 2007
@@ -23,12 +23,13 @@
class YReplacePoint : public YSingleChildContainerWidget
{
-public:
+protected:
/**
* Constructor
**/
YReplacePoint( YWidget * parent );
+public:
/**
* Show a newly added child. The application using the ReplacePoint is
* required to call this after the new child is created.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.h Mon Jul 2 13:28:36 2007
@@ -26,13 +26,14 @@
class YSelectionBox : public YSelectionWidget
{
-public:
+protected:
/**
* Constructor.
**/
YSelectionBox( YWidget * parent, const string & label );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSlider.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSlider.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSlider.h Mon Jul 2 13:28:36 2007
@@ -25,13 +25,10 @@
class YMacroRecorder;
-/**
- * @short Implementation of the Slider widget
- **/
+
class YSlider : public YWidget
{
-public:
-
+protected:
/**
* Constructor
**/
@@ -41,6 +38,7 @@
int maxValue,
int initialValue );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h Mon Jul 2 13:28:36 2007
@@ -34,8 +34,7 @@
**/
class YSquash : public YSingleChildContainerWidget
{
-public:
-
+protected:
/**
* Constructor.
*
@@ -44,6 +43,7 @@
**/
YSquash( YWidget * parent, bool horSquash, bool vertSquash );
+public:
/**
* Destructor.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTable.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTable.h Mon Jul 2 13:28:36 2007
@@ -50,14 +50,14 @@
**/
class YTable : public YWidget
{
-public:
-
+protected:
/**
* Creates a new and empty Table
* @param num_cols The number of columns of the table
**/
YTable( const YWidgetOpt & opt, int num_cols );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTime.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTime.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTime.h Mon Jul 2 13:28:36 2007
@@ -22,19 +22,17 @@
#include "YWidget.h"
#include <ycp/YCPString.h>
-/**
- * Implementation of the Time and Heading widgets
- **/
+
class YTime : public YWidget
{
-public:
-
+protected:
/**
* Creates a new date
* @param text the initial text of the date
**/
YTime( const YWidgetOpt & opt, const YCPString & label );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTree.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTree.h Mon Jul 2 13:28:36 2007
@@ -32,15 +32,11 @@
typedef vector<YTreeItem *>::const_iterator YTreeItemListConstIterator;
-/**
- * @short Implementation of the Tree widget
- **/
class YTree : public YWidget
{
friend class YTreeItem;
-
-public:
-
+
+protected:
/**
* Constructor
* @param opt the widget options
@@ -49,6 +45,7 @@
YTree( const YWidgetOpt & opt, YCPString label );
+public:
/**
* Destructor. Frees all tree items.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWizard.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWizard.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWizard.h Mon Jul 2 13:28:36 2007
@@ -28,21 +28,18 @@
#define YWizardID "wizard"
#define YWizardContentsReplacePointID "contents"
-/**
- * @short Implementation of the SelectionBox widget.
- **/
class YWizard: public YWidget
{
-public:
-
+protected:
/**
- * Constructor
+ * Constructor.
**/
YWizard( const YWidgetOpt & opt,
const YCPValue & backButtonId, const YCPString & backButtonLabel,
const YCPValue & abortButtonId, const YCPString & abortButtonLabel,
const YCPValue & nextButtonId, const YCPString & nextButtonLabel );
+public:
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
@@ -65,11 +62,11 @@
/**
* Returns the current tree selection or an empty string if nothing is
- * selected or there is no tree.
+ * selected or there is no tree.
**/
virtual YCPString currentTreeSelection() { return YCPString( "" ); }
-
+
// Data members
YCPValue _backButtonId;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39102 - in /trunk/autoinstallation: package/autoyast2.changes src/modules/AutoinstScripts.ycp
by ug@svn.opensuse.org 02 Jul '07
by ug@svn.opensuse.org 02 Jul '07
02 Jul '07
Author: ug
Date: Mon Jul 2 12:23:09 2007
New Revision: 39102
URL: http://svn.opensuse.org/viewcvs/yast?rev=39102&view=rev
Log:
chrooted scripts execution fixed
Modified:
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/modules/AutoinstScripts.ycp
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyas…
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Mon Jul 2 12:23:09 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Mon Jul 2 12:22:33 CEST 2007 - ug(a)suse.de
+
+- chrooted scripts execution fixed
+
+-------------------------------------------------------------------
Wed Jun 20 12:06:30 CEST 2007 - ug(a)suse.de
- resue partition bug (#284102) fixed
Modified: trunk/autoinstallation/src/modules/AutoinstScripts.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/Aut…
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstScripts.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstScripts.ycp Mon Jul 2 12:23:09 2007
@@ -517,6 +517,11 @@
string executionString = "";
boolean showFeedback = s["feedback"]:false;
+ if( type == "chroot-scripts" && special ) {
+ // no AutoinstConfig::destdir in path for chrooted scripts
+ scriptPath = sformat("%1/%2",AutoinstConfig::scripts_dir, scriptName);
+ }
+
if (scriptInterpreter == "shell")
{
string debug = ( s["debug"]:true ? "-x" : "" );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0