CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
FWPartialConfigGUI Class Reference

#include <FWPartialConfig.h>

Inheritance diagram for FWPartialConfigGUI:
FWPartialConfigLoadGUI FWPartialConfigSaveGUI

Public Member Functions

void Cancel ()
 
 FWPartialConfigGUI (const char *path, FWConfigurationManager *)
 
 ~FWPartialConfigGUI ()
 

Protected Member Functions

 ClassDef (FWPartialConfigGUI, 0)
 

Protected Attributes

FWConfigurationManagerm_cfgMng
 
std::vector< TGCheckButton * > m_entries
 
FWConfiguration m_origConfig
 

Detailed Description

Definition at line 11 of file FWPartialConfig.h.

Constructor & Destructor Documentation

FWPartialConfigGUI::FWPartialConfigGUI ( const char *  path,
FWConfigurationManager iCfg 
)

Definition at line 47 of file FWPartialConfig.cc.

References FWXMLConfigParser::config(), g, FWConfiguration::keyValues(), m_cfgMng, m_entries, m_origConfig, SimpleSAXParser::parse(), geometryXMLtoCSV::parser, python.multivaluedict::sort(), AlCaHLTBitMon_QueryRunRegistry::string, FWConfiguration::swap(), and FWConfigurationManager::to().

47  :
48  TGTransientFrame(gClient->GetRoot(), FWGUIManager::getGUIManager()->getMainFrame(), 200, 140), m_cfgMng(iCfg)
49 {
50  if (path) {
51  std::ifstream g(path);
53  parser.parse();
54  parser.config()->swap(m_origConfig);
55  }
56  else {
57  FWConfiguration curr;
58  m_cfgMng->to(curr);
59  curr.swap(m_origConfig);
60  }
61 
62  TGVerticalFrame* vf = new TGVerticalFrame(this);
63  AddFrame(vf, new TGLayoutHints(kLHintsNormal, 2, 2, 4, 4));
64 
65  // can do a cast to non-const since we own the configuration
67  std::sort(kv->begin(), kv->end(),
68  [](const std::pair<std::string, FWConfiguration>& lhs, const std::pair<std::string, FWConfiguration>& rhs) -> bool {
69  return nmm.btnName(lhs.first) < nmm.btnName(rhs.first); } );
70 
71  for(FWConfiguration::KeyValues::const_iterator it = m_origConfig.keyValues()->begin(); it != m_origConfig.keyValues()->end(); ++it) {
72  if ( it->second.keyValues()) {
73  std::string nb = nmm.btnName(it->first);
74  TGCheckButton* cb = new TGCheckButton(vf, nb.c_str());
75  vf->AddFrame(cb);
76 
77  m_entries.push_back(cb);
78  }
79  }
80 }
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
void to(FWConfiguration &) const
const KeyValues * keyValues() const
FWConfigurationManager * m_cfgMng
std::vector< TGCheckButton * > m_entries
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
tuple path
else: Piece not in the list, fine.
void swap(FWConfiguration &)
CmsShowMainFrame * getMainFrame() const
Definition: FWGUIManager.h:201
static FWGUIManager * getGUIManager()
FWConfiguration m_origConfig
FWPartialConfigGUI::~FWPartialConfigGUI ( )
inline

Definition at line 15 of file FWPartialConfig.h.

15 {}

Member Function Documentation

void FWPartialConfigGUI::Cancel ( )

Definition at line 82 of file FWPartialConfig.cc.

83 {
84  // AMT Is this eniugh. Should there be a destroy ?
85  UnmapWindow();
86 }
FWPartialConfigGUI::ClassDef ( FWPartialConfigGUI  ,
 
)
protected

Member Data Documentation

FWConfigurationManager* FWPartialConfigGUI::m_cfgMng
protected
std::vector<TGCheckButton*> FWPartialConfigGUI::m_entries
protected
FWConfiguration FWPartialConfigGUI::m_origConfig
protected