[yast-commit] r42670 - in /trunk/pkg-bindings/src: PkgModuleFunctions.h Source.cc
Author: lslezak Date: Tue Dec 4 16:19:32 2007 New Revision: 42670 URL: http://svn.opensuse.org/viewcvs/yast?rev=42670&view=rev Log: - Pkg::SourceStartManager - added total progress Modified: trunk/pkg-bindings/src/PkgModuleFunctions.h trunk/pkg-bindings/src/Source.cc Modified: trunk/pkg-bindings/src/PkgModuleFunctions.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/PkgModuleFunctions.h?rev=42670&r1=42669&r2=42670&view=diff ============================================================================== --- trunk/pkg-bindings/src/PkgModuleFunctions.h (original) +++ trunk/pkg-bindings/src/PkgModuleFunctions.h Tue Dec 4 16:19:32 2007 @@ -178,6 +178,7 @@ void ProcessDone(); YCPValue SourceLoadImpl(const zypp::ProgressData::ReceiverFnc & progress = zypp::ProgressData::ReceiverFnc()); + YCPValue SourceStartManagerImpl(const YCPBoolean&, const zypp::ProgressData::ReceiverFnc & progress = zypp::ProgressData::ReceiverFnc()); // After all, APPL_HIGH might be more appropriate, because we suggest // the user what he should do and if it does not work, it's his job to Modified: trunk/pkg-bindings/src/Source.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Source.cc?rev=42670&r1=42669&r2=42670&view=diff ============================================================================== --- trunk/pkg-bindings/src/Source.cc (original) +++ trunk/pkg-bindings/src/Source.cc Tue Dec 4 16:19:32 2007 @@ -614,8 +614,52 @@ YCPValue PkgModuleFunctions::SourceStartManager (const YCPBoolean& enable) { + // display the progress only when 'enable' is true + if (enable->value()) + { + std::list<std::string> stages; + stages.push_back("Load Sources"); + stages.push_back("Refresh Sources"); + stages.push_back("Rebuild Cache"); + stages.push_back("Load Data"); + + // 3 steps per repository (download, cache rebuild, load resolvables) + ProcessStart("Loading the Package Manager...", stages, "help"); + + // mark refreshing as in progress now + ProcessNextStage(); + + ptr = this; + } + + YCPValue ret = SourceStartManagerImpl(source_receiver); + + if (enable->value()) + { + ProcessDone(); + ptr = NULL; + } + + return ret; +} + +/**************************************************************************************** + * @builtin SourceStartManager + * + * @short Start the source manager - restore the sources and load the resolvables + * @description + * Calls SourceRestore(), if argument enable is true SourceLoad() is called. + * @param boolean enable If true the resolvables are loaded from the enabled sources + * + * @return boolean + **/ +YCPValue +PkgModuleFunctions::SourceStartManagerImpl(const YCPBoolean& enable, const zypp::ProgressData::ReceiverFnc &progress) +{ YCPValue success = SourceRestore(); + ProcessNextStage(); + if( enable->value() ) { if (!success->asBoolean()->value()) @@ -624,7 +668,7 @@ } // enable all sources and load the resolvables - success = YCPBoolean(SourceLoad()->asBoolean()->value() && success->asBoolean()->value()); + success = YCPBoolean(SourceLoadImpl(source_receiver)->asBoolean()->value() && success->asBoolean()->value()); } return success; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org