Draft: App chooser widget
Related to #123 .
Here is my first attempt at porting the Thunar/Settings Manager code to libxfceui. I stripped out all Thunar-specific code and replaced as much of it as I could with more generic methods.
A couple of discussion points:
- One thing that I did not yet implement is the actual opening of the file with the selected application. Actually, I cut the file property out of the widget completely, so it currently takes a mime-type and returns the GAppInfo, leaving the calling application to handle the rest. Since Thunar already handles opening files elsewhere in its codebase, it seemed to me that including it here would lead to more duplication, not less. My thought is that if it turns out to be needed/useful when we eventually port Thunar to this widget, we can always add it back.
- The "forget" menu item of the context menu needs work as I could not get it to work consistently.
- I switched the base class from GtkDialog to GtkWindow given that the former is a bit more flexible, especially since this is now separated from any particular app, and it may be used in different ways in the future (e.g., on the panel). Practically, it simply means the calling code needs to connect the "destroy" signal to a callback rather than use gtk_dialog_run().
@alexxcons When you have a chance may you take a look at what I have so far and tell me what you think? Thanks!