Author: mzugec
Date: Thu Sep 4 12:10:56 2008
New Revision: 50644
URL: http://svn.opensuse.org/viewcvs/yast?rev=50644&view=rev
Log:
complete workflow
Modified:
branches/tmp/mzugec/supportconfig/VERSION
branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes
branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp
branches/tmp/mzugec/supportconfig/src/dialogs.ycp
branches/tmp/mzugec/supportconfig/src/wizards.ycp
Modified: branches/tmp/mzugec/supportconfig/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/VERSION?rev=50644&r1=50643&r2=50644&view=diff
==============================================================================
--- branches/tmp/mzugec/supportconfig/VERSION (original)
+++ branches/tmp/mzugec/supportconfig/VERSION Thu Sep 4 12:10:56 2008
@@ -1 +1 @@
-2.17.0
+2.17.1
Modified: branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes?rev=50644&r1=50643&r2=50644&view=diff
==============================================================================
--- branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes (original)
+++ branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes Thu Sep 4 12:10:56 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Sep 4 12:10:27 CEST 2008 - mzugec@suse.cz
+
+- complete workflow
+- 2.17.1
+
+-------------------------------------------------------------------
Fri Aug 22 14:37:34 CEST 2008 - mzugec@suse.cz
- fixed spec file
Modified: branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp?rev=50644&r1=50643&r2=50644&view=diff
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp (original)
+++ branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp Thu Sep 4 12:10:56 2008
@@ -265,8 +265,11 @@
// write settings
if(Abort()) return false;
Progress::NextStage();
+ string command = sformat("supportconfig %1 -f %2", GetParameterList(), proposed_log_path);
+ map output = (map)SCR::Execute(.target.bash_output, command);
+ y2milestone("output %1", output);
/* Error message */
- if(false) Report::Error (_("Cannot write settings."));
+ if (output["exit"]:-1 != 0) Report::Error (_("Cannot write settings."));
sleep(sl);
// run SuSEconfig
Modified: branches/tmp/mzugec/supportconfig/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/dialogs.ycp?rev=50644&r1=50643&r2=50644&view=diff
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/dialogs.ycp (original)
+++ branches/tmp/mzugec/supportconfig/src/dialogs.ycp Thu Sep 4 12:10:56 2008
@@ -71,6 +71,8 @@
Wizard::SetContentsButtons(caption, contents, HELPS["c1"]:"",
Label::BackButton(), Label::NextButton());
+ Wizard::DisableBackButton();
+
any ret = nil;
while(true) {
@@ -261,82 +263,88 @@
return ret;
}
-/**
- *
- */
+
+symbol GenerateDialog () {
+ string cmd = sformat("supportconfig %1 -t %2", Supportconfig::GetParameterList(), Supportconfig::proposed_log_path);
+ string caption = _("Collecting Data");
+ term contents = `VBox (
+ `LogView (`id (`log), _("Progress"), 1000, 1000)
+ );
+ Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
+ Label::BackButton(), Label::NextButton());
+ symbol ret = nil;
+ integer pid = (integer) SCR::Execute(.process.start_shell, cmd);
+ string unfinished_line = "";
+ Wizard::DisableNextButton ();
+ while (true) {
+ sleep (100);
+ if (SCR::Read (.process.running, pid) == true) {
+ string new_text = (string)SCR::Read (.process.read, pid);
+ if (new_text != nil)
+ UI::ChangeWidget (`id (`log), `LastLine, new_text);
+ } else {
+ Wizard::EnableNextButton ();
+ break;
+ }
+ ret = (symbol)UI::PollInput();
+ if (ret == `back || ret == `abort )
+ {
+ SCR::Execute (.process.kill, pid);
+ break;
+ }
+ }
+ while(ret!=`back && ret!=`abort && ret!=`next){
+ ret = (symbol)UI::UserInput();
+ }
+ return ret;
+}
+
+
+/*
any FilesDialog(){
string caption = _("OnStar Included Files Configuration (3/3)");
term contents = `VBox(
`HBox(
`PushButton(`id(`start_supportconfig), _("Trigger to collect logs")),
- `InputField(`id(`directory_path), `opt(`disabled), _("Path to log directory"))
+ `InputField(`id(`directory_path), `opt(`disabled), _("Path to log directory"), Supportconfig::proposed_log_path)
),
- `SelectionBox(`id(`file_list), `opt(`disabled), _("Log Files"), []),
- `HBox(
- `PushButton(`id(`delete_file), `opt(`disabled), _("Delete Selected File")),
- `PushButton(`id(`show_file), `opt(`disabled), _("Show Selected File"))
- ));
+ `LogView(`id(`lw), _("Log Files"), 19, 0)
+ );
Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
Label::BackButton(), Label::NextButton());
+ Wizard::DisableNextButton();
any ret = nil;
string full_log_path="";
while(true) {
ret = UI::UserInput();
- /* abort? */
if(ret == `abort || ret == `cancel) {
if(ReallyAbort()) break;
else continue;
}
- else if(ret == `next || ret == `back) {
- y2milestone("Creating output tarball");
- string command = sformat("supportconfig %1 -i %2", Supportconfig::GetParameterList(), Supportconfig::proposed_log_path);
-
- break;
- }
else if(ret==`start_supportconfig){
- y2internal("button pressed");
+ y2internal("Gathering system configuration logs");
- string command = sformat("supportconfig %1 -o %2", Supportconfig::GetParameterList(), Supportconfig::proposed_log_path);
-/*
+ string command = sformat("supportconfig %1 -t %2", Supportconfig::GetParameterList(), 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);
-*/
-
-map output=$[];
-Supportconfig::proposed_log_path="/tmp/onstar/";
-
- output = (map)SCR::Execute(.target.bash_output, sformat("ls -t %1|head -n1|tr -d '\n'", Supportconfig::proposed_log_path));
- y2internal("output %1", output);
- if (output["exit"]:-1!=0){
- Popup::Error(output["stderr"]:"");
- ret=`back;
- break;
- }
- Supportconfig::created_directory=output["stdout"]:"";
- full_log_path=sformat("%1/%2", Supportconfig::proposed_log_path, Supportconfig::created_directory);
- output = (map)SCR::Execute(.target.bash_output, sformat("ls %1", full_log_path));
- if (output["exit"]:-1!=0){
- Popup::Error(output["stderr"]:"");
- ret=`back;
- break;
- }
- UI::ChangeWidget(`file_list, `Items, filter(string s, splitstring(output["stdout"]:"", "\n"), {return (size(s)>0);}));
- UI::ChangeWidget(`directory_path, `Value, full_log_path);
- UI::ChangeWidget(`file_list, `Enabled, true);
- UI::ChangeWidget(`show_file, `Enabled, true);
- UI::ChangeWidget(`delete_file, `Enabled, true);
+import "LogViewCore";
+LogViewCore::Start((term)`id(`lw), $["command":command]);
+while(LogViewCore::IsProcessRunning()){
+ LogViewCore::Update((term)`id(`lw));
+ sleep(1000);
+ y2internal("sleeping");
+}
+ Wizard::EnableNextButton();
continue;
}
+ else if(ret == `next || ret == `back) {
+ y2milestone("Creating output tarball");
+ string command = sformat("supportconfig %1 -f %2", Supportconfig::GetParameterList(), Supportconfig::proposed_log_path);
+
+ break;
+ }
else if (ret==`show_file){
string selected_item = (string)UI::QueryWidget(`file_list, `CurrentItem);
@@ -369,6 +377,69 @@
}
return ret;
}
+*/
+symbol FilesDialog2() {
+ string caption = _("Collected Data Review");
+ // FIXME use list of generated files, as well as directory prefix
+ map output = (map)SCR::Execute(.target.bash_output, sformat("ls -t %1|head -n1|tr -d '\n'", Supportconfig::proposed_log_path));
+ y2internal("output %1", output);
+ if (output["exit"]:-1!=0){
+ Popup::Error(output["stderr"]:"");
+ return `back;
+ }
+ Supportconfig::created_directory=output["stdout"]:"";
+ string full_log_path=sformat("%1/%2/", Supportconfig::proposed_log_path, Supportconfig::created_directory);
+ output = (map)SCR::Execute(.target.bash_output, sformat("ls %1", full_log_path));
+ if (output["exit"]:-1!=0){
+ Popup::Error(output["stderr"]:"");
+ return `back;
+ }
+ list<string> files = filter(string s, splitstring(output["stdout"]:"", "\n"), {return (size(s)>0);});
+ term contents = `VBox (
+ `HBox (
+ `HStretch(),
+ `ReplacePoint (`id (`filelist_rp),
+ `ComboBox (`id (`filelist), `opt (`notify, `hstretch), _("File Name"), files)),
+ `VBox (
+ `Label(""),
+ `PushButton (`id (`remove), `opt (`hstretch), _("Remove from Data"))
+ ),
+ `HStretch()
+ ),
+ `ReplacePoint (`id (`file_rp),
+ `RichText (`id (`file), `opt (`plainText), "")
+// `MultiLineEdit (`id (`file), `opt (`read_only), _("File Contents"))
+ )
+ );
+ Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
+ Label::BackButton(), Label::NextButton());
+ symbol ret = `filelist;
+ while (true) {
+ if (ret == `filelist)
+ {
+ string file = full_log_path + (string)UI::QueryWidget (`id (`filelist), `Value);
+ string data = (string)SCR::Read (.target.string, file);
+ UI::ReplaceWidget (`id (`file_rp),
+ `RichText (`id (`file), `opt (`plainText), data));
+// UI::ChangeWidget (`id (`file), `Value, data);
+ }
+ ret = (symbol)UI::UserInput();
+ if (ret == `next || ret == `abort || ret == `back)
+ break;
+ if (ret == `remove)
+ {
+ string file = (string)UI::QueryWidget (`id (`filelist), `Value);
+ files = filter (string f, files, { return f != file; });
+ UI::ReplaceWidget (`id (`filelist_rp),
+ `ComboBox (`id (`filelist), `opt (`notify, `hstretch), _("File Name"), files));
+ ret = `filelist;
+// FIXME uncomment, following line not tested
+ y2internal("removing %1%2", full_log_path, file);
+ SCR::Execute (.target.bash, sformat("/bin/rm %1%2", full_log_path, file));
+ }
+ }
+ return ret;
+}
/* EOF */
}
Modified: branches/tmp/mzugec/supportconfig/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/wizards.ycp?rev=50644&r1=50643&r2=50644&view=diff
==============================================================================
--- branches/tmp/mzugec/supportconfig/src/wizards.ycp (original)
+++ branches/tmp/mzugec/supportconfig/src/wizards.ycp Thu Sep 4 12:10:56 2008
@@ -49,7 +49,8 @@
"config1" : ``(Configure1Dialog()),
"config_details" : ``( ConfigurationDialog() ),
"contact" : ``(ContactDialog()),
- "files" : ``(FilesDialog()),
+ "generate" : ``(GenerateDialog()),
+ "files2" : ``(FilesDialog2()),
];
/* FIXME: adapt to your needs */
@@ -68,9 +69,15 @@
"contact" : $[
`abort : `abort,
`back : `back,
- `next : "files",
+ `next : "generate",
],
- "files" : $[
+ "generate" : $[
+ `abort : `abort,
+ `back : `back,
+ `next : "files2",
+
+ ],
+ "files2" : $[
`abort : `abort,
`back : `back,
`next : `next,
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org