[Aptitude-devel] Changesets 00288a0dcae2 through 4710b5c94fcc

Daniel Burrows dburrows at debian.org
Mon Dec 8 01:10:28 UTC 2008

On Wed, Dec 03, 2008 at 09:01:38PM -0800, Daniel Burrows <dburrows at debian.org> was heard to say:
> On Wed, Dec 03, 2008 at 07:45:34PM -0800, Daniel Burrows <dburrows at debian.org> was heard to say:
> >   The Package menu still doesn't apply to the currently active tab.  I
> > think that in order to handle this, we'll have to allow tabs to know
> > whether they're currently selected.  I'll implement a flag on each Tab,
> > along with signals when a tab is selected or deselected (with a
> > guarantee that deselection is sent before selection).
>   Hm, it might be a little more complicated than that.  Also, this is a
> general problem; for instance, when the Undo menu item is hooked up
> we'll need to ensure that it applies only to the active tab (since the
> resolver has a different undo stack than the package cache).

  I've given this some more thought.  I see two obvious approaches:

    (1) Implement some sort of generic framework for constraining
        actions to only happen when a tab is active.  This could
        take the form of signals that trigger when the active state
        changes, combined with a utility routine that blocks a signal
        connection unless a given tab is visible.  The idea would be
        to use the block/unblock utility to control whether updates
        are applied, and to trigger an update explicitly when the tab
        is activated.

    (2) Add an interface to Tab that can be used to generate the
        Package menu -- perhaps a routine to query for the currently
        active actions, and a signal that triggers when the menu needs
        to be updated.  Add additional interfaces for the Undo menu and
        any other menus that need this special treatment.

  Although I like building generic systems, I'm leaning towards (2) and
will probably implement it when I get some time.  The easy parts of (1)
are implemented, but using those hooks to implement the menu support
will lead to a fragmented and convoluted system; I don't see a problem
with including details of menu handling in the Tab interface, and it
seems likely to produce much simpler and cleaner code.


More information about the Aptitude-devel mailing list