Author: jsuchome
Date: Fri Jun 13 16:13:59 2008
New Revision: 48298
URL: http://svn.opensuse.org/viewcvs/yast?rev=48298&view=rev
Log:
moved current routines.ycp function to ProductCreator.ycp, added
some to help with kiwi's config.xml map handling
Modified:
trunk/product-creator/src/ProductCreator.ycp
trunk/product-creator/src/routines.ycp
Modified: trunk/product-creator/src/ProductCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/ProductCreator.ycp?rev=48298&r1=48297&r2=48298&view=diff
==============================================================================
--- trunk/product-creator/src/ProductCreator.ycp (original)
+++ trunk/product-creator/src/ProductCreator.ycp Fri Jun 13 16:13:59 2008
@@ -27,7 +27,9 @@
import "AutoinstSoftware";
import "Arch";
import "PackageAI";
+import "Popup";
import "String";
+import "SourceManager";
import "GPG";
import "GPGWidgets";
import "Mode";
@@ -108,7 +110,42 @@
return modified;
};
-include "product-creator/routines.ycp";
+/**
+ * Abort function
+ * @return blah blah lahjk
+ */
+global define boolean Abort() ``{
+ if(AbortFunction != nil)
+ return eval(AbortFunction) == true;
+ return false;
+}
+
+/**
+ * Check for pending Abort press
+ * @return true if pending abort
+ */
+global define boolean PollAbort() ``{
+ return UI::PollInput() == `abort;
+}
+
+/**
+ * If modified, ask for confirmation
+ * @return true if abort is confirmed
+ */
+global define boolean ReallyAbort() ``{
+ return !ProductCreator::Modified() || Popup::ReallyAbort(true);
+}
+
+/**
+ * Progress::NextStage and Progress::Title combined into one function
+ * @param title progressbar title
+ */
+define void ProgressNextStage(string title) ``{
+ Progress::NextStage();
+ Progress::Title(title);
+}
+
+
// set the packages to 'taboo' state
Modified: trunk/product-creator/src/routines.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/routines.ycp?rev=48298&r1=48297&r2=48298&view=diff
==============================================================================
--- trunk/product-creator/src/routines.ycp (original)
+++ trunk/product-creator/src/routines.ycp Fri Jun 13 16:13:59 2008
@@ -10,47 +10,56 @@
{
textdomain "product-creator";
+
+import "Kiwi";
import "Progress";
-import "Popup";
-import "SourceManager";
-/* FIXME: Remove this file if you do not need it! */
+// shortcut for returning "descripton" value from a map describing config.xml
+string get_description (map config, string key) {
+ return config["description",0,key,0,Kiwi::content_key]:"";
+}
-/**
- * Abort function
- * @return blah blah lahjk
- */
-global define boolean Abort() ``{
- if(AbortFunction != nil)
- return eval(AbortFunction) == true;
- return false;
-}
-
-/**
- * Check for pending Abort press
- * @return true if pending abort
- */
-global define boolean PollAbort() ``{
- return UI::PollInput() == `abort;
-}
-
-/**
- * If modified, ask for confirmation
- * @return true if abort is confirmed
- */
-global define boolean ReallyAbort() ``{
- return !Modified() || Popup::ReallyAbort(true);
-}
-
-/**
- * Progress::NextStage and Progress::Title combined into one function
- * @param title progressbar title
- */
-global define void ProgressNextStage(string title) ``{
- Progress::NextStage();
- Progress::Title(title);
+// shortcut for returning "preferences" value from a map describing config.xml
+string get_preferences (map config, string key, any defval) {
+ return sformat ("%1",
+ config["preferences",0,key,0,Kiwi::content_key]:defval);
}
+// update the whole map with a new key in preferences section
+map