CMS 3D CMS Logo

IgQtAppDebugPluginsInfo Class Reference

#include <Iguana/Studio/interface/IgQtAppDebug.h>

Inheritance diagram for IgQtAppDebugPluginsInfo:

IgQtAppDebugInfo

List of all members.

Public Member Functions

 IgQtAppDebugPluginsInfo (IgState *state, QWidget *parent)

Protected Member Functions

virtual void update (void)

Private Attributes

IgStatem_state


Detailed Description

Definition at line 69 of file IgQtAppDebug.h.


Constructor & Destructor Documentation

IgQtAppDebugPluginsInfo::IgQtAppDebugPluginsInfo ( IgState state,
QWidget *  parent 
)

Definition at line 278 of file IgQtAppDebug.cc.

References IgQtAppDebugInfo::list().

00280     : IgQtAppDebugInfo (parent, false),
00281       m_state (state)
00282 {
00283     list ()->addColumn ("Type");
00284     list ()->addColumn ("Plug-in");
00285     list ()->addColumn ("Attached");
00286     list ()->setRootIsDecorated (true);
00287 
00288     setCaption ("Available Plugins");
00289     resize (600, 200);
00290 }


Member Function Documentation

void IgQtAppDebugPluginsInfo::update ( void   )  [protected, virtual]

Implements IgQtAppDebugInfo.

Definition at line 299 of file IgQtAppDebug.cc.

References ASSERT, IgPluginManager::beginDirectories(), HcalDataFrameFilter_impl::check(), IgModuleDescriptor::child(), IgModuleDescriptor::children(), d, archive::db, dir, IgPluginManager::endDirectories(), IgPluginManager::get(), i, IgQtAppDebugInfo::list(), m_state, name, plugin, and IgModuleDescriptor::token().

00300 {
00301     static const char   *check [] = {
00302         "    16    13        2            1",
00303         "  c none",
00304         "x c #000000",
00305         "                ",
00306         "               x",
00307         "             xx ",
00308         "            x   ",
00309         "  xx      xx    ",
00310         " xxxx    xx     ",
00311         "  xxxx  xx      ",
00312         "   xxxxxx       ",
00313         "    xxxxx       ",
00314         "     xxx        ",
00315         "      xx        ",
00316         "                ",
00317         "                "
00318     };
00319     static QPixmap      *checkPixmap = new QPixmap (check);
00320 
00321     // FIXME: get state from constructor?
00322     QListView   *props = list ();
00323 
00324     ASSERT (m_state);
00325     ASSERT (props);
00326 
00327     props->clear ();
00328     
00329     typedef std::pair<std::string,std::string> Seen;
00330     IgPluginManager                     *db = IgPluginManager::get ();
00331     IgPluginManager::DirectoryIterator  dir;
00332     IgModuleCache::Iterator             plugin;
00333     IgModuleDescriptor                  *cache;
00334     std::set<Seen>                      seen;
00335     unsigned                            i;
00336 
00337     for (dir = db->beginDirectories (); dir != db->endDirectories (); ++dir)
00338         for (plugin = (*dir)->begin (); plugin != (*dir)->end (); ++plugin)
00339             for (cache=(*plugin)->cacheRoot(), i=0; i < cache->children(); ++i)
00340             {
00341                 IgModuleDescriptor *d = cache->child (i);
00342 
00343                 // Get category
00344                 const char *catname = d->token (0).c_str ();
00345                 QListViewItem *cat = props->findItem (catname, 0);
00346                 if (! cat)
00347                 {
00348                     cat = new QListViewItem (props, catname);
00349                     cat->setOpen (true);
00350                 }
00351 
00352                 // Get last item
00353                 QListViewItem *prev = cat ? cat->firstChild () : 0;
00354                 while (prev && prev->nextSibling ())
00355                     prev = prev->nextSibling ();
00356 
00357                 const char *name = d->token (1).c_str ();
00358                 const char *lib = (*plugin)->libraryName ();
00359                 if (! *name)
00360                     name = "(Built-in)";
00361 
00362                 if (seen.count (Seen (catname, name)))
00363                     continue;
00364                 seen.insert (Seen (catname, name));
00365 
00366                 if (! prev)
00367                     prev = new QListViewItem (cat, name, lib);
00368                 else
00369                     prev = new QListViewItem (cat, prev, name, lib);
00370 
00371                 if ((*plugin)->attached ())
00372                     prev->setPixmap (2, *checkPixmap);
00373             }
00374 }


Member Data Documentation

IgState* IgQtAppDebugPluginsInfo::m_state [private]

Definition at line 78 of file IgQtAppDebug.h.

Referenced by update().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:26 2009 for CMSSW by  doxygen 1.5.4