Author: jsuchome
Date: Mon Feb 22 15:58:53 2010
New Revision: 60942
URL: http://svn.opensuse.org/viewcvs/yast?rev=60942&view=rev
Log:
- enable saving kiwi logs on demand (fate#306937)
- 2.17.29
Modified:
branches/SuSE-Code-11-SP1-Branch/product-creator/VERSION
branches/SuSE-Code-11-SP1-Branch/product-creator/package/yast2-product-creator.changes
branches/SuSE-Code-11-SP1-Branch/product-creator/src/Kiwi.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/product-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/product-creator/VERSION?rev=60942&r1=60941&r2=60942&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/product-creator/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/product-creator/VERSION Mon Feb 22 15:58:53 2010
@@ -1 +1 @@
-2.17.28
+2.17.29
Modified: branches/SuSE-Code-11-SP1-Branch/product-creator/package/yast2-product-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/product-creator/package/yast2-product-creator.changes?rev=60942&r1=60941&r2=60942&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/product-creator/package/yast2-product-creator.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/product-creator/package/yast2-product-creator.changes Mon Feb 22 15:58:53 2010
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Feb 22 15:43:36 CET 2010 - jsuchome@suse.cz
+
+- enable saving kiwi logs on demand (fate#306937)
+- 2.17.29
+
+-------------------------------------------------------------------
Mon Jan 25 19:39:12 CET 2010 - jsuchome@suse.cz
- when package cannot be installed, look if it is not provided
Modified: branches/SuSE-Code-11-SP1-Branch/product-creator/src/Kiwi.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/product-creator/src/Kiwi.ycp?rev=60942&r1=60941&r2=60942&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/product-creator/src/Kiwi.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/product-creator/src/Kiwi.ycp Mon Feb 22 15:58:53 2010
@@ -72,6 +72,9 @@
// map with image templates (to base new projects on)
global map Templates = $[];
+ string stdout_file = "/tmp/image_creator.stdout";
+ string stderr_file = "/tmp/image_creator.stderr";
+
/**
* crypt given user password with current encryption algorithm
*/
@@ -405,6 +408,32 @@
if (SCR::Read(.process.running, pid) == true) SCR::Execute (.process.kill, pid);
}
+ /**
+ * ask user where to save kiwi log files
+ */
+ boolean save_logs_popup () {
+
+ UI::OpenDialog (`opt(`decorated), `HBox(`HSpacing(1.5), `VBox (
+ `VSpacing (0.2),
+ `TextEntry (`id (`stdout_file), _("Path to file with standard output"), stdout_file),
+ `TextEntry (`id (`stderr_file), _("Path to file with error output"), stderr_file),
+ `PushButton (`id (`ok), Label::SaveButton ()),
+ `VSpacing (0.2)
+ ), `HSpacing(1.5)));
+
+ UI::UserInput ();
+
+ stdout_file = (string) UI::QueryWidget (`id (`stdout_file), `Value);
+ stderr_file = (string) UI::QueryWidget (`id (`stderr_file), `Value);
+
+ UI::CloseDialog ();
+
+ if (FileUtils::CheckAndCreatePath (path_to_dir (stdout_file)))
+ SCR::Write (.target.string, stdout_file, (string) UI::QueryWidget (`id (`log), `Value));
+ if (FileUtils::CheckAndCreatePath (path_to_dir (stderr_file)))
+ SCR::Write (.target.string, stderr_file, (string) UI::QueryWidget (`id (`errlog), `Value));
+ return true;
+ }
/**
* run kiwi to finally create the selected image
@@ -452,14 +481,20 @@
`VSpacing(0.5),
`LogView (`id (`errlog), "", 8, 0),
`VSpacing(0.5),
- `ReplacePoint (`id (`rp),
- `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())
+ `HBox (
+ `ReplacePoint (`id (`rp),
+ `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())
+ ),
+ // button label
+ `PushButton (`id(`save), _("Save logs"))
),
`VSpacing(0.5)
))
), `HSpacing(1.5)
));
+ UI::ChangeWidget (`id (`save), `Enabled, false);
+
integer id = -1;
void update_output () {
@@ -507,7 +542,12 @@
`Label (`opt (`boldFont), _("Image creation failed.")),
`PushButton (`id(`close), Label::CloseButton ())
));
- ret = (symbol) UI::UserInput ();
+ UI::ChangeWidget (`id (`save), `Enabled, true);
+ repeat
+ {
+ ret = (symbol) UI::UserInput ();
+ if (ret == `save) save_logs_popup ();
+ } until (ret == `close);
break;
}
else if (!creating)
@@ -533,7 +573,12 @@
`Label (`opt (`boldFont), _("Image creation succeeded.")),
`PushButton (`id(`ok), Label::OKButton ())
));
- ret = (symbol) UI::UserInput ();
+ UI::ChangeWidget (`id (`save), `Enabled, true);
+ repeat
+ {
+ ret = (symbol) UI::UserInput ();
+ if (ret == `save) save_logs_popup ();
+ } until (ret == `ok);
break;
}
}
@@ -543,8 +588,21 @@
}
if (ret == `cancel)
{
+ UI::ReplaceWidget (`id (`rp), `HBox (
+ // label (command result)
+ `Label (`opt (`boldFont), _("Image creation canceled.")),
+ `PushButton (`id(`close), Label::CloseButton ())
+ ));
SCR::Execute (.process.kill, id, 15);
give_kiwi_time_to_finish (id);
+ UI::ChangeWidget (`id (`save), `Enabled, true);
+ repeat
+ {
+ ret = (symbol) UI::UserInput ();
+ if (ret == `save)
+ save_logs_popup ();
+ } until (ret == `close);
+ break;
}
sleep (100);
} while (ret == nil);
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org