CMS 3D CMS Logo

IgControlCentre Class Reference

#include <Iguana/GLBrowsers/interface/IgControlCentre.h>

List of all members.

Public Slots

virtual void apply (void)
 Respond to "Apply" button press.
virtual void back (void)
 Go to the back.
virtual void enableCategory (IgControlCategory *category, bool state=true)
virtual void help (void)
 Get help.
virtual void revert (void)
 Respond to "Revert" button press.

Public Member Functions

void addCategory (IgControlCategory *category)
 Add category to the control centre.
virtual void hide (void)
 Hide the control centre dialog.
QIconView * iconView (void)
 IgControlCentre (QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
void removeCategory (IgControlCategory *category)
 Remove category to the control centre.
void selectCategory (const QString &name)
void selectCategory (IgControlCategory *category)
 Make category the current selection and show its control area in the body content area.
virtual void show (void)
 Show the control centre dialog.
void updateOnWindowActive (void)
 ~IgControlCentre (void)

Protected Slots

virtual void languageChange ()

Protected Member Functions

void windowActivationChange (bool oldActive)

Protected Attributes

QGridLayout * IgControlCentreLayout
QHBoxLayout * m_layout1
QGridLayout * m_layout2

Private Types

typedef std::map< QString,
std::pair< IgControlCategory *,
bool > > 
CategoryMap
typedef std::map< QString,
std::pair< void *, bool > > 
IconViewArch
typedef std::vector
< QIconViewItem * > 
IconViewList

Private Slots

void addIconViewItems (QString name)
void cleanCategory (void)
 Mark the current category clean, disabling the "Apply" and "Revert" buttons.
void dirtyCategory (void)
 Mark the current category dirty, enabling the "Apply" and "Revert" buttons.
void hideCategory (void)
void hideIconView (void)
void selectIconItem (QIconViewItem *)
void showCategory (IgControlCategory *category)
void showIconView (QString name)

Private Member Functions

void deleteIconViewArch (IconViewArch *toplevel)
void enableCategory (QString name, IconViewArch *toplevel, bool state=true)
bool hasCategory (const IgControlCategory *category)
 Find the Category and returns the QIconViewItem.
void removeCategory (QString name, IconViewArch *toplevel)
void updateControlCentre (QString name)

Private Attributes

QPushButton * m_apply
QPushButton * m_back
QString m_baseName
CategoryMap m_categories
QPushButton * m_close
IgControlCategorym_current
bool m_focusChanged
QPushButton * m_help
QIconView * m_iconView
IconViewArch m_iconViewArch
IconViewList m_iconViewList
QString m_name
QPushButton * m_revert
bool m_updateOnWindowActive


Detailed Description

Definition at line 30 of file IgControlCentre.h.


Member Typedef Documentation

typedef std::map<QString, std::pair<IgControlCategory *, bool> > IgControlCentre::CategoryMap [private]

Definition at line 82 of file IgControlCentre.h.

typedef std::map<QString, std::pair<void*, bool> > IgControlCentre::IconViewArch [private]

Definition at line 84 of file IgControlCentre.h.

typedef std::vector<QIconViewItem*> IgControlCentre::IconViewList [private]

Definition at line 83 of file IgControlCentre.h.


Constructor & Destructor Documentation

IgControlCentre::IgControlCentre ( QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0 
)

Definition at line 29 of file IgControlCentre.cc.

References apply(), back(), HLT_VtxMuL3::connect, help(), IgControlCentreLayout, languageChange(), m_apply, m_back, m_baseName, m_close, m_help, m_iconView, m_layout1, m_layout2, m_name, m_revert, revert(), selectIconItem(), and reco::Single.

00030     : QDialog( parent, name, modal, fl ),
00031       IgControlCentreLayout (0),
00032       m_layout1 (0),
00033       m_layout2 (0),
00034       m_current (0),
00035       m_iconView (0),
00036       m_updateOnWindowActive (false),
00037       m_focusChanged (false)
00038 {
00039     if ( !name )
00040       setName( m_name );
00041     
00042     m_name = "IGUANA Control Centre";
00043     m_baseName = "";
00044     
00045     setFocusPolicy (QWidget::StrongFocus);
00046     IgControlCentreLayout = new QGridLayout( this, 1, 1, 11, 6, "IgControlCentreLayout");
00047 
00048     m_layout2 = new QGridLayout( 0, 1, 1, 0, 6, "m_layout2"); 
00049 
00050     m_iconView = new QIconView (0, "m_iconView");
00051     m_iconView->setSelectionMode (QIconView::Single);
00052     m_iconView->setAutoArrange (true);
00053     m_iconView->setResizeMode (QIconView::Adjust);
00054     
00055     m_layout2->addWidget(m_iconView , 0, 0 );
00056 
00057     m_layout1 = new QHBoxLayout( 0, 0, 6, "m_layout1"); 
00058 
00059     m_back = new QPushButton( this, "m_back" );
00060     m_back->setAutoDefault( false );
00061     m_back->setEnabled ( false );
00062     m_back->setFixedSize (QSize(45, 22));
00063     m_layout1->addWidget( m_back );
00064     QSpacerItem* spacer0 = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00065     m_layout1->addItem( spacer0 );
00066 
00067     m_close = new QPushButton( this, "m_close" );
00068     m_close->setAutoDefault( false );
00069     m_close->setFixedSize (QSize(45, 22));
00070     m_layout1->addWidget( m_close );
00071     QSpacerItem* spacer = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00072     m_layout1->addItem( spacer );
00073 
00074     m_revert = new QPushButton( this, "m_revert" );
00075     m_revert->setAutoDefault( false );
00076     m_revert->setEnabled( false );
00077     m_revert->setFixedSize (QSize(45, 22));
00078     m_layout1->addWidget( m_revert );
00079     QSpacerItem* spacer_2 = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00080     m_layout1->addItem( spacer_2 );
00081 
00082     m_apply = new QPushButton( this, "m_apply" );
00083     m_apply->setAutoDefault( false );
00084     m_apply->setEnabled( false );
00085     m_apply->setFixedSize (QSize(45, 22));
00086     m_layout1->addWidget( m_apply );
00087     QSpacerItem* spacer_3 = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00088     m_layout1->addItem( spacer_3 );
00089 
00090     m_help = new QPushButton( this, "m_help" );
00091     m_help->setAutoDefault( false );
00092     m_help->setFixedSize (QSize(45, 22));
00093     m_layout1->addWidget( m_help );
00094 
00095     m_layout2->addLayout( m_layout1, 1, 0 );
00096 
00097     IgControlCentreLayout->addLayout( m_layout2, 0, 0 );
00098     languageChange();
00099     clearWState( WState_Polished );
00100     setSizeGripEnabled (true);
00101 
00102     // signals and slots connections
00103     connect (m_back, SIGNAL(clicked ()), this, SLOT(back ()));
00104     connect (m_close, SIGNAL(clicked ()), this, SLOT(close ()));
00105     connect (m_apply, SIGNAL(clicked ()), this, SLOT(apply ()));
00106     connect (m_revert, SIGNAL(clicked ()), this, SLOT(revert ()));
00107     connect (m_help, SIGNAL(clicked ()), this, SLOT(help ()));
00108     connect (m_iconView, SIGNAL (doubleClicked (QIconViewItem *)),
00109              this,       SLOT (selectIconItem (QIconViewItem *)));
00110     connect (m_iconView, SIGNAL (returnPressed (QIconViewItem *)),
00111              this,       SLOT (selectIconItem (QIconViewItem *)));
00112 }

IgControlCentre::~IgControlCentre ( void   ) 

Definition at line 117 of file IgControlCentre.cc.

References deleteIconViewArch(), m_categories, and m_iconViewArch.

00118 {
00119     // no need to delete child widgets, Qt does it all for us
00120     while (! m_categories.empty ())
00121     {
00122         delete m_categories.begin ()->second.first;
00123         m_categories.erase (m_categories.begin ());
00124     }
00125     deleteIconViewArch (&m_iconViewArch);
00126 }


Member Function Documentation

void IgControlCentre::addCategory ( IgControlCategory category  ) 

Add category to the control centre.

It must be a non-null pointer to a category not previously added to the control centre. An item by the category's name will be added to the list and to the dialog's widget stack for the actual body content area. It will not be made the current selection.

Definition at line 438 of file IgControlCentre.cc.

References ASSERT, c, c1, hasCategory(), index, m_categories, m_iconViewArch, and name.

Referenced by IgControlCategory::clearCategory().

00439 { 
00440     ASSERT (category);
00441     ASSERT (!hasCategory (category));
00442     
00443     QString name = category->name ();
00444     unsigned int length = name.length ();
00445     
00446     ASSERT (length);
00447     ASSERT (m_categories.find (name) == m_categories.end ());
00448     ASSERT ((name.left(1) != "/") && (name.right(1) != "/"));
00449     
00450     std::pair<IgControlCategory *, bool> c(category, true);
00451     m_categories[name]=c;
00452     
00453     int index = name.find ("/");
00454     IconViewArch *toplevel = &m_iconViewArch;
00455     while (index != -1)
00456     {
00457       length = length -1;
00458       
00459       QString sname = name.left(index);
00460       length = length-index;
00461       name = name.right (length);
00462       if (toplevel->find(sname) != toplevel->end ())
00463         toplevel = static_cast<IconViewArch *>((*toplevel)[sname].first);
00464       else
00465       {
00466         IconViewArch *child = new IconViewArch;
00467         std::pair<void *, bool> c(child, true);
00468         (*toplevel)[sname] = c;
00469         toplevel=child;
00470       }
00471       index = name.find ("/");
00472     }
00473     std::pair<void *, bool> c1(0, true);
00474     (*toplevel)[name] = c1;
00475 }

void IgControlCentre::addIconViewItems ( QString  name  )  [private, slot]

Definition at line 308 of file IgControlCentre.cc.

References first, index, m_back, m_baseName, m_categories, m_iconView, m_iconViewArch, m_iconViewList, m_name, and edm::second().

Referenced by showIconView().

00309 {
00310   if (m_baseName == name && m_iconView->count() != 0) return;
00311   QString newBase ("");
00312   IconViewArch *toplevel = &m_iconViewArch;
00313  
00314   if (name != "")
00315   {  
00316     int index = name.find ("/");
00317     while (index != -1)
00318     {
00319       unsigned int length = name.length ();
00320       std::pair<void*, bool> item = (*toplevel)[name.left (index)];
00321       if (item.second == true)
00322       {
00323         toplevel=static_cast<IconViewArch *>(item.first);
00324         if(newBase == "")
00325           newBase = name.left (index);
00326         else
00327           newBase = newBase+ "/" + name.left (index);
00328 
00329         name = name.right (length - index - 1);
00330         index = name.find ("/");
00331       }
00332       else
00333       {
00334         index = -1;
00335         name = name.left (index);
00336       }
00337     }
00338     if ((*toplevel)[name].second == true)
00339     {
00340       toplevel=static_cast<IconViewArch *>((*toplevel)[name].first);
00341       
00342       if (newBase == "")
00343         newBase = name;
00344       else
00345         newBase = newBase+ "/" + name;
00346     }
00347   }
00348   
00349   if (newBase == "")
00350     m_back->setEnabled (false);
00351   else
00352     m_back->setEnabled (true);
00353 
00354   m_baseName = newBase;
00355   m_iconViewList.clear ();
00356   m_iconView->clear ();
00357   IconViewArch::iterator itr;
00358   
00359   for(itr = toplevel->begin (); itr != toplevel->end (); itr++)
00360   {
00361     if (itr->second.second == true)
00362     {
00363       if (itr->second.first)
00364         m_iconViewList.push_back (new QIconViewItem (m_iconView,
00365                                                      itr->first));
00366       else
00367       {
00368         QString cat (itr->first);
00369         if (!m_baseName.isEmpty ())
00370           cat = m_baseName + "/" + cat;
00371         QPixmap icon (m_categories[cat].first->getIcon ());
00372         if (icon.isNull ())
00373           m_iconViewList.push_back (new QIconViewItem (m_iconView, itr->first));
00374         else
00375           m_iconViewList.push_back (new QIconViewItem (m_iconView,
00376                                                        itr->first,
00377                                                        icon));
00378       }
00379     }
00380   }
00381   m_iconView->arrangeItemsInGrid ();
00382 
00383   if (m_baseName.length ())
00384   {
00385     if (m_baseName.length () > 20)
00386       setCaption(tr(m_name + " [..." + m_baseName.right (17) + "]"));
00387     else
00388       setCaption(tr(m_name + " [" + m_baseName + "]"));
00389   }
00390 }

void IgControlCentre::apply ( void   )  [virtual, slot]

Respond to "Apply" button press.

Directs the call to the current category.

Definition at line 213 of file IgControlCentre.cc.

References IgControlCategory::apply(), ASSERT, and m_current.

Referenced by IgControlCentre().

00214 {
00215     ASSERT (m_current);
00216     m_current->apply ();
00217 }

void IgControlCentre::back ( void   )  [virtual, slot]

Go to the back.

Definition at line 243 of file IgControlCentre.cc.

References index, m_baseName, and showIconView().

Referenced by hide(), IgControlCentre(), removeCategory(), selectCategory(), and updateControlCentre().

00244 { 
00245     int index = m_baseName.findRev ("/");
00246     if (index != -1)
00247       showIconView (m_baseName.left(index));
00248     else
00249       showIconView ("");
00250 }

void IgControlCentre::cleanCategory ( void   )  [private, slot]

Mark the current category clean, disabling the "Apply" and "Revert" buttons.

Definition at line 608 of file IgControlCentre.cc.

References m_apply, and m_revert.

Referenced by hideCategory(), showCategory(), and showIconView().

00609 {
00610     m_apply->setEnabled (false);
00611     m_revert->setEnabled (false);
00612 }

void IgControlCentre::deleteIconViewArch ( IconViewArch toplevel  )  [private]

Definition at line 129 of file IgControlCentre.cc.

Referenced by ~IgControlCentre().

00130 {
00131     while (!toplevel->empty ()){
00132        IconViewArch::iterator itr = toplevel->begin ();
00133        if (itr->second.first != 0)
00134        {
00135          deleteIconViewArch (static_cast<IconViewArch *>(itr->second.first));
00136          delete static_cast<IconViewArch *>(itr->second.first);
00137        }
00138        toplevel->erase (itr);
00139     }
00140 }

void IgControlCentre::dirtyCategory ( void   )  [private, slot]

Mark the current category dirty, enabling the "Apply" and "Revert" buttons.

Definition at line 599 of file IgControlCentre.cc.

References m_apply, and m_revert.

Referenced by hideCategory(), and showCategory().

00600 {
00601     m_apply->setEnabled (true);
00602     m_revert->setEnabled (true);
00603 }

void IgControlCentre::enableCategory ( QString  name,
IconViewArch toplevel,
bool  state = true 
) [private]

Definition at line 540 of file IgControlCentre.cc.

References ASSERT, enableCategory(), first, index, and m_focusChanged.

00541 {
00542     int index = name.find ("/");
00543     if (index != -1)
00544     {
00545       QString sname = name.left(index);
00546       name = name.right (name.length() - index - 1);
00547       enableCategory (name, static_cast<IconViewArch *>((*toplevel)[sname].first), state);
00548       name = sname;
00549     }
00550     m_focusChanged = true;
00551     
00552     if ((*toplevel)[name].first == 0 || state)
00553       (*toplevel)[name].second = state;
00554     else
00555     {
00556       ASSERT (toplevel->size ());
00557       IconViewArch::iterator itr;
00558   
00559       IconViewArch *tmpmap = static_cast<IconViewArch *>((*toplevel)[name].first);
00560       for(itr = tmpmap->begin (); itr != tmpmap->end (); itr++)
00561       {
00562         if (itr->second.second == true)
00563         {
00564           (*toplevel)[name].second = true;
00565           return;
00566         }
00567       }
00568       (*toplevel)[name].second = false;
00569     }
00570 }

void IgControlCentre::enableCategory ( IgControlCategory category,
bool  state = true 
) [virtual, slot]

Definition at line 573 of file IgControlCentre.cc.

References ASSERT, hasCategory(), m_categories, and m_iconViewArch.

Referenced by enableCategory(), and enableCategory().

00574 {
00575     ASSERT (m_categories.size ());
00576     ASSERT (category && hasCategory (category));
00577     ASSERT (m_categories.find (category->name ()) != m_categories.end ());
00578     m_categories[category->name ()].second = state;
00579     enableCategory (category->name (), &m_iconViewArch, state);
00580 }

bool IgControlCentre::hasCategory ( const IgControlCategory category  )  [private]

Find the Category and returns the QIconViewItem.

Definition at line 421 of file IgControlCentre.cc.

References m_categories.

Referenced by addCategory(), enableCategory(), removeCategory(), and selectCategory().

00422 {
00423     CategoryMap::iterator itr;
00424     for(itr = m_categories.begin (); itr != m_categories.end (); itr++)
00425     {
00426       if (itr->second.first == category)
00427         return true;
00428     }
00429     return false;
00430 }

void IgControlCentre::help ( void   )  [virtual, slot]

Get help.

Definition at line 230 of file IgControlCentre.cc.

References IgControlCategory::getHelpURL(), m_current, and IgQtAppHelp::netscape().

Referenced by IgControlCentre().

00231 {
00232     QString url ("");
00233     if (m_current)
00234       url = m_current->getHelpURL ();
00235     if (url.isEmpty ())
00236       url = "https://iguana.web.cern.ch/iguana/snapshot/help/control_centre.html";
00237     IgQtAppHelp::netscape (url);
00238 }

void IgControlCentre::hide ( void   )  [virtual]

Hide the control centre dialog.

Definition at line 199 of file IgControlCentre.cc.

References back(), m_baseName, m_current, and name.

00200 {
00201     if (m_current)
00202     {
00203       QString name = m_baseName;
00204       back ();
00205       m_baseName =  name;
00206     }
00207     QWidget::hide ();
00208 }

void IgControlCentre::hideCategory ( void   )  [private, slot]

Definition at line 271 of file IgControlCentre.cc.

References clean, cleanCategory(), dirtyCategory(), IgControlCategory::hide(), m_current, m_layout2, and IgControlCategory::panel().

Referenced by showCategory(), and showIconView().

00272 {
00273     if(!m_current) return;
00274     disconnect (m_current, SIGNAL(dirty()), 
00275                 this, SLOT(dirtyCategory()));
00276     disconnect (m_current, SIGNAL(clean()), 
00277                this, SLOT(cleanCategory()));
00278     m_current->hide ();
00279     m_current->panel ()->reparent ((QWidget*)(0), QPoint(0,0));
00280     m_layout2->remove (m_current->panel ());
00281     m_current = 0;
00282 }

void IgControlCentre::hideIconView ( void   )  [private, slot]

Definition at line 409 of file IgControlCentre.cc.

References m_iconView, and m_layout2.

Referenced by showCategory().

00410 {
00411     if (!m_iconView->isShown ()) return;
00412     m_iconView->reparent (0, QPoint(0,0));
00413     m_layout2->remove (m_iconView);
00414     m_iconView->hide ();
00415 }

QIconView * IgControlCentre::iconView ( void   ) 

Definition at line 615 of file IgControlCentre.cc.

References m_iconView.

00616 {
00617     return m_iconView;    
00618 }

void IgControlCentre::languageChange (  )  [protected, virtual, slot]

Definition at line 146 of file IgControlCentre.cc.

References reco::fitHelper::add(), m_apply, m_back, m_close, m_help, m_name, and m_revert.

Referenced by IgControlCentre().

00147 {
00148     setCaption( tr( m_name ) );
00149     m_back->setText( tr( "&Back" ) );
00150     m_back->setAccel( QKeySequence( tr( "Alt+P" ) ) );
00151     QWhatsThis::add( m_back, tr( "Go to the previous panel of the control centre." ) );
00152     m_close->setText( tr( "&Close" ) );
00153     m_close->setAccel( QKeySequence( tr( "Alt+C" ) ) );
00154     QWhatsThis::add( m_close, tr( "Close the Control Centre." ) );
00155     m_revert->setText( tr( "&Revert" ) );
00156     m_revert->setAccel( QKeySequence( tr( "Alt+R" ) ) );
00157     QWhatsThis::add( m_revert, tr( "Revert the changes made via GUI which are not yet applied. <br>\n"
00158 "When track changes option is not available or if available and <br>\n"
00159 "enabled then changes made via GUI will automatically be applied <br>\n"
00160 "and one can not revert those changes." ) );
00161     m_apply->setText( tr( "&Apply" ) );
00162     m_apply->setAccel( QKeySequence( tr( "Alt+A" ) ) );
00163     QWhatsThis::add( m_apply, tr( "Apply the changes made via GUI which are not yet applied.<br>\n"
00164 "When track changes option is not available or if available and<br>\n"
00165 "enabled then changes made via GUI will automatically be applied." ) );
00166     m_help->setText( tr( "&Help" ) );
00167     m_help->setAccel( QKeySequence( tr( "Alt+H" ) ) );
00168     QWhatsThis::add( m_help, tr( "Get the help.\n"));
00169 }

void IgControlCentre::removeCategory ( QString  name,
IconViewArch toplevel 
) [private]

Definition at line 478 of file IgControlCentre.cc.

References first, index, removeCategory(), and size.

00479 {
00480     int index = name.find ("/");
00481     if (index != -1)
00482     {
00483       QString sname = name.left(index);
00484       name = name.right (name.length() - index - 1);
00485       removeCategory (name, static_cast<IconViewArch *>((*toplevel)[sname].first));
00486       name = sname;
00487     }
00488     if ((*toplevel)[name].first == 0)
00489       toplevel->erase (name);
00490     else if (static_cast<IconViewArch *>((*toplevel)[name].first)->size () == 0)
00491     {
00492         delete static_cast<IconViewArch *>((*toplevel)[name].first);
00493         toplevel->erase (name);
00494     }
00495 }

void IgControlCentre::removeCategory ( IgControlCategory category  ) 

Remove category to the control centre.

It must be a non-null pointer to a category previously added to the control centre. The category will be removed from the list and from the body content area widget stack, but will not be deleted. If it is the currently selected category, selection will be reset to null.

Definition at line 503 of file IgControlCentre.cc.

References ASSERT, back(), hasCategory(), m_categories, m_current, and m_iconViewArch.

Referenced by IgControlCategory::clearCategory(), and removeCategory().

00504 {    
00505     ASSERT (category);
00506     ASSERT (hasCategory (category));
00507     if (m_current == category)
00508       back ();
00509     m_categories.erase (category->name ());
00510     removeCategory (category->name (), &m_iconViewArch);
00511 }

void IgControlCentre::revert ( void   )  [virtual, slot]

Respond to "Revert" button press.

Directs the call to the current category.

Definition at line 222 of file IgControlCentre.cc.

References ASSERT, m_current, and IgControlCategory::revert().

Referenced by IgControlCentre().

00223 {
00224     ASSERT (m_current);
00225     m_current->revert ();
00226 }

void IgControlCentre::selectCategory ( const QString &  name  ) 

Definition at line 534 of file IgControlCentre.cc.

References updateControlCentre().

00535 {
00536     updateControlCentre (name);
00537 }

void IgControlCentre::selectCategory ( IgControlCategory category  ) 

Make category the current selection and show its control area in the body content area.

If category is a non-null pointer, it must have been previously added with addCategory(), and will be made the current selection. If category is null, the current selection is cleared.

Definition at line 519 of file IgControlCentre.cc.

References ASSERT, back(), hasCategory(), m_categories, and showCategory().

Referenced by Ig2DWindow::show2DViewProperties(), Ig3DWindow::showAnims(), Ig3DWindow::showClips(), Ig3DWindow::showGrids(), IgLegoWindow::showLegoViewProperties(), IgRZWindow::showLights(), IgLegoWindow::showLights(), IgSpareWindow::showLights(), IgRPhiWindow::showLights(), Ig3DWindow::showLights(), Ig3DWindow::showNodeManip(), IgRPhiWindow::showRPhiViewProperties(), IgRZWindow::showRZViewProperties(), Ig3DWindow::showSlicers(), IgSpareWindow::showSpareViewProperties(), Ig3DWindow::showViewpoints(), and Ig3DBaseWindow::showViewProperties().

00520 {
00521     if (category)
00522     {
00523       ASSERT (hasCategory (category));
00524       if (m_categories [category->name ()].second == true)
00525       {
00526         showCategory (category);
00527         return;
00528       }
00529     }
00530     back ();
00531 }

void IgControlCentre::selectIconItem ( QIconViewItem *  item  )  [private, slot]

Definition at line 583 of file IgControlCentre.cc.

References ASSERT, m_baseName, and updateControlCentre().

Referenced by IgControlCentre().

00584 {
00585     ASSERT (item);
00586     if (m_baseName == "")
00587       updateControlCentre (item->text ());
00588     else
00589       updateControlCentre (m_baseName + "/" + item->text ());
00590 }

void IgControlCentre::show ( void   )  [virtual]

Show the control centre dialog.

Definition at line 173 of file IgControlCentre.cc.

References firstTime, m_baseName, m_focusChanged, m_updateOnWindowActive, old, and updateControlCentre().

Referenced by Ig2DWindow::show2DViewProperties(), Ig3DWindow::showAnims(), Ig3DWindow::showClips(), Ig3DWindow::showGrids(), IgLegoWindow::showLegoViewProperties(), IgRZWindow::showLights(), IgLegoWindow::showLights(), IgSpareWindow::showLights(), IgRPhiWindow::showLights(), Ig3DWindow::showLights(), Ig3DWindow::showNodeManip(), IgRPhiWindow::showRPhiViewProperties(), IgRZWindow::showRZViewProperties(), Ig3DWindow::showSlicers(), IgSpareWindow::showSpareViewProperties(), Ig3DWindow::showViewpoints(), and Ig3DBaseWindow::showViewProperties().

00174 {
00175     static bool firstTime=true;
00176     if(!isShown())
00177     {
00178       QString old (m_baseName);
00179       m_baseName = "qqqqqq";      
00180       updateControlCentre (old);
00181       m_updateOnWindowActive=false;
00182       m_focusChanged = false;
00183       if (firstTime)
00184       {
00185         resize(QSize(600, 400).expandedTo (minimumSizeHint ()));
00186         firstTime = false;
00187       }
00188       QWidget::show ();
00189     }
00190     else
00191     {
00192       setActiveWindow ();
00193       raise();    
00194     }
00195 }

void IgControlCentre::showCategory ( IgControlCategory category  )  [private, slot]

Definition at line 285 of file IgControlCentre.cc.

References clean, cleanCategory(), HLT_VtxMuL3::connect, dirtyCategory(), hideCategory(), hideIconView(), m_back, m_baseName, m_current, m_layout2, m_name, IgControlCategory::panel(), and IgControlCategory::show().

Referenced by selectCategory(), and updateControlCentre().

00286 {
00287     m_baseName = category->name ();
00288     if (m_current == category) return;
00289     hideCategory ();
00290     hideIconView ();
00291     m_current = category;
00292     connect (m_current, SIGNAL(dirty()), 
00293              this, SLOT(dirtyCategory()));
00294     connect (m_current, SIGNAL(clean()), 
00295              this, SLOT(cleanCategory()));
00296     m_current->panel ()->reparent (this, QPoint(0,0));
00297     m_layout2->addWidget(m_current->panel (), 0, 0);
00298     m_current->panel ()->show();
00299     m_back->setEnabled (true);
00300     if (m_baseName.length () > 20)
00301       setCaption(tr(m_name + " [..." + m_baseName.right (17) + "]"));
00302     else
00303       setCaption(tr(m_name + " [" + m_baseName + "]"));
00304     m_current->show ();
00305 }

void IgControlCentre::showIconView ( QString  name  )  [private, slot]

Definition at line 393 of file IgControlCentre.cc.

References addIconViewItems(), cleanCategory(), hideCategory(), m_iconView, m_layout2, and m_name.

Referenced by back(), and updateControlCentre().

00394 {
00395     addIconViewItems (name);
00396     if (!m_iconView->isShown ())
00397     {
00398       hideCategory ();
00399       m_iconView->reparent (this, QPoint(0,0));
00400       m_layout2->addWidget (m_iconView , 0, 0 );
00401       cleanCategory ();
00402       setCaption(tr(m_name));
00403       m_iconView->show ();
00404       m_iconView->arrangeItemsInGrid ();
00405     }
00406 }

void IgControlCentre::updateControlCentre ( QString  name  )  [private]

Definition at line 253 of file IgControlCentre.cc.

References back(), first, m_baseName, m_categories, edm::second(), showCategory(), and showIconView().

Referenced by selectCategory(), selectIconItem(), show(), and windowActivationChange().

00254 {
00255     if (name.length ()
00256         && m_categories.find (name) != m_categories.end ())
00257     {
00258       if (m_categories [name].second == true)
00259         showCategory (m_categories [name].first);
00260       else
00261       {
00262         m_baseName = name;
00263         back ();
00264       }
00265       return;
00266     }
00267     showIconView (name);
00268 }

void IgControlCentre::updateOnWindowActive ( void   ) 

Definition at line 656 of file IgControlCentre.cc.

References m_updateOnWindowActive.

Referenced by IgStudioCentre::appActive(), and Ig3DBaseWindow::focusIn().

00657 { m_updateOnWindowActive = true; }

void IgControlCentre::windowActivationChange ( bool  oldActive  )  [protected]

Definition at line 623 of file IgControlCentre.cc.

References IgControlCategory::focusIn(), IgControlCategory::focusOut(), m_baseName, m_categories, m_current, m_focusChanged, m_updateOnWindowActive, old, and updateControlCentre().

00624 {  
00625     QDialog::windowActivationChange (oldActive);
00626     if (isActiveWindow() && m_updateOnWindowActive)
00627     {
00628       if(m_current && m_categories [m_current->name ()].second == true)
00629       {
00630         m_current->focusIn ();
00631       }
00632       else if (m_focusChanged)
00633       {
00634         m_focusChanged = false;
00635         QString old (m_baseName);
00636         m_baseName = "qqqqqq";
00637         updateControlCentre (old);
00638       }
00639       else if(m_current)
00640       {
00641         m_current->focusIn ();
00642       }
00643       m_updateOnWindowActive = false;
00644     }
00645     else if (!isActiveWindow())
00646     {
00647       m_updateOnWindowActive = false;
00648       if ( m_current && m_categories [m_current->name ()].second == true)
00649         m_current->focusOut ();
00650     }
00651     else
00652       m_updateOnWindowActive = false;
00653 }


Member Data Documentation

QGridLayout* IgControlCentre::IgControlCentreLayout [protected]

Definition at line 74 of file IgControlCentre.h.

Referenced by IgControlCentre().

QPushButton* IgControlCentre::m_apply [private]

Definition at line 101 of file IgControlCentre.h.

Referenced by cleanCategory(), dirtyCategory(), IgControlCentre(), and languageChange().

QPushButton* IgControlCentre::m_back [private]

Definition at line 103 of file IgControlCentre.h.

Referenced by addIconViewItems(), IgControlCentre(), languageChange(), and showCategory().

QString IgControlCentre::m_baseName [private]

Definition at line 105 of file IgControlCentre.h.

Referenced by addIconViewItems(), back(), hide(), IgControlCentre(), selectIconItem(), show(), showCategory(), updateControlCentre(), and windowActivationChange().

CategoryMap IgControlCentre::m_categories [private]

Definition at line 94 of file IgControlCentre.h.

Referenced by addCategory(), addIconViewItems(), enableCategory(), hasCategory(), removeCategory(), selectCategory(), updateControlCentre(), windowActivationChange(), and ~IgControlCentre().

QPushButton* IgControlCentre::m_close [private]

Definition at line 99 of file IgControlCentre.h.

Referenced by IgControlCentre(), and languageChange().

IgControlCategory* IgControlCentre::m_current [private]

Definition at line 96 of file IgControlCentre.h.

Referenced by apply(), help(), hide(), hideCategory(), removeCategory(), revert(), showCategory(), and windowActivationChange().

bool IgControlCentre::m_focusChanged [private]

Definition at line 107 of file IgControlCentre.h.

Referenced by enableCategory(), show(), and windowActivationChange().

QPushButton* IgControlCentre::m_help [private]

Definition at line 102 of file IgControlCentre.h.

Referenced by IgControlCentre(), and languageChange().

QIconView* IgControlCentre::m_iconView [private]

Definition at line 98 of file IgControlCentre.h.

Referenced by addIconViewItems(), hideIconView(), iconView(), IgControlCentre(), and showIconView().

IconViewArch IgControlCentre::m_iconViewArch [private]

Definition at line 93 of file IgControlCentre.h.

Referenced by addCategory(), addIconViewItems(), enableCategory(), removeCategory(), and ~IgControlCentre().

IconViewList IgControlCentre::m_iconViewList [private]

Definition at line 95 of file IgControlCentre.h.

Referenced by addIconViewItems().

QHBoxLayout* IgControlCentre::m_layout1 [protected]

Definition at line 75 of file IgControlCentre.h.

Referenced by IgControlCentre().

QGridLayout* IgControlCentre::m_layout2 [protected]

Definition at line 76 of file IgControlCentre.h.

Referenced by hideCategory(), hideIconView(), IgControlCentre(), showCategory(), and showIconView().

QString IgControlCentre::m_name [private]

Definition at line 104 of file IgControlCentre.h.

Referenced by addIconViewItems(), IgControlCentre(), languageChange(), showCategory(), and showIconView().

QPushButton* IgControlCentre::m_revert [private]

Definition at line 100 of file IgControlCentre.h.

Referenced by cleanCategory(), dirtyCategory(), IgControlCentre(), and languageChange().

bool IgControlCentre::m_updateOnWindowActive [private]

Definition at line 106 of file IgControlCentre.h.

Referenced by show(), updateOnWindowActive(), and windowActivationChange().


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