Mailinglist Archive: yast-devel (168 mails)

< Previous Next >
[yast-devel] Package callbacks - turning off
  • From: Ladislav Slezak <lslezak@xxxxxxx>
  • Date: Tue, 15 Apr 2008 12:53:53 +0200
  • Message-id: <48048941.5010601@xxxxxxx>

Hi all,

I have added these new functions into PackageCallbacks.ycp (yast2-2.16.52):

RegisterEmptyProgressCallbacks() - registers empty callbacks
RestorePreviousProgressCallbacks() - restores the previous registered callbacks

(Pkg-bindings have a stack of registered functions for each callback, unregistering a callback means removing the function from the top of the stack.)


If you need to temporarily turn off the callbacks then use the functions in a wrapper to ensure that the restoring function is always called:

//disable callbacks
PackageCallbacks::RegisterEmptyProgressCallbacks();

// Start the requested operation here
DoActionWithoutCallbacks();

// restore the previous callbacks
PackageCallbacks::RestorePreviousProgressCallbacks();



RegisterEmptyProgressCallbacks() sets empty callbacks for all progress callbacks, if you need to disable just a particular type of callback then use

PackageCallbacks::SetDummy*Callbacks() and PackageCallbacks::Restore*Callbacks()
functions.


The new functionality is used to fix bug #377919, but it might be useful in other modules/scripts.


--

Best Regards

Ladislav Slezák
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarská 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups