YaST Commits
Threads by month
- ----- 2024 -----
- 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
- 2 participants
- 96018 discussions
[yast-commit] r38255 - /branches/tmp/sh/mod-ui/core/libyui/src/
by sh-sh-sh@svn.opensuse.org 01 Jun '07
by sh-sh-sh@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: sh-sh-sh
Date: Fri Jun 1 18:10:17 2007
New Revision: 38255
URL: http://svn.opensuse.org/viewcvs/yast?rev=38255&view=rev
Log:
use const char *
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/YCheckBoxFrame.h
branches/tmp/sh/mod-ui/core/libyui/src/YColoredLabel.h
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/YLabel.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/YRichText.h
branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YSelectionWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YSlider.h
branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.h
branches/tmp/sh/mod-ui/core/libyui/src/YSplit.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/YTextEntry.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 Fri Jun 1 18:10:17 2007
@@ -58,7 +58,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YAlignment"; }
+ virtual const char * widgetClass() { return "YAlignment"; }
/**
* Moves a child widget to a new position.
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 Fri Jun 1 18:10:17 2007
@@ -40,7 +40,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YBarGraph"; }
+ virtual const char * widgetClass() { return "YBarGraph"; }
/**
* Returns the current number of bar segments, i.e. the nuber of values.
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 Fri Jun 1 18:10:17 2007
@@ -41,7 +41,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YCheckBox"; }
+ virtual const char * widgetClass() { return "YCheckBox"; }
#if 0
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h Fri Jun 1 18:10:17 2007
@@ -38,7 +38,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YCheckBoxFrame"; }
+ virtual const char * widgetClass() { return "YCheckBoxFrame"; }
/**
* Implements the ui command changeWidget.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YColoredLabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YColoredLabel.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YColoredLabel.h Fri Jun 1 18:10:17 2007
@@ -39,7 +39,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YColoredLabel"; }
+ virtual const char * widgetClass() { return "YColoredLabel"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -46,7 +46,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YComboBox"; }
+ virtual const char * widgetClass() { return "YComboBox"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -49,7 +49,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YContainerWidget"; }
+ virtual const char * widgetClass() { return "YContainerWidget"; }
/**
* Returns 'true' if there are any 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 Fri Jun 1 18:10:17 2007
@@ -39,7 +39,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YDate"; }
+ virtual const char * widgetClass() { return "YDate"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -48,7 +48,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YDialog"; }
+ virtual const char * widgetClass() { return "YDialog"; }
/**
* Returns true, since this is a dialog widget.
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 Fri Jun 1 18:10:17 2007
@@ -42,7 +42,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YDownloadProgress"; }
+ virtual const char * widgetClass() { return "YDownloadProgress"; }
/**
* Implements the ChangeWidget() UI command.
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 Fri Jun 1 18:10:17 2007
@@ -38,7 +38,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YDumbTab"; }
+ virtual const char * widgetClass() { return "YDumbTab"; }
/**
* Implements the UI::ChangeWidget()
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 Fri Jun 1 18:10:17 2007
@@ -39,7 +39,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YEmpty"; }
+ virtual const char * widgetClass() { return "YEmpty"; }
/**
* Minimum size the widget should have to make it look and feel
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 Fri Jun 1 18:10:17 2007
@@ -38,7 +38,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YFrame"; }
+ virtual const char * widgetClass() { return "YFrame"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -38,7 +38,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YImage"; }
+ virtual const char * widgetClass() { return "YImage"; }
};
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 Fri Jun 1 18:10:17 2007
@@ -43,7 +43,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YIntField"; }
+ virtual const char * widgetClass() { return "YIntField"; }
/**
* Implements the ChangeWidget() UI command.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h Fri Jun 1 18:10:17 2007
@@ -40,7 +40,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YLabel"; }
+ virtual const char * widgetClass() { return "YLabel"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -43,7 +43,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YLogView"; }
+ virtual const char * widgetClass() { return "YLogView"; }
/**
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 Fri Jun 1 18:10:17 2007
@@ -48,7 +48,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YMenuButton"; }
+ virtual const char * widgetClass() { return "YMenuButton"; }
/**
* Implements the ui command changeWidget for the widget specific
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 Fri Jun 1 18:10:17 2007
@@ -42,7 +42,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YMultiLineEdit"; }
+ virtual const char * widgetClass() { return "YMultiLineEdit"; }
/**
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 Fri Jun 1 18:10:17 2007
@@ -44,7 +44,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YMultiProgressMeter"; }
+ virtual const char * widgetClass() { return "YMultiProgressMeter"; }
/**
* 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 Fri Jun 1 18:10:17 2007
@@ -44,7 +44,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YMultiSelectionBox"; }
+ virtual const char * widgetClass() { return "YMultiSelectionBox"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -41,7 +41,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YPackageSelector"; }
+ virtual const char * widgetClass() { return "YPackageSelector"; }
};
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 Fri Jun 1 18:10:17 2007
@@ -52,7 +52,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YPartitionSplitter"; }
+ virtual const char * widgetClass() { return "YPartitionSplitter"; }
/**
* Implements the ChangeWidget() UI command.
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 Fri Jun 1 18:10:17 2007
@@ -43,7 +43,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YProgressBar"; }
+ virtual const char * widgetClass() { return "YProgressBar"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -41,7 +41,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual const char *widgetClass() { return "YPushButton"; }
+ virtual const char * widgetClass() { return "YPushButton"; }
/**
* Get the label (the text on the RadioButton).
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 Fri Jun 1 18:10:17 2007
@@ -62,7 +62,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YRadioButton"; }
+ virtual const char * widgetClass() { return "YRadioButton"; }
/**
* Get the current on/off value:
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 Fri Jun 1 18:10:17 2007
@@ -44,7 +44,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YRadioButtonGroup"; }
+ virtual const char * widgetClass() { return "YRadioButtonGroup"; }
/**
* Returns true, since this is a radio button group
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 Fri Jun 1 18:10:17 2007
@@ -37,7 +37,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YReplacePoint"; }
+ virtual const char * widgetClass() { return "YReplacePoint"; }
/**
* Inherited from YWidget. Returns true.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRichText.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRichText.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRichText.h Fri Jun 1 18:10:17 2007
@@ -41,7 +41,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YRichText"; }
+ virtual const char * widgetClass() { return "YRichText"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -44,7 +44,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YSelectionBox"; }
+ virtual const char * widgetClass() { return "YSelectionBox"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -43,7 +43,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YSelectionWidget"; }
+ virtual const char * widgetClass() { return "YSelectionWidget"; }
/**
* The name of the widget property that holds the keyboard shortcut.
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 Fri Jun 1 18:10:17 2007
@@ -45,7 +45,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YSlider"; }
+ virtual const char * widgetClass() { return "YSlider"; }
/**
* Implements the ChangeWidget() UI command.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.h Fri Jun 1 18:10:17 2007
@@ -42,7 +42,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YSpacing"; }
+ virtual const char * widgetClass() { return "YSpacing"; }
/**
* Minimum size the widget should have to make it look and feel
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSplit.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSplit.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSplit.h Fri Jun 1 18:10:17 2007
@@ -41,7 +41,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YSplit"; }
+ virtual const char * widgetClass() { return "YSplit"; }
/**
* Returns the dimensions.
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 Fri Jun 1 18:10:17 2007
@@ -38,7 +38,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YSquash"; }
+ virtual const char * widgetClass() { return "YSquash"; }
/**
* In a squashed dimension the widget NOT stretchable.
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 Fri Jun 1 18:10:17 2007
@@ -63,7 +63,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YTable"; }
+ virtual const char * widgetClass() { return "YTable"; }
/**
* Adds an item to the table that is given as term
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h Fri Jun 1 18:10:17 2007
@@ -48,7 +48,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YTextEntry"; }
+ virtual const char * widgetClass() { return "YTextEntry"; }
/**
* Get the current value (the text entered by the user or set from the
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 Fri Jun 1 18:10:17 2007
@@ -39,7 +39,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YTime"; }
+ virtual const char * widgetClass() { return "YTime"; }
/**
* Implements the ui command changeWidget.
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 Fri Jun 1 18:10:17 2007
@@ -60,7 +60,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YTree"; }
+ virtual const char * widgetClass() { return "YTree"; }
/**
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 Fri Jun 1 18:10:17 2007
@@ -47,7 +47,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YWizard"; }
+ virtual const char * widgetClass() { return "YWizard"; }
/**
* Generic direct access to implementation-specific functions.
--
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] r38254 - in /branches/tmp/sh/mod-ui/core/libyui/src: YPushButton.cc YPushButton.h YRadioButton.h YTextEntry.h YWidget.h
by sh-sh-sh@svn.opensuse.org 01 Jun '07
by sh-sh-sh@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: sh-sh-sh
Date: Fri Jun 1 18:06:58 2007
New Revision: 38254
URL: http://svn.opensuse.org/viewcvs/yast?rev=38254&view=rev
Log:
ported PushButton
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc
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/YTextEntry.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc Fri Jun 1 18:06:58 2007
@@ -12,72 +12,104 @@
File: YPushButton.cc
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Stefan Hundhammer <sh(a)suse.de>
+ Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
-#include <ycp/YCPSymbol.h>
-#include <ycp/YCPBoolean.h>
#define y2log_component "ui"
#include <ycp/y2log.h>
#include "YUISymbols.h"
#include "YPushButton.h"
+struct YPushButtonPrivate
+{
+ std::string label;
+ bool isDefaultButton;
+
+ /**
+ * Constructor.
+ **/
+ YPushButtonPrivate( const std::string & label, bool isDefaultButton )
+ : label( label )
+ , isDefaultButton( isDefaultButton )
+ {}
+}
+
-YPushButton::YPushButton( const YWidgetOpt & opt, YCPString label )
+YPushButton::YPushButton( const YWidgetOpt & opt, const std::string & label )
: YWidget( opt )
- , label( label )
+ , priv( new YPushButtonPrivate( label, opt.isDefaultButton.value() ) )
+{
+}
+
+
+YPushButton::~YPushButton()
{
+ // NOP
}
+void YPushButton::setLabel( const std::string & label )
+{
+ priv->label = label;
+}
-void YPushButton::setLabel( const YCPString & label )
+std::string YPushButton::label() const
{
- this->label = label;
+ return priv->label;
}
-YCPString YPushButton::getLabel()
+bool YPushButton::isDefaultButton() const
{
- return label;
+ return priv->isDefaultButton;
}
-YCPValue YPushButton::changeWidget( const YCPSymbol & property, const YCPValue & newvalue )
+const YPropertySet &
+YPushButton::propertySet()
{
- string s = property->symbol();
+ static YPropertySet propSet;
- /**
- * @property string Label the text on the PushButton
- */
- if ( s == YUIProperty_Label )
+ if ( propSet.isEmpty() )
{
- if ( newvalue->isString() )
- {
- setLabel( newvalue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "PushButton: Invalid parameter %s for Label property. Must be string",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
+ /*
+ * @property string Label text on the button
+ */
+ propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
+ propSet.add( YWidget::propertySet() );
}
- else return YWidget::changeWidget( property, newvalue );
+
+ return propSet;
}
+void
+YPushButton::setProperty( const std::string & propertyName, const YPropertyValue & val )
+{
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
+
+ if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() );
+ else
+ {
+ YWidget::setProperty( propertyName, val );
+ }
+}
-YCPValue YPushButton::queryWidget( const YCPSymbol & property )
+
+YPropertyValue
+YPushButton::getProperty( const std::string & propertyName )
{
- string s = property->symbol();
- if ( s == YUIProperty_Label ) return getLabel();
- else return YWidget::queryWidget( property );
+ propertySet().check( propertyName ); // throws exceptions if not found
+
+ if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
+ else
+ {
+ return YWidget::getProperty( propertyName );
+ }
}
+
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 Fri Jun 1 18:06:58 2007
@@ -12,8 +12,7 @@
File: YPushButton.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Stefan Hundhammer <sh(a)suse.de>
+ Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
@@ -21,75 +20,102 @@
#define YPushButton_h
#include "YWidget.h"
-#include <ycp/YCPString.h>
-/**
- * @short Implementation of the PushButton widget
- * Derived classes need to check opt.isDefaultButton!
- */
+class YPushButtonPrivate;
+
+
class YPushButton : public YWidget
{
public:
/**
- * Creates a new YPushButton
- * @param label the button label
- * @param opt widget options
- */
- YPushButton( const YWidgetOpt & opt, YCPString label );
+ * Constructor.
+ **/
+ YPushButton( const YWidgetOpt & opt, const std::string & label );
+
+ /**
+ * Destructor.
+ **/
+ ~YPushButton();
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YPushButton"; }
+ virtual const char *widgetClass() { return "YPushButton"; }
/**
- * Implements the ui command changeWidget for the widget specific
- * properties.
- */
- YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
+ * Get the label (the text on the RadioButton).
+ **/
+ std::string label() const;
/**
- * Implements the ui command changeWidget for the widget specific
- * properties.
- */
- YCPValue queryWidget( const YCPSymbol & property );
+ * Set the label (the text on the button).
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
+ **/
+ virtual void setLabel( const std::string & label );
/**
- * change the label of the push button. Overload this, but call
- * YPushButton::setLabel at the end of your own function.
- */
- virtual void setLabel( const YCPString & label );
+ * Returns 'true' if this is the dialog's default button, i.e. the one
+ * button that gets activated if the user hits the [Return] key anywhere in
+ * the dialog.
+ **/
+ bool isDefaultButton() const;
/**
- * Get the current label of the text entry. This method cannot be overidden.
- * The value of the label cannot be changed other than by calling setLabel,
- * i.e. not by the ui. Therefore setLabel stores the current label in
- * #label.
- */
- YCPString getLabel();
-
- /**
- * Set this button's icon from an icon file in the UI's default icon directory.
- * Clear the icon if the name is empty.
+ * Set this button's icon from an icon file in the UI's default icon
+ * directory. Clear the icon if the name is empty.
*
* This default implementation does nothing.
* UIs that can handle icons can choose to overwrite this method.
**/
- virtual void setIcon( const YCPString & icon_name ) {}
+ virtual void setIcon( const std::string & iconName ) {}
/**
- * The name of the widget property that holds the keyboard shortcut.
- * Inherited from YWidget.
- */
- const char *shortcutProperty() { return YUIProperty_Label; }
+ * Set a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
+ **/
+ virtual void setProperty( const std::string & propertyName,
+ const YPropertyValue & val );
+ /**
+ * Get a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
+ **/
+ virtual YPropertyValue getProperty( const std::string & propertyName );
-protected:
/**
- * The button label
- */
- YCPString label;
+ * Return this class's property set.
+ * This also initializes the property upon the first call.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual const YPropertySet & propertySet();
+
+ /**
+ * Get the string of this widget that holds the keyboard shortcut.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual std::string shortcutString() { return label(); }
+
+ /**
+ * Set the string of this widget that holds the keyboard shortcut.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setShortcutString( const std::string & str )
+ { setLabel( str ); }
+
+
+private:
+
+ ImplPtr<YPushButtonPrivate> priv;
};
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 Fri Jun 1 18:06:58 2007
@@ -12,15 +12,13 @@
File: YRadioButton.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Stefan Hundhammer <sh(a)suse.de>
+ Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
#ifndef YRadioButton_h
#define YRadioButton_h
-#include "ImplPtr.h"
#include "YWidget.h"
class YRadioButtonGroup;
@@ -61,25 +59,37 @@
virtual ~YRadioButton();
/**
- * Set the radio button to a new value - check or uncheck it
+ * Returns a descriptive name of this widget class for logging,
+ * debugging etc.
*/
- virtual void setValue( bool checked ) = 0;
+ virtual char *widgetClass() { return "YRadioButton"; }
/**
- * Returns the current value of the radio button:
+ * Get the current on/off value:
* 'true' if checked, 'false' if unchecked.
+ *
+ * Derived classes are required to implement this.
*/
virtual bool value() = 0;
/**
- * Returns the user-visible label (the text on the RadioButton).
+ * Set the radio button value (on/off).
+ *
+ * Derived classes are required to implement this.
+ */
+ virtual void setValue( bool checked ) = 0;
+
+ /**
+ * Get the label (the text on the RadioButton).
**/
std::string label() const;
/**
- * Change the label. Overload this, but call
- * YRadioButton::setLabel at the end of your own function.
- */
+ * Set the label (the text on the RadioButton).
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
+ **/
virtual void setLabel( const std::string & label );
/**
@@ -94,12 +104,6 @@
void buttonGroupIsDead();
/**
- * Returns a descriptive name of this widget class for logging,
- * debugging etc.
- */
- virtual char *widgetClass() { return "YRadioButton"; }
-
- /**
* Set a property.
* Reimplemented from YWidget.
*
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h Fri Jun 1 18:06:58 2007
@@ -20,7 +20,6 @@
#define YTextEntry_h
#include <string>
-#include "ImplPtr.h"
#include "YWidget.h"
class YMacroRecorder;
@@ -46,6 +45,12 @@
virtual ~YTextEntry();
/**
+ * Returns a descriptive name of this widget class for logging,
+ * debugging etc.
+ */
+ virtual char *widgetClass() { return "YTextEntry"; }
+
+ /**
* Get the current value (the text entered by the user or set from the
* outside) of this input field.
*
@@ -70,8 +75,7 @@
* Set the label (the caption above the input field).
*
* Derived classes are free to reimplement this, but they should call this
- * base class method (YTextEntry::setLabel() at the end of the overloaded
- * function.
+ * base class method at the end of the overloaded function.
**/
virtual void setLabel( const std::string & label );
@@ -113,14 +117,6 @@
**/
virtual void setInputMaxLength( int numberOfChars );
-
- /**
- * Returns a descriptive name of this widget class for logging,
- * debugging etc.
- */
- virtual char *widgetClass() { return "YTextEntry"; }
-
-
/**
* Set a property.
* Reimplemented from YWidget.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Fri Jun 1 18:06:58 2007
@@ -27,6 +27,7 @@
#include "YWidgetOpt.h"
#include "YUISymbols.h"
#include "YUIException.h"
+#include "ImplPtr.h"
#define YWIDGET_MAGIC 42 // what else? ;- )
--
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] r38253 - in /branches/tmp/sh/mod-ui/qt/src: YQRadioButton.cc YQRadioButton.h YQTextEntry.cc YQTextEntry.h YQUI.h YQUI_widgets.cc
by sh-sh-sh@svn.opensuse.org 01 Jun '07
by sh-sh-sh@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: sh-sh-sh
Date: Fri Jun 1 17:16:50 2007
New Revision: 38253
URL: http://svn.opensuse.org/viewcvs/yast?rev=38253&view=rev
Log:
- Ported TextEntry
- Minor fixes for RadioButton
Modified:
branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc
branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h
branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc
branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
Modified: branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQRadioB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc Fri Jun 1 17:16:50 2007
@@ -41,7 +41,7 @@
YQRadioButton::YQRadioButton( QWidget * parent,
const YWidgetOpt & opt,
YRadioButtonGroup * rbg,
- const YCPString & label,
+ const std::string & label,
bool checked )
: QGroupBox( parent )
, YRadioButton( opt, label )
@@ -51,7 +51,7 @@
QBoxLayout * layout = new QBoxLayout( this, QBoxLayout::LeftToRight );
- _qt_radiobutton = new QRadioButton( fromUTF8( label->value() ), this );
+ _qt_radiobutton = new QRadioButton( fromUTF8( label ), this );
layout->addSpacing( SPACING );
layout->addWidget( _qt_radiobutton );
layout->addSpacing( SPACING );
@@ -97,9 +97,9 @@
}
-void YQRadioButton::setLabel( const YCPString & label )
+void YQRadioButton::setLabel( const std::string & label )
{
- _qt_radiobutton->setText( fromUTF8(label->value() ) );
+ _qt_radiobutton->setText( fromUTF8( label ) );
YRadioButton::setLabel( label );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQRadioB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h Fri Jun 1 17:16:50 2007
@@ -22,7 +22,6 @@
#define YQRadioButton_h
#include <qgroupbox.h>
-#include <ycp/YCPString.h>
#include "YRadioButton.h"
@@ -40,10 +39,26 @@
YQRadioButton( QWidget * parent,
const YWidgetOpt & opt,
YRadioButtonGroup * rbg,
- const YCPString & label,
+ const std::string & label,
bool checked );
/**
+ * Returns the "checked" state of the RadioButton.
+ */
+ bool value();
+
+ /**
+ * Sets the "checked" state of the RadioButton.
+ */
+ void setValue( bool checked );
+
+ /**
+ * Changes the label of the text entry.
+ */
+ void setLabel( const std::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.
@@ -63,31 +78,16 @@
void setSize( long newWidth, long newHeight );
/**
- * Sets the "checked" state of the RadioButton.
- */
- void setValue( bool checked );
-
- /**
- * Returns the "checked" state of the RadioButton.
- */
- bool value();
-
- /**
- * Changes the label of the text entry.
- */
- void setLabel( const YCPString & label );
-
- /**
* Accept the keyboard focus.
*/
virtual bool setKeyboardFocus();
/**
- * Returns the actual qt button. Used by
- * @ref YQButtonGroup
+ * Returns the actual qt button. Used by YQButtonGroup.
*/
QRadioButton * getQtButton();
+
protected slots:
/**
* Triggered when the RadioButton is toggled.
Modified: branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQTextEn…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc Fri Jun 1 17:16:50 2007
@@ -12,8 +12,7 @@
File: YQTextEntry.cc
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Stefan Hundhammer <sh(a)suse.de>
+ Author: Stefan Hundhammer <sh(a)suse.de>
textdomain "packages-qt"
@@ -22,9 +21,9 @@
#include <qlineedit.h>
#include <qlabel.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/keysym.h>
+#include <X11/X.h> // CapsLock detection
+#include <X11/Xlib.h> // CapsLock detection
+#include <X11/keysym.h> // CapsLock detection
#define y2log_component "qt-ui"
#include <ycp/y2log.h>
@@ -40,10 +39,10 @@
YQTextEntry::YQTextEntry( QWidget * parent,
const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & text )
+ const std::string & label,
+ bool passwordMode )
: QVBox( parent )
- , YTextEntry( opt, label )
+ , YTextEntry( opt, label, passwordMode )
, _validator(0)
, _displayingCapsLockWarning( false )
{
@@ -52,16 +51,15 @@
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_label->setFont( YQUI::ui()->currentFont() );
- if ( label->value() == "" )
+ if ( label.empty() )
_qt_label->hide();
_qt_lineEdit = new YQRawLineEdit( this );
_qt_lineEdit->setFont( YQUI::ui()->currentFont() );
- _qt_lineEdit->setText( fromUTF8(text->value() ) );
_qt_label->setBuddy( _qt_lineEdit );
@@ -70,7 +68,7 @@
connect( _qt_lineEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT ( changed ( const QString & ) ) );
- if ( opt.passwordMode.value() )
+ if ( passwordMode )
{
_qt_lineEdit->setEchoMode( QLineEdit::Password );
@@ -83,6 +81,30 @@
}
+std::string YQTextEntry::value()
+{
+ return toUTF8( _qt_lineEdit->text() );
+}
+
+
+void YQTextEntry::setValue( const std::string & newText )
+{
+ QString text = fromUTF8( newText );
+
+ if ( isValidText( text ) )
+ {
+ _qt_lineEdit->blockSignals( true );
+ _qt_lineEdit->setText( text );
+ _qt_lineEdit->blockSignals( false );
+ }
+ else
+ {
+ y2error( "%s \"%s\": Rejecting invalid value \"%s\"",
+ widgetClass(), debugLabel().c_str(), newText.c_str() );
+ }
+}
+
+
void YQTextEntry::setEnabling( bool enabled )
{
_qt_lineEdit->setEnabled( enabled );
@@ -113,33 +135,10 @@
resize( newWidth, newHeight );
}
-void YQTextEntry::setText( const YCPString & ytext )
-{
- QString text = fromUTF8( ytext->value() );
-
- if ( isValidText( text ) )
- {
- _qt_lineEdit->blockSignals( true );
- _qt_lineEdit->setText( text );
- _qt_lineEdit->blockSignals( false );
- }
- else
- {
- y2error( "%s \"%s\": Rejecting invalid value \"%s\"",
- widgetClass(), debugLabel().c_str(), ytext->value().c_str() );
- }
-}
-
-
-YCPString YQTextEntry::getText()
-{
- return YCPString( toUTF8(_qt_lineEdit->text() ) );
-}
-
-void YQTextEntry::setLabel( const YCPString & label )
+void YQTextEntry::setLabel( const std::string & label )
{
- _qt_label->setText( fromUTF8(label->value() ) );
+ _qt_label->setText( fromUTF8(label ) );
YTextEntry::setLabel( label );
}
@@ -156,15 +155,15 @@
}
-void YQTextEntry::setValidChars( const YCPString & newValidChars )
+void YQTextEntry::setValidChars( const std::string & newValidChars )
{
if ( _validator )
{
- _validator->setValidChars( fromUTF8( newValidChars->value() ) );
+ _validator->setValidChars( fromUTF8( newValidChars ) );
}
else
{
- _validator = new QY2CharValidator( fromUTF8( newValidChars->value() ), this );
+ _validator = new QY2CharValidator( fromUTF8( newValidChars ), this );
_qt_lineEdit->setValidator( _validator );
// No need to delete the validator in the destructor - Qt will take
@@ -176,16 +175,17 @@
y2error( "Old value \"%s\" of %s \"%s\" invalid according to ValidChars \"%s\" - deleting",
(const char *) _qt_lineEdit->text(),
widgetClass(), debugLabel().c_str(),
- newValidChars->value().c_str() );
+ newValidChars.c_str() );
_qt_lineEdit->setText( "" );
}
YTextEntry::setValidChars( newValidChars );
}
-void YQTextEntry::setInputMaxLength( const YCPInteger & numberOfChars)
+void YQTextEntry::setInputMaxLength( int len )
{
- _qt_lineEdit->setMaxLength(numberOfChars->asInteger()->value());
+ _qt_lineEdit->setMaxLength( len );
+ YTextEntry::setInputMaxLength( len );
}
bool YQTextEntry::setKeyboardFocus()
@@ -238,7 +238,7 @@
if ( _qt_lineEdit->echoMode() == QLineEdit::Normal )
return;
- _qt_label->setText( fromUTF8( getLabel()->value() ) );
+ _qt_label->setText( fromUTF8( label() ) );
_qt_label->setFont( YQUI::ui()->currentFont() );
_displayingCapsLockWarning = false;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQTextEn…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h Fri Jun 1 17:16:50 2007
@@ -12,8 +12,7 @@
File: YQTextEntry.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Stefan Hundhammer <sh(a)suse.de>
+ Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
@@ -43,70 +42,80 @@
public:
/**
* Constructor.
- */
+ **/
YQTextEntry( QWidget * parent,
const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & text );
+ const std::string & label,
+ bool passwordMode = false );
/**
- * 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 setEnabling( bool enabled );
+ * Get the current value (the text entered by the user or set from the
+ * outside) of this input field.
+ *
+ * Reimplemented from YTextEntry.
+ **/
+ virtual std::string value();
/**
- * Minimum size the widget should have to make it look and feel
- * nice.
- * @dim Dimension, either YD_HORIZ or YD_VERT
+ * Set the current value (the text entered by the user or set from the
+ * outside) of this input field.
+ *
+ * Reimplemented from YTextEntry.
*/
- long nicesize( YUIDimension dim );
+ virtual void setValue( const std::string & text );
/**
- * Sets the new size of the widget.
- */
- void setSize( long newWidth, long newHeight );
+ * Set the label (the caption above the input field).
+ *
+ * Reimplemented from YTextEntry.
+ **/
+ void setLabel( const std::string & label );
/**
- * Set the text in the entry to a new value
- */
- void setText( const YCPString & text );
+ * Set the valid input characters. No input validation is performed (i.e.,
+ * the user can enter anything) if this is empty.
+ *
+ * Reimplemented from YTextEntry.
+ **/
+ void setValidChars( const std::string & validChars );
/**
- * Gets the text currently entered in the text entry
+ * Specify the amount of characters which can be inserted.
+ *
+ * Reimplemented from @ref YTextEntry.
*/
- YCPString getText();
+ void setInputMaxLength( int numberOfChars );
/**
- * Changes the label of the text entry.
- */
- void setLabel( const YCPString & label );
+ * Returns 'true' if a given text is valid according to ValidChars.
+ **/
+ bool isValidText( const QString & text ) const;
/**
- * Change the valid input characters.
+ * Set enabled/disabled status.
*
- * Reimplemented from @ref YTextEntry.
- */
- void setValidChars( const YCPString & validChars );
+ * Reimplemented from YWidget.
+ **/
+ void setEnabling( bool enabled );
/**
- * Specify the amount of characters which can be inserted.
- *
- * Reimplemented from @ref YTextEntry.
- */
- void setInputMaxLength( const YCPInteger & numberOfChars );
+ * Minimum size the widget should have to make it look and feel
+ * nice.
+ * dim Dimension, either YD_HORIZ or YD_VERT
+ * Reimplemented from YWidget.
+ **/
+ long nicesize( YUIDimension dim );
+
+ /**
+ * Sets the new size of the widget.
+ **/
+ void setSize( long newWidth, long newHeight );
/**
* Accept the keyboard focus.
*/
virtual bool setKeyboardFocus();
- /**
- * Returns 'true' if a given text is valid according to ValidChars.
- **/
- bool isValidText( const QString & text ) const;
-
protected slots:
/**
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 Fri Jun 1 17:16:50 2007
@@ -438,13 +438,13 @@
YWidget * createPackageSelector ( YWidget * parent, YWidgetOpt & opt, const YCPString & floppyDevice );
YWidget * createPushButton ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createMenuButton ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
- YWidget * createRadioButton ( YWidget * parent, YWidgetOpt & opt, YRadioButtonGroup * rbg, const YCPString & label, bool checked);
+ YWidget * createRadioButton ( YWidget * parent, YWidgetOpt & opt, YRadioButtonGroup * rbg, const std::string & label, bool checked);
YWidget * createRichText ( YWidget * parent, YWidgetOpt & opt, const YCPString & text);
YWidget * createSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createMultiSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createSpacing ( YWidget * parent, YWidgetOpt & opt, float size, bool horizontal, bool vertical);
YWidget * createTable ( YWidget * parent, YWidgetOpt & opt, vector<string> header);
- YWidget * createTextEntry ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text);
+ YWidget * createTextEntry ( YWidget * parent, YWidgetOpt & opt, const std::string & label, bool passwordMode );
YWidget * createTree ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createPkgSpecial ( YWidget * parent, YWidgetOpt & opt, const YCPString & subwidget );
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 Fri Jun 1 17:16:50 2007
@@ -250,7 +250,7 @@
YWidget * YQUI::createRadioButton ( YWidget * parent,
YWidgetOpt & opt,
YRadioButtonGroup * rbg,
- const YCPString & label,
+ const std::string & label,
bool checked)
{
return new YQRadioButton( (QWidget *) ( parent->widgetRep() ), opt, rbg, label, checked);
@@ -263,11 +263,11 @@
}
YWidget * YQUI::createTextEntry ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & text )
+ YWidgetOpt & opt,
+ const std::string & label,
+ bool passwordMode )
{
- return new YQTextEntry( (QWidget *) ( parent->widgetRep() ), opt, label, text);
+ return new YQTextEntry( (QWidget *) ( parent->widgetRep() ), opt, label, passwordMode );
}
YWidget * YQUI::createMultiLineEdit ( YWidget * parent,
--
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] r38252 - /branches/tmp/sh/mod-ui/core/libyui/src/
by sh-sh-sh@svn.opensuse.org 01 Jun '07
by sh-sh-sh@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: sh-sh-sh
Date: Fri Jun 1 17:16:19 2007
New Revision: 38252
URL: http://svn.opensuse.org/viewcvs/yast?rev=38252&view=rev
Log:
- Ported YTextEntry
- Removed obsolete changeWidget/queryWidget code in proted widgets
- Interim solution for shortcut management
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc
branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc
branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc
branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc
branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h
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/YUI_widgets.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Fri Jun 1 17:16:19 2007
@@ -7,6 +7,20 @@
This had cluttered the API for a long time.
+* Got rid of all YCP data types in all widget classes:
+
+ * YCPString -> std::string
+ * YCPInteger -> int
+ * YCPBoolean -> bool
+
+* In function parameters, std::string is generally passed as const std::string & .
+
+* All widgets: No longer implementing changeWidget() / queryWidget() directly,
+ now using setProperty() / getProperty().
+ Reason: No more YCP depencency in YWidget derived classes.
+ See YRadioButton or YTextEntry for examples.
+
+
* YRadioButton:
* Made all memeber variables private.
@@ -21,4 +35,22 @@
* virtual void setValue( YCPBoolean ) -> virtual void setValue( bool )
+* YTextEntry:
+
+ * Made all memeber variables private.
+ Access via access functions only from now on.
+
+ * label is now std::string , no longer YCPString
+ * passwordMode is now passed directly in the constructor, not only via YWidgetOpt
+ * passwordMode is now a member, no longer avaliable only from YWidgetOpt
+
+ * Renamed getText() -> value(),
+ * Renamed setText() -> setValue()
+ * virtual YCPString getText() -> virtual std::string value()
+ * virtual void setText( YCPString ) -> virtual void setValue( std::string )
+ * getLabel() -> label()
+ * virtual setValidChars( YCPStrng ) -> virtual setValidChars( std::string )
+ * virtual setInputMaxLength( YCPInteger ) -> virtual setInputMaxLength( int )
+ * overloaded virtual setInputMaxLength( int ) is now required to call
+ YTextEntry::setInputMaxLength() at its end
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h Fri Jun 1 17:16:19 2007
@@ -119,6 +119,18 @@
_type( YIntegerProperty ), _integerVal( num ) {}
/**
+ * Constructor for numerical (YCP integer) properties.
+ **/
+ YPropertyValue( int num ):
+ _type( YIntegerProperty ), _integerVal( num ) {}
+
+ /**
+ * Default constructor
+ **/
+ YPropertyValue():
+ _type( YUnknownPropertyType ) {}
+
+ /**
* Returns the type of this property value.
* Use this to determine which xyVal() method to use.
**/
@@ -218,6 +230,11 @@
bool isEmpty() const { return _properties.empty(); }
/**
+ * Returns the number of properties in this set.
+ **/
+ int size() const { return (int) _properties.size(); }
+
+ /**
* Add a property to this property set.
**/
void add( const YProperty & prop );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc Fri Jun 1 17:16:19 2007
@@ -44,14 +44,14 @@
YRadioButtonPrivate( std::string label )
: label( label )
, radioButtonGroup( 0 )
- {};
+ {}
};
YRadioButton::YRadioButton( const YWidgetOpt & opt,
- const YCPString & label )
+ const std::string & label )
: YWidget( opt )
- , priv( new YRadioButtonPrivate( label->value() ) )
+ , priv( new YRadioButtonPrivate( label ) )
{
YUI_CHECK_NEW( priv );
}
@@ -83,6 +83,11 @@
if ( propSet.isEmpty() )
{
+ /*
+ * @property boolean Value the on/off state of the RadioButton
+ * @property string Label the text on the RadioButton
+ */
+
propSet.add( YProperty( YUIProperty_Value, YBoolProperty ) );
propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
propSet.add( YWidget::propertySet() );
@@ -111,8 +116,8 @@
{
propertySet().check( propertyName ); // throws exceptions if not found
- if ( propertyName == YUIProperty_Value ) return YPropertyValue( value() );
- if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
+ if ( propertyName == YUIProperty_Value ) return YPropertyValue( value() );
+ else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
else
{
return YWidget::getProperty( propertyName );
@@ -120,58 +125,6 @@
}
-YCPValue YRadioButton::changeWidget( const YCPSymbol & property, const YCPValue & newvalue )
-{
- string s = property->symbol();
- /*
- * @property boolean Value the state of the RadioButton ( on or off )
- */
- if ( s == YUIProperty_Value )
- {
- if ( newvalue->isBoolean() )
- {
- setValue( newvalue->asBoolean()->value() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "RadioButton: Invalid parameter %s for property `Value. Must be boolean",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
-
- /*
- * @property string Label the RadioButton's text
- */
- else if ( s == YUIProperty_Label )
- {
- if ( newvalue->isString() )
- {
- setLabel( newvalue->asString()->value() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "RadioButton: Invalid parameter %s for property `Label. Must be string",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- else return YWidget::changeWidget( property, newvalue );
-}
-
-
-
-YCPValue YRadioButton::queryWidget( const YCPSymbol & property )
-{
- string s = property->symbol();
- if ( s == YUIProperty_Value ) return YCPBoolean( value() );
- else if ( s == YUIProperty_Label ) return YCPString( label() );
- else return YWidget::queryWidget( property );
-}
-
-
void YRadioButton::buttonGroupIsDead()
{
priv->radioButtonGroup = 0;
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 Fri Jun 1 17:16:19 2007
@@ -22,7 +22,6 @@
#include "ImplPtr.h"
#include "YWidget.h"
-#include <ycp/YCPString.h>
class YRadioButtonGroup;
class YMacroRecorder;
@@ -54,7 +53,7 @@
* Creates a new RadioButton with user-visible text 'label'.
* 'label' can and should contain a keyboard shortcut (designated with '&').
*/
- YRadioButton( const YWidgetOpt & opt, const YCPString & label );
+ YRadioButton( const YWidgetOpt & opt, const std::string & label );
/**
* Destructor: Removes the button from the radio button group.
@@ -62,6 +61,39 @@
virtual ~YRadioButton();
/**
+ * Set the radio button to a new value - check or uncheck it
+ */
+ virtual void setValue( bool checked ) = 0;
+
+ /**
+ * Returns the current value of the radio button:
+ * 'true' if checked, 'false' if unchecked.
+ */
+ virtual bool value() = 0;
+
+ /**
+ * Returns the user-visible label (the text on the RadioButton).
+ **/
+ std::string label() const;
+
+ /**
+ * Change the label. Overload this, but call
+ * YRadioButton::setLabel at the end of your own function.
+ */
+ virtual void setLabel( const std::string & label );
+
+ /**
+ * Get a pointer to the radio button group this button belongs to.
+ */
+ YRadioButtonGroup *buttonGroup();
+
+ /**
+ * This function is called from YRadioButtonGroup::~YRadioButtonGroup to
+ * notify this widget that the radio button group is no longer valid.
+ */
+ void buttonGroupIsDead();
+
+ /**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
@@ -91,58 +123,25 @@
/**
* Return this class's property set.
* This also initializes the property upon the first call.
+ *
* Reimplemented from YWidget.
**/
virtual const YPropertySet & propertySet();
-
- /**
- * Returns the user-visible label (the text on the RadioButton).
- **/
- std::string label() const;
-
- /**
- * Change the label. Overload this, but call
- * YRadioButton::setLabel at the end of your own function.
- */
- virtual void setLabel( const std::string & label );
/**
- * Implements the ui command changeWidget.
- */
- YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
-
- /**
- * Implements the ui command queryWidget
- */
- YCPValue queryWidget( const YCPSymbol & property );
-
- /**
- * Set the radio button to a new value - check or uncheck it
- */
- virtual void setValue( bool checked ) = 0;
-
- /**
- * Returns the current value of the radio button:
- * 'true' if checked, 'false' if unchecked.
- */
- virtual bool value() = 0;
-
- /**
- * This function is called from @ref YRadioButtonGroup#~YRadioButtonGroup and
- * tells that the pointer to the radiobuttongroup is not longer valid.
- */
- void buttonGroupIsDead();
-
- /**
- * Get a pointer to the radio button group this button belongs to.
- */
- YRadioButtonGroup *buttonGroup();
+ * Get the string of this widget that holds the keyboard shortcut.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual std::string shortcutString() { return label(); }
/**
- * The name of the widget property that holds the keyboard shortcut.
- * Inherited from YWidget.
- */
- const char *shortcutProperty() { return YUIProperty_Label; }
+ * Set the string of this widget that holds the keyboard shortcut.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setShortcutString( const std::string & str )
+ { setLabel( str ); }
/**
* The name of the widget property that will return user input.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc Fri Jun 1 17:16:19 2007
@@ -59,6 +59,8 @@
* please tell me.
*/
+ // FIXME: There must be a better way to do this.
+
for ( unsigned i=0; i<buttonlist.size(); i++ )
buttonlist[i]->buttonGroupIsDead();
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc Fri Jun 1 17:16:19 2007
@@ -152,9 +152,22 @@
string( 1, shortcutMarker() ) ); // equivalent to 'string( "& " )'
}
- YCPSymbol propertyName( widget()->shortcutProperty() );
- YCPValue propertyValue = YCPString( str );
- widget()->changeWidget( propertyName, propertyValue );
+ if ( widget()->shortcutProperty() )
+ {
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ YCPSymbol propertyName( widget()->shortcutProperty() );
+ YCPValue propertyValue = YCPString( str );
+ widget()->changeWidget( propertyName, propertyValue );
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ }
+ else
+ {
+ widget()->setShortcutString( str );
+ }
_shortcut_string_chached = false;
_clean_shortcut_string_chached = false;
@@ -214,12 +227,6 @@
string
YShortcut::getShortcutString()
{
- if ( ! widget()->shortcutProperty() )
- {
- y2error( "ERROR: %s widgets can't handle shortcuts!", widgetClass() );
- return string( "" );
- }
-
return getShortcutString( widget() );
}
@@ -227,14 +234,27 @@
string
YShortcut::getShortcutString( YWidget * widget )
{
- if ( ! widget || ! widget->shortcutProperty() )
+ if ( ! widget )
return string( "" );
- YCPSymbol propertyName( widget->shortcutProperty() );
- YCPValue propertyValue = widget->queryWidget( propertyName );
-
- return propertyValue.isNull() || ! propertyValue->isString() ?
- string( "" ) : propertyValue->asString()->value();
+ if ( widget->shortcutProperty() )
+ {
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ YCPSymbol propertyName( widget->shortcutProperty() );
+ YCPValue propertyValue = widget->queryWidget( propertyName );
+
+ return propertyValue.isNull() || ! propertyValue->isString() ?
+ string( "" ) : propertyValue->asString()->value();
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ }
+ else
+ {
+ return widget->shortcutString();
+ }
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc Fri Jun 1 17:16:19 2007
@@ -359,7 +359,8 @@
for ( YWidgetListIterator it = widgetList.begin(); it != widgetList.end(); ++it )
{
- if ( ( *it )->shortcutProperty() )
+ if ( ( *it )->shortcutProperty() ||
+ ! (*it)->shortcutString().empty() )
{
YShortcut * shortcut = new YShortcut( *it );
_shortcutList.push_back( shortcut );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc Fri Jun 1 17:16:19 2007
@@ -1,16 +1,16 @@
/*---------------------------------------------------------------------\
-| |
-| __ __ ____ _____ ____ |
-| \ \ / /_ _/ ___|_ _|___ \ |
-| \ V / _` \___ \ | | __) | |
-| | | (_| |___) || | / __/ |
-| |_|\__,_|____/ |_| |_____| |
-| |
-| core system |
-| (C) SuSE GmbH |
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YTextEntry.cc
+ File: YTextEntry.cc
Author: Mathias Kettner <kettner(a)suse.de>
Maintainer: Stefan Hundhammer <sh(a)suse.de>
@@ -29,126 +29,138 @@
#include "YTextEntry.h"
-YTextEntry::YTextEntry( const YWidgetOpt & opt, const YCPString & label )
+struct YTextEntryPrivate
+{
+ std::string label;
+ bool passwordMode;
+ std::string validChars;
+ int inputMaxLength;
+
+ /**
+ * Constructor
+ **/
+
+ YTextEntryPrivate( std::string label, bool passwordMode )
+ : label( label )
+ , passwordMode( passwordMode )
+ , validChars( "" )
+ , inputMaxLength( -1 )
+ {}
+};
+
+
+
+YTextEntry::YTextEntry( const YWidgetOpt & opt, const std::string & label, bool passwordMode )
: YWidget( opt )
- , label( label )
- , validChars( "" )
+ , priv( new YTextEntryPrivate( label, passwordMode ) )
{
- _passwordMode = opt.passwordMode.value();
+ YUI_CHECK_NEW( priv );
+
setDefaultStretchable( YD_HORIZ, true );
setDefaultStretchable( YD_VERT, false );
}
-void YTextEntry::setLabel( const YCPString & label )
+YTextEntry::~YTextEntry()
{
- this->label = label;
+ // NOP
}
-YCPString YTextEntry::getLabel()
+std::string YTextEntry::label()
{
- return label;
+ return priv->label;
}
-void YTextEntry::setValidChars( const YCPString & newValidChars )
+void YTextEntry::setLabel( const std::string & label )
{
- this->validChars= newValidChars;
+ priv->label = label;
}
-YCPString YTextEntry::getValidChars()
+std::string YTextEntry::validChars()
{
- return validChars;
+ return priv->validChars;
}
-YCPValue YTextEntry::changeWidget( const YCPSymbol & property, const YCPValue & newvalue )
+void YTextEntry::setValidChars( const std::string & newValidChars )
{
- string s = property->symbol();
- /**
- * @property string Value the field's contents ( the user input )
- */
- if ( s == YUIProperty_Value )
- {
- if ( newvalue->isString() )
- {
- setText( newvalue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "TextEntry: Invalid parameter %s for Value property. Must be string.",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- /**
- * @property string Label label above the field
- */
- else if ( s == YUIProperty_Label )
- {
- if ( newvalue->isString() )
- {
- setLabel( newvalue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "TextEntry: Invalid parameter %s for Label property. Must be string.",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- /**
- * @property string ValidChars valid input characters
- */
- else if ( s == YUIProperty_ValidChars )
- {
- if ( newvalue->isString() )
- {
- setValidChars( newvalue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "TextEntry: Invalid parameter %s for ValidChars property. Must be string.",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
- }
- /**
- * @property interger InputMaxLength limit the amount of characters
- */
- else if ( s == YUIProperty_InputMaxLength )
+ priv->validChars= newValidChars;
+}
+
+
+bool YTextEntry::passwordMode() const
+{
+ return priv->passwordMode;
+}
+
+
+int YTextEntry::inputMaxLength() const
+{
+ return priv->inputMaxLength;
+}
+
+void YTextEntry::setInputMaxLength( int len )
+{
+ priv->inputMaxLength = len;
+}
+
+
+const YPropertySet &
+YTextEntry::propertySet()
+{
+ static YPropertySet propSet;
+
+ if ( propSet.isEmpty() )
{
- if ( newvalue->isInteger() )
- {
- setInputMaxLength( newvalue->asInteger()->value() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "TextEntry: Invalid parameter %s for InputMaxLength. Must be integer.",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
+ /*
+ * @property string Value the field's contents (the user input)
+ * @property string Label caption above the field
+ * @property string ValidChars set of valid input characters
+ * @property integer InputMaxLength maximum number of input characters
+ */
+ propSet.add( YProperty( YUIProperty_Value, YStringProperty ) );
+ propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
+ propSet.add( YProperty( YUIProperty_ValidChars, YStringProperty ) );
+ propSet.add( YProperty( YUIProperty_InputMaxLength, YIntegerProperty ) );
+ propSet.add( YWidget::propertySet() );
}
- else return YWidget::changeWidget( property, newvalue );
+
+ return propSet;
}
-void YTextEntry::setInputMaxLength( const YCPInteger & numberOfChars )
+
+void
+YTextEntry::setProperty( const std::string & propertyName, const YPropertyValue & val )
{
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
+
+ if ( propertyName == YUIProperty_Value ) setValue( val.stringVal() );
+ else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() );
+ else if ( propertyName == YUIProperty_ValidChars ) setValidChars( val.stringVal() );
+ else if ( propertyName == YUIProperty_InputMaxLength ) setInputMaxLength( val.integerVal() );
+ else
+ {
+ YWidget::setProperty( propertyName, val );
+ }
}
-YCPValue YTextEntry::queryWidget( const YCPSymbol & property )
+
+YPropertyValue
+YTextEntry::getProperty( const std::string & propertyName )
{
- string s = property->symbol();
- if ( s == YUIProperty_Value ) return getText();
- else if ( s == YUIProperty_Label ) return getLabel();
- else if ( s == YUIProperty_ValidChars ) return getValidChars();
- else return YWidget::queryWidget( property );
+ propertySet().check( propertyName ); // throws exceptions if not found
+
+ if ( propertyName == YUIProperty_Value ) return YPropertyValue( value() );
+ else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
+ else if ( propertyName == YUIProperty_ValidChars ) return YPropertyValue( validChars() );
+ else if ( propertyName == YUIProperty_InputMaxLength ) return YPropertyValue( inputMaxLength() );
+ else
+ {
+ return YWidget::getProperty( propertyName );
+ }
}
@@ -165,7 +177,7 @@
text += ", \"<not recording password in plain text>\" );\t// ";
text += widgetClass();
text += " \"" + debugLabel() + "\"";
-
+
macroRecorder->recordComment( text );
}
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h Fri Jun 1 17:16:19 2007
@@ -12,128 +12,160 @@
File: YTextEntry.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Stefan Hundhammer <sh(a)suse.de>
+ Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
#ifndef YTextEntry_h
#define YTextEntry_h
+#include <string>
+#include "ImplPtr.h"
#include "YWidget.h"
-#include <ycp/YCPString.h>
class YMacroRecorder;
+class YTextEntryPrivate;
+
-/**
- * @short Implementation of the TextEntry and Password widgets
- * Notice: Derived classes need to check opt.passwordMode!
- */
class YTextEntry : public YWidget
{
public:
/**
- * Creates a new text entry with a label and an initial text.
+ * Constructor.
+ *
+ * Creates an input field with 'label' as the caption.
+ * If 'passwordMode' is set, the input will be not be echoed as clear text.
*/
- YTextEntry( const YWidgetOpt & opt, const YCPString & label );
+ YTextEntry( const YWidgetOpt & opt,
+ const std::string & label,
+ bool passwordMode = false );
/**
- * Returns a descriptive name of this widget class for logging,
- * debugging etc.
- */
- virtual char *widgetClass() { return "YTextEntry"; }
-
+ * Destructor.
+ **/
+ virtual ~YTextEntry();
/**
- * Implements the ui command changeWidget for the widget specific
- * properties.
+ * Get the current value (the text entered by the user or set from the
+ * outside) of this input field.
+ *
+ * Derived classes need to implement this.
*/
- YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
+ virtual std::string value() = 0;
/**
- * Implements the ui command changeWidget for the widget specific properties.
+ * Set the current value (the text entered by the user or set from the
+ * outside) of this input field.
+ *
+ * Derived classes need to implement this.
*/
- YCPValue queryWidget( const YCPSymbol & property );
+ virtual void setValue( const std::string & text ) = 0;
/**
- * Set the text in the entry to a new value
- */
- virtual void setText( const YCPString & text ) = 0;
+ * Get the label (the caption above the input field).
+ **/
+ std::string label();
/**
- * get the text currently entered in the text entry
- */
- virtual YCPString getText() = 0;
+ * Set the label (the caption above the input field).
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method (YTextEntry::setLabel() at the end of the overloaded
+ * function.
+ **/
+ virtual void setLabel( const std::string & label );
/**
- * change the label of the text entry. Overload this, but call
- * YTextEntry::setLabel at the end of your own function.
- */
- virtual void setLabel( const YCPString & label );
+ * Returns 'true' if this input field is in password mode, i.e. if there should
+ * be no on-screen echo or only a '*' for each character typed.
+ *
+ * Notice that this can only be set in the constructor.
+ **/
+ bool passwordMode() const;
/**
- * Get the current label of the text entry. This method cannot be
- * overidden. The value of the label cannot be changed other than by
- * calling setLabel, i.e. not by the ui. Therefore setLabel stores the
- * current label in #label.
- */
- YCPString getLabel();
+ * Get the valid input characters. No input validation is performed (i.e.,
+ * the user can enter anything) if this is empty.
+ **/
+ std::string validChars();
/**
- * Change the valid input characters.
+ * Set the valid input characters. No input validation is performed (i.e.,
+ * the user can enter anything) if this is empty.
*
- * Overload this, but call YTextEntry::setValidChars at the end of your own
- * method.
- */
- virtual void setValidChars( const YCPString & validChars );
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
+ **/
+ virtual void setValidChars( const std::string & validChars );
/**
- * Specify the amount of characters which can be inserted.
- *
- * Overload this to limit the input.
- */
- virtual void setInputMaxLength( const YCPInteger & numberOfChars );
+ * Gthe maximum input length, i.e., the maximum number of characters the
+ * user can enter. -1 means no limit.
+ **/
+ int inputMaxLength() const;
/**
- * Get the valid input characters.
- */
- YCPString getValidChars();
+ * Set the maximum input length, i.e., the maximum number of characters the
+ * user can enter. -1 means no limit.
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
+ **/
+ virtual void setInputMaxLength( int numberOfChars );
+
/**
- * The name of the widget property that holds the keyboard shortcut.
- * Inherited from YWidget.
+ * Returns a descriptive name of this widget class for logging,
+ * debugging etc.
*/
- const char *shortcutProperty() { return YUIProperty_Label; }
-
+ virtual char *widgetClass() { return "YTextEntry"; }
+
+
/**
- * The name of the widget property that will return user input.
- * Inherited from YWidget.
+ * Set a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ virtual void setProperty( const std::string & propertyName,
+ const YPropertyValue & val );
/**
- * Returns 'true' if this text entry is in password mode, i.e. there should
- * be no on-screen echo or only a '*' for each character typed
+ * Get a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw YUIPropertyExceptions.
**/
- bool passwordMode() const { return _passwordMode; }
-
-
-protected:
+ virtual YPropertyValue getProperty( const std::string & propertyName );
/**
- * The text entry label
- */
- YCPString label;
+ * Return this class's property set.
+ * This also initializes the property upon the first call.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual const YPropertySet & propertySet();
+
+ /**
+ * Get the string of this widget that holds the keyboard shortcut.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual std::string shortcutString() { return label(); }
/**
- * Valid input characters
- */
- YCPString validChars;
+ * Set the string of this widget that holds the keyboard shortcut.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setShortcutString( const std::string & str )
+ { setLabel( str ); }
/**
- * Flag: password mode (-> true) or plain text entry?
+ * The name of the widget property that will return user input.
+ * Inherited from YWidget.
**/
- bool _passwordMode;
+ const char *userInputProperty() { return YUIProperty_Value; }
private:
@@ -142,8 +174,10 @@
* Save the widget's user input to a macro recorder.
* Intentionally declared as "private" so all macro recording internals are
* handled by the abstract libyui level, not by a specific UI.
- */
+ **/
virtual void saveUserInput( YMacroRecorder *macroRecorder );
+
+ ImplPtr<YTextEntryPrivate> priv;
};
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 Fri Jun 1 17:16:19 2007
@@ -558,7 +558,7 @@
* @param rbg the radio button group the new button will belong to
*/
virtual YWidget *createRadioButton( YWidget *parent, YWidgetOpt & opt, YRadioButtonGroup *rbg,
- const YCPString & label, bool checked ) = 0;
+ const std::string & label, bool checked ) = 0;
/**
* Creates a check box
@@ -570,7 +570,7 @@
/**
* Creates a text entry or password entry field.
*/
- virtual YWidget *createTextEntry( YWidget *parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text ) = 0;
+ virtual YWidget *createTextEntry( YWidget *parent, YWidgetOpt & opt, const std::string & label, bool passwordMode ) = 0;
/**
* Creates a MultiLineEdit widget.
@@ -1263,11 +1263,11 @@
* Helper function of createWidgetTree.
* Creates one of TextEntry, Password
*
- * @param password true if this should be password entry field
+ * 'passwordMode' true if this should be a password input field
*/
YWidget *createTextEntry( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- bool password );
+ bool passwordMode );
/**
* Helper function of createWidgetTree.
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 Fri Jun 1 17:16:19 2007
@@ -45,6 +45,7 @@
#include "YUI.h"
#include "YEvent.h"
+#include "YUIException.h"
#include "YUISymbols.h"
#include "YDialog.h"
#include "YWidget.h"
@@ -235,7 +236,7 @@
* @description
* Use this builtin if you want to run external program from ncurses UI
* as a separate process. It saves current window layout to the stack and
- * runs the external program in the same terminal. When done, it restores
+ * runs the external program in the same terminal. When done, it restores
* the original window layout and returns exit code of the external program
* (an integer value returned by system() call). When called from Qt UI,
* an error message is printed to the log.
@@ -246,17 +247,17 @@
*/
YCPInteger YUI::evaluateRunInTerminal(const YCPString & module )
-{
- int ret = runInTerminal( module );
+{
+ int ret = runInTerminal( module );
return YCPInteger ( ret );
}
-int YUI::runInTerminal ( const YCPString & module )
+int YUI::runInTerminal ( const YCPString & module )
{
- y2error("Not in text-mode: Cannot run external program in terminal.");
-
+ y2error("Not in text-mode: Cannot run external program in terminal.");
+
return -1;
}
@@ -860,7 +861,52 @@
{
blockEvents(); // We don't want self-generated events from UI::ChangeWidget().
YCPSymbol sym = property->asSymbol();
- YCPValue ret = widget->changeWidget( sym, new_value );
+ YCPValue ret = YCPVoid();
+
+ YPropertySet propSet = widget->propertySet();
+
+ if ( propSet.size() == 6 ) // unchanged from YWidget, no properties supported
+ {
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ y2debug( "Old style UI::ChangeWidget() for %s::%s",
+ widget->widgetClass(), sym->symbol().c_str() );
+ ret = widget->changeWidget( sym, new_value );
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ }
+ else
+ {
+ y2milestone( "New style UI::ChangeWidget() for %s::%s",
+ widget->widgetClass(), sym->symbol().c_str() );
+
+ YPropertyValue val;
+
+ if ( new_value->isString() ) val = YPropertyValue( new_value->asString()->value() );
+ else if ( new_value->isInteger() ) val = YPropertyValue( new_value->asInteger()->value() );
+ else if ( new_value->isBoolean() ) val = YPropertyValue( new_value->asBoolean()->value() );
+ else
+ {
+ y2error( "Unknown type for property %s::%s: %s",
+ widget->widgetClass(), sym->symbol().c_str(), new_value->toString().c_str() );
+
+ unblockEvents();
+ return YCPBoolean( false );
+ }
+
+ try
+ {
+ widget->setProperty( sym->symbol(), val );
+ ret = YCPBoolean( true );
+ }
+ catch( YUIPropertyException & exception )
+ {
+ y2error( "Caught property exception" );
+ }
+ }
+
if ( widget->shortcutProperty() // The widget has a shortcut property
&& sym->symbol() == widget->shortcutProperty() // and this is what should be changed
@@ -918,7 +964,50 @@
return YCPVoid();
if ( property->isSymbol() )
- return widget->queryWidget( property->asSymbol() );
+ {
+ YPropertySet propSet = widget->propertySet();
+ YCPSymbol sym = property->asSymbol();
+
+ if ( propSet.size() == 6 ) // unchanged from YWidget, no properties supported
+ {
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ y2debug( "Old style UI::QueryWidget() for %s::%s",
+ widget->widgetClass(), sym->symbol().c_str() );
+ return widget->queryWidget( property->asSymbol() );
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ // FIXME: Get rid of this
+ }
+ else
+ {
+ y2debug( "New style UI::QueryWidget() for %s::%s",
+ widget->widgetClass(), sym->symbol().c_str() );
+
+ try
+ {
+ YPropertyValue val = widget->getProperty( sym->symbol() );
+
+ switch ( val.type() )
+ {
+ case YStringProperty: return YCPString ( val.stringVal() );
+ case YBoolProperty: return YCPBoolean( val.boolVal() );
+ case YIntegerProperty: return YCPInteger( val.integerVal() );
+
+ default:
+ y2error( "Unknown result for setProperty( %s )", sym->symbol().c_str() );
+ return YCPVoid();
+ }
+ }
+ catch( YUIPropertyException & exception )
+ {
+ y2error( "Caught property exception" );
+ return YCPVoid();
+ }
+ }
+
+ }
else
return widget->queryWidgetTerm( property->asTerm() );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.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_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc Fri Jun 1 17:16:19 2007
@@ -41,15 +41,16 @@
#include "YUI_util.h"
#include "YAlignment.h"
-#include "YComboBox.h"
#include "YCheckBoxFrame.h"
+#include "YComboBox.h"
#include "YMenuButton.h"
+#include "YMultiSelectionBox.h"
+#include "YPushButton.h"
#include "YRadioButton.h"
#include "YRadioButtonGroup.h"
#include "YSelectionBox.h"
-#include "YMultiSelectionBox.h"
-#include "YPushButton.h"
#include "YTable.h"
+#include "YTextEntry.h"
#include "YTree.h"
using std::string;
@@ -1627,7 +1628,8 @@
return 0;
}
- YRadioButton *radioButton = dynamic_cast<YRadioButton *> ( createRadioButton( parent, opt, rbg, term->value( argnr )->asString(), checked->value() ) );
+ YRadioButton *radioButton =
+ dynamic_cast<YRadioButton *> ( createRadioButton( parent, opt, rbg, term->value( argnr )->asString()->value(), checked->value() ) );
assert( radioButton );
// Add to radiobutton group. This can _not_ be done in the
@@ -1731,8 +1733,10 @@
term->toString().c_str() );
return 0;
}
- YCPString initial_text( "" );
- if ( term->size() >= argnr + 2 ) initial_text = term->value( argnr+1 )->asString();
+
+ std::string initialValue;
+ if ( term->size() >= argnr + 2 )
+ initialValue = term->value( argnr+1 )->asString()->value();
for ( int o=0; o < optList->size(); o++ )
{
@@ -1740,9 +1744,13 @@
else logUnknownOption( term, optList->value(o) );
}
- if ( passwordMode ) opt.passwordMode.setValue( true );
+ YTextEntry * textEntry = dynamic_cast<YTextEntry *>
+ ( createTextEntry( parent, opt, term->value( argnr )->asString()->value(), passwordMode ) );
+
+ if ( textEntry && ! initialValue.empty() )
+ textEntry->setValue( initialValue );
- return createTextEntry( parent, opt, term->value( argnr )->asString(), initial_text );
+ return textEntry;
}
@@ -1751,7 +1759,7 @@
* @short multiple line text edit field
* @class YMultiLineEdit
* @arg string label label above the field
- * @optarg string initialText the initial contents of the field
+ * @optarg string initialValue the initial contents of the field
* @usage `MultiLineEdit( `id( `descr ), "Enter problem & description:", "No problem here." )
*
* @examples MultiLineEdit1.ycp MultiLineEdit2.ycp MultiLineEdit3.ycp MultiLineEdit-setInputMaxLength.ycp
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc Fri Jun 1 17:16:19 2007
@@ -40,7 +40,6 @@
#define MAX_DEBUG_LABEL_LEN 50
-
int YWidget::next_internal_widget_id = 0;
@@ -305,6 +304,12 @@
}
+void YWidget::setShortcutString( const std::string & str )
+{
+ y2error( "Default setShortcutString() method called - "
+ "should be reimplemented in %s", widgetClass() );
+}
+
void YWidget::setNotify( bool notify )
{
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Fri Jun 1 17:16:19 2007
@@ -26,6 +26,7 @@
#include "YProperty.h"
#include "YWidgetOpt.h"
#include "YUISymbols.h"
+#include "YUIException.h"
#define YWIDGET_MAGIC 42 // what else? ;- )
@@ -392,10 +393,29 @@
/**
* The name of the widget property that holds the keyboard shortcut, if any.
* Overwrite this for widgets that can have keyboard shortcuts.
- */
+ **/
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
virtual const char *shortcutProperty() { return (const char *) 0; }
/**
+ * Get the string of this widget that holds the keyboard shortcut, if any.
+ * Most widgets will return label().
+ *
+ * Overwrite this for widgets that can have keyboard shortcuts.
+ **/
+ virtual std::string shortcutString() { return std::string( "" ); }
+
+ /**
+ * Set the string of this widget that holds the keyboard shortcut, if any.
+ * Most widgets will call setLabel().
+ *
+ * Overwrite this for widgets that can have keyboard shortcuts.
+ **/
+ virtual void setShortcutString( const std::string & str );
+
+ /**
* The name of the widget property that will return user input, if there is
* any. Widgets that do have user input (such as TextEntry, ComboBox,
* SelBox) should overwrite this methods. Widgets that are purely passive
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h Fri Jun 1 17:16:19 2007
@@ -144,7 +144,6 @@
YBoolOpt isHeading; // YLabel
YBoolOpt autoScrollDown; // YRichText
YBoolOpt plainTextMode; // YRichText
- YBoolOpt passwordMode; // YTextEntry
YBoolOpt isShrinkable; // YTextEntry
YBoolOpt isEditable; // YComboBox
YBoolOpt immediateMode; // YTable
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
01 Jun '07
Author: ug
Date: Fri Jun 1 16:57:11 2007
New Revision: 38251
URL: http://svn.opensuse.org/viewcvs/yast?rev=38251&view=rev
Log:
Created tag stable-2_15_11 for autoinstallation
Added:
tags/stable-2_15_11/autoinstallation/
- copied from r38250, trunk/autoinstallation/
--
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] r38250 - in /trunk/autoinstallation: VERSION package/autoyast2.changes
by ug@svn.opensuse.org 01 Jun '07
by ug@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: ug
Date: Fri Jun 1 16:47:35 2007
New Revision: 38250
URL: http://svn.opensuse.org/viewcvs/yast?rev=38250&view=rev
Log:
2.15.11
Modified:
trunk/autoinstallation/VERSION
trunk/autoinstallation/package/autoyast2.changes
Modified: trunk/autoinstallation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/VERSION?rev=382…
==============================================================================
--- trunk/autoinstallation/VERSION (original)
+++ trunk/autoinstallation/VERSION Fri Jun 1 16:47:35 2007
@@ -1 +1 @@
-2.15.10
+2.15.11
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 Fri Jun 1 16:47:35 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Fri Jun 1 16:47:16 CEST 2007 - ug(a)suse.de
+
+- 2.15.11
+
+-------------------------------------------------------------------
Fri Jun 1 15:39:58 CEST 2007 - ug(a)suse.de
- fix for the reuse of LVM volumes
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
01 Jun '07
Author: mvidner
Date: Fri Jun 1 16:22:01 2007
New Revision: 38249
URL: http://svn.opensuse.org/viewcvs/yast?rev=38249&view=rev
Log:
Created tag stable-2_15_1 for perl-bindings
Added:
tags/stable-2_15_1/perl-bindings/
- copied from r38248, trunk/perl-bindings/
--
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] r38248 - in /trunk/add-on: VERSION package/yast2-add-on.changes src/add-on-workflow.ycp src/add-on.ycp
by locilka@svn.opensuse.org 01 Jun '07
by locilka@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: locilka
Date: Fri Jun 1 16:11:33 2007
New Revision: 38248
URL: http://svn.opensuse.org/viewcvs/yast?rev=38248&view=rev
Log:
- Fixed Add-On client to provide command-line again. Providing
"help" and "longhelp" (#279074).
- Fixed Add-On workflow to store the "PRODUCT" tag from content
file for later usage in AutoYaST cloning (#279893).
- 2.15.9
Modified:
trunk/add-on/VERSION
trunk/add-on/package/yast2-add-on.changes
trunk/add-on/src/add-on-workflow.ycp
trunk/add-on/src/add-on.ycp
Modified: trunk/add-on/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on/VERSION?rev=38248&r1=3824…
==============================================================================
--- trunk/add-on/VERSION (original)
+++ trunk/add-on/VERSION Fri Jun 1 16:11:33 2007
@@ -1 +1 @@
-2.15.8
+2.15.9
Modified: trunk/add-on/package/yast2-add-on.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on/package/yast2-add-on.chan…
==============================================================================
--- trunk/add-on/package/yast2-add-on.changes (original)
+++ trunk/add-on/package/yast2-add-on.changes Fri Jun 1 16:11:33 2007
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Fri Jun 1 15:35:46 CEST 2007 - locilka(a)suse.cz
+
+- Fixed Add-On client to provide command-line again. Providing
+ "help" and "longhelp" (#279074).
+- Fixed Add-On workflow to store the "PRODUCT" tag from content
+ file for later usage in AutoYaST cloning (#279893).
+- 2.15.9
+
+-------------------------------------------------------------------
Fri May 25 13:30:04 CEST 2007 - jsrain(a)suse.cz
- removed outdated translations from .desktop-files (#271209)
Modified: trunk/add-on/src/add-on-workflow.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on/src/add-on-workflow.ycp?r…
==============================================================================
--- trunk/add-on/src/add-on-workflow.ycp (original)
+++ trunk/add-on/src/add-on-workflow.ycp Fri Jun 1 16:11:33 2007
@@ -634,11 +634,13 @@
}
Pkg::ResolvableInstall (prod["name"]:"", `product);
map data = Pkg::SourceGeneralData (AddOnProduct::src_id);
+
string url = data["url"]:"";
string product_dir = data["product_dir"]:"";
AddOnProduct::add_on_products = add (AddOnProduct::add_on_products, $[
"media" : AddOnProduct::src_id,
"product" : prod["display_name"]:prod["short_name"]:prod["name"]:"",
+ "autoyast_product" : prod["name"]:"",
"media_url" : url,
"product_dir" : product_dir,
]);
@@ -754,11 +756,12 @@
}
foreach (string product, selected, {
+ integer src_id = (AddOnProduct::src_id == -1 ? prod2src[product]:-1 : AddOnProduct::src_id);
+
AddOnProduct::add_on_products = add (AddOnProduct::add_on_products, $[
- "media" : AddOnProduct::src_id == -1
- ? prod2src[product]:-1
- : AddOnProduct::src_id,
+ "media" : src_id,
"product" : product,
+ "autoyast_prouduct" : product,
"media_url" : url,
"product_dir" : product_dir,
]);
Modified: trunk/add-on/src/add-on.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on/src/add-on.ycp?rev=38248&…
==============================================================================
--- trunk/add-on/src/add-on.ycp (original)
+++ trunk/add-on/src/add-on.ycp Fri Jun 1 16:11:33 2007
@@ -21,14 +21,31 @@
include "add-on/add-on-workflow.ycp";
-
-// Bugzilla #269886, CommanLine "support"
-// argmap is only a map, CommandLine uses string parameters
-if (size (GetInstArgs::argmap()) == 0 && size (WFM::Args()) > 0) {
+list wfm_args = WFM::Args();
+y2milestone ("ARGS: %1", wfm_args);
+if (
+ (size (wfm_args) > 0)
+ &&
+ (contains (wfm_args, "help") || contains (wfm_args, "longhelp"))
+) {
Mode::SetUI ("commandline");
- y2milestone ("Mode CommandLine not supported, exiting...");
- // TRANSLATORS: error message - the module does not provide command line interface
- CommandLine::Print(_("There is no user interface available for this module."));
+ // TRANSLATORS: commandline help
+ CommandLine::Print(_("
+Add-On Module Help
+------------------
+
+To add a new Add-On product via command-line, use this syntax:
+ /sbin/yast2 add-on URL
+URL is the path to the Add-On source.
+
+Examples of URL:
+http://server.name/directory/Lang-AddOn-10.2-i386/
+ftp://server.name/directory/Lang-AddOn-10.2-i386/
+nfs://server.name/directory/SDK1-SLE-i386/
+disk://dev/sda5/directory/Product/CD1/
+cd://
+dvd://
+"));
return `auto;
}
--
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] r38247 - in /trunk/perl-bindings: VERSION package/yast2-perl-bindings.changes pluglib-bindings/stylesheets/swigxml2typeinfo.xsl
by mvidner@svn.opensuse.org 01 Jun '07
by mvidner@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: mvidner
Date: Fri Jun 1 16:07:34 2007
New Revision: 38247
URL: http://svn.opensuse.org/viewcvs/yast?rev=38247&view=rev
Log:
pluglib-bindings: do not create nearly empty '.pm' for STL classes
Modified:
trunk/perl-bindings/VERSION
trunk/perl-bindings/package/yast2-perl-bindings.changes
trunk/perl-bindings/pluglib-bindings/stylesheets/swigxml2typeinfo.xsl
Modified: trunk/perl-bindings/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/VERSION?rev=38247&…
==============================================================================
--- trunk/perl-bindings/VERSION (original)
+++ trunk/perl-bindings/VERSION Fri Jun 1 16:07:34 2007
@@ -1 +1 @@
-2.15.0
+2.15.1
Modified: trunk/perl-bindings/package/yast2-perl-bindings.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/package/yast2-perl…
==============================================================================
--- trunk/perl-bindings/package/yast2-perl-bindings.changes (original)
+++ trunk/perl-bindings/package/yast2-perl-bindings.changes Fri Jun 1 16:07:34 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Jun 1 16:07:25 CEST 2007 - mvidner(a)suse.cz
+
+- pluglib-bindings: do not create nearly empty '.pm' for STL classes
+- 2.15.1
+
+-------------------------------------------------------------------
Tue Feb 6 16:24:12 CET 2007 - mvidner(a)suse.cz
- pluglib-bindings.ami: Detect if sablot fails.
Modified: trunk/perl-bindings/pluglib-bindings/stylesheets/swigxml2typeinfo.xsl
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/pluglib-bindings/s…
==============================================================================
--- trunk/perl-bindings/pluglib-bindings/stylesheets/swigxml2typeinfo.xsl (original)
+++ trunk/perl-bindings/pluglib-bindings/stylesheets/swigxml2typeinfo.xsl Fri Jun 1 16:07:34 2007
@@ -61,7 +61,7 @@
</xsl:if>
</xsl:template>
-<xsl:template match="class" mode="class">
+<xsl:template match="class[attributelist/attribute[@name='sym_name']]" mode="class">
<xsl:param name="class" select="attributelist/attribute[@name='sym_name']/@value"/>
<xsl:text>package </xsl:text>
<xsl:value-of select="/top/attributelist/attribute[@name='module']/@value"/>
--
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] r38246 - in /trunk/packager: package/yast2-packager.changes src/modules/AddOnProduct.ycp
by locilka@svn.opensuse.org 01 Jun '07
by locilka@svn.opensuse.org 01 Jun '07
01 Jun '07
Author: locilka
Date: Fri Jun 1 16:04:52 2007
New Revision: 38246
URL: http://svn.opensuse.org/viewcvs/yast?rev=38246&view=rev
Log:
- Adjusted Add-On module to store also a "PRODUCT" tag from the
product content file to be later used by AutoYaST cloning.
- Add-On Export uses that "autoyast_product" ("PRODUCT") instead of
the "product" key which is used for other purposes, mostly for
UI (#279893).
Modified:
trunk/packager/package/yast2-packager.changes
trunk/packager/src/modules/AddOnProduct.ycp
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Fri Jun 1 16:04:52 2007
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Fri Jun 1 15:58:06 CEST 2007 - locilka(a)suse.cz
+
+- Adjusted Add-On module to store also a "PRODUCT" tag from the
+ product content file to be later used by AutoYaST cloning.
+- Add-On Export uses that "autoyast_product" ("PRODUCT") instead of
+ the "product" key which is used for other purposes, mostly for
+ UI (#279893).
+
+-------------------------------------------------------------------
Wed May 30 14:16:09 CEST 2007 - lslezak(a)suse.cz
- do not show an installation source in the package installation
Modified: trunk/packager/src/modules/AddOnProduct.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/AddOnProduc…
==============================================================================
--- trunk/packager/src/modules/AddOnProduct.ycp (original)
+++ trunk/packager/src/modules/AddOnProduct.ycp Fri Jun 1 16:04:52 2007
@@ -61,6 +61,7 @@
* "media" : 4, // ID of the source
* "product_dir" : "/",
* "product" : "openSUSE version XX.Y",
+ * "autoyast_product" : "'PRODUCT' tag for AutoYaST Export",
* ],
* ...
* ]
@@ -520,6 +521,7 @@
AddOnProduct::add_on_products = add (AddOnProduct::add_on_products, $[
"media" : src,
"product" : prod["label"]:prod["productname"]:prod["productversion"]:"",
+ "autoyast_product" : prod["productname"]:"",
"media_url" : url,
"product_dir" : pth,
]);
@@ -548,12 +550,41 @@
/* Export/Import --> */
+/**
+ * Returns map describing all used add-ons.
+ *
+ * @return map
+ *
+ * @struct This is an XML file created from exported map:
+ * <add-on>
+ * <add_on_products config:type="list">
+ * <listentry>
+ * <media_url>ftp://server.name/.../</media_url>
+ * <product>NEEDS_TO_MATCH_"PRODUCT"_TAG_FROM_content_FILE!</product>
+ * <product_dir>/</product_dir>
+ * </listentry>
+ * ...
+ * </add_on_products>
+ * </add-on>
+ */
global map Export () {
+ y2milestone ("Add-Ons Input: %1", add_on_products);
+
list<map<string,any> > exp = maplist (map<string,any> p, add_on_products, {
if (haskey (p, "media"))
p = remove (p, "media");
+
+ // bugzilla #279893
+ if (haskey (p, "autoyast_product")) {
+ p["product"] = p["autoyast_product"]:"";
+ p = remove (p, "autoyast_product");
+ }
+
return p;
});
+
+ y2milestone ("Add-Ons Output: %2", exp);
+
return $[
"add_on_products" : exp,
];
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0