[Aptitude-devel] Complex search query creation widget

Obey Arthur Liu arthur at milliways.fr
Thu Dec 25 14:06:08 UTC 2008


Hi,

I've been thinking about adding some GUI to expose the powerful search
query syntax of aptitude. It's a shame that many don't use it.
Currently, there's mainly a Entry for the query and a Button to initiate
search. There's also a ComboBox to limit the query according to the
installed/not installed/whatever status of the package.

I'm joining a changeset that adds some checkboxes for "broken",
"configured"... and puts everything except the Entry and Button into an
expander.

Right now, the idea is to invisibly add ~b or ~c to the query. Later we
could think about doing something more elaborate, à la Wireshark.

I reviewed the code in packagestab.cc to implement the code changes but
it seems that it won't be that easy to integrate it cleanly into the
existing code.

The whole stuff is handled by repopulate_searchable_view with a lot of
arguments pointing to the Gtk widgets. It's not very extensible: I'm not
sure SigC++ will be happy having a dozen Gtk::CheckBox arguments.

My first idea was to collapse everything limit related to a query string
that is 'somehow' given to repopulate_searchable_view. It would be a
little less flexible, but at least extensible.

Then I remembered about the commit message of a009513b2e55 :
>   (a) make the implementation cleaner; packagestab.cc is getting quite
>       messy.  Probably we need to create an object that represents the
>       whole "search view plus entry box" aggregate; it can be an element
>       of the various tabs that contain these aggregates.
> 
>       Among other things, this will eliminate the duplication of code
>       between the two places where we set the limit text (there are two
>       places that have to check for parse exceptions and display the
>       error).
> 
>   (b) Give the dashboard's search bar the same abilities.  Perhaps we
>       could create one object to represent a search bar where patterns
>       are typed (would aggregate the entry with the error label and the
>       Find button), and then make that a sub-part of an object
>       representing a search bar plus a package view with a limit filter
>       in between.

Well, someone already did the thinking. So let's do these
SearchEntryAndButton and BigSearchQueryConstructorWidget. It's just that
I'm getting a little confused with the fancy hooks and quarks things
that popped up recently..

Arthur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20081225/a3b589ed/attachment.pgp 


More information about the Aptitude-devel mailing list