From a529f2cf1f89003ab03e210800f13ebc7335348e Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Sun, 27 Apr 2008 12:30:13 +0000 Subject: [PATCH] - comments --- src/output/Out.h | 6 +++++- src/output/xmlout.rnc | 3 ++- src/zypper-misc.cc | 19 +++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/output/Out.h b/src/output/Out.h index 6c0c05d..d1ea9c1 100644 --- a/src/output/Out.h +++ b/src/output/Out.h @@ -225,7 +225,11 @@ public: const std::string & prompt, const PromptOptions & poptions, const std::string & startdesc = "") = 0; - + + /** + * Print help for prompt, if available. + * This method should be called after '?' prompt option has been entered. + */ virtual void promptHelp(const PromptOptions & poptions) = 0; public: diff --git a/src/output/xmlout.rnc b/src/output/xmlout.rnc index 2a01be2..7d29d6e 100644 --- a/src/output/xmlout.rnc +++ b/src/output/xmlout.rnc @@ -66,7 +66,8 @@ prompt-element = element text { text }, element option { attribute default { xsd:boolean }?, - attribute value { xsd:string } + attribute value { xsd:string }, + attribute desc { xsd:string }? }* } diff --git a/src/zypper-misc.cc b/src/zypper-misc.cc index a7f5af2..66c7b7b 100644 --- a/src/zypper-misc.cc +++ b/src/zypper-misc.cc @@ -2184,8 +2184,8 @@ void solve_and_commit (Zypper & zypper) return; } } - - + + // returns SUMMARY_* int retv = summary(zypper); if (retv != SUMMARY_NOTHING_TO_DO || !zypper.runtimeData().srcpkgs_to_install.empty()) @@ -2208,19 +2208,22 @@ void solve_and_commit (Zypper & zypper) // after install/update command summary if there will be any package // to-be-removed automatically to show why, if asked. popts.setOptions(_("y/n/p"), 0); + // translators: help text for 'y' option in the y/n/p prompt popts.setOptionHelp(0, _("Accept the summary and proceed with installation/removal of packages.")); + // translators: help text for 'n' option in the y/n/p prompt popts.setOptionHelp(1, _("Cancel the operation.")); + // translators: help text for 'p' option in the y/n/p prompt popts.setOptionHelp(2, _("Restart solver in no-force-resolution mode in order to show dependency problems.")); - // translators: Translate 'p' to whathever you translated it in the y/n/p prompt text. string prompt_text = _("Continue?"); zypper.out().prompt(PROMPT_YN_INST_REMOVE_CONTINUE, prompt_text, popts); unsigned int reply = get_prompt_reply(zypper, PROMPT_YN_INST_REMOVE_CONTINUE, popts); - + if (reply == 2) { // one more solver solver run with force-resoltion off zypper.runtimeData().force_resolution = false; + // undo solver changes before retrying God->resolver()->undo(); continue; } @@ -2270,12 +2273,12 @@ void solve_and_commit (Zypper & zypper) commit_done = true; } - - + + MIL << endl << "DONE" << endl; - + gData.show_media_progress_hack = false; - + if (!result._errors.empty()) retv = ZYPPER_EXIT_ERR_ZYPP; -- 2.7.4