Author: mzugec
Date: Thu Aug 21 16:41:12 2008
New Revision: 50283
URL: http://svn.opensuse.org/viewcvs/yast?rev=50283&view=rev
Log:
initial commit
Added:
branches/tmp/mzugec/supportconfig/
branches/tmp/mzugec/supportconfig/MAINTAINER
branches/tmp/mzugec/supportconfig/src/
branches/tmp/mzugec/supportconfig/src/.cvsignore
branches/tmp/mzugec/supportconfig/src/.dep
branches/tmp/mzugec/supportconfig/src/Makefile.am
branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp
branches/tmp/mzugec/supportconfig/src/complex.ycp
branches/tmp/mzugec/supportconfig/src/dialogs.ycp
branches/tmp/mzugec/supportconfig/src/helps.ycp
branches/tmp/mzugec/supportconfig/src/supportconfig (with props)
branches/tmp/mzugec/supportconfig/src/supportconfig.desktop
branches/tmp/mzugec/supportconfig/src/supportconfig.ycp
branches/tmp/mzugec/supportconfig/src/supportconfig_auto.ycp
branches/tmp/mzugec/supportconfig/src/supportconfig_proposal.ycp
branches/tmp/mzugec/supportconfig/src/wizards.ycp
Added: branches/tmp/mzugec/supportconfig/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/MAINTAINER?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/MAINTAINER (added)
+++ branches/tmp/mzugec/supportconfig/MAINTAINER Thu Aug 21 16:41:12 2008
@@ -0,0 +1 @@
+Michal Zugec
Added: branches/tmp/mzugec/supportconfig/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/.cvsignore?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/.cvsignore (added)
+++ branches/tmp/mzugec/supportconfig/src/.cvsignore Thu Aug 21 16:41:12 2008
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: branches/tmp/mzugec/supportconfig/src/.dep
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/.dep?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/.dep (added)
+++ branches/tmp/mzugec/supportconfig/src/.dep Thu Aug 21 16:41:12 2008
@@ -0,0 +1,7 @@
+Supportconfig.ybc: \
+ /usr/share/YaST2/modules/Progress.ybc \
+ /usr/share/YaST2/modules/Report.ybc \
+ /usr/share/YaST2/modules/Summary.ybc \
+ /usr/share/YaST2/modules/Message.ybc \
+ /usr/share/YaST2/modules/Map.ybc
+
Added: branches/tmp/mzugec/supportconfig/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/Makefile.am?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/Makefile.am (added)
+++ branches/tmp/mzugec/supportconfig/src/Makefile.am Thu Aug 21 16:41:12 2008
@@ -0,0 +1,29 @@
+# Makefile.am for supportconfig/src
+
+yncludedir = @yncludedir@/supportconfig
+
+client_DATA = \
+ supportconfig.ycp \
+ supportconfig_auto.ycp \
+ supportconfig_proposal.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ supportconfig.desktop
+
+module_DATA = \
+ Supportconfig.ycp
+
+# create a symlink for local build, #145327
+supportconfig:
+ ln -sf . $@
+ycpchook = supportconfig
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,351 @@
+/* ------------------------------------------------------------------------------
+ * 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/Supportconfig.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Supportconfig settings, input and output functions
+ * Authors: Michal Zugec
+ *
+ * $Id: Supportconfig.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Representation of the configuration of supportconfig.
+ * Input and output routines.
+ */
+
+{
+
+module "Supportconfig";
+textdomain "supportconfig";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+import "Map";
+
+/**
+ * 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;
+}
+
+// content of /etc/supportconfig.conf
+map configuration = $[];
+
+// options parsed from configuration map
+global map options = $[];
+
+// command line parameters for supportconfig
+global boolean use_defaults=false;
+global boolean full_listening=false;
+global boolean exclude_disk_scan=false;
+global boolean search_for_edir=false;
+global boolean full_logging=false;
+global boolean minimal_logs=false;
+global boolean include_slp=false;
+global boolean rpm_check=false;
+global string novell_number="";
+
+global string proposed_log_path="/tmp/onstar";
+
+// Settings: Define all variables needed for configuration of supportconfig
+// 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 supportconfig settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* Supportconfig read dialog caption */
+ string caption = _("Initializing supportconfig Configuration");
+
+ // TODO FIXME 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/3 */
+ _("Read the configuration")
+ ], [
+ /* 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();
+ configuration = (map)SCR::Read(.etc.onstar.all);
+ foreach(map row, configuration["value"]:[], {
+ options[row["name"]:""]=row["value"]:"";
+ });
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+
+ // read current settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ if(Abort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write all supportconfig settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* Supportconfig read dialog caption */
+ string caption = _("Saving supportconfig 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;
+}
+
+global boolean WriteConfig(){
+ y2milestone("Writing /etc/supportconfig.conf configuration");
+ list new_config=[];
+ list<string>used_options=[];
+ foreach(map row, configuration["value"]:[], {
+ row["value"] = options[ row["name"]:"" ]:"";
+ new_config=add(new_config, row);
+ used_options=add(used_options, row["name"]:"");
+ });
+ foreach(string key, (list<string>)Map::Keys(options), {
+ if(!contains(used_options, key)){
+ y2milestone("new option (not in old configuration) %1=%2", key, options[key]:"");
+ new_config=add(new_config, $[
+ "name" : key,
+ "value" : options[key]:"",
+ "comment" : "",
+ "kind" : "value",
+ "type" : 1
+ ]);
+ }
+ });
+ configuration["value"]=new_config;
+ y2internal("Write:%1", SCR::Write(.etc.onstar.all, configuration));
+ y2internal("Write:%1", SCR::Write(.etc.onstar, nil));
+ return true;
+}
+
+/**
+ * Get all supportconfig 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 supportconfig 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: branches/tmp/mzugec/supportconfig/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/complex.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/complex.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/complex.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,86 @@
+/* ------------------------------------------------------------------------------
+ * 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/supportconfig/complex.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Dialogs definitions
+ * Authors: Michal Zugec
+ *
+ * $Id: complex.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ */
+
+{
+
+textdomain "supportconfig";
+
+import "Label";
+import "Popup";
+import "Wizard";
+//import "Wizard_hw";
+import "Confirm";
+import "Supportconfig";
+
+
+include "supportconfig/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return Supportconfig::Modified();
+}
+
+boolean ReallyAbort() {
+ return !Supportconfig::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"]:"");
+ // Supportconfig::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = Supportconfig::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // Supportconfig::SetAbortFunction(PollAbort);
+ boolean ret = Supportconfig::Write();
+ return ret ? `next : `abort;
+}
+
+
+
+/* EOF */
+}
Added: branches/tmp/mzugec/supportconfig/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/dialogs.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/dialogs.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/dialogs.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,325 @@
+/* ------------------------------------------------------------------------------
+ * 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/supportconfig/dialogs.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Dialogs definitions
+ * Authors: Michal Zugec
+ *
+ * $Id: dialogs.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "supportconfig";
+
+import "Label";
+import "Wizard";
+import "Supportconfig";
+import "Map";
+
+include "supportconfig/helps.ycp";
+
+
+/**
+ * Configure1 dialog
+ * @return dialog result
+ */
+any Configure1Dialog () {
+
+ /* Supportconfig configure1 dialog caption */
+ string caption = _("OnStar Configuration (1/3)");
+
+ list<term> items = [
+ `item(`id(`use_defaults), _("Use Defaults (ignore /etc/supportconfig.conf)"), Supportconfig::use_defaults),
+ `item(`id(`full_listening), _("Create a full file listing from '/'"), Supportconfig::full_listening),
+ `item(`id(`exclude_disk_scan), _("Exclude detailed disk info and scans"), Supportconfig::exclude_disk_scan),
+ `item(`id(`search_for_edir), _("Search root filesystem for eDirectory instances"), Supportconfig::search_for_edir),
+ `item(`id(`full_logging), _("Activates all supportconfig functions"), Supportconfig::full_logging),
+ `item(`id(`minimal_logs), _("Only gather a minimum amount of info"), Supportconfig::minimal_logs),
+ `item(`id(`include_slp), _("Include full SLP service lists"), Supportconfig::include_slp),
+ `item(`id(`rpm_check), _("Performs an rpm -V for each installed rpm"), Supportconfig::rpm_check)
+ ];
+ /* Supportconfig configure1 dialog contents */
+ term contents = `VBox(
+ `Left(
+ `HBox(
+ `InputField(`id(`log_dir), _("Log directory"), Supportconfig::proposed_log_path),
+ `VBox(`Label(""), `PushButton(`id(`browse), Label::BrowseButton()))
+ )),
+ `MultiSelectionBox(`id(`options), _("Options"), items)
+ );
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["c1"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ list selected=(list)UI::QueryWidget(`options, `SelectedItems);
+ Supportconfig::use_defaults=contains(selected, `use_defaults);
+ Supportconfig::full_listening=contains(selected, `full_listening);
+ Supportconfig::exclude_disk_scan=contains(selected, `exclude_disk_scan);
+ Supportconfig::search_for_edir=contains(selected, `search_for_edir);
+ Supportconfig::full_logging=contains(selected, `full_logging);
+ Supportconfig::minimal_logs=contains(selected, `minimal_logs);
+ Supportconfig::include_slp=contains(selected, `include_slp);
+ Supportconfig::rpm_check=contains(selected, `rpm_check);
+ Supportconfig::proposed_log_path=(string)UI::QueryWidget(`log_dir, `Value);
+ // if "use defaults" is not checked, go to detailed dialog
+ if (!Supportconfig::use_defaults) ret = `details;
+ break;
+ }
+ else if (ret == `browse){
+ string dir = UI::AskForExistingDirectory((string)UI::QueryWidget(`log_dir, `Value), _("Select directory to store log files"));
+ if (dir!=nil) UI::ChangeWidget(`log_dir, `Value, dir);
+ continue;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * Overview dialog
+ * @return dialog result
+ */
+any ConfigurationDialog() {
+
+ /* Supportconfig overview dialog caption */
+ string caption = _("OnStar Detailed Configuration (2/3)");
+
+ list overview = Supportconfig::Overview();
+
+ list<term> bool_items = [];
+ list<term> table_items = [];
+ foreach(string key, (list<string>)Map::Keys(Supportconfig::options), {
+ if (issubstring(key, "VAR_OPTION"))
+ table_items = add(table_items, `item(`id(key), key, Supportconfig::options[key]:""));
+ else
+ bool_items = add(bool_items, `item(`id(key), key, Supportconfig::options[key]:""=="1"));
+ });
+
+ /* FIXME table header */
+ term contents =
+ `HBox(
+ `MultiSelectionBox(`id(`opt_msb), _("Default Options"), bool_items),
+ `VBox(
+ `Table(`id(`var_table), `header(_("Name"), _("Value")), table_items),
+ `PushButton(`id(`edit), Label::EditButton())
+ )
+ );
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ /* edit */
+ else if(ret == `edit) {
+ /* FIXME */
+ any id = UI::QueryWidget(`var_table, `CurrentItem);
+ term row = (term)UI::QueryWidget(`var_table, `Item(id));
+ UI::OpenDialog(`VBox(
+ `InputField(`id(`changed_value), row[1]:"", row[2]:""),
+ `HBox(
+ `PushButton(`id(`cancel), Label::CancelButton()),
+ `PushButton(`id(`ok), Label::OKButton())
+ )
+ ));
+ any ret=UI::UserInput();
+ if (ret==`ok){
+ string new_value = (string)UI::QueryWidget(`id(`changed_value), `Value);
+ if (new_value != row[2]:"") {
+ UI::CloseDialog();
+ UI::ChangeWidget(`id(`var_table), `Cell(`id(id), 1), new_value);
+ continue;
+ }
+ }
+ UI::CloseDialog();
+ continue;
+ }
+ else if(ret == `next || ret == `back) {
+ y2milestone("store configuration for /etc/supportconfig.conf");
+ list selected_items = (list)UI::QueryWidget(`id(`opt_msb), `SelectedItems);
+ foreach(string key, (list<string>)Map::Keys(Supportconfig::options), {
+ string val = Supportconfig::options[key]:"";
+ if (issubstring(key, "VAR_OPTION")){
+ string new_val = (string)UI::QueryWidget(`var_table, `Cell(`id(key), 1));
+ if(new_val!=val){
+ y2internal("value changed %1=%2, new value %3", key, val, new_val);
+ Supportconfig::options[key]=new_val;
+ }
+ } else{
+ boolean bool_val=(contains(selected_items, key));
+ if ((val=="1")!=bool_val){
+ y2internal("value changed %1=%2, new value %3", key, val, bool_val ? "1" : "0");
+ Supportconfig::options[key]=bool_val ? "1" : "0";
+ }
+ }
+ });
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+y2internal("%1", Supportconfig::options);
+ return ret;
+}
+
+/**
+ * Configure2 dialog
+ * @return dialog result
+ */
+any ContactDialog () {
+
+ /* Supportconfig configure2 dialog caption */
+ string caption = _("OnStar Detailed Configuration (3/3)");
+
+ /* Supportconfig configure2 dialog contents */
+ term contents = `VBox(
+ `Frame (_("Contact Informations"), `VBox(
+ `Left(`InputField(`id(`company), _("Company"), Supportconfig::options["VAR_OPTION_CONTACT_COMPANY"]:"")),
+ `Left(`InputField(`id(`email), _("Email Address"), Supportconfig::options["VAR_OPTION_CONTACT_EMAIL"]:"")),
+ `Left(`InputField(`id(`name), _("Name"), Supportconfig::options["VAR_OPTION_CONTACT_NAME"]:"")),
+ `Left(`InputField(`id(`phone), _("Phone Number"), Supportconfig::options["VAR_OPTION_CONTACT_PHONE"]:""))
+ )),
+ `Frame (_("Upload Informations"), `VBox(
+ `Left(`InputField(`id(`target), _("Upload Target"), Supportconfig::options["VAR_OPTION_UPLOAD_TARGET"]:"")),
+ `Left(`InputField(`id(`novell_number), _("Novell 11 digit service request number"), Supportconfig::novell_number))
+ )));
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ Supportconfig::options["VAR_OPTION_CONTACT_COMPANY"]=(string)UI::QueryWidget(`company, `Value);
+ Supportconfig::options["VAR_OPTION_CONTACT_EMAIL"]=(string)UI::QueryWidget(`email, `Value);
+ Supportconfig::options["VAR_OPTION_CONTACT_NAME"]=(string)UI::QueryWidget(`name, `Value);
+ Supportconfig::options["VAR_OPTION_CONTACT_PHONE"]=(string)UI::QueryWidget(`phone, `Value);
+ Supportconfig::options["VAR_OPTION_UPLOAD_TARGET"]=(string)UI::QueryWidget(`target, `Value);
+ Supportconfig::novell_number=(string)UI::QueryWidget(`novell_number, `Value);
+ Supportconfig::WriteConfig();
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+any FilesDialog(){
+ string caption = _("OnStar Included Files Configuration (3/3)");
+ term contents = `VBox(`PushButton(`id(`start_supportconfig), _("Trigger to collect logs")));
+ Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
+ Label::BackButton(), Label::NextButton());
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else if(ret==`start_supportconfig){
+ y2internal("button pressed");
+ string parameters="";
+ if(Supportconfig::use_defaults) parameters=sformat("%1 %2", parameters, "-D");
+ if(Supportconfig::full_listening) parameters=sformat("%1 %2", parameters, "-L");
+ if(Supportconfig::exclude_disk_scan) parameters=sformat("%1 %2", parameters, "-d");
+ if(Supportconfig::search_for_edir) parameters=sformat("%1 %2", parameters, "-e");
+ if(Supportconfig::full_logging) parameters=sformat("%1 %2", parameters, "-A");
+ if(Supportconfig::minimal_logs) parameters=sformat("%1 %2", parameters, "-m");
+ if(Supportconfig::include_slp) parameters=sformat("%1 %2", parameters, "-s");
+ if(Supportconfig::rpm_check) parameters=sformat("%1 %2", parameters, "-v");
+ if(size(Supportconfig::novell_number)>0) parameters=sformat("%1 %2 %3", parameters, "-r", Supportconfig::novell_number);
+
+ string command = sformat("supportconfig %1 -o %2", parameters, Supportconfig::proposed_log_path);
+ y2internal("command %1", command);
+ map output=(map)SCR::Execute(.target.bash_output, command);
+ y2internal("output %1", output);
+ if (output["exit"]:-1!=0){
+ Popup::Error(output["stdout"]:"");
+ ret=`back;
+ break;
+ }
+ y2internal("output %1", output);
+ output = (map)SCR::Execute(.target.bash_output, sformat("ls -t %1|head -n1", Supportconfig::proposed_log_path));
+ y2internal("output %1", output);
+ if (output["exit"]:-1!=0){
+ Popup::Error(output["stderr"]:"");
+ ret=`back;
+ break;
+ }
+ continue;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+
+}
+
+/* EOF */
+}
Added: branches/tmp/mzugec/supportconfig/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/helps.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/helps.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/helps.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,119 @@
+/* ------------------------------------------------------------------------------
+ * 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/supportconfig/helps.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Help texts of all the dialogs
+ * Authors: Michal Zugec
+ *
+ * $Id: helps.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "supportconfig";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing supportconfig 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 supportconfig 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>Supportconfig Configuration</big></b><br>
+Configure supportconfig here.<br></p>
+") +
+
+ /* Summary dialog help 2/3 */
+ _("<p><b><big>Adding a supportconfig:</big></b><br>
+Choose an supportconfig from the list of detected supportconfigs.
+If your supportconfig 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>Supportconfig Configuration Overview</big></b><br>
+Obtain an overview of installed supportconfigs. Additionally
+edit their configurations.<br></p>
+") +
+
+ /* Ovreview dialog help 2/3 */
+_("<p><b><big>Adding a supportconfig:</big></b><br>
+Press <b>Add</b> to configure a supportconfig.</p>") +
+
+ /* Ovreview dialog help 3/3 */
+_("<p><b><big>Editing or Deleting:</big></b><br>
+Choose a supportconfig 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: branches/tmp/mzugec/supportconfig/src/supportconfig
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/supportconfig?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/supportconfig (added)
+++ branches/tmp/mzugec/supportconfig/src/supportconfig Thu Aug 21 16:41:12 2008
@@ -0,0 +1 @@
+link .
\ No newline at end of file
Added: branches/tmp/mzugec/supportconfig/src/supportconfig.desktop
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/supportconfig.desktop?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/supportconfig.desktop (added)
+++ branches/tmp/mzugec/supportconfig/src/supportconfig.desktop Thu Aug 21 16:41:12 2008
@@ -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=supportconfig
+
+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=supportconfig
+
+Icon=yast-supportconfig
+Exec=/sbin/yast2 supportconfig
+
+Name=Supportconfig
+GenericName=supportconfig
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: branches/tmp/mzugec/supportconfig/src/supportconfig.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/supportconfig.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/supportconfig.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/supportconfig.ycp Thu Aug 21 16:41:12 2008
@@ -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/supportconfig.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Main file
+ * Authors: Michal Zugec
+ *
+ * $Id: supportconfig.ycp 27914 2006-02-13 14:32:08Z locilka $
+ *
+ * Main file for supportconfig configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of supportconfig</h3>
+ */
+
+textdomain "supportconfig";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("Supportconfig module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+include "supportconfig/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "supportconfig",
+ /* Command line help text for the Xsupportconfig module */
+ "help" : _("Configuration of supportconfig"),
+ "guihandler" : SupportconfigSequence,
+ "initialize" : Supportconfig::Read,
+ "finish" : Supportconfig::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 = SupportconfigAutoSequence();
+else ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("Supportconfig module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: branches/tmp/mzugec/supportconfig/src/supportconfig_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/supportconfig_auto.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/supportconfig_auto.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/supportconfig_auto.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,134 @@
+/* ------------------------------------------------------------------------------
+ * 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/supportconfig_auto.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Client for autoinstallation
+ * Authors: Michal Zugec
+ *
+ * $Id: supportconfig_auto.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * 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 supportconfig 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 ("supportconfig_auto", [ "Summary", mm ]);
+ */
+
+{
+
+textdomain "supportconfig";
+
+y2milestone("----------------------------------------");
+y2milestone("Supportconfig auto started");
+
+import "Supportconfig";
+include "supportconfig/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(Supportconfig::Summary(), 0, "");
+}
+/* Reset configuration */
+else if (func == "Reset") {
+ Supportconfig::Import($[]);
+ ret = $[];
+}
+/* Change configuration (run AutoSequence) */
+else if (func == "Change") {
+ ret = SupportconfigAutoSequence();
+}
+/* Import configuration */
+else if (func == "Import") {
+ ret = Supportconfig::Import(param);
+}
+/* Return actual state */
+else if (func == "Export") {
+ ret = Supportconfig::Export();
+}
+/* Return needed packages */
+else if (func == "Packages") {
+ ret = Supportconfig::AutoPackages();
+}
+/* Read current state */
+else if (func == "Read") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ ret = Supportconfig::Read();
+ Progress::set (progress_orig);
+}
+/* Write givven settings */
+else if (func == "Write") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ Supportconfig::SetWriteOnly (true);
+ ret = Supportconfig::Write();
+ Progress::set (progress_orig);
+}
+/**
+ * did configuration changed
+ * return boolean
+ */
+else if (func == "GetModified") {
+ ret = Supportconfig::Modified ();
+}
+/**
+ * set configuration as changed
+ * return boolean
+ */
+else if (func == "SetModified") {
+ Supportconfig::SetModified (true);
+ ret = true;
+}
+
+/* Unknown function */
+else {
+ y2error("Unknown function: %1", func);
+ ret = false;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("Supportconfig auto finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: branches/tmp/mzugec/supportconfig/src/supportconfig_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/supportconfig_proposal.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/supportconfig_proposal.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/supportconfig_proposal.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,107 @@
+/* ------------------------------------------------------------------------------
+ * 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/supportconfig_proposal.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Proposal function dispatcher.
+ * Authors: Michal Zugec
+ *
+ * $Id: supportconfig_proposal.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Proposal function dispatcher for supportconfig configuration.
+ * See source/installation/proposal/proposal-API.txt
+ */
+
+{
+
+textdomain "supportconfig";
+
+import "Supportconfig";
+import "Progress";
+
+/* The main () */
+y2milestone("----------------------------------------");
+y2milestone("Supportconfig 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 || !Supportconfig::ProposalValid()) {
+ Supportconfig::SetProposalValid (true);
+ boolean progress_orig = Progress::set (false);
+ Supportconfig::Read();
+ Progress::set (progress_orig);
+ }
+ list sum = Supportconfig::Summary();
+ proposal = sum[0]:"";
+
+ ret = $[
+ "preformatted_proposal" : proposal,
+ "warning_level" : warning_level,
+ "warning" : warning,
+ ];
+}
+/* run the module */
+else if(func == "AskUser") {
+ map stored = Supportconfig::Export();
+ symbol seq = (symbol) WFM::CallFunction("supportconfig", [.propose]);
+ if(seq != `next) Supportconfig::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 Supportconfig in proposals */
+ "rich_text_title" : _("Supportconfig"),
+ /* Menu title for Supportconfig in proposals */
+ "menu_title" : _("&Supportconfig"),
+ "id" : "supportconfig",
+ ];
+}
+/* write the proposal */
+else if(func == "Write") {
+ Supportconfig::Write();
+}
+/* unknown function */
+else {
+ y2error("unknown function: %1", func);
+}
+
+/* Finish */
+y2debug("ret=%1",ret);
+y2milestone("Supportconfig proposal finished");
+y2milestone("----------------------------------------");
+return ret;
+
+/* EOF */
+}
Added: branches/tmp/mzugec/supportconfig/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/wizards.ycp?rev=50283&view=auto
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/wizards.ycp (added)
+++ branches/tmp/mzugec/supportconfig/src/wizards.ycp Thu Aug 21 16:41:12 2008
@@ -0,0 +1,145 @@
+/* ------------------------------------------------------------------------------
+ * 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/supportconfig/wizards.ycp
+ * Package: Configuration of supportconfig
+ * Summary: Wizards definitions
+ * Authors: Michal Zugec
+ *
+ * $Id: wizards.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "supportconfig";
+
+import "Sequencer";
+import "Wizard";
+
+include "supportconfig/complex.ycp";
+include "supportconfig/dialogs.ycp";
+
+
+/**
+ * Main workflow of the supportconfig configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ /* FIXME: adapt to your needs */
+ map aliases = $[
+ "config1" : ``(Configure1Dialog()),
+ "config_details" : ``( ConfigurationDialog() ),
+ "contact" : ``(ContactDialog()),
+ "files" : ``(FilesDialog()),
+ ];
+
+ /* FIXME: adapt to your needs */
+ map sequence = $[
+ "ws_start" : "config1",
+ "config1" : $[
+ `abort : `abort,
+ `next : "contact",
+ `details : "config_details"
+ ],
+ "config_details" : $[
+ `abort : `abort,
+ `back : `back,
+ `next : "contact",
+ ],
+ "contact" : $[
+ `abort : `abort,
+ `back : `back,
+ `next : "files",
+ ],
+ "files" : $[
+ `abort : `abort,
+ `back : `back,
+ `next : `next,
+
+ ]
+ ];
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Whole configuration of supportconfig
+ * @return sequence result
+ */
+any SupportconfigSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/**
+ * Whole configuration of supportconfig but without reading and writing.
+ * For use with autoinstallation.
+ * @return sequence result
+ */
+any SupportconfigAutoSequence() {
+
+ /* Initialization dialog caption */
+ string caption = _("Supportconfig Configuration");
+ /* Initialization dialog contents */
+ term contents = `Label(_("Initializing..."));
+
+ Wizard::CreateDialog();
+ Wizard::SetContentsButtons(caption, contents, "",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = MainSequence();
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/* EOF */
+}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org