19#include "GaudiKernel/IToolSvc.h"
71 message(
"ERROR - received NULL ToolSvc Pointer");
82 m_d->toolsvc = sys ? sys->toolSvc() : 0;
84 message(
"ERROR - received NULL system Pointer");
86 message(
"ERROR - could not get ToolSvc Pointer");
104 m_d->monitoredTypeToIgnoreList[mt] = ignoreList;
105 if (!
m_d->monitoredTypes.contains(mt)) {
106 m_d->monitoredTypes << mt;
115 for (
const QString& mt : mts) {
116 m_d->monitoredTypeToIgnoreList[mt] = ignoreList;
117 if (!
m_d->monitoredTypes.contains(mt)) {
118 m_d->monitoredTypes << mt;
129 if (
m_d->monitoredTypes.contains(mt)) {
130 m_d->monitoredTypes.removeAll(mt);
131 m_d->removeIgnoreList(mt);
140 for (
const QString& mt : mts) {
141 if (
m_d->monitoredTypes.contains(mt)) {
142 m_d->monitoredTypes.removeAll(mt);
143 m_d->removeIgnoreList(mt);
154 if (
m_d->monitoredTypes.count()>0) {
155 m_d->monitoredTypes.clear();
156 m_d->monitoredTypeToIgnoreList.clear();
164 return m_d->monitoredTypes;
173 std::vector<std::string> instances;
174 instances =
toolsvc->getInstances( tooltype.toStdString() );
176 theclass->messageVerbose(
"Used toolsvc->getInstances(..) to find "+QString::number(instances.size())+
" public tools of type "+tooltype );
177 for (
unsigned i = 0; i < instances.size(); ++i ) {
178 QString
instance(instances.at(i).c_str());
179 if (
instance.startsWith(
"ToolSvc.",Qt::CaseInsensitive))
182 QStringList ignorelist =
ignoreList(tooltype);
183 if (!ignorelist.isEmpty()) {
185 for (
const QString& ignorepattern : ignorelist) {
186 if (QRegExp(ignorepattern,Qt::CaseSensitive,QRegExp::Wildcard).exactMatch(
instance)) {
201 theclass->messageVerbose(
" --> Appended "+tooltype+
"/"+
instance+
" to list" );
212 QStringList newtools =
m_d->actualCurrentlyAvailableTools();
213 if ( newtools ==
m_d->availableTools ) {
214 m_d->restartTimer(2000);
218 m_d->availableTools = newtools;
219 bool notempty = !
m_d->availableTools.empty();
222 for (QComboBox* cb :
m_d->handledComboBoxes) {
224 cb->addItems(
m_d->availableTools);
227 for (QWidget* w :
m_d->handledWidgets) {
228 if (w->isEnabled() != notempty)
229 w->setEnabled(notempty);
232 messageDebug(
"Emitting availableToolsChanged (ntools="+QString::number(
m_d->availableTools.count())+
")");
235 m_d->restartTimer(2000);
242 return m_d->availableTools;
250 message(
"setComboBoxData ERROR: Null pointer to combobox");
262 message(
"disableIfNoTools ERROR: Null pointer to widget");
273 message(
"handleComboBox ERROR: Null pointer to combobox");
276 if (!
m_d->handledComboBoxes.contains(cb)) {
278 m_d->handledComboBoxes << cb;
279 connect(cb,SIGNAL(destroyed(QObject*)),
this,SLOT(
widgetDeleted(QObject*)));
288 message(
"handleEnabledState ERROR: Null pointer to widget");
291 if (!
m_d->handledWidgets.contains(w)) {
293 m_d->handledWidgets << w;
294 connect(w,SIGNAL(destroyed(QObject*)),
this,SLOT(
widgetDeleted(QObject*)));
301 if ( o->inherits(
"QComboBox") &&
m_d->handledComboBoxes.contains(
static_cast<QComboBox*
>(o)))
302 m_d->handledComboBoxes.removeAll(
static_cast<QComboBox*
>(o));
303 if ( o->isWidgetType() &&
m_d->handledWidgets.contains(
static_cast<QWidget*
>(o)))
304 m_d->handledWidgets.removeAll(
static_cast<QWidget*
>(o));
311 if (event->timerId()!=
m_d->timerid) {
312 message(
"ERROR: Bad timer ID!!");
313 killTimer(event->timerId());
318 m_d->restartTimer(3000);
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
void messageVerbose(const QString &) const
void message(const QString &) const
void messageDebug(const QString &) const