El 05/06/2008 07:28 PM, David García Garzón escribió:
Every (interface) new feature, a new picture (Natanael, make yourself
the honors next time)
http://iua-share.upf.edu/wikis/clam/index.php/Image:ProcessingTreeWithIco
ns.png
Sorry about that. I just didn't though it as a commitable change. :)
If you can show something, even if not commited, even if it is a fake, take a
photo ;-)
OK :)
A simple yet great usability feature. As a side effect i foresee that
people will add more icons now :-)
BTW, the Tunner monitor points to "tunner.svg" and SpectrogramMonitor to
"none.svg", both which doesn't exist.
I added a very simple icon for the tunner based on the polarpeaks and i just
made the spectrogram point to spectrogram.svg which already existed.
Missing metadata for some monitors was also added.
You are adding really a quick and cool features, Natanael. :-)
Thank you. These little hacks helps me to learn about the platform in a
funny way. :)
What i tried to tell you in my previous mail is that the code would be cleaner
if you decide first which is the icon name for the processing (processing.svg
or something from the factory) and then building the full path, the icon and
setting the icon once. You almost got the idea but this patch i just commited
shows the difference:
Oh, OK. Thanks for the advice and corrections.
BTW, what do you think about defining the key previously, and search for
the description in a similar way that the icon? (see attached patch)
Best regards,
Natanael.
Index: ProcessingTree.cxx
===================================================================
--- ProcessingTree.cxx (revision 11360)
+++ ProcessingTree.cxx (working copy)
@@ -192,16 +192,12 @@
QTreeWidgetItem * categoryTree = new QTreeWidgetItem( this, QStringList() << category.c_str());
for(itKey = keys.begin(); itKey != keys.end(); itKey++)
{
- std::string description;
- if(factory.GetValuesFromAttribute(*itKey, "description").empty())
- {
- description = *itKey;
- }
- else
- {
- description = factory.GetValuesFromAttribute(*itKey, "description").front();
- }
std::string key = *itKey;
+
+ std::string description = key;
+ CLAM::ProcessingFactory::Values descriptionList=factory.GetValuesFromAttribute(key, "description");
+ if (! descriptionList.empty()) description=descriptionList.front();
+
QTreeWidgetItem * item = new QTreeWidgetItem( categoryTree, QStringList() << description.c_str());
CLAM::ProcessingFactory::Values iconList=factory.GetValuesFromAttribute(key,"icon");
_______________________________________________
Clam-devel mailing list
[email protected]
https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel