josef reidiner napsal(a):
Duncan Mac-Vicar P. napsal(a):
great!, so what do I need to do to fix the package selector? I guess for every item I lock on the UI I apply the lock in the pool. What should I call later to save them?
Duncan
quick: class Locks (no direct locking)- addLock/unlock method and saveLocks for save locks
little more verbose: Lock items via Locks class (singleton so can be called where you want). Unlock also via Locks class. There is two method for locking. One use selectable and second is more flexible and use PoolQuery (same class as for searching - locked/unlocked is result of search). When you want save locks to file use method saveLocks (default use settings from ZConfig - but you can specify file...so if frontend want have separated file of locks it is possible). For more detail look at tests locks when they are used. Pepa
I forgot few notes 1) addlock/unlock is added to separate front and is optimalized for few lock/unlock same item, so nothing new is saved if you lock something and unlock it and also if you unlock and lock again. 2) saveLocks use callback for complicated unlocking. So look at ZYpp callbacks, it has been called when locking query doesn't match unlocking but some locked solvable intersects. As argument get locking query which you want unlock (typically user defined or setted by another frontend if that frontend use another strategy to lock) and enum which say if result of queries intersect or is equal (equal results of query, not query itself). Action is delete, don't remove query and abort saving. 3) Locks also have cleaning api, which clean empty locks (and maybe as side efect I add remove duplicated query). This also have callback, which ask you if you really want remove query. Pepa -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org