[Kde-imaging] ImageCollection or Browser
Aurelien Gateau
aurelien.gateau at free.fr
Sun Jun 20 23:39:15 CEST 2004
Hello,
As discussed previously, I added the TODO to the libkipi source. I did not
merge libkipi/TODO with kipi-plugins/TODO because they are different things
(although the first might influence the second).
I would like to start the discussion with the first issue: ImageCollection or
Browser.
This issue is described in the libkipi/design document, wrote by Jesper. In
short, I suggested to modify all plugins to use a QListView which would
display the available image collections, letting the user select an image
collection within this list.
Jesper had a problem with this because this model would not fit with the way
KimDaBa works. Instead, he suggested to replace the current system with a new
host-app implemented class: KIPI::Browser, which would provide to the
plugins:
- A widget to choose images from
- A method to get the list of images the user selected.
The big advantage of this method, is that libkipi would no longer force host
apps to work in terms of image collections. It also allows for better
integration between the application and the plugin.
The (simplified) defintion would look like this:
class Interface {
...
virtual Browser browser() = 0;
}
class Browser {
public:
Browser( BrowserShared* );
virtual QWidget* widget( QWidget* parent );
KURL::List images();
}
While creating its GUI, the plugin would do:
Browser browser=interface->browser();
QWidget* browserWidget=browser->widget();
// Assuming layout is a pointer to a QBoxLayout
layout->addWidget(browserWidget);
To process images, the plugin would do:
Browser browser=interface->browser();
KURL::List images=browser->images();
for (image in images) {
...
}
This solution sounds great to me, and I guess Jesper likes it too :-). Renchi,
Gilles, what do you think of this?
Aurélien
More information about the Kde-imaging
mailing list