Author: gs
Date: Tue Apr 19 13:00:01 2011
New Revision: 63827
URL: http://svn.opensuse.org/viewcvs/yast?rev=63827&view=rev
Log:
YaSt module fro FCoE configuration
Added:
trunk/fcoe-client/
trunk/fcoe-client/MAINTAINER
trunk/fcoe-client/Makefile.cvs
trunk/fcoe-client/RPMNAME
trunk/fcoe-client/VERSION
trunk/fcoe-client/_cvsignore
trunk/fcoe-client/agents/
trunk/fcoe-client/agents/Makefile.am
trunk/fcoe-client/agents/_cvsignore
trunk/fcoe-client/configure.in.in
trunk/fcoe-client/doc/
trunk/fcoe-client/doc/Makefile.am
trunk/fcoe-client/doc/_cvsignore
trunk/fcoe-client/doc/autodocs/
trunk/fcoe-client/doc/autodocs/Makefile.am
trunk/fcoe-client/doc/autodocs/_cvsignore
trunk/fcoe-client/package/
trunk/fcoe-client/package/_cvsignore
trunk/fcoe-client/package/yast2-fcoe-client.changes
trunk/fcoe-client/src/
trunk/fcoe-client/src/FcoeClient.ycp
trunk/fcoe-client/src/FcoeClient2.pm
trunk/fcoe-client/src/FcoeClient3.py
trunk/fcoe-client/src/Makefile.am
trunk/fcoe-client/src/_cvsignore
trunk/fcoe-client/src/complex.ycp
trunk/fcoe-client/src/dialogs.ycp
trunk/fcoe-client/src/fcoe-client.desktop
trunk/fcoe-client/src/fcoe-client.ycp
trunk/fcoe-client/src/fcoe-client_auto.ycp
trunk/fcoe-client/src/fcoe-client_proposal.ycp
trunk/fcoe-client/src/helps.ycp
trunk/fcoe-client/src/wizards.ycp
trunk/fcoe-client/testsuite/
trunk/fcoe-client/testsuite/Makefile.am
trunk/fcoe-client/testsuite/_cvsignore
trunk/fcoe-client/testsuite/tests/
trunk/fcoe-client/testsuite/tests/FcoeClient.err
trunk/fcoe-client/testsuite/tests/FcoeClient.out
trunk/fcoe-client/testsuite/tests/FcoeClient.ycp
trunk/fcoe-client/testsuite/tests/_cvsignore
trunk/fcoe-client/yast2-fcoe-client.spec.in
Added: trunk/fcoe-client/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/MAINTAINER?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/MAINTAINER (added)
+++ trunk/fcoe-client/MAINTAINER Tue Apr 19 13:00:01 2011
@@ -0,0 +1 @@
+Gabriele Mohr
Added: trunk/fcoe-client/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/Makefile.cvs?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/Makefile.cvs (added)
+++ trunk/fcoe-client/Makefile.cvs Tue Apr 19 13:00:01 2011
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: trunk/fcoe-client/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/RPMNAME?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/RPMNAME (added)
+++ trunk/fcoe-client/RPMNAME Tue Apr 19 13:00:01 2011
@@ -0,0 +1 @@
+yast2-fcoe-client
Added: trunk/fcoe-client/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/VERSION?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/VERSION (added)
+++ trunk/fcoe-client/VERSION Tue Apr 19 13:00:01 2011
@@ -0,0 +1 @@
+2.15.0
Added: trunk/fcoe-client/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/_cvsignore?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/_cvsignore (added)
+++ trunk/fcoe-client/_cvsignore Tue Apr 19 13:00:01 2011
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+fcoe-client.pot
+autom4te.cache
Added: trunk/fcoe-client/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/agents/Makefile.am?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/agents/Makefile.am (added)
+++ trunk/fcoe-client/agents/Makefile.am Tue Apr 19 13:00:01 2011
@@ -0,0 +1,7 @@
+# Makefile.am for fcoe-client/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA =
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: trunk/fcoe-client/agents/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/agents/_cvsignore?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/agents/_cvsignore (added)
+++ trunk/fcoe-client/agents/_cvsignore Tue Apr 19 13:00:01 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/fcoe-client/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/configure.in.in?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/configure.in.in (added)
+++ trunk/fcoe-client/configure.in.in Tue Apr 19 13:00:01 2011
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: trunk/fcoe-client/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/doc/Makefile.am?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/doc/Makefile.am (added)
+++ trunk/fcoe-client/doc/Makefile.am Tue Apr 19 13:00:01 2011
@@ -0,0 +1,10 @@
+# Makefile.am for fcoe-client/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/fcoe-client/doc/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/doc/_cvsignore?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/doc/_cvsignore (added)
+++ trunk/fcoe-client/doc/_cvsignore Tue Apr 19 13:00:01 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/fcoe-client/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/doc/autodocs/Makefile.am?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/doc/autodocs/Makefile.am (added)
+++ trunk/fcoe-client/doc/autodocs/Makefile.am Tue Apr 19 13:00:01 2011
@@ -0,0 +1,3 @@
+# Makefile.am for fcoe-client/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/fcoe-client/doc/autodocs/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/doc/autodocs/_cvsignore?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/doc/autodocs/_cvsignore (added)
+++ trunk/fcoe-client/doc/autodocs/_cvsignore Tue Apr 19 13:00:01 2011
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/fcoe-client/package/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/package/_cvsignore?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/package/_cvsignore (added)
+++ trunk/fcoe-client/package/_cvsignore Tue Apr 19 13:00:01 2011
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/fcoe-client/package/yast2-fcoe-client.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/package/yast2-fcoe-client.changes?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/package/yast2-fcoe-client.changes (added)
+++ trunk/fcoe-client/package/yast2-fcoe-client.changes Tue Apr 19 13:00:01 2011
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Tue Apr 19 12:42:00 2011 - gs@suse.de
+
+- initial version
Added: trunk/fcoe-client/src/FcoeClient.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/FcoeClient.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/FcoeClient.ycp (added)
+++ trunk/fcoe-client/src/FcoeClient.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,322 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/FcoeClient.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: FcoeClient settings, input and output functions
+ * Authors: Gabriele Mohr
+ *
+ *
+ * Representation of the configuration of fcoe-client.
+ * Input and output routines.
+ */
+
+{
+
+module "FcoeClient";
+textdomain "fcoe-client";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+
+/**
+ * Prototypes
+ */
+global boolean Modified();
+
+/**
+ * Data was modified?
+ */
+boolean modified = false;
+
+/**
+ */
+boolean proposal_valid = false;
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+boolean write_only = false;
+
+/**
+ * Abort function
+ * return boolean return true if abort
+ */
+boolean() AbortFunction = Modified;
+
+/**
+ * Abort function
+ * @return boolean return true if abort
+ */
+global define boolean Abort() ``{
+ if(AbortFunction != nil)
+ {
+ return AbortFunction () == true;
+ }
+ return false;
+}
+
+/**
+ * Data was modified?
+ * @return true if modified
+ */
+global boolean Modified() {
+ y2debug("modified=%1",modified);
+ return modified;
+}
+
+/**
+ * Mark as modified, for Autoyast.
+ */
+global void SetModified(boolean value) {
+ modified = true;
+ }
+
+global boolean ProposalValid() {
+ return proposal_valid;
+}
+
+global void SetProposalValid(boolean value) {
+ proposal_valid = value;
+}
+
+/**
+ * @return true if module is marked as "write only" (don't start services etc...)
+ */
+global boolean WriteOnly() {
+ return write_only;
+}
+
+/**
+ * Set write_only flag (for autoinstalation).
+ */
+global void SetWriteOnly(boolean value) {
+ write_only = value;
+}
+
+
+global void SetAbortFunction(boolean() function) {
+ AbortFunction = function;
+}
+
+
+// Settings: Define all variables needed for configuration of fcoe-client
+// TODO FIXME: Define all the variables necessary to hold
+// TODO FIXME: the configuration here (with the appropriate
+// TODO FIXME: description)
+// TODO FIXME: For example:
+// /**
+// * List of the configured cards.
+// */
+// list cards = [];
+//
+// /**
+// * Some additional parameter needed for the configuration.
+// */
+// boolean additional_parameter = true;
+
+/**
+ * Read all fcoe-client settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* FcoeClient read dialog caption */
+ string caption = _("Initializing fcoe-client Configuration");
+
+ // TODO FIXME Set the right number of stages
+ integer steps = 4;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Read the database"),
+ /* Progress stage 2/3 */
+ _("Read the previous settings"),
+ /* Progress stage 3/3 */
+ _("Detect the devices")
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the database..."),
+ /* Progress step 2/3 */
+ _("Reading the previous settings..."),
+ /* Progress step 3/3 */
+ _("Detecting the devices..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // read database
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(_("Cannot read database1."));
+ sleep(sl);
+
+ // read another database
+ if(Abort()) return false;
+ Progress::NextStep();
+ /* Error message */
+ if(false) Report::Error(_("Cannot read database2."));
+ sleep(sl);
+
+ // read current settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ // detect devices
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Warning(_("Cannot detect devices."));
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write all fcoe-client settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* FcoeClient read dialog caption */
+ string caption = _("Saving fcoe-client Configuration");
+
+ // TODO FIXME And set the right number of stages
+ integer steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the settings"),
+ /* Progress stage 2/2 */
+ _("Run SuSEconfig")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Running SuSEconfig..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // write settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error (_("Cannot write settings."));
+ sleep(sl);
+
+ // run SuSEconfig
+ if(Abort()) return false;
+ Progress::NextStage ();
+ /* Error message */
+ if(false) Report::Error (Message::SuSEConfigFailed());
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ return true;
+}
+
+/**
+ * Get all fcoe-client settings from the first parameter
+ * (For use by autoinstallation.)
+ * @param settings The YCP structure to be imported.
+ * @return boolean True on success
+ */
+global boolean Import (map settings) {
+ // TODO FIXME: your code here (fill the above mentioned variables)...
+ return true;
+}
+
+/**
+ * Dump the fcoe-client settings to a single map
+ * (For use by autoinstallation.)
+ * @return map Dumped settings (later acceptable by Import ())
+ */
+global map Export () {
+ // TODO FIXME: your code here (return the above mentioned variables)...
+ return $[];
+}
+
+/**
+ * Create a textual summary and a list of unconfigured cards
+ * @return summary of the current configuration
+ */
+global list Summary() {
+ // TODO FIXME: your code here...
+ /* Configuration summary text for autoyast */
+ return [ _("Configuration summary..."), [] ];
+}
+
+/**
+ * Create an overview table with all configured cards
+ * @return table items
+ */
+global list Overview() {
+ // TODO FIXME: your code here...
+ return [];
+}
+
+/**
+ * Return packages needed to be installed and removed during
+ * Autoinstallation to insure module has all needed software
+ * installed.
+ * @return map with 2 lists.
+ */
+global map AutoPackages() {
+ // TODO FIXME: your code here...
+ return $[ "install":[], "remove":[] ];
+}
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/FcoeClient2.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/FcoeClient2.pm?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/FcoeClient2.pm (added)
+++ trunk/fcoe-client/src/FcoeClient2.pm Tue Apr 19 13:00:01 2011
@@ -0,0 +1,326 @@
+#! /usr/bin/perl -w
+
+# ------------------------------------------------------------------------------
+# Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+#
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of version 2 of the GNU General Public License as published by the
+# Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, contact Novell, Inc.
+#
+# To contact Novell about this file by physical or electronic mail, you may find
+# current contact information at www.novell.com.
+# ------------------------------------------------------------------------------
+
+# File: modules/FcoeClient.pm
+# Package: Configuration of fcoe-client
+# Summary: FcoeClient settings, input and output functions
+# Authors: Gabriele Mohr
+#
+# $Id: FcoeClient2.pm 41350 2007-10-10 16:59:00Z dfiser $
+#
+# Representation of the configuration of fcoe-client.
+# Input and output routines.
+
+
+package FcoeClient;
+
+use strict;
+
+use YaST::YCP qw(Boolean :LOGGING);
+use YaPI;
+
+textdomain("fcoe-client");
+
+our %TYPEINFO;
+
+YaST::YCP::Import ("Progress");
+YaST::YCP::Import ("Report");
+YaST::YCP::Import ("Summary");
+YaST::YCP::Import ("Message");
+
+##
+ # Data was modified?
+ #
+my $modified = 0;
+
+##
+ #
+my $proposal_valid = 0;
+
+##
+ # Write only, used during autoinstallation.
+ # Don't run services and SuSEconfig, it's all done at one place.
+ #
+my $write_only = 0;
+
+##
+ # Data was modified?
+ # @return true if modified
+ #
+BEGIN { $TYPEINFO {Modified} = ["function", "boolean"]; }
+sub Modified {
+ y2debug ("modified=$modified");
+ return Boolean($modified);
+}
+
+##
+ # Mark as modified, for Autoyast.
+ #
+BEGIN { $TYPEINFO {SetModified} = ["function", "void", "boolean" ]; }
+sub SetModified {
+ my $value = $_[1];
+ $modified = $value;
+}
+
+BEGIN { $TYPEINFO {ProposalValid} = ["function", "boolean"]; }
+sub ProposalValid {
+ return Boolean($proposal_valid);
+}
+
+BEGIN { $TYPEINFO {SetProposalValid} = ["function", "void", "boolean" ]; }
+sub SetProposalValid{
+ my $value = $_[1];
+ $proposal_valid = $value;
+}
+
+BEGIN { $TYPEINFO {WriteOnly} = ["function", "boolean"]; }
+sub WriteOnly {
+ return Boolean($write_only);
+}
+
+BEGIN { $TYPEINFO {SetWriteOnly} = ["function", "void", "boolean" ]; }
+sub SetWriteOnly{
+ my $value = $_[1];
+ $write_only = $value;
+}
+
+
+# Settings: Define all variables needed for configuration of fcoe-client
+# TODO FIXME: Define all the variables necessary to hold
+# TODO FIXME: the configuration here (with the appropriate
+# TODO FIXME: description)
+# TODO FIXME: For example:
+# ##
+# # List of the configured cards.
+# #
+# my @cards = ();
+#
+# ##
+# # Some additional parameter needed for the configuration.
+# #
+# my $additional_parameter = 1;
+
+##
+ # Read all fcoe-client settings
+ # @return true on success
+ #
+BEGIN { $TYPEINFO{Read} = ["function", "boolean"]; }
+sub Read {
+
+ # FcoeClient read dialog caption
+ my $caption = __("Initializing fcoe-client Configuration");
+
+ # TODO FIXME Set the right number of stages
+ my $steps = 4;
+
+ my $sl = 0.5;
+ sleep($sl);
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ Progress->New( $caption, " ", $steps, [
+ # Progress stage 1/3
+ __("Read the database"),
+ # Progress stage 2/3
+ __("Read the previous settings"),
+ # Progress stage 3/3
+ __("Detect the devices")
+ ], [
+ # Progress step 1/3
+ __("Reading the database..."),
+ # Progress step 2/3
+ __("Reading the previous settings..."),
+ # Progress step 3/3
+ __("Detecting the devices..."),
+ # Progress finished
+ __("Finished")
+ ],
+ ""
+ );
+
+ # read database
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Error(__("Cannot read the database1."));
+ }
+ sleep($sl);
+
+ # read another database
+ Progress->NextStep();
+ # Error message
+ if(0)
+ {
+ Report->Error(__("Cannot read the database2."));
+ }
+ sleep($sl);
+
+ # read current settings
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Error(Message->CannotReadCurrentSettings());
+ }
+ sleep($sl);
+
+ # detect devices
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Warning(__("Cannot detect devices."));
+ }
+ sleep($sl);
+
+ # Progress finished
+ Progress->NextStage();
+ sleep($sl);
+
+ $modified = 0;
+ return Boolean(1);
+}
+
+##
+ # Write all fcoe-client settings
+ # @return true on success
+ #
+BEGIN { $TYPEINFO{Write} = ["function", "boolean"]; }
+sub Write {
+
+ # FcoeClient read dialog caption
+ my $caption = __("Saving fcoe-client Configuration");
+
+ # TODO FIXME And set the right number of stages
+ my $steps = 2;
+
+ my $sl = 0.5;
+ sleep($sl);
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ Progress->New($caption, " ", $steps, [
+ # Progress stage 1/2
+ __("Write the settings"),
+ # Progress stage 2/2
+ __("Run SuSEconfig")
+ ], [
+ # Progress step 1/2
+ __("Writing the settings..."),
+ # Progress step 2/2
+ __("Running SuSEconfig..."),
+ # Progress finished
+ __("Finished")
+ ],
+ ""
+ );
+
+ # write settings
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Error (__("Cannot write settings."));
+ }
+ sleep($sl);
+
+ # run SuSEconfig
+ Progress->NextStage ();
+ # Error message
+ if(0)
+ {
+ Report->Error (Message->SuSEConfigFailed());
+ }
+ sleep($sl);
+
+ # Progress finished
+ Progress->NextStage();
+ sleep($sl);
+
+ return Boolean(1);
+}
+
+##
+ # Get all fcoe-client settings from the first parameter
+ # (For use by autoinstallation.)
+ # @param settings The YCP structure to be imported.
+ # @return boolean True on success
+ #
+BEGIN { $TYPEINFO{Import} = ["function", "boolean", [ "map", "any", "any" ] ]; }
+sub Import {
+ my %settings = %{$_[0]};
+ # TODO FIXME: your code here (fill the above mentioned variables)...
+ return Boolean(1);
+}
+
+##
+ # Dump the fcoe-client settings to a single map
+ # (For use by autoinstallation.)
+ # @return map Dumped settings (later acceptable by Import ())
+ #
+BEGIN { $TYPEINFO{Export} =["function", [ "map", "any", "any" ] ]; }
+sub Export {
+ # TODO FIXME: your code here (return the above mentioned variables)...
+ return {};
+}
+
+##
+ # Create a textual summary and a list of unconfigured cards
+ # @return summary of the current configuration
+ #
+BEGIN { $TYPEINFO{Summary} = ["function", [ "list", "string" ] ]; }
+sub Summary {
+ # TODO FIXME: your code here...
+ # Configuration summary text for autoyast
+ return (
+ __("Configuration summary ...")
+ );
+}
+
+##
+ # Create an overview table with all configured cards
+ # @return table items
+ #
+BEGIN { $TYPEINFO{Overview} = ["function", [ "list", "string" ] ]; }
+sub Overview {
+ # TODO FIXME: your code here...
+ return ();
+}
+
+##
+ # Return packages needed to be installed and removed during
+ # Autoinstallation to insure module has all needed software
+ # installed.
+ # @return map with 2 lists.
+ #
+BEGIN { $TYPEINFO{AutoPackages} = ["function", ["map", "string", ["list", "string"]]]; }
+sub AutoPackages {
+ # TODO FIXME: your code here...
+ my %ret = (
+ "install" => (),
+ "remove" => (),
+ );
+ return \%ret;
+}
+
+1;
+# EOF
Added: trunk/fcoe-client/src/FcoeClient3.py
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/FcoeClient3.py?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/FcoeClient3.py (added)
+++ trunk/fcoe-client/src/FcoeClient3.py Tue Apr 19 13:00:01 2011
@@ -0,0 +1,301 @@
+#!/usr/bin/env python
+
+# ------------------------------------------------------------------------------
+# Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+#
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of version 2 of the GNU General Public License as published by the
+# Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, contact Novell, Inc.
+#
+# To contact Novell about this file by physical or electronic mail, you may find
+# current contact information at www.novell.com.
+# ------------------------------------------------------------------------------
+
+# File: modules/FcoeClient3.py
+# Package: Configuration of fcoe-client
+# Summary: FcoeClient settings, input and output functions
+# Authors: Gabriele Mohr
+#
+# $Id: FcoeClient3.py 27914 2006-02-13 14:32:08Z locilka $
+#
+# Representation of the configuration of fcoe-client.
+# Input and output routines.
+
+
+from time import sleep
+from YCPDeclarations import YCPDeclare
+import ycp
+from ycp import Term, Symbol, Path
+from ycp import y2internal, y2security, y2error, y2warning, y2milestone, y2debug
+
+##
+ # Set textdomain
+ #
+import gettext
+gettext.install("fcoe-client")
+
+ycp.import_module("Progress")
+ycp.import_module("Report")
+ycp.import_module("Summary")
+ycp.import_module("Message")
+
+##
+ # Data was modified?
+ #
+modified = False
+
+##
+ #
+proposal_valid = False
+
+##
+ # Write only, used during autoinstallation.
+ # Don't run services and SuSEconfig, it's all done at one place.
+ #
+write_only = False
+
+##
+ # Data was modified?
+ # @return true if modified
+ #
+@YCPDeclare("boolean")
+def Modified():
+ global modified
+ y2debug ("modified=%d" % (modified));
+ return modified
+
+##
+ # Mark as modified, for Autoyast.
+ #
+@YCPDeclare("void", "boolean")
+def SetModified(value):
+ global modified
+ modified = value
+
+@YCPDeclare("boolean")
+def ProposalValid():
+ global proposal_valid
+ return proposal_valid
+
+@YCPDeclare("void", "boolean")
+def SetProposalValid(value):
+ global proposal_valid
+ proposal_valid = value
+
+@YCPDeclare("boolean")
+def WriteOnly():
+ global write_only
+ return write_only
+
+@YCPDeclare("void", "boolean")
+def SetWriteOnly(value):
+ global write_only
+ write_only = value
+
+
+# Settings: Define all variables needed for configuration of fcoe-client
+# TODO FIXME: Define all the variables necessary to hold
+# TODO FIXME: the configuration here (with the appropriate
+# TODO FIXME: description)
+# TODO FIXME: For example:
+# ##
+# # List of the configured cards.
+# #
+# cards = []
+#
+# ##
+# # Some additional parameter needed for the configuration.
+# #
+# additional_parameter = 1
+
+##
+ # Read all fcoe-client settings
+ # @return true on success
+ #
+@YCPDeclare("boolean")
+def Read():
+ global modified
+
+ # FcoeClient read dialog caption
+ caption = _("Initializing fcoe-client Configuration")
+
+ # TODO FIXME Set the right number of stages
+ steps = 4
+
+ sl = 0.5
+ sleep(sl)
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ ycp.Progress.New(caption, " ", steps, [
+ # Progress stage 1/3
+ _("Read the database"),
+ # Progress stage 2/3
+ _("Read the previous settings"),
+ # Progress stage 3/3
+ _("Detect the devices")
+ ], [
+ # Progress step 1/3
+ _("Reading the database..."),
+ # Progress step 2/3
+ _("Reading the previous settings..."),
+ # Progress step 3/3
+ _("Detecting the devices..."),
+ # Progress finished
+ _("Finished")
+ ],
+ ""
+ )
+
+ # read database
+ ycp.Progress.NextStage();
+ # Error message
+ if False:
+ ycp.Report.Error(_("Cannot read the database1."))
+ sleep(sl)
+
+ # read another database
+ ycp.Progress.NextStep()
+ # Error message
+ if False:
+ ycp.Report.Error(_("Cannot read the database2."))
+ sleep(sl)
+
+ # read current settings
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Error(ycp.Message.CannotReadCurrentSettings())
+ sleep(sl)
+
+ # detect devices
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Warning(_("Cannot detect devices."))
+ sleep(sl)
+
+ # Progress finished
+ ycp.Progress.NextStage()
+ sleep(sl)
+
+ modified = False
+
+ return True
+
+##
+ # Write all fcoe-client settings
+ # @return true on success
+ #
+@YCPDeclare("boolean")
+def Write():
+ # FcoeClient read dialog caption
+ caption = _("Saving fcoe-client Configuration")
+
+ # TODO FIXME And set the right number of stages
+ steps = 2
+
+ sl = 0.5
+ sleep(sl)
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ ycp.Progress.New(caption, " ", steps, [
+ # Progress stage 1/2
+ _("Write the settings"),
+ # Progress stage 2/2
+ _("Run SuSEconfig")
+ ], [
+ # Progress step 1/2
+ _("Writing the settings..."),
+ # Progress step 2/2
+ _("Running SuSEconfig..."),
+ # Progress finished
+ _("Finished")
+ ],
+ ""
+ )
+
+ # write settings
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Error (_("Cannot write settings."))
+ sleep(sl)
+
+ # run SuSEconfig
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Error(ycp.Message.SuSEConfigFailed())
+ sleep(sl)
+
+ # Progress finished
+ ycp.Progress.NextStage()
+ sleep(sl)
+
+ return True
+
+##
+ # Get all fcoe-client settings from the first parameter
+ # (For use by autoinstallation.)
+ # @param settings The YCP structure to be imported.
+ # @return boolean True on success
+ #
+@YCPDeclare("boolean", "map")
+def Import(map_settings):
+ # TODO FIXME: your code here (fill the above mentioned variables)...
+ return True
+
+##
+ # Dump the fcoe-client settings to a single map
+ # (For use by autoinstallation.)
+ # @return map Dumped settings (later acceptable by Import ())
+ #
+@YCPDeclare("map")
+def Export():
+ # TODO FIXME: your code here (return the above mentioned variables)...
+ return {}
+
+##
+ # Create a textual summary and a list of unconfigured cards
+ # @return summary of the current configuration
+ #
+@YCPDeclare("list")
+def Summary():
+ # TODO FIXME: your code here...
+ # Configuration summary text for autoyast
+ return [ _("Configuration summary ...") ]
+
+##
+ # Create an overview table with all configured cards
+ # @return table items
+ #
+@YCPDeclare("list")
+def Overview():
+ # TODO FIXME: your code here...
+ return []
+
+##
+ # Return packages needed to be installed and removed during
+ # Autoinstallation to insure module has all needed software
+ # installed.
+ # @return map with 2 lists.
+ #
+@YCPDeclare("map")
+def AutoPackages():
+ # TODO FIXME: your code here...
+ return {
+ "install" : [],
+ "remove" : []
+ }
+
+# EOF
Added: trunk/fcoe-client/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/Makefile.am?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/Makefile.am (added)
+++ trunk/fcoe-client/src/Makefile.am Tue Apr 19 13:00:01 2011
@@ -0,0 +1,31 @@
+# Makefile.am for fcoe-client/src
+
+yncludedir = @yncludedir@/fcoe-client
+
+client_DATA = \
+ fcoe-client.ycp \
+ fcoe-client_auto.ycp \
+ fcoe-client_proposal.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ fcoe-client.desktop
+
+module_DATA = \
+ FcoeClient.ycp \
+ FcoeClient2.pm \
+ FcoeClient3.py
+
+# create a symlink for local build, #145327
+fcoe-client:
+ ln -sf . $@
+ycpchook = fcoe-client
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/fcoe-client/src/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/_cvsignore?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/_cvsignore (added)
+++ trunk/fcoe-client/src/_cvsignore Tue Apr 19 13:00:01 2011
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/fcoe-client/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/complex.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/complex.ycp (added)
+++ trunk/fcoe-client/src/complex.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,138 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/fcoe-client/complex.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+textdomain "fcoe-client";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "FcoeClient";
+
+
+include "fcoe-client/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return FcoeClient::Modified();
+}
+
+boolean ReallyAbort() {
+ return !FcoeClient::Modified() || Popup::ReallyAbort(true);
+}
+
+boolean PollAbort() {
+ return UI::PollInput() == `abort;
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ // FcoeClient::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = FcoeClient::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // FcoeClient::SetAbortFunction(PollAbort);
+ boolean ret = FcoeClient::Write();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Init
+ **/
+void InitServicesDialog (string id) {
+ y2milestone( "Init services dialog" );
+}
+
+void InitInterfacesDialog (string id) {
+ y2milestone( "Init interfaces dialog" );
+}
+
+void InitConfigurationDialog (string id) {
+ y2milestone( "Init configuration dialog" );
+}
+
+/**
+ * Handle
+ **/
+symbol HandleServicesDialog( string id, map event )
+{
+ any action = event["ID"]:nil;
+ return nil;
+}
+
+symbol HandleInterfacesDialog( string id, map event )
+{
+ any action = event["ID"]:nil;
+ y2milestone( "Action: %1, returning `edit", action);
+ if ( action == `edit )
+ return `edit;
+ return nil;
+}
+
+symbol HandleConfigurationDialog( string id, map event )
+{
+ any action = event["ID"]:nil;
+ return nil;
+}
+
+/**
+ * Store
+ **/
+
+void StoreServicesDialog (string id, map event) {
+ y2milestone( "Store services dialog" );
+}
+
+void StoreInterfacesDialog (string id, map event) {
+ y2milestone( "Store interfaces dialog" );
+}
+
+void StoreConfigurationDialog (string id, map event) {
+ y2milestone( "Store configuration dialog" );
+}
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/dialogs.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/dialogs.ycp (added)
+++ trunk/fcoe-client/src/dialogs.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,128 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/fcoe-client/dialogs.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+ textdomain "fcoe-client";
+
+ import "Label";
+ import "Wizard";
+ import "FcoeClient";
+
+ include "fcoe-client/helps.ycp";
+
+integer mbox_x = 1;
+integer mbox_y = 0.5;
+
+term items = `VBox(
+ `VSpacing (0.4),
+ `Left (`RadioButton (`id ("startup_auto"), `opt (`notify),
+ "When Booting")),
+ `Left (`RadioButton (`id ("startup_manual"), `opt (`notify),
+ "Manually")
+ ),
+ `VSpacing (0.4)
+ );
+
+symbol EditDialog() {
+
+ y2milestone( "Edit dialog ***" );
+ return `next;
+}
+
+/**
+ * Services dialog
+ * @return term
+ */
+
+term ServicesDialogContent () {
+
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox (
+ `VSpacing(2.0),
+ // frame
+ `Frame (_("Service Start"),
+ `VBox (`RadioButtonGroup (`id ("service_startup"), items))
+ ),
+ `VStretch()
+ )
+ );
+}
+
+/**
+ * Interfaces dialog
+ * @return term
+ */
+term InterfacesDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `Table(`id(`interfaces), `opt(`notify, `immediate ),
+ `header(_("Portal Address"), _("Target Name"), _("Start-Up")),
+ []
+ ),
+ `Left(`HBox(
+ `PushButton(`id(`add), _("Add")),
+ `PushButton(`id(`edit), _("Edit"))
+ ))
+ )
+ );
+}
+
+/**
+ * Configuration dialog
+ * @return term
+ */
+term ConfigurationDialogContent() {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VSpacing(2.0),
+ `Frame (
+ // Frame label - configuration settings of FCoE
+ _("Configuration Settings"),
+ `VBox (
+ // ComboBox label
+ `Left(`ComboBox(`id("debug"), _("&Debug"),
+ [`item(`id("yes"), "yes", true ),
+ `item(`id("no"), "no" )
+ ])
+ ),
+ `Left(`ComboBox(`id("syslog"), _("&Use syslog"),
+ [`item(`id("yes"), "yes", true ),
+ `item(`id("no"), "no" )
+ ])
+ )
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/fcoe-client.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/fcoe-client.desktop?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/fcoe-client.desktop (added)
+++ trunk/fcoe-client/src/fcoe-client.desktop Tue Apr 19 13:00:01 2011
@@ -0,0 +1,25 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=fcoe-client
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=fcoe-client
+
+Icon=yast-fcoe-client
+Exec=/sbin/yast2 fcoe-client
+
+Name=FcoeClient
+GenericName=fcoe-client
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: trunk/fcoe-client/src/fcoe-client.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/fcoe-client.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/fcoe-client.ycp (added)
+++ trunk/fcoe-client/src/fcoe-client.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,93 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/fcoe-client.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Main file
+ * Authors: Gabriele Mohr
+ *
+ * $Id: fcoe-client.ycp 27914 2006-02-13 14:32:08Z locilka $
+ *
+ * Main file for fcoe-client configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of fcoe-client</h3>
+ */
+
+textdomain "fcoe-client";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("FcoeClient module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+include "fcoe-client/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "fcoe-client",
+ /* Command line help text for the Xfcoe-client module */
+ "help" : _("Configuration of fcoe-client"),
+ "guihandler" : FcoeClientSequence,
+ "initialize" : FcoeClient::Read,
+ "finish" : FcoeClient::Write,
+ "actions" : $[
+ // FIXME TODO: fill the functionality description here
+ ],
+ "options" : $[
+ // FIXME TODO: fill the option descriptions here
+ ],
+ "mappings" : $[
+ // FIXME TODO: fill the mappings of actions and options here
+ ]
+];
+
+/* is this proposal or not? */
+boolean propose = false;
+list args = WFM::Args();
+if(size(args) > 0) {
+ if(is(WFM::Args(0), path) && WFM::Args(0) == .propose) {
+ y2milestone("Using PROPOSE mode");
+ propose = true;
+ }
+}
+
+/* main ui function */
+any ret = nil;
+
+if(propose) ret = FcoeClientAutoSequence();
+else ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("FcoeClient module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/fcoe-client_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/fcoe-client_auto.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/fcoe-client_auto.ycp (added)
+++ trunk/fcoe-client/src/fcoe-client_auto.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,133 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/fcoe-client_auto.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Client for autoinstallation
+ * Authors: Gabriele Mohr
+ *
+ *
+ * This is a client for autoinstallation. It takes its arguments,
+ * goes through the configuration and return the setting.
+ * Does not do any changes to the configuration.
+ */
+
+/**
+ * @param function to execute
+ * @param map/list of fcoe-client settings
+ * @return map edited settings, Summary or boolean on success depending on called function
+ * @example map mm = $[ "FAIL_DELAY" : "77" ];
+ * @example map ret = WFM::CallFunction ("fcoe-client_auto", [ "Summary", mm ]);
+ */
+
+{
+
+textdomain "fcoe-client";
+
+y2milestone("----------------------------------------");
+y2milestone("FcoeClient auto started");
+
+import "FcoeClient";
+include "fcoe-client/wizards.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map) WFM::Args(1);
+}
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+/* Create a summary*/
+if(func == "Summary") {
+ ret = select(FcoeClient::Summary(), 0, "");
+}
+/* Reset configuration */
+else if (func == "Reset") {
+ FcoeClient::Import($[]);
+ ret = $[];
+}
+/* Change configuration (run AutoSequence) */
+else if (func == "Change") {
+ ret = FcoeClientAutoSequence();
+}
+/* Import configuration */
+else if (func == "Import") {
+ ret = FcoeClient::Import(param);
+}
+/* Return actual state */
+else if (func == "Export") {
+ ret = FcoeClient::Export();
+}
+/* Return needed packages */
+else if (func == "Packages") {
+ ret = FcoeClient::AutoPackages();
+}
+/* Read current state */
+else if (func == "Read") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ ret = FcoeClient::Read();
+ Progress::set (progress_orig);
+}
+/* Write givven settings */
+else if (func == "Write") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ FcoeClient::SetWriteOnly (true);
+ ret = FcoeClient::Write();
+ Progress::set (progress_orig);
+}
+/**
+ * did configuration changed
+ * return boolean
+ */
+else if (func == "GetModified") {
+ ret = FcoeClient::Modified ();
+}
+/**
+ * set configuration as changed
+ * return boolean
+ */
+else if (func == "SetModified") {
+ FcoeClient::SetModified (true);
+ ret = true;
+}
+
+/* Unknown function */
+else {
+ y2error("Unknown function: %1", func);
+ ret = false;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("FcoeClient auto finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/fcoe-client_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/fcoe-client_proposal.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/fcoe-client_proposal.ycp (added)
+++ trunk/fcoe-client/src/fcoe-client_proposal.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,106 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/fcoe-client_proposal.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Proposal function dispatcher.
+ * Authors: Gabriele Mohr
+ *
+ *
+ * Proposal function dispatcher for fcoe-client configuration.
+ * See source/installation/proposal/proposal-API.txt
+ */
+
+{
+
+textdomain "fcoe-client";
+
+import "FcoeClient";
+import "Progress";
+
+/* The main () */
+y2milestone("----------------------------------------");
+y2milestone("FcoeClient proposal started");
+
+string func = (string) WFM::Args(0);
+map param = (map) WFM::Args(1);
+map ret = $[];
+
+/* create a textual proposal */
+if(func == "MakeProposal") {
+ string proposal = "";
+ string warning = nil;
+ symbol warning_level = nil;
+ boolean force_reset = param["force_reset"]:false;
+
+ if(force_reset || !FcoeClient::ProposalValid()) {
+ FcoeClient::SetProposalValid (true);
+ boolean progress_orig = Progress::set (false);
+ FcoeClient::Read();
+ Progress::set (progress_orig);
+ }
+ list sum = FcoeClient::Summary();
+ proposal = sum[0]:"";
+
+ ret = $[
+ "preformatted_proposal" : proposal,
+ "warning_level" : warning_level,
+ "warning" : warning,
+ ];
+}
+/* run the module */
+else if(func == "AskUser") {
+ map stored = FcoeClient::Export();
+ symbol seq = (symbol) WFM::CallFunction("fcoe-client", [.propose]);
+ if(seq != `next) FcoeClient::Import(stored);
+ y2debug("stored=%1",stored);
+ y2debug("seq=%1",seq);
+ ret = $[
+ "workflow_sequence" : seq
+ ];
+}
+/* create titles */
+else if(func == "Description") {
+ ret = $[
+ /* Rich text title for FcoeClient in proposals */
+ "rich_text_title" : _("FcoeClient"),
+ /* Menu title for FcoeClient in proposals */
+ "menu_title" : _("&FcoeClient"),
+ "id" : "fcoe-client",
+ ];
+}
+/* write the proposal */
+else if(func == "Write") {
+ FcoeClient::Write();
+}
+/* unknown function */
+else {
+ y2error("unknown function: %1", func);
+}
+
+/* Finish */
+y2debug("ret=%1",ret);
+y2milestone("FcoeClient proposal finished");
+y2milestone("----------------------------------------");
+return ret;
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/helps.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/helps.ycp (added)
+++ trunk/fcoe-client/src/helps.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,118 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/fcoe-client/helps.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Help texts of all the dialogs
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+textdomain "fcoe-client";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing fcoe-client Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Read dialog help 2/2 */
+ _("<p><b><big>Aborting Initialization:</big></b><br>
+Safely abort the configuration utility by pressing <b>Abort</b> now.</p>
+"),
+
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving fcoe-client Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Write dialog help 2/2 */
+_("<p><b><big>Aborting Saving:</big></b><br>
+Abort the save procedure by pressing <b>Abort</b>.
+An additional dialog informs whether it is safe to do so.
+</p>
+"),
+
+ /* Summary dialog help 1/3 */
+ "summary" : _("<p><b><big>FcoeClient Configuration</big></b><br>
+Configure fcoe-client here.<br></p>
+") +
+
+ /* Summary dialog help 2/3 */
+ _("<p><b><big>Adding a fcoe-client:</big></b><br>
+Choose an fcoe-client from the list of detected fcoe-clients.
+If your fcoe-client was not detected, use <b>Other (not detected)</b>.
+Then press <b>Configure</b>.</p>
+") +
+
+ /* Summary dialog help 3/3 */
+ _("<p><b><big>Editing or Deleting:</big></b><br>
+If you press <b>Edit</b>, an additional dialog in which to change
+the configuration opens.</p>
+"),
+
+ /* Ovreview dialog help 1/3 */
+ "overview" : _("<p><b><big>FcoeClient Configuration Overview</big></b><br>
+Obtain an overview of installed fcoe-clients. Additionally
+edit their configurations.<br></p>
+") +
+
+ /* Ovreview dialog help 2/3 */
+_("<p><b><big>Adding a fcoe-client:</big></b><br>
+Press <b>Add</b> to configure a fcoe-client.</p>") +
+
+ /* Ovreview dialog help 3/3 */
+_("<p><b><big>Editing or Deleting:</big></b><br>
+Choose a fcoe-client to change or remove.
+Then press <b>Edit</b> or <b>Delete</b> as desired.</p>
+"),
+
+ /* Configure1 dialog help 1/2 */
+ "c1" : _("<p><b><big>Configuration Part One</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>") +
+
+ /* Configure1 dialog help 2/2 */
+_("<p><b><big>Selecting Something</big></b><br>
+It is not possible. You must code it first. :-)
+</p>"),
+
+ /* Configure2 dialog help 1/2 */
+ "c2" : _("<p><b><big>Configuration Part Two</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>
+") +
+
+ /* Configure2 dialog help 2/2 */
+_("<p><b><big>Selecting Something</big></b><br>
+It is not possible. You must code it first. :-)
+</p>"),
+
+];
+
+/* EOF */
+}
Added: trunk/fcoe-client/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/wizards.ycp?rev=63827&view=auto
==============================================================================
--- trunk/fcoe-client/src/wizards.ycp (added)
+++ trunk/fcoe-client/src/wizards.ycp Tue Apr 19 13:00:01 2011
@@ -0,0 +1,226 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/fcoe-client/wizards.ycp
+ * Package: Configuration of fcoe-client
+ * Summary: Wizards definitions
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+ textdomain "fcoe-client";
+
+ import "Sequencer";
+ import "Wizard";
+ import "CWM";
+ import "CWMTab";
+ import "CWMServiceStart";
+
+ include "fcoe-client/complex.ycp";
+ include "fcoe-client/dialogs.ycp";
+
+
+/**
+ * Main workflow of the fcoe-client configuration
+ * @return sequence result
+ */
+
+any GlobalDialog() {
+
+ map > widgets =
+ $[
+ "serv" : $[
+ "widget" : `custom,
+ "help" : HELPS["services"]:"",
+ "custom_widget" : ServicesDialogContent(),
+ "handle" : HandleServicesDialog,
+ "init" : InitServicesDialog,
+ "store" : StoreServicesDialog,
+ ],
+ "inter" : $[
+ "widget" : `custom,
+ "help" : HELPS["interfaces"]:"",
+ "custom_widget" : InterfacesDialogContent(),
+ "handle" : HandleInterfacesDialog,
+ "init" : InitInterfacesDialog,
+ "store" : StoreInterfacesDialog,
+ ],
+ "config" : $[
+ "widget" : `custom,
+ "help" : HELPS["configuration"]:"",
+ "custom_widget" : ConfigurationDialogContent(),
+ "init" : InitConfigurationDialog,
+ "handle" : HandleConfigurationDialog,
+ "store" : StoreConfigurationDialog,
+ ],
+ ];
+ map tabs =
+ $[
+ "services" : $[
+ // Header of tab in tab widget
+ "header" : _("&Services"),
+ "widget_names" : ["serv"],
+ "contents" : ServicesDialogContent(),
+ ],
+ "interfaces" : $[
+ // Header of tab in tab widget
+ "header" : _("&Interfaces"),
+ "widget_names" : ["inter"],
+ "contents" : InterfacesDialogContent(),
+ ],
+ "configuration" : $[
+ // Header of tab in tab widget
+ "header" : _("&Configuration"),
+ "widget_names" : ["config"],
+ "contents" : ConfigurationDialogContent(),
+ ],
+ ];
+
+ string ini_tab = "";
+
+ if ( true ) // TODO: check lldpad / fcoemon running
+ ini_tab = "interfaces";
+ else
+ ini_tab = "services";
+
+ map wd =
+ $[
+ "tab" : CWMTab::CreateWidget (
+ $[
+ "tab_order" : ["services", "interfaces", "configuration"],
+ "tabs" : tabs,
+ "widget_descr" : widgets,
+ "initial_tab" : ini_tab,
+ ])
+ ];
+
+ term contents = `VBox("tab");
+
+ list